define(["@jupyter-widgets/base"], function(__WEBPACK_EXTERNAL_MODULE__jupyter_widgets_base__) { 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 = "./lib/index.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./lib/index.js":
/*!**********************!*\
  !*** ./lib/index.js ***!
  \**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

// Export widget models and views, and the npm package version number.
module.exports = __webpack_require__(/*! ./widget.js */ "./lib/widget.js");
module.exports['version'] = __webpack_require__(/*! ../package.json */ "./package.json").version;

/***/ }),

/***/ "./lib/widget.css":
/*!************************!*\
  !*** ./lib/widget.css ***!
  \************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {


var content = __webpack_require__(/*! !../node_modules/css-loader!./widget.css */ "./node_modules/css-loader/index.js!./lib/widget.css");

if(typeof content === 'string') content = [[module.i, content, '']];

var transform;
var insertInto;



var options = {"hmr":true}

options.transform = transform
options.insertInto = undefined;

var update = __webpack_require__(/*! ../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);

if(content.locals) module.exports = content.locals;

if(false) {}

/***/ }),

/***/ "./lib/widget.js":
/*!***********************!*\
  !*** ./lib/widget.js ***!
  \***********************/
/*! exports provided: VitessceModel, VitessceView */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VitessceModel", function() { return VitessceModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VitessceView", function() { return VitessceView; });
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_get__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/get */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/get.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createSuper */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createSuper.js");
/* harmony import */ var _home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
/* harmony import */ var _jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @jupyter-widgets/base */ "@jupyter-widgets/base");
/* harmony import */ var _jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var lodash_extend__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash/extend */ "./node_modules/lodash/extend.js");
/* harmony import */ var lodash_extend__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash_extend__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var vitessce__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vitessce */ "./node_modules/vitessce/dist/umd/production/index.min.js");
/* harmony import */ var vitessce__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(vitessce__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../package.json */ "./package.json");
var _package_json__WEBPACK_IMPORTED_MODULE_12___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1);
/* harmony import */ var vitessce_dist_es_production_static_css_index_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vitessce/dist/es/production/static/css/index.css */ "./node_modules/vitessce/dist/es/production/static/css/index.css");
/* harmony import */ var vitessce_dist_es_production_static_css_index_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(vitessce_dist_es_production_static_css_index_css__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _widget_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./widget.css */ "./lib/widget.css");
/* harmony import */ var _widget_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_widget_css__WEBPACK_IMPORTED_MODULE_14__);














 // See widget.py for the kernel counterpart to this file.

var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; // The jupyter server may be running through a proxy,
// which means that the client needs to prepend the part of the URL before /proxy/8000 such as
// https://hub.gke2.mybinder.org/user/vitessce-vitessce-python-swi31vcv/proxy/8000/A/0/cells

function prependBaseUrl(config, proxy) {
  if (!proxy) {
    return config;
  }

  var _URL = new URL(window.location.href),
      origin = _URL.origin;

  var baseUrl;
  var jupyterLabConfigEl = document.getElementById('jupyter-config-data');

  if (jupyterLabConfigEl) {
    // This is jupyter lab
    baseUrl = JSON.parse(jupyterLabConfigEl.textContent || '').baseUrl;
  } else {
    // This is jupyter notebook
    baseUrl = document.getElementsByTagName('body')[0].getAttribute('data-base-url');
  }

  return Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])({}, config), {}, {
    datasets: config.datasets.map(function (d) {
      return Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])({}, d), {}, {
        files: d.files.map(function (f) {
          return Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__["default"])({}, f), {}, {
            url: "".concat(origin).concat(baseUrl).concat(f.url)
          });
        })
      });
    })
  });
}

function VitessceWidget(props) {
  var model = props.model;
  var config = prependBaseUrl(model.get('config'), model.get('proxy'));
  var height = model.get('height');
  var theme = model.get('theme') === 'auto' ? prefersDark ? 'dark' : 'light' : model.get('theme');
  var divRef = Object(react__WEBPACK_IMPORTED_MODULE_8__["useRef"])();
  Object(react__WEBPACK_IMPORTED_MODULE_8__["useEffect"])(function () {
    if (!divRef.current) {
      return function () {};
    }

    function handleMouseEnter() {
      var jpn = divRef.current.closest('.jp-Notebook');

      if (jpn) {
        jpn.style.overflow = "hidden";
      }
    }

    function handleMouseLeave() {
      var jpn = divRef.current.closest('.jp-Notebook');

      if (jpn) {
        jpn.style.overflow = "auto";
      }
    }

    divRef.current.addEventListener("mouseenter", handleMouseEnter);
    divRef.current.addEventListener("mouseleave", handleMouseLeave);
    return function () {
      divRef.current.removeEventListener("mouseenter", handleMouseEnter);
      divRef.current.removeEventListener("mouseleave", handleMouseLeave);
    };
  }, [divRef]);
  var onConfigChange = Object(react__WEBPACK_IMPORTED_MODULE_8__["useCallback"])(function (config) {
    model.set('config', config);
    model.save_changes();
  }, [model]);
  return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement('div', {
    className: 'vitessce-widget',
    ref: divRef,
    style: {
      height: "".concat(height, "px")
    }
  }, react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(vitessce__WEBPACK_IMPORTED_MODULE_11__["Vitessce"], {
    config: config,
    onConfigChange: onConfigChange,
    height: height,
    theme: theme
  }));
} // Custom Model. Custom widgets models must at least provide default values
// for model attributes, including
//
//  - `_view_name`
//  - `_view_module`
//  - `_view_module_version`
//
//  - `_model_name`
//  - `_model_module`
//  - `_model_module_version`
//
//  when different from the base class.
// When serialiazing the entire widget state for embedding, only values that
// differ from the defaults will be specified.


var VitessceModel = _jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7__["DOMWidgetModel"].extend({
  defaults: lodash_extend__WEBPACK_IMPORTED_MODULE_10___default()(_jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7__["DOMWidgetModel"].prototype.defaults(), {
    _model_name: 'VitessceModel',
    _view_name: 'VitessceView',
    _model_module: 'vitessce-jupyter',
    _view_module: 'vitessce-jupyter',
    _model_module_version: _package_json__WEBPACK_IMPORTED_MODULE_12__.version,
    _view_module_version: _package_json__WEBPACK_IMPORTED_MODULE_12__.version,
    config: {},
    height: 600,
    theme: 'auto',
    proxy: false
  })
});
var VitessceView = /*#__PURE__*/function (_DOMWidgetView) {
  Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(VitessceView, _DOMWidgetView);

  var _super = Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_5__["default"])(VitessceView);

  function VitessceView() {
    Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, VitessceView);

    return _super.apply(this, arguments);
  }

  Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(VitessceView, [{
    key: "render",
    value: function render() {
      Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_get__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(VitessceView.prototype), "render", this).call(this);

      react_dom__WEBPACK_IMPORTED_MODULE_9___default.a.render(this._render(this.model, this), this.el);
      setTimeout(function () {
        window.dispatchEvent(new Event('resize'));
      }, 500);
    }
  }, {
    key: "_render",
    value: function _render(model, view) {
      return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(VitessceWidget, {
        model: model,
        view: view
      });
    }
  }, {
    key: "remove",
    value: function remove() {
      react_dom__WEBPACK_IMPORTED_MODULE_9___default.a.unmountComponentAtNode(this.el);
      return Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_get__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_home_runner_work_vitessce_python_vitessce_python_js_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(VitessceView.prototype), "remove", this).call(this);
    }
  }]);

  return VitessceView;
}(_jupyter_widgets_base__WEBPACK_IMPORTED_MODULE_7__["DOMWidgetView"]);

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
/*!**************************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
/*!*******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass.js":
/*!****************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/createSuper.js":
/*!****************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createSuper.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 _createSuper; });
/* harmony import */ var _getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isNativeReflectConstruct */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js");
/* harmony import */ var _possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./possibleConstructorReturn */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");



function _createSuper(Derived) {
  return function () {
    var Super = Object(_getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(Derived),
        result;

    if (Object(_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_1__["default"])()) {
      var NewTarget = Object(_getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return Object(_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, result);
  };
}

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/defineProperty.js":
/*!*******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/get.js":
/*!********************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/get.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 _get; });
/* harmony import */ var _superPropBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./superPropBase */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/superPropBase.js");

function _get(target, property, receiver) {
  if (typeof Reflect !== "undefined" && Reflect.get) {
    _get = Reflect.get;
  } else {
    _get = function _get(target, property, receiver) {
      var base = Object(_superPropBase__WEBPACK_IMPORTED_MODULE_0__["default"])(target, property);
      if (!base) return;
      var desc = Object.getOwnPropertyDescriptor(base, property);

      if (desc.get) {
        return desc.get.call(receiver);
      }

      return desc.value;
    };
  }

  return _get(target, property, receiver || target);
}

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
/*!*******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits.js":
/*!*************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js":
/*!*****************************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.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 _isNativeReflectConstruct; });
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;
  }
}

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
/*!******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.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 _objectSpread2; });
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/defineProperty.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 _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

    if (i % 2) {
      ownKeys(Object(source), true).forEach(function (key) {
        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(Object(source)).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }

  return target;
}

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
/*!******************************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized */ "./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
/*!*******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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-preset-react-app/node_modules/@babel/runtime/helpers/esm/superPropBase.js":
/*!******************************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/superPropBase.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 _superPropBase; });
/* harmony import */ var _getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf */ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");

function _superPropBase(object, property) {
  while (!Object.prototype.hasOwnProperty.call(object, property)) {
    object = Object(_getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(object);
    if (object === null) break;
  }

  return object;
}

/***/ }),

/***/ "./node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/typeof.js":
/*!***********************************************************************************************!*\
  !*** ./node_modules/babel-preset-react-app/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) {
  "@babel/helpers - typeof";

  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/css-loader/index.js!./lib/widget.css":
/*!**************************************************!*\
  !*** ./node_modules/css-loader!./lib/widget.css ***!
  \**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
// imports


// module
exports.push([module.i, ".vitessce-container {\n    width: 100%;\n}\n\n.vitessce-widget {\n    width: 100%;\n    \n}\n\n.vitessce-container div {\n    font-size: 14px;\n}", ""]);

// exports


/***/ }),

/***/ "./node_modules/css-loader/index.js!./node_modules/vitessce/dist/es/production/static/css/index.css":
/*!*************************************************************************************************!*\
  !*** ./node_modules/css-loader!./node_modules/vitessce/dist/es/production/static/css/index.css ***!
  \*************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(/*! ../../../../../../css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
// imports


// module
exports.push([module.i, ".react-draggable-transparent-selection .react-grid-item{-webkit-user-select:none !important;-moz-user-select:none !important;-o-user-select:none !important;-ms-user-select:none !important;user-select:none !important}body{margin:0;text-align:left}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto;box-sizing:border-box}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-2OwvL{position:fixed;background-color:rgba(255,255,255,0.95);border:1px solid rgba(0,0,0,0.1);border-radius:3px;font-size:12px;cursor:default;padding:3px;box-shadow:0 0 3px 0 rgba(0,0,0,0.1),0 1px 5px 0 rgba(0,0,0,0.05)}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-dark-2PO31{color:#ccc;background-color:rgba(68,68,68,0.97)}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-icon-I4kiw{display:inline-block;margin-right:3px;vertical-align:middle}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-icon-I4kiw>svg{width:30px;height:20px}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-item-1HeVv{padding:2px;white-space:nowrap;border-radius:2px;transition:background .15s ease,color .15s ease}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-item-1HeVv:hover{background:#337ab7;color:#fff}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-hr-3yapb{margin-top:5px;margin-bottom:5px;border:0;border-top:1px solid rgba(0,0,0,0.1)}.vitessce-container .higlass-wrapper .ContextMenu-module_play-icon-R4pIO{width:12px;height:12px;position:absolute;right:5px}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-span-8EUfZ{margin-right:20px;vertical-align:middle;display:inline-block;line-height:normal;white-space:nowrap}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-thumbnail-2vHLD{margin-right:10px;border:1px solid #888}.vitessce-container .higlass-wrapper .ContextMenu-module_context-menu-thumbnail-inline-1iOcg{display:inline-block;margin-right:10px;vertical-align:middle}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-2zDf3,.vitessce-container .higlass-wrapper .TrackControl-module_track-control-vertical-2McB_{position:absolute;z-index:1;display:flex;background:rgba(255,255,255,0.75);right:2px;top:2px;border-radius:2.5px;box-shadow:0 0 0 1px rgba(0,0,0,0.05),0 0 3px 0 rgba(0,0,0,0.1);opacity:0;transition:opacity .15s ease,background .15s ease,box-shadow .15s ease}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-dark-fP2uZ,.vitessce-container .higlass-wrapper .TrackControl-module_track-control-dark-fP2uZ .TrackControl-module_track-control-active-2JD9i{background:rgba(40,40,40,0.85)}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-vertical-2McB_{flex-direction:column-reverse}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-left-zHd9W{left:2px;right:auto}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-active-2JD9i,.vitessce-container .higlass-wrapper .TrackControl-module_track-control-vertical-active-1QCKn{opacity:1;z-index:1}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-active-2JD9i:hover,.vitessce-container .higlass-wrapper .TrackControl-module_track-control-vertical-active-1QCKn:hover{background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,0.1),0 0 3px 0 rgba(0,0,0,0.2)}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-dark-fP2uZ.TrackControl-module_track-control-active-2JD9i:hover{background:rgba(34,34,34,0.95)}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-padding-right-2p6Lp{right:80px}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-2fdIb{width:20px;height:20px;padding:4px;cursor:pointer;opacity:.66;transition:background .15s ease,color .15s ease,opacity .15s ease}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-2fdIb:hover{color:#fff;background:#337ab7;opacity:1}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-2fdIb:first-child{border-radius:2.5px 0 0 2.5px}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-2fdIb:last-child{border-radius:0 2.5px 2.5px 0}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-dark-fP2uZ .TrackControl-module_track-control-button-2fdIb{color:#ccc}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-dark-fP2uZ .TrackControl-module_track-control-button-2fdIb:hover{color:#fff;background:#337ab7;opacity:1}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-vertical-1s22z:first-child{border-radius:0 0 2.5px 2.5px}.vitessce-container .higlass-wrapper .TrackControl-module_track-control-button-vertical-1s22z:last-child{border-radius:2.5px 2.5px 0 0}.vitessce-container .higlass-wrapper .CenterTrack-module_center-track-3ptRW{position:relative;background:transparent}.vitessce-container .higlass-wrapper .CenterTrack-module_center-track-container-2ELhp{position:absolute;z-index:1}.vitessce-container .higlass-wrapper .Track-module_track-range-selection-1yrDf{position:absolute;z-index:-1;opacity:0;transition:opacity .15s ease}.vitessce-container .higlass-wrapper .Track-module_track-range-selection-active-1oljJ{z-index:1;opacity:1}.vitessce-container .higlass-wrapper .Track-module_track-range-selection-group-inactive-YNRM4{display:none}.vitessce-container .higlass-wrapper .Track-module_track-range-selection-group-brush-selection-2VYDl{outline:2px solid rgba(0,0,0,0.33);fill:#000;fill-opacity:.1}.vitessce-container .higlass-wrapper .DragListeningDiv-module_drag-listening-div-active-3wpRk{z-index:10;box-shadow:inset 0 0 3px 0 red}.vitessce-container .higlass-wrapper .GalleryTracks-module_gallery-tracks-3tsUO{position:relative;top:0;left:0;width:100%;height:100%}.vitessce-container .higlass-wrapper .GalleryTracks-module_gallery-track-eGKoq{position:absolute;box-sizing:border-box;top:0;right:0;bottom:0;left:0}.vitessce-container .higlass-wrapper .GalleryTracks-module_gallery-invisible-track-1hMJp,.vitessce-container .higlass-wrapper .GalleryTracks-module_gallery-sub-track-z1HEh{position:absolute}.vitessce-container .higlass-wrapper .TiledPlot-module_tiled-plot-uFHiB{position:relative;flex:1 1;overflow:hidden}.vitessce-container .higlass-wrapper .TiledPlot-module_horizontalList-1c1P8{display:flex;width:600px;height:300px;white-space:nowrap}.vitessce-container .higlass-wrapper .TiledPlot-module_list-24zgV{width:400px;height:600px;overflow:hidden;-webkit-overflow-scrolling:touch}.vitessce-container .higlass-wrapper .TiledPlot-module_stylizedList-Mt4JL{position:relative;z-index:0;background-color:#f3f3f3;outline:none}.vitessce-container .higlass-wrapper .TiledPlot-module_stylizedItem-2bQBK{position:relative;display:flex;align-items:center;width:100%;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#333;font-weight:400}.vitessce-container .higlass-wrapper .TiledPlot-module_stylizedHelper-3IVEu{box-shadow:0 5px 5px -5px rgba(0,0,0,0.2),0 -5px 5px -5px rgba(0,0,0,0.2);background-color:rgba(255,255,255,0.8);cursor:row-resize}.vitessce-container .higlass-wrapper .TiledPlot-module_stylizedHelper-3IVEu.TiledPlot-module_horizontalItem-2-ZjU{cursor:col-resize}.vitessce-container .higlass-wrapper .TiledPlot-module_horizontalItem-2-ZjU{display:flex;flex-shrink:0;align-items:center;justify-content:center}.vitessce-container .higlass-wrapper .TiledPlot-module_resizable-track-2oLT9{width:100%;height:100%}.vitessce-container .higlass-wrapper path.TiledPlot-module_domain-qYw6K{stroke-width:0px}.vitessce-container .higlass-wrapper .TrackRenderer-module_track-renderer-3TM7n{position:relative}.vitessce-container .higlass-wrapper .TrackRenderer-module_track-renderer-element-2i16D,.vitessce-container .higlass-wrapper .TrackRenderer-module_track-renderer-events-3tVM2{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.vitessce-container .higlass-wrapper .TrackRenderer-module_track-renderer-events-3tVM2{z-index:1}.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ{display:flex;align-items:center;box-sizing:border-box;padding:.5em;color:#000;font-size:1em;line-height:1em;border:0;border-radius:2.5px;background:#fff;box-shadow:0 0 0 1px #ccc;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;-webkit-appearance:none}.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:hover{background:#f2f2f2;box-shadow:0 0 0 1px #ccc}.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:focus{box-shadow:0 0 0 2px #0089ff}.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:active{transform:scale(0.9)}.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:active,.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:focus,.vitessce-container .higlass-wrapper .Button-module_button-3YXsQ:hover{cursor:pointer;outline:none}.vitessce-container .higlass-wrapper .Button-module_button-shortcut-1zMAn{padding:.1em 5px;color:#999;font-size:.8em;transition:color .15s ease}.vitessce-container .higlass-wrapper .Cross-module_cross-3WYME{position:relative;width:1em;height:1em}.vitessce-container .higlass-wrapper .Cross-module_cross-3WYME:after,.vitessce-container .higlass-wrapper .Cross-module_cross-3WYME:before{content:\"\";display:block;position:absolute;top:50%;left:0;width:1em;height:1px;background:#000;transform-origin:center}.vitessce-container .higlass-wrapper .Cross-module_cross-3WYME:before{transform:translateY(-50%) rotate(45deg)}.vitessce-container .higlass-wrapper .Cross-module_cross-3WYME:after{transform:translateY(-50%) rotate(-45deg)}.vitessce-container .higlass-wrapper .Modal-module_modal-background-3vDy1{position:absolute;z-index:1000;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.666);-webkit-animation:Modal-module_fade-in-3Nm-O .2s ease 1;animation:Modal-module_fade-in-3Nm-O .2s ease 1;transition:opacity .2s ease}.vitessce-container .higlass-wrapper .Modal-module_modal-hide-3huBg{opacity:0}.vitessce-container .higlass-wrapper .Modal-module_modal-wrap-1HWNn{position:absolute;top:20px;right:20px;bottom:20px;left:20px}.vitessce-container .higlass-wrapper .Modal-module_modal-window-1XZAq{position:relative;width:100%;max-width:640px;max-height:100%;margin-left:auto;margin-right:auto;color:#000;border-radius:5px;background:#fff;-webkit-animation:Modal-module_fade-scale-in-11Dkx .2s ease 1;animation:Modal-module_fade-scale-in-11Dkx .2s ease 1}.vitessce-container .higlass-wrapper .Modal-module_modal-window-max-height-CZYCl{height:100%}.vitessce-container .higlass-wrapper .Modal-module_modal-content-2xb_x{padding:10px}@-webkit-keyframes Modal-module_fade-in-3Nm-O{0%{opacity:0}to{opacity:1}}@keyframes Modal-module_fade-in-3Nm-O{0%{opacity:0}to{opacity:1}}@-webkit-keyframes Modal-module_fade-scale-in-11Dkx{0%{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes Modal-module_fade-scale-in-11Dkx{0%{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}.vitessce-container .higlass-wrapper .Dialog-module_dialog-header-2mk2M{position:relative;z-index:2;display:flex;justify-content:space-between;margin:0 -10px 10px;padding:0 10px 10px;border-bottom:1px solid #ccc}.vitessce-container .higlass-wrapper .Dialog-module_dialog-header-2mk2M h3{margin:0;padding:0;font-size:20px;line-height:1em}.vitessce-container .higlass-wrapper .Dialog-module_dialog-header-2mk2M button{font-size:10px}.vitessce-container .higlass-wrapper .Dialog-module_dialog-main-max-height-1EAb2{position:absolute;z-index:1;top:40px;right:0;bottom:50px;left:0;padding:10px;overflow:auto}.vitessce-container .higlass-wrapper .Dialog-module_dialog-footer-1BnEv,.vitessce-container .higlass-wrapper .Dialog-module_dialog-footer-max-height-KjDek{display:flex;justify-content:space-between;margin:10px -10px 0;padding:10px 10px 0;border-top:1px solid #ccc}.vitessce-container .higlass-wrapper .Dialog-module_dialog-footer-1BnEv button,.vitessce-container .higlass-wrapper .Dialog-module_dialog-footer-max-height-KjDek button{font-size:14px}.vitessce-container .higlass-wrapper .Dialog-module_dialog-footer-max-height-KjDek{position:absolute;z-index:2;left:10px;right:10px;bottom:10px}.vitessce-container .higlass-wrapper .tileset-finder-label{font-weight:700}.vitessce-container .higlass-wrapper .tileset-finder-search-box{margin-left:10px}.vitessce-container .higlass-wrapper .tileset-finder-search-bar{display:flex;margin-left:5px;justify-content:space-between;align-items:center}.vitessce-container .higlass-wrapper .tileset-finder-checkbox-tree{margin:5px;padding:3px;border:1px solid #aaa;border-radius:5px}.vitessce-container .higlass-wrapper .react-checkbox-tree{display:flex;flex-direction:row;font-size:14px}.vitessce-container .higlass-wrapper .react-checkbox-tree>ol{flex:1 1 auto}.vitessce-container .higlass-wrapper .react-checkbox-tree ol{margin:0;padding-left:0;list-style-type:none}.vitessce-container .higlass-wrapper .react-checkbox-tree ol ol{padding-left:24px}.vitessce-container .higlass-wrapper .react-checkbox-tree button{line-height:normal;color:inherit}.vitessce-container .higlass-wrapper .react-checkbox-tree button:focus{outline:none}.vitessce-container .higlass-wrapper .react-checkbox-tree button:disabled{cursor:not-allowed}.vitessce-container .higlass-wrapper .react-checkbox-tree .rct-bare-label{cursor:default}.vitessce-container .higlass-wrapper .react-checkbox-tree label{margin-bottom:0;cursor:pointer;font-weight:400}.vitessce-container .higlass-wrapper .react-checkbox-tree label:hover{background:rgba(51,51,204,0.1)}.vitessce-container .higlass-wrapper .react-checkbox-tree label:active{background:rgba(51,51,204,0.15)}.vitessce-container .higlass-wrapper .react-checkbox-tree:not(.rct-native-display) input{display:none}.vitessce-container .higlass-wrapper .react-checkbox-tree.rct-native-display input{margin:0 5px}.vitessce-container .higlass-wrapper .react-checkbox-tree .rct-icon{font-family:FontAwesome;font-style:normal}.vitessce-container .higlass-wrapper .rct-disabled>.rct-text>label{opacity:.75;cursor:not-allowed}.vitessce-container .higlass-wrapper .rct-disabled>.rct-text>label:active,.vitessce-container .higlass-wrapper .rct-disabled>.rct-text>label:hover{background:transparent}.vitessce-container .higlass-wrapper .rct-text{display:flex;align-items:center}.vitessce-container .higlass-wrapper .rct-options{flex:0 0 auto;margin-left:.5rem;text-align:right}.vitessce-container .higlass-wrapper .rct-option{opacity:.75;border:0;background:none;cursor:pointer;padding:0 4px;font-size:18px}.vitessce-container .higlass-wrapper .rct-option:hover{opacity:1}.vitessce-container .higlass-wrapper .rct-option+.rct-option{margin-left:2px}.vitessce-container .higlass-wrapper .rct-checkbox,.vitessce-container .higlass-wrapper .rct-collapse,.vitessce-container .higlass-wrapper .rct-node-icon{padding:0 5px}.vitessce-container .higlass-wrapper .rct-checkbox *,.vitessce-container .higlass-wrapper .rct-collapse *,.vitessce-container .higlass-wrapper .rct-node-icon *{display:inline-block;margin:0;width:14px}.vitessce-container .higlass-wrapper .rct-collapse{border:0;background:none;line-height:normal;color:inherit;font-size:12px}.vitessce-container .higlass-wrapper .rct-collapse.rct-collapse-btn{cursor:pointer}.vitessce-container .higlass-wrapper .rct-collapse>.rct-icon-expand-close{opacity:.5}.vitessce-container .higlass-wrapper .rct-collapse>.rct-icon-expand-close:hover{opacity:1}.vitessce-container .higlass-wrapper .rct-native-display .rct-checkbox{display:none}.vitessce-container .higlass-wrapper .rct-node-clickable{cursor:pointer}.vitessce-container .higlass-wrapper .rct-node-clickable:hover{background:rgba(51,51,204,0.1)}.vitessce-container .higlass-wrapper .rct-node-clickable:focus{outline:0;background:rgba(51,51,204,0.2)}.vitessce-container .higlass-wrapper .rct-node-icon{color:#33c}.vitessce-container .higlass-wrapper .rct-title{padding:0 5px}.vitessce-container .higlass-wrapper .rct-icon-expand-close:before{content:\"\\F054\"}.vitessce-container .higlass-wrapper .rct-icon-expand-open:before{content:\"\\F078\"}.vitessce-container .higlass-wrapper .rct-icon-uncheck:before{content:\"\\F096\"}.vitessce-container .higlass-wrapper .rct-icon-check:before{content:\"\\F046\"}.vitessce-container .higlass-wrapper .rct-icon-half-check:before{opacity:.5;content:\"\\F046\"}.vitessce-container .higlass-wrapper .rct-icon-leaf:before{content:\"\\F016\"}.vitessce-container .higlass-wrapper .rct-icon-parent-open:before{content:\"\\F115\"}.vitessce-container .higlass-wrapper .rct-icon-parent-close:before{content:\"\\F114\"}.vitessce-container .higlass-wrapper .rct-icon-expand-all:before{content:\"\\F0FE\"}.vitessce-container .higlass-wrapper .rct-icon-collapse-all:before{content:\"\\F146\"}.vitessce-container .higlass-wrapper .plot-type-selected{background-color:rgba(0,0,255,0.3)}.vitessce-container .higlass-wrapper .plot-type-container{overflow-y:scroll;padding:3px;max-height:15vh}.vitessce-container .higlass-wrapper .plot-type-container,.vitessce-container .higlass-wrapper .plot-type-container-empty{margin:5px;border:1px solid #aaa;border-radius:5px}.vitessce-container .higlass-wrapper .plot-type-container-empty{padding:3px 8px;background-color:#e8e8e8}.vitessce-container .higlass-wrapper .plot-type-item{cursor:pointer}.vitessce-container .higlass-wrapper .plot-type-item:not(.plot-type-selected):hover{background-color:rgba(51,51,204,0.1)}.vitessce-container .higlass-wrapper .track-thumbnail{width:30px;height:20px;display:inline-block;margin-right:10;vertical-align:middle}.vitessce-container .higlass-wrapper .track-thumbnail>svg{width:20px;height:20px}.vitessce-container .higlass-wrapper .AddTrackDialog-module_collapse-toggle-icon-1Of5_:before{font-family:Glyphicons Halflings;content:\"\\E159\";float:left;padding-right:3px}.vitessce-container .higlass-wrapper .AddTrackDialog-module_collapse-toggle-icon-1Of5_.AddTrackDialog-module_collapsed-1ifB1:before{content:\"\\E158\"}.vitessce-container .higlass-wrapper .AddTrackDialog-module_modal-title-1Atka{font-family:Roboto;font-weight:700}.vitessce-container .higlass-wrapper .AddTrackDialog-module_modal-container-14d_4{position:relative}.vitessce-container .higlass-wrapper .AddTrackDialog-module_modal-container-14d_4 .AddTrackDialog-module_modal-backdrop-ZrVQg,.vitessce-container .higlass-wrapper .AddTrackDialog-module_modal-container-14d_4 .AddTrackDialog-module_modal-bZqLI{position:absolute}.vitessce-container .higlass-wrapper .AddTrackDialog-module_modal-dialog-3bKDk{position:relative;display:table;overflow-y:auto;overflow-x:auto;width:600px;min-width:300px;margin:auto}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-right-handle-o7UYG,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-right-handle-oUk0R{border-right:solid #000;border-top:solid #000}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-left-handle-FO7d4,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-left-handle-R5Zui{border-left:solid #000;border-top:solid #000}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP{position:absolute;opacity:0;transition:transform .15s ease,opacity .15s ease}.vitessce-container .higlass-wrapper .DraggableDiv-module_draggable-div-2eWml{background-color:transparent;box-sizing:border-box}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-grabber-2mVDE{width:10px;height:4px;border-top:1px solid #000;border-bottom:1px solid #000}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-grabber-2mVDE{margin:4px 7px}.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-grabber-1mtC0{width:4px;height:10px;border-left:1px solid #000;border-right:1px solid #000}.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-grabber-1mtC0{margin:7px 4px}.vitessce-container .higlass-wrapper .DraggableDiv-module_draggable-div-2eWml:hover .DraggableDiv-module_bottom-draggable-handle-3olLp,.vitessce-container .higlass-wrapper .DraggableDiv-module_draggable-div-2eWml:hover .DraggableDiv-module_left-draggable-handle-2gpow,.vitessce-container .higlass-wrapper .DraggableDiv-module_draggable-div-2eWml:hover .DraggableDiv-module_right-draggable-handle-2Sriq,.vitessce-container .higlass-wrapper .DraggableDiv-module_draggable-div-2eWml:hover .DraggableDiv-module_top-draggable-handle-3W5bP{opacity:.5;background:rgba(255,255,255,0.75);box-shadow:0 0 3px 1px rgba(255,255,255,0.75);border-radius:3px}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:active,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:hover,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:active,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:hover,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:active,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:hover,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:active,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:hover{opacity:1 !important;transform:scale(2)}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:active .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:active .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:active .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:active .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:hover .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:hover .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:hover .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp:hover .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:active .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:active .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:active .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:active .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:hover .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:hover .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:hover .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow:hover .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:active .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:active .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:active .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:active .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:hover .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:hover .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:hover .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq:hover .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:active .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:active .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:active .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:active .DraggableDiv-module_top-draggable-handle-grabber-2mVDE,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:hover .DraggableDiv-module_bottom-draggable-handle-grabber-GN1_k,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:hover .DraggableDiv-module_left-draggable-handle-grabber-1Pqhc,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:hover .DraggableDiv-module_right-draggable-handle-grabber-1mtC0,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP:hover .DraggableDiv-module_top-draggable-handle-grabber-2mVDE{box-shadow:0 0 3px 1px #0089ff;background:#0089ff}.vitessce-container .higlass-wrapper .DraggableDiv-module_bottom-draggable-handle-3olLp,.vitessce-container .higlass-wrapper .DraggableDiv-module_top-draggable-handle-3W5bP{height:12px;cursor:row-resize}.vitessce-container .higlass-wrapper .DraggableDiv-module_left-draggable-handle-2gpow,.vitessce-container .higlass-wrapper .DraggableDiv-module_right-draggable-handle-2Sriq{width:12px;cursor:col-resize}.vitessce-container .higlass-wrapper .HorizontalTiledPlot-module_horizontal-tiled-plot-3EK65,.vitessce-container .higlass-wrapper .VerticalTiledPlot-module_vertical-tiled-plot-R3sb7{position:relative}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-focus-23by2,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-SYccr{position:relative;display:flex;align-items:stretch;height:100%;margin-bottom:0;font-size:13.71429px;transition:box-shadow .15s ease,font-size .15s ease}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-focus-23by2{box-shadow:0 0 0 1px #337ab7,0 0 3px 1px #337ab7}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-1_0ZU{position:relative;box-sizing:border-box;width:100%;height:100%;padding:3px;color:#666;font-size:inherit;line-height:24px;border:0;border-radius:3px 0 0 3px;background:transparent}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-1_0ZU:focus{outline:none;color:#000}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-dark-EML2e .GenomePositionSearchBox-module_genome-position-search-bar-1_0ZU:focus{color:#e5e5e5}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-33SWJ,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-focus-1IhAk{display:block;height:100%;padding:0 8px !important;color:#999;border:0 !important;border-radius:0 !important;background:transparent;transition:background .15s ease,color .15s ease}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-33SWJ:active,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-33SWJ:focus,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-33SWJ:hover,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-focus-1IhAk,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-focus-1IhAk:active,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-focus-1IhAk:focus,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-button-focus-1IhAk:hover{color:#fff;background:#337ab7}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-14AEk,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-focus-1Ay7Z{display:flex;align-items:center;transition:color .15s ease}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-14AEk:first-child,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-focus-1Ay7Z:first-child{margin-left:6px;margin-right:2px}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-14AEk span,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-focus-1Ay7Z span{display:block;margin-top:-2px}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-icon-focus-1Ay7Z{color:#337ab7}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-bar-suggestions-SrIoU{position:fixed;border-radius:3px;box-shadow:0 0 3px 0 rgba(0,0,0,0.1),0 1px 5px 0 rgba(0,0,0,0.05);background-color:rgba(255,255,255,0.95);border:1px solid rgba(0,0,0,0.1);padding:2px 0;font-size:90%;overflow:auto;max-height:50%}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-2bTUd{display:inline-block;margin-bottom:0;font-size:13.71429px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-sm-2Ltms{font-size:12px;line-height:1.5;border-radius:3px}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-default-2pap4{color:#666;background-color:#fff;border-color:#ccc}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-default-2pap4:hover{color:#000;background:#ccc}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-default-2pap4:active,.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_btn-default-2pap4:focus{color:#fff;border-color:#000;background:#000}.vitessce-container .higlass-wrapper .GenomePositionSearchBox-module_genome-position-search-SYccr .GenomePositionSearchBox-module_btn-2bTUd{border-radius:0 3px 3px 0}.vitessce-container .higlass-wrapper .ExportLinkDialog-module_export-link-dialog-wrapper-ldYlL{display:flex}.vitessce-container .higlass-wrapper .ExportLinkDialog-module_export-link-dialog-wrapper-ldYlL input{flex-grow:1}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-table-RHODc{border-collapse:collapse;margin:5px;color:#666}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-table-dark-_B9fu{color:#ccc}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-other-lIGbb{outline:none}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-top-center-2Dw4e{min-width:80px;min-height:20px;text-align:center;outline:none;border-top:1px solid #999;border-left:1px solid #999;border-right:1px solid #999;border-radius:2px 2px 0 0}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-top-center-2Dw4e:hover{color:#fff;background-color:#337ab7}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-left-2ycaN{min-width:40px;text-align:center;outline:none;border-top:1px solid #999;border-left:1px solid #999;border-bottom:1px solid #999;border-radius:2px 0 0 2px}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-left-2ycaN:hover{background-color:#337ab7;color:#fff}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-right-Qqjnn{min-width:40px;text-align:center;outline:none;border-top:1px solid #999;border-right:1px solid #999;border-bottom:1px solid #999;border-radius:0 2px 2px 0}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-right-Qqjnn:hover{background-color:#337ab7;color:#fff}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-middle-2YFZd{text-align:center;outline:none;border:1px solid #999}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-middle-middle-2YFZd:hover{background-color:#337ab7;color:#fff}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-bottom-middle-3ityE{min-height:20px;text-align:center;outline:none;border-left:1px solid #999;border-right:1px solid #999;border-bottom:1px solid #999;border-radius:0 0 2px 2px}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-bottom-middle-3ityE:hover{background-color:#337ab7;color:#fff}.vitessce-container .higlass-wrapper .AddTrackPositionMenu-module_add-track-position-span-2hbwE{margin:5px}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-3XnZx,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-focus-3akkN,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-squeazed-GHIVd{position:relative;display:flex;justify-content:space-between;height:24px;margin-top:4px;margin-bottom:4px;color:#999;font-size:12px;line-height:24px;vertical-align:middle;border:0;border-radius:3px;background:#e5e5e5;transition:height .15s ease,margin .15s ease}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-dark-97tZt{background:#222}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-focus-3akkN{height:32px;margin-top:0;margin-bottom:0}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-id-3YURk{padding-left:3px}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-id-3YURk:before{content:\"ID:\";font-weight:700;padding-right:5px}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-left-Qj9Sm{display:flex;flex-grow:1}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-3jrIz,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-squeazed-dU45Z{display:flex;align-items:center;justify-content:center;width:24px;height:100%;cursor:move;border-radius:3px 0 0 3px;transition:background .15s ease}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-3jrIz:hover,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-squeazed-dU45Z:hover{background:#999}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-3jrIz:hover div,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-squeazed-dU45Z:hover div{background:#fff}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-3jrIz div,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-squeazed-dU45Z div{width:1px;height:50%;margin:1px;background:#999;transition:background .15s ease}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-dark-97tZt .ViewHeader-module_multitrack-header-grabber-3jrIz div{background:#666}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-grabber-squeazed-dU45Z{width:19.2px}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-search-1X_3_{position:relative;flex-grow:1;height:100%;margin-right:12px}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-search-1X_3_:after{position:absolute;top:3px;bottom:3px;right:-12px;display:block;content:\"\";width:1px;margin:0 6px;background:#ccc}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-dark-97tZt .ViewHeader-module_multitrack-header-search-1X_3_:after{background:#666}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-3XnZx>nav,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-nav-list-2nvcu{display:flex}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-16QKZ,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF{width:24px;height:100%;padding:6px;transition:background .15s ease,color .15s ease}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-16QKZ:active,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-16QKZ:focus,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-16QKZ:hover,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF:active,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF:focus,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF:hover{color:#fff;background:#337ab7}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-16QKZ:last-child,.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF:last-child{border-radius:0 3px 3px 0}.vitessce-container .higlass-wrapper .ViewHeader-module_mouse-tool-selection-1pg2m{color:#fff;border-radius:3px 0 0 3px;background:#337ab7}.vitessce-container .higlass-wrapper .ViewHeader-module_multitrack-header-icon-squeazed-25lkF{width:20px 5;padding-left:3px;padding-right:3px}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-editor-header-2nTtX{margin:-10px -10px 0;padding:10px;display:flex;justify-content:space-between;background:#f2f2f2}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-editor-header-2nTtX button{display:flex;align-items:center;font-size:14px;background:#f2f2f2}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-editor-header-2nTtX button:hover{background:#e5e5e5}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-editor-header-2nTtX button:hover span{color:#666}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-editor-2HAFN{position:absolute;top:50px;right:0;bottom:0;left:0;margin:1px 0 0;padding:0;overflow:auto;font-size:12.5px;height:calc(100% - 80px)}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-1mYmL{position:absolute;right:0;bottom:0;left:0;margin:1px 0 0;padding:0;min-height:30px;background:#f2f2f2;transition:height .15s ease}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-header-3EbEM{background:#f2f2f2;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding-left:10px;height:30px;display:flex;align-items:center;cursor:pointer;position:sticky;position:-webkit-sticky;top:0}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ{background:#f2f2f2;overflow:auto;height:calc(100% - 30px)}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ td,.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ tr{outline:none;vertical-align:top}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ .ViewConfigEditor-module_title-3nLH_{font-weight:700;padding-left:8px;padding-top:8px;width:100px}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ .ViewConfigEditor-module_Warning-_sgiB{color:orange}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ .ViewConfigEditor-module_Success-nclFo{color:green}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ .ViewConfigEditor-module_Error-3enaC{color:red}.vitessce-container .higlass-wrapper .ViewConfigEditor-module_view-config-log-msg-2-CJZ pre{background:#fff;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-1NHR2{position:relative}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-dark-theme-2visd{background:#000}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-container-overflow-zNXnY,.vitessce-container .higlass-wrapper .HiGlass-module_higlass-scroll-container-overflow-2FS0w,.vitessce-container .higlass-wrapper .HiGlass-module_higlass-scroll-container-scroll-2lAU4{position:absolute;top:0;right:0;bottom:0;left:0}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-scroll-container-overflow-2FS0w{overflow:hidden}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-scroll-container-scroll-2lAU4{overflow-x:hidden;overflow-y:auto}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-canvas-_mP9r{position:absolute;width:100%;height:100%}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-drawing-surface-3aQQo{position:relative}.vitessce-container .higlass-wrapper .HiGlass-module_higlass-svg-JJZbf{position:absolute;width:100%;height:100%;left:0;top:0;pointer-events:none}.vitessce-container .higlass-wrapper .HiGlass-module_tiled-area-22H1L{display:flex;flex-direction:column}.vitessce-container .higlass-wrapper .HiGlass-module_track-mouseover-menu-1AoaP{position:fixed;z-index:1;margin:17px 0 0 9px;padding:0 .25rem;max-width:50vw;word-wrap:break-word;font-size:.8em;pointer-events:none;background:#fff;border-radius:.25rem;box-shadow:0 0 0 1px rgba(0,0,0,0.1),0 0 3px 0 rgba(0,0,0,0.075),0 0 7px 0 rgba(0,0,0,0.05)}.vitessce-container .higlass-wrapper .higlass .react-grid-layout{position:relative;transition:height .2s ease}.vitessce-container .higlass-wrapper .higlass .react-grid-item{transition:all .2s ease;transition-property:left,top}.vitessce-container .higlass-wrapper .higlass .react-grid-item.cssTransforms{transition-property:transform}.vitessce-container .higlass-wrapper .higlass .react-grid-item.resizing{z-index:1;will-change:width,height}.vitessce-container .higlass-wrapper .higlass .react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.vitessce-container .higlass-wrapper .higlass .react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.vitessce-container .higlass-wrapper .higlass .react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;bottom:0;right:0;cursor:se-resize}.vitessce-container .higlass-wrapper .higlass .react-grid-item>.react-resizable-handle:after{content:\"\";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,0.4);border-bottom:2px solid rgba(0,0,0,0.4)}.vitessce-container .higlass-wrapper .higlass .react-resizable{position:relative}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZ6IiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+\");background-position:100% 100%;padding:0 3px 3px 0}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-e,.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-w{top:50%;margin-top:-10px;cursor:ew-resize}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-w{left:0;transform:rotate(135deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-e{right:0;transform:rotate(315deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-n,.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-n{top:0;transform:rotate(225deg)}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.vitessce-container .higlass-wrapper .higlass code[class*=language-],.vitessce-container .higlass-wrapper .higlass pre[class*=language-]{color:#393a34;font-family:Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;font-size:.95em;line-height:1.2em;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}.vitessce-container .higlass-wrapper .higlass code[class*=language-]::selection,.vitessce-container .higlass-wrapper .higlass code[class*=language-] ::selection,.vitessce-container .higlass-wrapper .higlass pre[class*=language-]::selection,.vitessce-container .higlass-wrapper .higlass pre[class*=language-] ::selection{background:#b3d4fc}.vitessce-container .higlass-wrapper .higlass pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border:1px solid #ddd;background-color:#fff}.vitessce-container .higlass-wrapper .higlass :not(pre)>code[class*=language-]{padding:1px .2em;background:#f8f8f8;border:1px solid #ddd}.vitessce-container .higlass-wrapper .higlass .token.cdata,.vitessce-container .higlass-wrapper .higlass .token.comment,.vitessce-container .higlass-wrapper .higlass .token.doctype,.vitessce-container .higlass-wrapper .higlass .token.prolog{color:#998;font-style:italic}.vitessce-container .higlass-wrapper .higlass .token.namespace{opacity:.7}.vitessce-container .higlass-wrapper .higlass .token.attr-value,.vitessce-container .higlass-wrapper .higlass .token.string{color:#e3116c}.vitessce-container .higlass-wrapper .higlass .token.operator,.vitessce-container .higlass-wrapper .higlass .token.punctuation{color:#393a34}.vitessce-container .higlass-wrapper .higlass .token.boolean,.vitessce-container .higlass-wrapper .higlass .token.constant,.vitessce-container .higlass-wrapper .higlass .token.entity,.vitessce-container .higlass-wrapper .higlass .token.inserted,.vitessce-container .higlass-wrapper .higlass .token.number,.vitessce-container .higlass-wrapper .higlass .token.property,.vitessce-container .higlass-wrapper .higlass .token.regex,.vitessce-container .higlass-wrapper .higlass .token.symbol,.vitessce-container .higlass-wrapper .higlass .token.url,.vitessce-container .higlass-wrapper .higlass .token.variable{color:#36acaa}.vitessce-container .higlass-wrapper .higlass .language-autohotkey .token.selector,.vitessce-container .higlass-wrapper .higlass .token.atrule,.vitessce-container .higlass-wrapper .higlass .token.attr-name,.vitessce-container .higlass-wrapper .higlass .token.keyword{color:#00a4db}.vitessce-container .higlass-wrapper .higlass .language-autohotkey .token.tag,.vitessce-container .higlass-wrapper .higlass .token.deleted,.vitessce-container .higlass-wrapper .higlass .token.function{color:#9a050f}.vitessce-container .higlass-wrapper .higlass .language-autohotkey .token.keyword,.vitessce-container .higlass-wrapper .higlass .token.selector,.vitessce-container .higlass-wrapper .higlass .token.tag{color:#00009f}.vitessce-container .higlass-wrapper .higlass .token.bold,.vitessce-container .higlass-wrapper .higlass .token.function,.vitessce-container .higlass-wrapper .higlass .token.important{font-weight:700}.vitessce-container .higlass-wrapper .higlass .token.italic{font-style:italic}.vitessce-container .higlass-wrapper .higlass *{box-sizing:border-box}.vitessce-container .higlass-wrapper .higlass .react-resizable-handle{z-index:1}.vitessce-container .higlass-wrapper table.table-track-options{border-collapse:collapse;margin-left:auto;margin-right:auto}.vitessce-container .higlass-wrapper td.td-track-options{border:1px solid #fff;outline:none;padding:3px;position:relative;font-family:Roboto,sans-serif;font-size:14px;color:#666}.vitessce-container .higlass-wrapper .cell-label{position:absolute;left:0;top:0;margin-left:5px;color:#777}.vitessce-container .higlass-wrapper .modal-dialog{position:relative;display:table;overflow-y:auto;overflow-x:auto;width:auto;min-width:300px;margin:auto}.vitessce-container{position:relative}.vitessce-container *,.vitessce-container *::before,.vitessce-container *::after{box-sizing:border-box}.vitessce-container div{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;text-align:left}.vitessce-container article,.vitessce-container aside,.vitessce-container figcaption,.vitessce-container figure,.vitessce-container footer,.vitessce-container header,.vitessce-container hgroup,.vitessce-container main,.vitessce-container nav,.vitessce-container section{display:block}.vitessce-container h1,.vitessce-container h2,.vitessce-container h3,.vitessce-container h4,.vitessce-container h5,.vitessce-container h6{margin-top:0;margin-bottom:0.5rem;font-weight:500;line-height:1.2}.vitessce-container p{margin-top:0;margin-bottom:1rem}.vitessce-container ol,.vitessce-container ul,.vitessce-container dl{margin-top:0;margin-bottom:0}.vitessce-container b,.vitessce-container strong{font-weight:bolder}.vitessce-container small{font-size:80%}.vitessce-container a{color:#007bff;text-decoration:none;background-color:transparent}.vitessce-container a:hover{color:#0056b3;text-decoration:underline}.vitessce-container a:not([href]){color:inherit;text-decoration:none}.vitessce-container a:not([href]):hover{color:inherit;text-decoration:none}.vitessce-container img{vertical-align:middle;border-style:none}.vitessce-container svg{overflow:hidden}.vitessce-container table{border-collapse:collapse}.vitessce-container th{text-align:inherit}.vitessce-container button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.vitessce-container input,.vitessce-container button,.vitessce-container select,.vitessce-container optgroup,.vitessce-container textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}.vitessce-container button,.vitessce-container input{overflow:visible}.vitessce-container button,.vitessce-container select{text-transform:none}.vitessce-container select{word-wrap:normal}.vitessce-container button,.vitessce-container [type=\"button\"],.vitessce-container [type=\"reset\"],.vitessce-container [type=\"submit\"]{-webkit-appearance:button}.vitessce-container button:not(:disabled),.vitessce-container [type=\"button\"]:not(:disabled),.vitessce-container [type=\"reset\"]:not(:disabled),.vitessce-container [type=\"submit\"]:not(:disabled){cursor:pointer}.vitessce-container button::-moz-focus-inner,.vitessce-container [type=\"button\"]::-moz-focus-inner,.vitessce-container [type=\"reset\"]::-moz-focus-inner,.vitessce-container [type=\"submit\"]::-moz-focus-inner{padding:0;border-style:none}.vitessce-container input[type=\"radio\"],.vitessce-container input[type=\"checkbox\"]{box-sizing:border-box;padding:0}.vitessce-container [hidden]{display:none !important}.vitessce-container h1{font-size:2.5rem}.vitessce-container h2{font-size:2rem}.vitessce-container h3{font-size:1.75rem}.vitessce-container h4{font-size:1.5rem}.vitessce-container h5{font-size:1.25rem}.vitessce-container h6{font-size:1rem}.vitessce-container .container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.vitessce-container .row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.vitessce-container .col{flex-basis:0;flex-grow:1;max-width:100%;position:relative;width:100%;padding-right:15px;padding-left:15px}.vitessce-container .d-flex{display:flex !important}.vitessce-container .card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.vitessce-container .card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.vitessce-container .card-header+.list-group .list-group-item:first-child{border-top:0}.vitessce-container .card-body{flex:1 1 auto;min-height:1px;padding:0.75rem}.vitessce-container .list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0}.vitessce-container .list-group-item-action{width:100%;color:#495057;text-align:inherit}.vitessce-container .list-group-item-action:hover,.vitessce-container .list-group-item-action:focus{z-index:1;text-decoration:none}.vitessce-container .list-group-item{position:relative;display:block;padding:0.75rem 1.25rem;border:1px solid rgba(0,0,0,0.125)}.vitessce-container .list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.vitessce-container .list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.vitessce-container .list-group-item.disabled,.vitessce-container .list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.vitessce-container .list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.vitessce-container .list-group-item+.list-group-item{border-top-width:0}.vitessce-container .list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.vitessce-container .flex-column{flex-direction:column !important}.vitessce-container .align-items-start{align-items:flex-start !important}.vitessce-container .input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.vitessce-container .input-group>.form-control,.vitessce-container .input-group>.form-control-plaintext{position:relative;flex:1 1;min-width:0;margin-bottom:0}.vitessce-container .input-group>.form-control+.form-control,.vitessce-container .input-group>.form-control-plaintext+.form-control,.vitessce-container .input-group>.custom-select+.form-control,.vitessce-container .input-group>.custom-file+.form-control{margin-left:-1px}.vitessce-container .input-group>.form-control:focus{z-index:3}.vitessce-container .input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.vitessce-container .input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.vitessce-container .input-group-prepend,.vitessce-container .input-group-append{display:flex}.vitessce-container .input-group-prepend .btn,.vitessce-container .input-group-append .btn{position:relative;z-index:2}.vitessce-container .input-group-prepend .btn:focus,.vitessce-container .input-group-append .btn:focus{z-index:3}.vitessce-container .input-group-prepend .btn+.btn,.vitessce-container .input-group-append .btn+.btn{margin-left:-1px}.vitessce-container .input-group-prepend{margin-right:-1px}.vitessce-container .input-group-append{margin-left:-1px}.vitessce-container .input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.vitessce-container .input-group-lg>.form-control,.vitessce-container .input-group-lg>.input-group-prepend>.btn,.vitessce-container .input-group-lg>.input-group-append>.btn{padding:0.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:0.3rem}.vitessce-container .input-group-sm>.form-control:not(textarea){height:calc(1.5em + 0.5rem + 2px)}.vitessce-container .input-group-sm>.form-control,.vitessce-container .input-group-sm>.input-group-prepend>.btn,.vitessce-container .input-group-sm>.input-group-append>.btn{padding:0.25rem 0.5rem;font-size:0.875rem;line-height:1.5;border-radius:0.2rem}.vitessce-container .input-group>.input-group-prepend>.btn,.vitessce-container .input-group>.input-group-append:not(:last-child)>.btn,.vitessce-container .input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.vitessce-container .input-group>.input-group-append>.btn,.vitessce-container .input-group>.input-group-prepend:not(:first-child)>.btn,.vitessce-container .input-group>.input-group-prepend:first-child>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.vitessce-container .my-auto,.vitessce-container .mt-auto{margin-top:auto !important}.vitessce-container .my-auto,.vitessce-container .mb-auto{margin-bottom:auto !important}.vitessce-container .my-0,.vitessce-container .mt-0{margin-top:0 !important}.vitessce-container .my-0,.vitessce-container .mb-0{margin-bottom:0 !important}.vitessce-container .my-1,.vitessce-container .mt-1{margin-top:0.25rem !important}.vitessce-container .my-1,.vitessce-container .mb-1{margin-bottom:0.25rem !important}.vitessce-container .my-2,.vitessce-container .mt-2{margin-top:0.5rem !important}.vitessce-container .my-2,.vitessce-container .mb-2{margin-bottom:0.5rem !important}.vitessce-container .my-3,.vitessce-container .mt-3{margin-top:1rem !important}.vitessce-container .my-3,.vitessce-container .mb-3{margin-bottom:1rem !important}.vitessce-container .mx-auto,.vitessce-container .ml-auto{margin-left:auto !important}.vitessce-container .mx-auto,.vitessce-container .mr-auto{margin-right:auto !important}.vitessce-container .mx-0,.vitessce-container .ml-0{margin-left:0 !important}.vitessce-container .mx-0,.vitessce-container .mr-0{margin-right:0 !important}.vitessce-container .mx-1,.vitessce-container .ml-1{margin-left:0.25rem !important}.vitessce-container .mx-1,.vitessce-container .mr-1{margin-right:0.25rem !important}.vitessce-container .mx-2,.vitessce-container .ml-2{margin-left:0.5rem !important}.vitessce-container .mx-2,.vitessce-container .mr-2{margin-right:0.5rem !important}.vitessce-container .mx-3,.vitessce-container .ml-3{margin-left:1rem !important}.vitessce-container .mx-3,.vitessce-container .mr-3{margin-right:1rem !important}.vitessce-container .py-0,.vitessce-container .pt-0{padding-top:0 !important}.vitessce-container .py-0,.vitessce-container .pb-0{padding-bottom:0 !important}.vitessce-container .py-1,.vitessce-container .pt-1{padding-top:0.25rem !important}.vitessce-container .py-1,.vitessce-container .pb-1{padding-bottom:0.25rem !important}.vitessce-container .py-2,.vitessce-container .pt-2{padding-top:0.5rem !important}.vitessce-container .py-2,.vitessce-container .pb-2{padding-bottom:0.5rem !important}.vitessce-container .py-3,.vitessce-container .pt-3{padding-top:1rem !important}.vitessce-container .py-3,.vitessce-container .pb-3{padding-bottom:1rem !important}.vitessce-container .px-0,.vitessce-container .pl-0{padding-left:0 !important}.vitessce-container .px-0,.vitessce-container .pr-0{padding-right:0 !important}.vitessce-container .px-1,.vitessce-container .pl-1{padding-left:0.25rem !important}.vitessce-container .px-1,.vitessce-container .pr-1{padding-right:0.25rem !important}.vitessce-container .px-2,.vitessce-container .pl-2{padding-left:0.5rem !important}.vitessce-container .px-2,.vitessce-container .pr-2{padding-right:0.5rem !important}.vitessce-container .px-3,.vitessce-container .pl-3{padding-left:1rem !important}.vitessce-container .px-3,.vitessce-container .pr-3{padding-right:1rem !important}.vitessce-container .form-control{display:block;width:100%;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 0.75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:0.25rem;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.vitessce-container .form-control{transition:none}}.vitessce-container .form-control::-ms-expand{background-color:transparent;border:0}.vitessce-container .form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.vitessce-container .form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 0.2rem rgba(0,123,255,0.25)}.vitessce-container .form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.vitessce-container .form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.vitessce-container .form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.vitessce-container .form-control::placeholder{color:#6c757d;opacity:1}.vitessce-container .form-control:disabled,.vitessce-container .form-control[readonly]{background-color:#e9ecef;opacity:1}.vitessce-container select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.vitessce-container .btn .badge{position:relative;top:-1px}.vitessce-container .btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;line-height:1.5;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.vitessce-container .btn{transition:none}}.vitessce-container .btn:hover{color:#212529;text-decoration:none}.vitessce-container .btn:focus,.vitessce-container .btn.focus{outline:0;box-shadow:0 0 0 0.2rem rgba(0,123,255,0.25)}.vitessce-container .btn.disabled,.vitessce-container .btn:disabled{opacity:0.65}.vitessce-container .btn-outline-secondary{color:#6c757d;border-color:#6c757d}.vitessce-container .btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.vitessce-container .btn-outline-secondary:focus,.vitessce-container .btn-outline-secondary.focus{box-shadow:0 0 0 0.2rem rgba(108,117,125,0.5)}.vitessce-container .btn-outline-secondary.disabled,.vitessce-container .btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.vitessce-container .btn-outline-secondary:not(:disabled):not(.disabled):active,.vitessce-container .btn-outline-secondary:not(:disabled):not(.disabled).active,.vitessce-container .show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.vitessce-container .btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.vitessce-container .btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.vitessce-container .show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 0.2rem rgba(108,117,125,0.5)}.vitessce-container .modal-open{overflow:hidden}.vitessce-container .modal-open .modal{overflow-x:hidden;overflow-y:auto}.vitessce-container .modal{position:absolute;top:0;left:0;z-index:1050;width:100%;height:100%;overflow:hidden;outline:0}.vitessce-container .modal-dialog{position:relative;width:auto;margin:0.5rem;pointer-events:none}.vitessce-container .modal.fade .modal-dialog{transition:transform 0.3s ease-out;transform:translate(0, -50px)}@media (prefers-reduced-motion: reduce){.vitessce-container .modal.fade .modal-dialog{transition:none}}.vitessce-container .modal.show .modal-dialog{transform:none}.vitessce-container .modal.modal-static .modal-dialog{transform:scale(1.02)}.vitessce-container .modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.vitessce-container .modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.vitessce-container .modal-dialog-scrollable .modal-header,.vitessce-container .modal-dialog-scrollable .modal-footer{flex-shrink:0}.vitessce-container .modal-dialog-scrollable .modal-body{overflow-y:auto}.vitessce-container .modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.vitessce-container .modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);content:\"\"}.vitessce-container .modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.vitessce-container .modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.vitessce-container .modal-dialog-centered.modal-dialog-scrollable::before{content:none}.vitessce-container .modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:0.3rem;outline:0}.vitessce-container .modal-backdrop{position:absolute;top:0;left:0;z-index:1040;width:100%;height:100%;background-color:#000}.vitessce-container .modal-backdrop.fade{opacity:0}.vitessce-container .modal-backdrop.show{opacity:0.5}.vitessce-container .modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.vitessce-container .modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.vitessce-container .modal-title{margin-bottom:0;line-height:1.5}.vitessce-container .modal-body{position:relative;flex:1 1 auto;padding:1rem}.vitessce-container .modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:0.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(0.3rem - 1px);border-bottom-left-radius:calc(0.3rem - 1px)}.vitessce-container .modal-footer>*{margin:0.25rem}.vitessce-container .modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width: 576px){.vitessce-container .modal-dialog{max-width:500px;margin:1.75rem auto}.vitessce-container .modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.vitessce-container .modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.vitessce-container .modal-dialog-centered{min-height:calc(100% - 3.5rem)}.vitessce-container .modal-dialog-centered::before{height:calc(100vh - 3.5rem)}.vitessce-container .modal-sm{max-width:300px}}@media (min-width: 992px){.vitessce-container .modal-lg,.vitessce-container .modal-xl{max-width:800px}}@media (min-width: 1200px){.vitessce-container .modal-xl{max-width:1140px}}.vitessce-container .card{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-clip:border-box;border-radius:0.25rem}.vitessce-container .alert{position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem}.vitessce-container .alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.vitessce-container .justify-content-between{justify-content:space-between !important}.vitessce-container .align-items-baseline{align-items:baseline !important}.vitessce-container .pl-2,.vitessce-container .px-2{padding-left:0.5rem !important}.vitessce-container .align-items-end{align-items:flex-end !important}.vitessce-container.vitessce-theme-dark.welcome-container{overflow:visible}.vitessce-container.vitessce-theme-dark.welcome-container .react-grid-layout,.vitessce-container.vitessce-theme-dark.welcome-container .warning-layout{position:relative}.vitessce-container.vitessce-theme-dark .react-grid-layout,.vitessce-container.vitessce-theme-dark .warning-layout{background-color:#333;height:auto;position:absolute;width:100%}.vitessce-container.vitessce-theme-dark .warning-layout{height:100vh}.vitessce-container.vitessce-theme-dark .warning-layout .card{margin-left:0.5rem}.vitessce-container.vitessce-theme-dark .loading-indicator-backdrop{position:absolute;top:0;left:0;z-index:1040;width:100%;height:100%;border-radius:0.25rem;background-color:rgba(0,0,0,0.5)}.vitessce-container.vitessce-theme-dark .loading-indicator-backdrop .loading-indicator-container{display:grid;place-items:center;position:absolute;width:100%;height:100%}.vitessce-container.vitessce-theme-dark .react-grid-item{flex-direction:column !important;display:flex !important;padding-right:10px}.vitessce-container.vitessce-theme-dark .d-flex{flex-shrink:0}.vitessce-container.vitessce-theme-dark .title{color:#d3d3d3;overflow-x:hidden}.vitessce-container.vitessce-theme-dark .card{border:1px solid rgba(0,0,0,0.125)}.vitessce-container.vitessce-theme-dark .bg-black{background-color:#000;color:#fff}.vitessce-container.vitessce-theme-dark .bg-black a{color:#fff}.vitessce-container.vitessce-theme-dark .bg-primary{background-color:#222;color:#d3d3d3}.vitessce-container.vitessce-theme-dark .bg-primary a{color:#9bb7d6}.vitessce-container.vitessce-theme-dark .bg-secondary{background-color:#000;color:#d3d3d3}.vitessce-container.vitessce-theme-dark .scroll{overflow-y:auto}.vitessce-container.vitessce-theme-dark .details{font-size:80%;opacity:0.8}.vitessce-container.vitessce-theme-dark .description p,.vitessce-container.vitessce-theme-dark .description details,.vitessce-container.vitessce-theme-dark .description table{font-size:80%;opacity:0.8}.vitessce-container.vitessce-theme-dark .description details{margin-bottom:6px}.vitessce-container.vitessce-theme-dark .description summary{border-bottom:1px solid #3c3c3c;cursor:pointer}.vitessce-container.vitessce-theme-dark .description .metadata-container{padding-left:14px}.vitessce-container.vitessce-theme-dark .description .metadata-container table{width:100%}.vitessce-container.vitessce-theme-dark .description .metadata-container table td,.vitessce-container.vitessce-theme-dark .description .metadata-container table th{outline:none;padding:2px 2px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:50%}.vitessce-container.vitessce-theme-dark .description .metadata-container table tr:nth-child(even){background-color:#2f2f2f}.vitessce-container.vitessce-theme-dark .coll-full,.vitessce-container.vitessce-theme-dark .welcome-col-left,.vitessce-container.vitessce-theme-dark .welcome-col-right{position:relative;width:100%;padding-right:15px;padding-left:15px}.vitessce-container.vitessce-theme-dark .col-full{flex:0 0 100%;max-width:100%}.vitessce-container.vitessce-theme-dark .welcome-col-left{flex:0 0 50%;max-width:50%}.vitessce-container.vitessce-theme-dark .welcome-col-left .list-group-item{background-color:#000}.vitessce-container.vitessce-theme-dark .welcome-col-left .input-group input{background-color:#d3d3d3}.vitessce-container.vitessce-theme-dark .welcome-col-left a{color:#ffffff}.vitessce-container.vitessce-theme-dark .welcome-col-right{flex:0 0 50%;max-width:50%}.vitessce-container.vitessce-theme-dark .welcome-col-right .info-paragraph{margin-bottom:0 !important}.vitessce-container.vitessce-theme-dark .welcome-col-right .info-section-text{margin-top:0.5rem}.vitessce-container.vitessce-theme-dark .welcome-col-right a{color:#ffffff}.vitessce-container.vitessce-theme-dark .btn.icon{padding:0;height:2em;width:2em;background-color:white}.vitessce-container.vitessce-theme-dark .btn.icon>svg{vertical-align:middle}.vitessce-container.vitessce-theme-dark .roll-up{height:2em;overflow:hidden;background-color:white}.vitessce-container.vitessce-theme-dark .roll-up:hover{-webkit-animation-name:roll-up;animation-name:roll-up;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes roll-up{0%{height:2em}100%{height:100%}}@keyframes roll-up{0%{height:2em}100%{height:100%}}.vitessce-container.vitessce-theme-dark .tool{position:absolute;display:inline;z-index:1000;opacity:.65;color:black}.vitessce-container.vitessce-theme-dark .tool:hover{opacity:.90}.vitessce-container.vitessce-theme-dark .radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;width:1em;height:1em;padding:6px !important;background-clip:content-box;border:2px solid lightgrey;background-color:lightgrey;border-radius:50%}.vitessce-container.vitessce-theme-dark .radio:checked{background-clip:unset}.vitessce-container.vitessce-theme-dark .layer-controller-container>div:first-child{margin-top:0 !important}.vitessce-container.vitessce-theme-dark .channel-container{width:100%;display:flex;position:relative}.vitessce-container.vitessce-theme-dark .channel-set-color{display:flex;position:relative;top:5px;width:16px;height:16px;margin-right:24px;cursor:pointer;outline:currentColor none medium;border-radius:3px;box-shadow:rgba(0,0,0,0.15) 0px 0px 0px 1px inset}.vitessce-container.vitessce-theme-dark .channel-checked{display:flex;position:relative;margin-right:10px}.vitessce-container.vitessce-theme-dark .add-image-layer{color:#c6c6c6;border:1px dashed #c6c6c6}.vitessce-container.vitessce-theme-dark pre{color:#d3d3d3}.vitessce-container.vitessce-theme-dark .cell-tooltip,.vitessce-container.vitessce-theme-dark .cell-emphasis-crosshair{z-index:50;position:absolute;pointer-events:none;box-sizing:border-box}.vitessce-container.vitessce-theme-dark .cell-emphasis-crosshair{background-color:#d3d3d3}.vitessce-container.vitessce-theme-dark .cell-tooltip{height:auto;width:auto;opacity:0;padding:0.5rem;border-radius:0.25rem;border:1px solid gray;-webkit-animation-name:cell-tooltip;animation-name:cell-tooltip;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.vitessce-container.vitessce-theme-dark .cell-tooltip table>tbody>tr>th,.vitessce-container.vitessce-theme-dark .cell-tooltip table>tbody>tr>td{font-size:80%;opacity:0.8;outline:0;padding:0 2px}.vitessce-container.vitessce-theme-dark .cell-tooltip table{border-collapse:collapse}@-webkit-keyframes cell-tooltip{from{opacity:0}to{opacity:0.9}}@keyframes cell-tooltip{from{opacity:0}to{opacity:0.9}}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip{z-index:1060;display:block;max-width:250px;visibility:visible;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,0.65);font-size:14px;list-style:none;position:absolute}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip-hidden{display:none}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip .rc-tooltip-inner{border-radius:2px;box-shadow:0 3px 6px -4px rgba(100,100,100,0.12),0 6px 16px 0 rgba(100,100,100,0.08),0 9px 28px 8px rgba(100,100,100,0.05)}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip-placement-top{padding-top:8px}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip-placement-right{padding-left:8px}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip-placement-bottom{padding-top:8px}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip-placement-left{padding-right:8px}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip .rc-tooltip-inner{font-size:10px;min-width:30px;padding:6px 8px;color:#fff;text-align:left;text-decoration:none;word-wrap:break-word;background-color:rgba(0,0,0,0.9)}.vitessce-container.vitessce-theme-dark .help-tooltip.rc-tooltip .rc-tooltip-arrow{display:none}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip{top:0;left:0;z-index:1030;font-weight:normal;white-space:normal;text-align:left;cursor:auto;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,0.65);font-size:14px;list-style:none;position:absolute}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip::after{position:absolute;background:rgba(255,255,255,0.01);content:''}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip-hidden{display:none}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner{border-radius:2px;box-shadow:0 3px 6px -4px rgba(100,100,100,0.12),0 6px 16px 0 rgba(100,100,100,0.08),0 9px 28px 8px rgba(100,100,100,0.05)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip-placement-top{padding-bottom:10px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip-placement-right{padding-left:10px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip-placement-bottom{padding-top:10px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip-placement-left{padding-right:10px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-content{padding:0}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner{box-sizing:border-box;background-color:#fff;background-clip:padding-box}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list{list-style-type:none;padding:0;margin-bottom:0}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list dl,.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list ol,.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list ul{margin-top:0;margin-bottom:1rem}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button{border:0;padding:4px 16px;cursor:pointer;width:100%;background-color:transparent;border-radius:2px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button span.small{font-size:11px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button:hover{background-color:#ededed}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li:not(:last-child){border-bottom:1px solid gray}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list button{-webkit-appearance:button;text-transform:none;overflow:visible;margin:0;font-family:inherit;font-size:14px;line-height:inherit;border-radius:0}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner .popover-menu-color+.popover-menu-list{border-top:1px solid gray}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .popover-menu-color.twitter-picker{box-shadow:none !important;margin:0 auto}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .popover-menu-color.twitter-picker>div:nth-child(3){padding:6px !important;transform:translate(2px, 0)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .popover-menu-color.twitter-picker>div>div:nth-of-type(1){font-size:12px;width:20px !important}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .popover-menu-color.twitter-picker input{width:60px !important;font-size:12px}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .popover-menu-color.twitter-picker>div>span>div{width:18px !important;height:18px !important}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-inner-content{padding:12px 16px;color:rgba(0,0,0,0.65)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip .rc-tooltip-arrow{position:absolute;display:block;width:8px;height:8px;background:transparent;border-style:solid;border-width:4px;transform:rotate(45deg)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip.rc-tooltip-placement-top>.rc-tooltip-content>.rc-tooltip-arrow{bottom:6px;border-top-color:transparent;border-right-color:#fff;border-bottom-color:#fff;border-left-color:transparent;box-shadow:3px 3px 7px rgba(0,0,0,0.07);left:50%;transform:translateX(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip.rc-tooltip-placement-right>.rc-tooltip-content>.rc-tooltip-arrow{left:6px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:#fff;border-left-color:#fff;box-shadow:-3px 3px 7px rgba(0,0,0,0.07);top:50%;transform:translateY(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip.rc-tooltip-placement-bottom>.rc-tooltip-content>.rc-tooltip-arrow{top:6px;border-top-color:#fff;border-right-color:transparent;border-bottom-color:transparent;border-left-color:#fff;box-shadow:-2px -2px 5px rgba(0,0,0,0.06);left:50%;transform:translateX(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-dark .popover.rc-tooltip.rc-tooltip-placement-left>.rc-tooltip-content>.rc-tooltip-arrow{right:6px;border-top-color:#fff;border-right-color:#fff;border-bottom-color:transparent;border-left-color:transparent;box-shadow:3px -3px 7px rgba(0,0,0,0.07);top:50%;transform:translateY(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-dark .sets-manager{position:relative;width:100%;display:block;height:auto}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons{background-color:#d3d3d3;border-radius:4px;padding:2px;display:inline-block;position:absolute;bottom:1.75rem;right:0.25rem;box-shadow:-2px -2px 5px rgba(0,0,0,0.06)}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button{border:0;background-color:transparent;color:#626262}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button[disabled]{pointer-events:none}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button[disabled] svg{fill:silver}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button svg{fill:#555;vertical-align:top;height:20px;margin-top:1px}.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button:hover,.vitessce-container.vitessce-theme-dark .sets-manager .set-operation-buttons button:hover path{color:#2f2f2f;fill:#2f2f2f}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree{position:relative;top:0;left:0;width:100%;height:auto;display:block;padding-right:17px;box-sizing:content-box}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .plus-button{border:0;background-color:transparent;color:#e0e0e0;padding:0;font-size:18px;margin-bottom:2rem}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree{padding-left:0;margin:0;border:1px solid transparent}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .node-menu-icon{fill:gray;cursor:pointer;height:14px;position:relative;vertical-align:top;width:32px;top:5.5px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .node-menu-icon:hover{fill:#9a9a9a}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .node-size-label{font-size:12px;color:#adadad}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .level-buttons-container{height:20px;width:100%;position:relative;padding-left:4px;left:0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:12px;height:12px;padding:5px;background-clip:content-box;border:2px solid #ededed;background-color:#ededed;border-radius:6px;position:relative;top:3px;left:0px;float:left;margin-right:10px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button:checked,.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button.checked{background-clip:unset}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .level-0-treenode>.rc-tree-switcher i svg path{fill:#e0e0e0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-focused{border-color:cyan}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode{margin:0;padding:0;line-height:24px;white-space:nowrap;list-style:none;outline:0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button,.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input{padding:0;margin:0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button{height:24px;line-height:24px;border:1px solid transparent;color:#e0e0e0;background:transparent;background-color:transparent;vertical-align:top;font-size:14px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input{display:block;height:26px;box-sizing:border-box}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-input{font-size:14px;height:24px;line-height:24px;width:calc(100% - 60px);margin-right:10px;background-color:#d3d3d3;color:#000;border-radius:4px;outline:none;padding:4px 0px 4px 4px;border:1px solid #d3d3d3}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-input:focus{border:1px solid #9bb7d6}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-save-button{background-color:#555;border:1px solid #555;color:#d3d3d3;border-radius:3px;width:50px;height:24px;line-height:20px;font-size:13px;vertical-align:top;margin:0;padding:0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-save-button:hover{background-color:#626262;border:1px solid #626262}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .draggable{color:#333;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-khtml-user-drag:element;-webkit-user-drag:element;border:2px transparent solid}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over>.draggable{color:white;background-color:#316ac5;border:2px #316ac5 solid;opacity:0.8}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over-gap-top>.draggable{border-top:2px blue solid}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over-gap-bottom>.draggable{border-bottom:2px blue solid}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.filter-node>.rc-tree-node-content-wrapper{color:#a60000 !important;font-weight:bold !important}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode ul{margin:0;padding-left:35px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper{width:calc(100% - 20px);display:inline-block;margin:0;padding:0;text-decoration:none;vertical-align:top;cursor:pointer;position:relative}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span{position:relative;width:100%;display:inline-block}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span .title-button{position:relative;max-width:calc(100% - 45px);overflow:hidden;text-overflow:ellipsis}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span .node-menu-icon{position:relative;left:0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher,.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox{display:inline-block;margin-top:4px;margin-right:6px;vertical-align:middle;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;border:0 none;outline:none;cursor:pointer}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher svg{width:15px;height:15px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher.rc-tree-switcher-noop{cursor:auto}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher.rc-tree-switcher_close{transform:rotate(-90deg)}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox{width:13px;height:13px;margin:0 3px;border:2px solid gray;border-radius:3px;position:relative;left:0;margin-right:10px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-checked{background-color:gray}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-indeterminate{background-position:-14px -28px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-disabled{background-position:0 -56px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-checked.rc-tree-checkbox-disabled{background-position:-14px -56px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-indeterminate.rc-tree-checkbox-disabled{position:relative;background:#ccc;border-radius:3px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-indeterminate.rc-tree-checkbox-disabled::after{position:absolute;top:5px;left:3px;width:5px;height:0;border:2px solid #fff;border-top:0;border-left:0;transform:scale(1);content:' '}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree:not(.rc-tree-show-line) .rc-tree-treenode .rc-tree-switcher-noop{background:none}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child)>.rc-tree-switcher-noop{background-position:-56px -18px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree.rc-tree-show-line .rc-tree-treenode:last-child>.rc-tree-switcher-noop{background-position:-56px -36px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-child-tree{display:none}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-child-tree-open{display:block}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>span:not(.rc-tree-switcher),.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>a,.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>a span{color:#767676;cursor:not-allowed}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-treenode-active{background:rgba(0,0,0,0.1)}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-node-selected{background-color:#ffe6b0;border:1px #ffb951 solid;opacity:0.8}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-icon__open{margin-right:2px;vertical-align:top;background-position:-110px -16px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-icon__close{margin-right:2px;vertical-align:top;background-position:-110px 0}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-icon__docu{margin-right:2px;vertical-align:top;background-position:-110px -32px}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-icon__customize{margin-right:2px;vertical-align:top}.vitessce-container.vitessce-theme-dark .sets-manager .sets-manager-tree .rc-tree-indent-unit{display:inline-block;padding-left:18px}.vitessce-container.vitessce-theme-dark .vitessce-tooltip .ant-tooltip-content .ant-tooltip-inner{font-size:12px;background-color:rgba(0,0,0,0.95)}.vitessce-container.vitessce-theme-dark .selectable-table{flex:1 1 auto;outline:none}.vitessce-container.vitessce-theme-dark .selectable-table .table-row{display:flex;flex-direction:row;border-bottom:1px solid #444}.vitessce-container.vitessce-theme-dark .selectable-table .table-item{cursor:pointer}.vitessce-container.vitessce-theme-dark .selectable-table .table-item:not(.row-checked):hover{background-color:#2b2b2b}.vitessce-container.vitessce-theme-dark .selectable-table .table-item.row-checked{background-color:#444}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .hidden-input-column{display:none}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .table-cell{padding:0 4px}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container{width:1em}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container label{display:block;margin:0;cursor:pointer}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input{cursor:pointer}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.radio,.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;width:1em;height:1em;margin:0.3em 0.5em 0.0em 0.5em;padding:6px !important;background-clip:content-box;border:2px solid #d3d3d3;background-color:#d3d3d3}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.radio:checked,.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.checkbox:checked{background-clip:unset}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.radio{border-radius:50%}.vitessce-container.vitessce-theme-dark .selectable-table .table-item .input-container input.checkbox{border-radius:2px}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper{height:calc(100% - 20px)}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body{width:inherit;height:inherit;padding:5px;background-color:#000}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-lazy-wrapper{width:inherit;height:inherit}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent{display:block;position:relative;box-sizing:border-box;font-size:12px;color:#333;overflow:hidden}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper{width:inherit;height:inherit;position:relative;display:block;text-align:left;box-sizing:border-box}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass{width:100%;height:100%}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass .react-grid-layout{background-color:transparent !important}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass nav{display:flex}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass input{font-size:12px}.vitessce-container.vitessce-theme-dark .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass .btn{color:#999;font-size:12px}.vitessce-container.vitessce-theme-dark .vega-container{display:flex;flex:1 1 auto;overflow:hidden}.vitessce-container.vitessce-theme-dark .heatmap{width:100%;left:0;position:absolute;padding-right:inherit;padding-left:inherit}.vitessce-container.vitessce-theme-dark .heatmap-container{position:absolute;top:1.25rem;left:1.25rem;width:calc(100% - 2.5rem);height:calc(100% - 2.5rem)}.vitessce-container.vitessce-theme-dark .search-bar{margin-bottom:.25rem;border:0;padding:2px;border-radius:2px}.vitessce-container.vitessce-theme-light.welcome-container{overflow:visible}.vitessce-container.vitessce-theme-light.welcome-container .react-grid-layout,.vitessce-container.vitessce-theme-light.welcome-container .warning-layout{position:relative}.vitessce-container.vitessce-theme-light .react-grid-layout,.vitessce-container.vitessce-theme-light .warning-layout{background-color:#fff;height:auto;position:absolute;width:100%}.vitessce-container.vitessce-theme-light .warning-layout{height:100vh}.vitessce-container.vitessce-theme-light .warning-layout .card{margin-left:0.5rem}.vitessce-container.vitessce-theme-light .loading-indicator-backdrop{position:absolute;top:0;left:0;z-index:1040;width:100%;height:100%;border-radius:0.25rem;background-color:rgba(0,0,0,0.5)}.vitessce-container.vitessce-theme-light .loading-indicator-backdrop .loading-indicator-container{display:grid;place-items:center;position:absolute;width:100%;height:100%}.vitessce-container.vitessce-theme-light .react-grid-item{flex-direction:column !important;display:flex !important;padding-right:10px}.vitessce-container.vitessce-theme-light .d-flex{flex-shrink:0}.vitessce-container.vitessce-theme-light .title{color:#333;overflow-x:hidden}.vitessce-container.vitessce-theme-light .card{border:1px solid rgba(241,241,241,0.125)}.vitessce-container.vitessce-theme-light .bg-black{background-color:#000;color:#fff}.vitessce-container.vitessce-theme-light .bg-black a{color:#fff}.vitessce-container.vitessce-theme-light .bg-primary{background-color:#F1F1F1;color:#333}.vitessce-container.vitessce-theme-light .bg-primary a{color:#0074D9}.vitessce-container.vitessce-theme-light .bg-secondary{background-color:#F1F1F1;color:#222}.vitessce-container.vitessce-theme-light .scroll{overflow-y:auto}.vitessce-container.vitessce-theme-light .details{font-size:80%;opacity:0.8}.vitessce-container.vitessce-theme-light .description p,.vitessce-container.vitessce-theme-light .description details,.vitessce-container.vitessce-theme-light .description table{font-size:80%;opacity:0.8}.vitessce-container.vitessce-theme-light .description details{margin-bottom:6px}.vitessce-container.vitessce-theme-light .description summary{border-bottom:1px solid #fff;cursor:pointer}.vitessce-container.vitessce-theme-light .description .metadata-container{padding-left:14px}.vitessce-container.vitessce-theme-light .description .metadata-container table{width:100%}.vitessce-container.vitessce-theme-light .description .metadata-container table td,.vitessce-container.vitessce-theme-light .description .metadata-container table th{outline:none;padding:2px 2px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:50%}.vitessce-container.vitessce-theme-light .description .metadata-container table tr:nth-child(even){background-color:#fefefe}.vitessce-container.vitessce-theme-light .coll-full,.vitessce-container.vitessce-theme-light .welcome-col-left,.vitessce-container.vitessce-theme-light .welcome-col-right{position:relative;width:100%;padding-right:15px;padding-left:15px}.vitessce-container.vitessce-theme-light .col-full{flex:0 0 100%;max-width:100%}.vitessce-container.vitessce-theme-light .welcome-col-left{flex:0 0 50%;max-width:50%}.vitessce-container.vitessce-theme-light .welcome-col-left .list-group-item{background-color:#fff}.vitessce-container.vitessce-theme-light .welcome-col-left .input-group input{background-color:#fff}.vitessce-container.vitessce-theme-light .welcome-col-left a{color:#ffffff}.vitessce-container.vitessce-theme-light .welcome-col-right{flex:0 0 50%;max-width:50%}.vitessce-container.vitessce-theme-light .welcome-col-right .info-paragraph{margin-bottom:0 !important}.vitessce-container.vitessce-theme-light .welcome-col-right .info-section-text{margin-top:0.5rem}.vitessce-container.vitessce-theme-light .welcome-col-right a{color:#ffffff}.vitessce-container.vitessce-theme-light .btn.icon{padding:0;height:2em;width:2em;background-color:white}.vitessce-container.vitessce-theme-light .btn.icon>svg{vertical-align:middle}.vitessce-container.vitessce-theme-light .roll-up{height:2em;overflow:hidden;background-color:white}.vitessce-container.vitessce-theme-light .roll-up:hover{-webkit-animation-name:roll-up;animation-name:roll-up;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@keyframes roll-up{0%{height:2em}100%{height:100%}}.vitessce-container.vitessce-theme-light .tool{position:absolute;display:inline;z-index:1000;opacity:.65;color:black}.vitessce-container.vitessce-theme-light .tool:hover{opacity:.90}.vitessce-container.vitessce-theme-light .radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;width:1em;height:1em;padding:6px !important;background-clip:content-box;border:2px solid lightgrey;background-color:lightgrey;border-radius:50%}.vitessce-container.vitessce-theme-light .radio:checked{background-clip:unset}.vitessce-container.vitessce-theme-light .layer-controller-container>div:first-child{margin-top:0 !important}.vitessce-container.vitessce-theme-light .channel-container{width:100%;display:flex;position:relative}.vitessce-container.vitessce-theme-light .channel-set-color{display:flex;position:relative;top:5px;width:16px;height:16px;margin-right:24px;cursor:pointer;outline:currentColor none medium;border-radius:3px;box-shadow:rgba(0,0,0,0.15) 0px 0px 0px 1px inset}.vitessce-container.vitessce-theme-light .channel-checked{display:flex;position:relative;margin-right:10px}.vitessce-container.vitessce-theme-light .add-image-layer{color:#262626;border:1px dashed #262626}.vitessce-container.vitessce-theme-light pre{color:#333}.vitessce-container.vitessce-theme-light .cell-tooltip,.vitessce-container.vitessce-theme-light .cell-emphasis-crosshair{z-index:50;position:absolute;pointer-events:none;box-sizing:border-box}.vitessce-container.vitessce-theme-light .cell-emphasis-crosshair{background-color:#222}.vitessce-container.vitessce-theme-light .cell-tooltip{height:auto;width:auto;opacity:0;padding:0.5rem;border-radius:0.25rem;border:1px solid gray;-webkit-animation-name:cell-tooltip;animation-name:cell-tooltip;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.vitessce-container.vitessce-theme-light .cell-tooltip table>tbody>tr>th,.vitessce-container.vitessce-theme-light .cell-tooltip table>tbody>tr>td{font-size:80%;opacity:0.8;outline:0;padding:0 2px}.vitessce-container.vitessce-theme-light .cell-tooltip table{border-collapse:collapse}@keyframes cell-tooltip{from{opacity:0}to{opacity:0.9}}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip{z-index:1060;display:block;max-width:250px;visibility:visible;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,0.65);font-size:14px;list-style:none;position:absolute}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip-hidden{display:none}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip .rc-tooltip-inner{border-radius:2px;box-shadow:0 3px 6px -4px rgba(100,100,100,0.12),0 6px 16px 0 rgba(100,100,100,0.08),0 9px 28px 8px rgba(100,100,100,0.05)}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip-placement-top{padding-top:8px}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip-placement-right{padding-left:8px}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip-placement-bottom{padding-top:8px}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip-placement-left{padding-right:8px}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip .rc-tooltip-inner{font-size:10px;min-width:30px;padding:6px 8px;color:#fff;text-align:left;text-decoration:none;word-wrap:break-word;background-color:rgba(0,0,0,0.9)}.vitessce-container.vitessce-theme-light .help-tooltip.rc-tooltip .rc-tooltip-arrow{display:none}.vitessce-container.vitessce-theme-light .popover.rc-tooltip{top:0;left:0;z-index:1030;font-weight:normal;white-space:normal;text-align:left;cursor:auto;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,0.65);font-size:14px;list-style:none;position:absolute}.vitessce-container.vitessce-theme-light .popover.rc-tooltip::after{position:absolute;background:rgba(255,255,255,0.01);content:''}.vitessce-container.vitessce-theme-light .popover.rc-tooltip-hidden{display:none}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner{border-radius:2px;box-shadow:0 3px 6px -4px rgba(100,100,100,0.12),0 6px 16px 0 rgba(100,100,100,0.08),0 9px 28px 8px rgba(100,100,100,0.05)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip-placement-top{padding-bottom:10px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip-placement-right{padding-left:10px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip-placement-bottom{padding-top:10px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip-placement-left{padding-right:10px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-content{padding:0}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner{box-sizing:border-box;background-color:#fff;background-clip:padding-box}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list{list-style-type:none;padding:0;margin-bottom:0}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list dl,.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list ol,.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list ul{margin-top:0;margin-bottom:1rem}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button{border:0;padding:4px 16px;cursor:pointer;width:100%;background-color:transparent;border-radius:2px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button span.small{font-size:11px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li button:hover{background-color:#ededed}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list li:not(:last-child){border-bottom:1px solid gray}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-list button{-webkit-appearance:button;text-transform:none;overflow:visible;margin:0;font-family:inherit;font-size:14px;line-height:inherit;border-radius:0}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner .popover-menu-color+.popover-menu-list{border-top:1px solid gray}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .popover-menu-color.twitter-picker{box-shadow:none !important;margin:0 auto}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .popover-menu-color.twitter-picker>div:nth-child(3){padding:6px !important;transform:translate(2px, 0)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .popover-menu-color.twitter-picker>div>div:nth-of-type(1){font-size:12px;width:20px !important}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .popover-menu-color.twitter-picker input{width:60px !important;font-size:12px}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .popover-menu-color.twitter-picker>div>span>div{width:18px !important;height:18px !important}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-inner-content{padding:12px 16px;color:rgba(0,0,0,0.65)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip .rc-tooltip-arrow{position:absolute;display:block;width:8px;height:8px;background:transparent;border-style:solid;border-width:4px;transform:rotate(45deg)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip.rc-tooltip-placement-top>.rc-tooltip-content>.rc-tooltip-arrow{bottom:6px;border-top-color:transparent;border-right-color:#fff;border-bottom-color:#fff;border-left-color:transparent;box-shadow:3px 3px 7px rgba(0,0,0,0.07);left:50%;transform:translateX(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip.rc-tooltip-placement-right>.rc-tooltip-content>.rc-tooltip-arrow{left:6px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:#fff;border-left-color:#fff;box-shadow:-3px 3px 7px rgba(0,0,0,0.07);top:50%;transform:translateY(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip.rc-tooltip-placement-bottom>.rc-tooltip-content>.rc-tooltip-arrow{top:6px;border-top-color:#fff;border-right-color:transparent;border-bottom-color:transparent;border-left-color:#fff;box-shadow:-2px -2px 5px rgba(0,0,0,0.06);left:50%;transform:translateX(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-light .popover.rc-tooltip.rc-tooltip-placement-left>.rc-tooltip-content>.rc-tooltip-arrow{right:6px;border-top-color:#fff;border-right-color:#fff;border-bottom-color:transparent;border-left-color:transparent;box-shadow:3px -3px 7px rgba(0,0,0,0.07);top:50%;transform:translateY(-50%) rotate(45deg)}.vitessce-container.vitessce-theme-light .sets-manager{position:relative;width:100%;display:block;height:auto}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons{background-color:#d3d3d3;border-radius:4px;padding:2px;display:inline-block;position:absolute;bottom:1.75rem;right:0.25rem;box-shadow:-2px -2px 5px rgba(0,0,0,0.06)}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button{border:0;background-color:transparent;color:#626262}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button[disabled]{pointer-events:none}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button[disabled] svg{fill:silver}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button svg{fill:#555;vertical-align:top;height:20px;margin-top:1px}.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button:hover,.vitessce-container.vitessce-theme-light .sets-manager .set-operation-buttons button:hover path{color:#2f2f2f;fill:#2f2f2f}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree{position:relative;top:0;left:0;width:100%;height:auto;display:block;padding-right:17px;box-sizing:content-box}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .plus-button{border:0;background-color:transparent;color:#404040;padding:0;font-size:18px;margin-bottom:2rem}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree{padding-left:0;margin:0;border:1px solid transparent}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .node-menu-icon{fill:gray;cursor:pointer;height:14px;position:relative;vertical-align:top;width:32px;top:5.5px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .node-menu-icon:hover{fill:#9a9a9a}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .node-size-label{font-size:12px;color:#0d0d0d}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .level-buttons-container{height:20px;width:100%;position:relative;padding-left:4px;left:0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:12px;height:12px;padding:5px;background-clip:content-box;border:2px solid #4d4d4d;background-color:#4d4d4d;border-radius:6px;position:relative;top:3px;left:0px;float:left;margin-right:10px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button:checked,.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .level-buttons-container .level-buttons input.level-radio-button.checked{background-clip:unset}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .level-0-treenode>.rc-tree-switcher i svg path{fill:#404040}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-focused{border-color:cyan}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode{margin:0;padding:0;line-height:24px;white-space:nowrap;list-style:none;outline:0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button,.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input{padding:0;margin:0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button{height:24px;line-height:24px;border:1px solid transparent;color:#404040;background:transparent;background-color:transparent;vertical-align:top;font-size:14px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input{display:block;height:26px;box-sizing:border-box}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-input{font-size:14px;height:24px;line-height:24px;width:calc(100% - 60px);margin-right:10px;background-color:#d3d3d3;color:#000;border-radius:4px;outline:none;padding:4px 0px 4px 4px;border:1px solid #d3d3d3}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-input:focus{border:1px solid #0074D9}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-save-button{background-color:#555;border:1px solid #555;color:#d3d3d3;border-radius:3px;width:50px;height:24px;line-height:20px;font-size:13px;vertical-align:top;margin:0;padding:0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .title-button-with-input .title-save-button:hover{background-color:#626262;border:1px solid #626262}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .draggable{color:#333;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-khtml-user-drag:element;-webkit-user-drag:element;border:2px transparent solid}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over>.draggable{color:white;background-color:#316ac5;border:2px #316ac5 solid;opacity:0.8}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over-gap-top>.draggable{border-top:2px blue solid}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.drag-over-gap-bottom>.draggable{border-bottom:2px blue solid}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode.filter-node>.rc-tree-node-content-wrapper{color:#a60000 !important;font-weight:bold !important}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode ul{margin:0;padding-left:35px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper{width:calc(100% - 20px);display:inline-block;margin:0;padding:0;text-decoration:none;vertical-align:top;cursor:pointer;position:relative}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span{position:relative;width:100%;display:inline-block}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span .title-button{position:relative;max-width:calc(100% - 45px);overflow:hidden;text-overflow:ellipsis}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper>span .node-menu-icon{position:relative;left:0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher,.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox{display:inline-block;margin-top:4px;margin-right:6px;vertical-align:middle;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;border:0 none;outline:none;cursor:pointer}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher svg{width:15px;height:15px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher.rc-tree-switcher-noop{cursor:auto}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-switcher.rc-tree-switcher_close{transform:rotate(-90deg)}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox{width:13px;height:13px;margin:0 3px;border:2px solid gray;border-radius:3px;position:relative;left:0;margin-right:10px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-checked{background-color:gray}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-indeterminate{background-position:-14px -28px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox-disabled{background-position:0 -56px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-checked.rc-tree-checkbox-disabled{background-position:-14px -56px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-indeterminate.rc-tree-checkbox-disabled{position:relative;background:#ccc;border-radius:3px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree .rc-tree-treenode span.rc-tree-checkbox.rc-tree-checkbox-indeterminate.rc-tree-checkbox-disabled::after{position:absolute;top:5px;left:3px;width:5px;height:0;border:2px solid #fff;border-top:0;border-left:0;transform:scale(1);content:' '}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree:not(.rc-tree-show-line) .rc-tree-treenode .rc-tree-switcher-noop{background:none}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child)>.rc-tree-switcher-noop{background-position:-56px -18px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree.rc-tree-show-line .rc-tree-treenode:last-child>.rc-tree-switcher-noop{background-position:-56px -36px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-child-tree{display:none}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-child-tree-open{display:block}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>span:not(.rc-tree-switcher),.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>a,.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-treenode-disabled>a span{color:#767676;cursor:not-allowed}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-treenode-active{background:rgba(0,0,0,0.1)}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-node-selected{background-color:#ffe6b0;border:1px #ffb951 solid;opacity:0.8}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-icon__open{margin-right:2px;vertical-align:top;background-position:-110px -16px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-icon__close{margin-right:2px;vertical-align:top;background-position:-110px 0}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-icon__docu{margin-right:2px;vertical-align:top;background-position:-110px -32px}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-icon__customize{margin-right:2px;vertical-align:top}.vitessce-container.vitessce-theme-light .sets-manager .sets-manager-tree .rc-tree-indent-unit{display:inline-block;padding-left:18px}.vitessce-container.vitessce-theme-light .vitessce-tooltip .ant-tooltip-content .ant-tooltip-inner{font-size:12px;background-color:rgba(0,0,0,0.95)}.vitessce-container.vitessce-theme-light .selectable-table{flex:1 1 auto;outline:none}.vitessce-container.vitessce-theme-light .selectable-table .table-row{display:flex;flex-direction:row;border-bottom:1px solid silver}.vitessce-container.vitessce-theme-light .selectable-table .table-item{cursor:pointer}.vitessce-container.vitessce-theme-light .selectable-table .table-item:not(.row-checked):hover{background-color:#dadada}.vitessce-container.vitessce-theme-light .selectable-table .table-item.row-checked{background-color:silver}.vitessce-container.vitessce-theme-light .selectable-table .table-item .hidden-input-column{display:none}.vitessce-container.vitessce-theme-light .selectable-table .table-item .table-cell{padding:0 4px}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container{width:1em}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container label{display:block;margin:0;cursor:pointer}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input{cursor:pointer}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.radio,.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;width:1em;height:1em;margin:0.3em 0.5em 0.0em 0.5em;padding:6px !important;background-clip:content-box;border:2px solid #d3d3d3;background-color:#d3d3d3}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.radio:checked,.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.checkbox:checked{background-clip:unset}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.radio{border-radius:50%}.vitessce-container.vitessce-theme-light .selectable-table .table-item .input-container input.checkbox{border-radius:2px}.vitessce-container.vitessce-theme-light .higlass-title-wrapper{height:calc(100% - 20px)}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body{width:inherit;height:inherit;padding:5px;background-color:#F1F1F1}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-lazy-wrapper{width:inherit;height:inherit}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent{display:block;position:relative;box-sizing:border-box;font-size:12px;color:#333;overflow:hidden}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper{width:inherit;height:inherit;position:relative;display:block;text-align:left;box-sizing:border-box}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass{width:100%;height:100%}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass .react-grid-layout{background-color:transparent !important}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass nav{display:flex}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass input{font-size:12px}.vitessce-container.vitessce-theme-light .higlass-title-wrapper .card-body .higlass-wrapper-parent .higlass-wrapper .higlass .btn{color:#999;font-size:12px}.vitessce-container.vitessce-theme-light .vega-container{display:flex;flex:1 1 auto;overflow:hidden}.vitessce-container.vitessce-theme-light .heatmap{width:100%;left:0;position:absolute;padding-right:inherit;padding-left:inherit}.vitessce-container.vitessce-theme-light .heatmap-container{position:absolute;top:1.25rem;left:1.25rem;width:calc(100% - 2.5rem);height:calc(100% - 2.5rem)}.vitessce-container.vitessce-theme-light .search-bar{margin-bottom:.25rem;border:0;padding:2px;border-radius:2px}\n\n.react-grid-layout {\n  position: relative;\n  transition: height 200ms ease;\n}\n.react-grid-item {\n  transition: all 200ms ease;\n  transition-property: left, top;\n}\n.react-grid-item.cssTransforms {\n  transition-property: transform;\n}\n.react-grid-item.resizing {\n  z-index: 1;\n  will-change: width, height;\n}\n\n.react-grid-item.react-draggable-dragging {\n  transition: none;\n  z-index: 3;\n  will-change: transform;\n}\n\n.react-grid-item.dropping {\n  visibility: hidden;\n}\n\n.react-grid-item.react-grid-placeholder {\n  background: red;\n  opacity: 0.2;\n  transition-duration: 100ms;\n  z-index: 2;\n  -webkit-user-select: none;\n  -ms-user-select: none;\n  -o-user-select: none;\n  user-select: none;\n}\n\n.react-grid-item > .react-resizable-handle {\n  position: absolute;\n  width: 20px;\n  height: 20px;\n  bottom: 0;\n  right: 0;\n  cursor: se-resize;\n}\n\n.react-grid-item > .react-resizable-handle::after {\n  content: \"\";\n  position: absolute;\n  right: 3px;\n  bottom: 3px;\n  width: 5px;\n  height: 5px;\n  border-right: 2px solid rgba(0, 0, 0, 0.4);\n  border-bottom: 2px solid rgba(0, 0, 0, 0.4);\n}\n\n.react-resizable-hide > .react-resizable-handle {\n  display: none;\n}\n\n.react-resizable {\n  position: relative;\n}\n.react-resizable-handle {\n  position: absolute;\n  width: 20px;\n  height: 20px;\n  background-repeat: no-repeat;\n  background-origin: content-box;\n  box-sizing: border-box;\n  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');\n  background-position: bottom right;\n  padding: 0 3px 3px 0;\n}\n.react-resizable-handle-sw {\n  bottom: 0;\n  left: 0;\n  cursor: sw-resize;\n  transform: rotate(90deg);\n}\n.react-resizable-handle-se {\n  bottom: 0;\n  right: 0;\n  cursor: se-resize;\n}\n.react-resizable-handle-nw {\n  top: 0;\n  left: 0;\n  cursor: nw-resize;\n  transform: rotate(180deg);\n}\n.react-resizable-handle-ne {\n  top: 0;\n  right: 0;\n  cursor: ne-resize;\n  transform: rotate(270deg);\n}\n.react-resizable-handle-w,\n.react-resizable-handle-e {\n  top: 50%;\n  margin-top: -10px;\n  cursor: ew-resize;\n}\n.react-resizable-handle-w {\n  left: 0;\n  transform: rotate(135deg);\n}\n.react-resizable-handle-e {\n  right: 0;\n  transform: rotate(315deg);\n}\n.react-resizable-handle-n,\n.react-resizable-handle-s {\n  left: 50%;\n  margin-left: -10px;\n  cursor: ns-resize;\n}\n.react-resizable-handle-n {\n  top: 0;\n  transform: rotate(225deg);\n}\n.react-resizable-handle-s {\n  bottom: 0;\n  transform: rotate(45deg);\n}", ""]);

// exports


/***/ }),

/***/ "./node_modules/css-loader/lib/css-base.js":
/*!*************************************************!*\
  !*** ./node_modules/css-loader/lib/css-base.js ***!
  \*************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
	var list = [];

	// return the list of modules as css string
	list.toString = function toString() {
		return this.map(function (item) {
			var content = cssWithMappingToString(item, useSourceMap);
			if(item[2]) {
				return "@media " + item[2] + "{" + content + "}";
			} else {
				return content;
			}
		}).join("");
	};

	// import a list of modules into the list
	list.i = function(modules, mediaQuery) {
		if(typeof modules === "string")
			modules = [[null, modules, ""]];
		var alreadyImportedModules = {};
		for(var i = 0; i < this.length; i++) {
			var id = this[i][0];
			if(typeof id === "number")
				alreadyImportedModules[id] = true;
		}
		for(i = 0; i < modules.length; i++) {
			var item = modules[i];
			// skip already imported module
			// this implementation is not 100% perfect for weird media query combinations
			//  when a module is imported multiple times with different media queries.
			//  I hope this will never occur (Hey this way we have smaller bundles)
			if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
				if(mediaQuery && !item[2]) {
					item[2] = mediaQuery;
				} else if(mediaQuery) {
					item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
				}
				list.push(item);
			}
		}
	};
	return list;
};

function cssWithMappingToString(item, useSourceMap) {
	var content = item[1] || '';
	var cssMapping = item[3];
	if (!cssMapping) {
		return content;
	}

	if (useSourceMap && typeof btoa === 'function') {
		var sourceMapping = toComment(cssMapping);
		var sourceURLs = cssMapping.sources.map(function (source) {
			return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
		});

		return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
	}

	return [content].join('\n');
}

// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
	// eslint-disable-next-line no-undef
	var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
	var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;

	return '/*# ' + data + ' */';
}


/***/ }),

/***/ "./node_modules/lodash/_Symbol.js":
/*!****************************************!*\
  !*** ./node_modules/lodash/_Symbol.js ***!
  \****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");

/** Built-in value references. */
var Symbol = root.Symbol;

module.exports = Symbol;


/***/ }),

/***/ "./node_modules/lodash/_apply.js":
/*!***************************************!*\
  !*** ./node_modules/lodash/_apply.js ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * A faster alternative to `Function#apply`, this function invokes `func`
 * with the `this` binding of `thisArg` and the arguments of `args`.
 *
 * @private
 * @param {Function} func The function to invoke.
 * @param {*} thisArg The `this` binding of `func`.
 * @param {Array} args The arguments to invoke `func` with.
 * @returns {*} Returns the result of `func`.
 */
function apply(func, thisArg, args) {
  switch (args.length) {
    case 0: return func.call(thisArg);
    case 1: return func.call(thisArg, args[0]);
    case 2: return func.call(thisArg, args[0], args[1]);
    case 3: return func.call(thisArg, args[0], args[1], args[2]);
  }
  return func.apply(thisArg, args);
}

module.exports = apply;


/***/ }),

/***/ "./node_modules/lodash/_arrayLikeKeys.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash/_arrayLikeKeys.js ***!
  \***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"),
    isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),
    isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
    isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"),
    isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"),
    isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js");

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Creates an array of the enumerable property names of the array-like `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @param {boolean} inherited Specify returning inherited property names.
 * @returns {Array} Returns the array of property names.
 */
function arrayLikeKeys(value, inherited) {
  var isArr = isArray(value),
      isArg = !isArr && isArguments(value),
      isBuff = !isArr && !isArg && isBuffer(value),
      isType = !isArr && !isArg && !isBuff && isTypedArray(value),
      skipIndexes = isArr || isArg || isBuff || isType,
      result = skipIndexes ? baseTimes(value.length, String) : [],
      length = result.length;

  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) &&
        !(skipIndexes && (
           // Safari 9 has enumerable `arguments.length` in strict mode.
           key == 'length' ||
           // Node.js 0.10 has enumerable non-index properties on buffers.
           (isBuff && (key == 'offset' || key == 'parent')) ||
           // PhantomJS 2 has enumerable non-index properties on typed arrays.
           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
           // Skip index properties.
           isIndex(key, length)
        ))) {
      result.push(key);
    }
  }
  return result;
}

module.exports = arrayLikeKeys;


/***/ }),

/***/ "./node_modules/lodash/_assignValue.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash/_assignValue.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"),
    eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js");

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Assigns `value` to `key` of `object` if the existing value is not equivalent
 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * for equality comparisons.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function assignValue(object, key, value) {
  var objValue = object[key];
  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
      (value === undefined && !(key in object))) {
    baseAssignValue(object, key, value);
  }
}

module.exports = assignValue;


/***/ }),

/***/ "./node_modules/lodash/_baseAssignValue.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash/_baseAssignValue.js ***!
  \*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js");

/**
 * The base implementation of `assignValue` and `assignMergeValue` without
 * value checks.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && defineProperty) {
    defineProperty(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}

module.exports = baseAssignValue;


/***/ }),

/***/ "./node_modules/lodash/_baseGetTag.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/_baseGetTag.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
    getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
    objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");

/** `Object#toString` result references. */
var nullTag = '[object Null]',
    undefinedTag = '[object Undefined]';

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? getRawTag(value)
    : objectToString(value);
}

module.exports = baseGetTag;


/***/ }),

/***/ "./node_modules/lodash/_baseIsArguments.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash/_baseIsArguments.js ***!
  \*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
    isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");

/** `Object#toString` result references. */
var argsTag = '[object Arguments]';

/**
 * The base implementation of `_.isArguments`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 */
function baseIsArguments(value) {
  return isObjectLike(value) && baseGetTag(value) == argsTag;
}

module.exports = baseIsArguments;


/***/ }),

/***/ "./node_modules/lodash/_baseIsNative.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash/_baseIsNative.js ***!
  \**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"),
    isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"),
    isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
    toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js");

/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!isObject(value) || isMasked(value)) {
    return false;
  }
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  return pattern.test(toSource(value));
}

module.exports = baseIsNative;


/***/ }),

/***/ "./node_modules/lodash/_baseIsTypedArray.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash/_baseIsTypedArray.js ***!
  \**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
    isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"),
    isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;

/**
 * The base implementation of `_.isTypedArray` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 */
function baseIsTypedArray(value) {
  return isObjectLike(value) &&
    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}

module.exports = baseIsTypedArray;


/***/ }),

/***/ "./node_modules/lodash/_baseKeysIn.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/_baseKeysIn.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
    isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"),
    nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/lodash/_nativeKeysIn.js");

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeysIn(object) {
  if (!isObject(object)) {
    return nativeKeysIn(object);
  }
  var isProto = isPrototype(object),
      result = [];

  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}

module.exports = baseKeysIn;


/***/ }),

/***/ "./node_modules/lodash/_baseRest.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_baseRest.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"),
    overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"),
    setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js");

/**
 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @returns {Function} Returns the new function.
 */
function baseRest(func, start) {
  return setToString(overRest(func, start, identity), func + '');
}

module.exports = baseRest;


/***/ }),

/***/ "./node_modules/lodash/_baseSetToString.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash/_baseSetToString.js ***!
  \*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"),
    defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"),
    identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js");

/**
 * The base implementation of `setToString` without support for hot loop shorting.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var baseSetToString = !defineProperty ? identity : function(func, string) {
  return defineProperty(func, 'toString', {
    'configurable': true,
    'enumerable': false,
    'value': constant(string),
    'writable': true
  });
};

module.exports = baseSetToString;


/***/ }),

/***/ "./node_modules/lodash/_baseTimes.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash/_baseTimes.js ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);

  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}

module.exports = baseTimes;


/***/ }),

/***/ "./node_modules/lodash/_baseUnary.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash/_baseUnary.js ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * The base implementation of `_.unary` without support for storing metadata.
 *
 * @private
 * @param {Function} func The function to cap arguments for.
 * @returns {Function} Returns the new capped function.
 */
function baseUnary(func) {
  return function(value) {
    return func(value);
  };
}

module.exports = baseUnary;


/***/ }),

/***/ "./node_modules/lodash/_copyObject.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/_copyObject.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"),
    baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js");

/**
 * Copies properties of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy properties from.
 * @param {Array} props The property identifiers to copy.
 * @param {Object} [object={}] The object to copy properties to.
 * @param {Function} [customizer] The function to customize copied values.
 * @returns {Object} Returns `object`.
 */
function copyObject(source, props, object, customizer) {
  var isNew = !object;
  object || (object = {});

  var index = -1,
      length = props.length;

  while (++index < length) {
    var key = props[index];

    var newValue = customizer
      ? customizer(object[key], source[key], key, object, source)
      : undefined;

    if (newValue === undefined) {
      newValue = source[key];
    }
    if (isNew) {
      baseAssignValue(object, key, newValue);
    } else {
      assignValue(object, key, newValue);
    }
  }
  return object;
}

module.exports = copyObject;


/***/ }),

/***/ "./node_modules/lodash/_coreJsData.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/_coreJsData.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");

/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];

module.exports = coreJsData;


/***/ }),

/***/ "./node_modules/lodash/_createAssigner.js":
/*!************************************************!*\
  !*** ./node_modules/lodash/_createAssigner.js ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"),
    isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js");

/**
 * Creates a function like `_.assign`.
 *
 * @private
 * @param {Function} assigner The function to assign values.
 * @returns {Function} Returns the new assigner function.
 */
function createAssigner(assigner) {
  return baseRest(function(object, sources) {
    var index = -1,
        length = sources.length,
        customizer = length > 1 ? sources[length - 1] : undefined,
        guard = length > 2 ? sources[2] : undefined;

    customizer = (assigner.length > 3 && typeof customizer == 'function')
      ? (length--, customizer)
      : undefined;

    if (guard && isIterateeCall(sources[0], sources[1], guard)) {
      customizer = length < 3 ? undefined : customizer;
      length = 1;
    }
    object = Object(object);
    while (++index < length) {
      var source = sources[index];
      if (source) {
        assigner(object, source, index, customizer);
      }
    }
    return object;
  });
}

module.exports = createAssigner;


/***/ }),

/***/ "./node_modules/lodash/_defineProperty.js":
/*!************************************************!*\
  !*** ./node_modules/lodash/_defineProperty.js ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js");

var defineProperty = (function() {
  try {
    var func = getNative(Object, 'defineProperty');
    func({}, '', {});
    return func;
  } catch (e) {}
}());

module.exports = defineProperty;


/***/ }),

/***/ "./node_modules/lodash/_freeGlobal.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/_freeGlobal.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;

module.exports = freeGlobal;

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))

/***/ }),

/***/ "./node_modules/lodash/_getNative.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash/_getNative.js ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"),
    getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js");

/**
 * Gets the native function at `key` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the method to get.
 * @returns {*} Returns the function if it's native, else `undefined`.
 */
function getNative(object, key) {
  var value = getValue(object, key);
  return baseIsNative(value) ? value : undefined;
}

module.exports = getNative;


/***/ }),

/***/ "./node_modules/lodash/_getRawTag.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash/_getRawTag.js ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

module.exports = getRawTag;


/***/ }),

/***/ "./node_modules/lodash/_getValue.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_getValue.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Gets the value at `key` of `object`.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function getValue(object, key) {
  return object == null ? undefined : object[key];
}

module.exports = getValue;


/***/ }),

/***/ "./node_modules/lodash/_isIndex.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/_isIndex.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}

module.exports = isIndex;


/***/ }),

/***/ "./node_modules/lodash/_isIterateeCall.js":
/*!************************************************!*\
  !*** ./node_modules/lodash/_isIterateeCall.js ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"),
    isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"),
    isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"),
    isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");

/**
 * Checks if the given arguments are from an iteratee call.
 *
 * @private
 * @param {*} value The potential iteratee value argument.
 * @param {*} index The potential iteratee index or key argument.
 * @param {*} object The potential iteratee object argument.
 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
 *  else `false`.
 */
function isIterateeCall(value, index, object) {
  if (!isObject(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number'
        ? (isArrayLike(object) && isIndex(index, object.length))
        : (type == 'string' && index in object)
      ) {
    return eq(object[index], value);
  }
  return false;
}

module.exports = isIterateeCall;


/***/ }),

/***/ "./node_modules/lodash/_isMasked.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_isMasked.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js");

/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  return uid ? ('Symbol(src)_1.' + uid) : '';
}());

/**
 * Checks if `func` has its source masked.
 *
 * @private
 * @param {Function} func The function to check.
 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
 */
function isMasked(func) {
  return !!maskSrcKey && (maskSrcKey in func);
}

module.exports = isMasked;


/***/ }),

/***/ "./node_modules/lodash/_isPrototype.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash/_isPrototype.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Checks if `value` is likely a prototype object.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 */
function isPrototype(value) {
  var Ctor = value && value.constructor,
      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

  return value === proto;
}

module.exports = isPrototype;


/***/ }),

/***/ "./node_modules/lodash/_nativeKeysIn.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash/_nativeKeysIn.js ***!
  \**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * This function is like
 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * except that it includes inherited enumerable properties.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function nativeKeysIn(object) {
  var result = [];
  if (object != null) {
    for (var key in Object(object)) {
      result.push(key);
    }
  }
  return result;
}

module.exports = nativeKeysIn;


/***/ }),

/***/ "./node_modules/lodash/_nodeUtil.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_nodeUtil.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");

/** Detect free variable `exports`. */
var freeExports =  true && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
  try {
    // Use `util.types` for Node.js 10+.
    var types = freeModule && freeModule.require && freeModule.require('util').types;

    if (types) {
      return types;
    }

    // Legacy `process.binding('util')` for Node.js < 10.
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}());

module.exports = nodeUtil;

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))

/***/ }),

/***/ "./node_modules/lodash/_objectToString.js":
/*!************************************************!*\
  !*** ./node_modules/lodash/_objectToString.js ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

module.exports = objectToString;


/***/ }),

/***/ "./node_modules/lodash/_overRest.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_overRest.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var apply = __webpack_require__(/*! ./_apply */ "./node_modules/lodash/_apply.js");

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
 * A specialized version of `baseRest` which transforms the rest array.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @param {Function} transform The rest array transform.
 * @returns {Function} Returns the new function.
 */
function overRest(func, start, transform) {
  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  return function() {
    var args = arguments,
        index = -1,
        length = nativeMax(args.length - start, 0),
        array = Array(length);

    while (++index < length) {
      array[index] = args[start + index];
    }
    index = -1;
    var otherArgs = Array(start + 1);
    while (++index < start) {
      otherArgs[index] = args[index];
    }
    otherArgs[start] = transform(array);
    return apply(func, this, otherArgs);
  };
}

module.exports = overRest;


/***/ }),

/***/ "./node_modules/lodash/_root.js":
/*!**************************************!*\
  !*** ./node_modules/lodash/_root.js ***!
  \**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

module.exports = root;


/***/ }),

/***/ "./node_modules/lodash/_setToString.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash/_setToString.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/lodash/_baseSetToString.js"),
    shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/lodash/_shortOut.js");

/**
 * Sets the `toString` method of `func` to return `string`.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var setToString = shortOut(baseSetToString);

module.exports = setToString;


/***/ }),

/***/ "./node_modules/lodash/_shortOut.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_shortOut.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
    HOT_SPAN = 16;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;

/**
 * Creates a function that'll short out and invoke `identity` instead
 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
 * milliseconds.
 *
 * @private
 * @param {Function} func The function to restrict.
 * @returns {Function} Returns the new shortable function.
 */
function shortOut(func) {
  var count = 0,
      lastCalled = 0;

  return function() {
    var stamp = nativeNow(),
        remaining = HOT_SPAN - (stamp - lastCalled);

    lastCalled = stamp;
    if (remaining > 0) {
      if (++count >= HOT_COUNT) {
        return arguments[0];
      }
    } else {
      count = 0;
    }
    return func.apply(undefined, arguments);
  };
}

module.exports = shortOut;


/***/ }),

/***/ "./node_modules/lodash/_toSource.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/_toSource.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used for built-in method references. */
var funcProto = Function.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/**
 * Converts `func` to its source code.
 *
 * @private
 * @param {Function} func The function to convert.
 * @returns {string} Returns the source code.
 */
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return (func + '');
    } catch (e) {}
  }
  return '';
}

module.exports = toSource;


/***/ }),

/***/ "./node_modules/lodash/assignIn.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/assignIn.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"),
    createAssigner = __webpack_require__(/*! ./_createAssigner */ "./node_modules/lodash/_createAssigner.js"),
    keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js");

/**
 * This method is like `_.assign` except that it iterates over own and
 * inherited source properties.
 *
 * **Note:** This method mutates `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @alias extend
 * @category Object
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 * @see _.assign
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 * }
 *
 * function Bar() {
 *   this.c = 3;
 * }
 *
 * Foo.prototype.b = 2;
 * Bar.prototype.d = 4;
 *
 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
 */
var assignIn = createAssigner(function(object, source) {
  copyObject(source, keysIn(source), object);
});

module.exports = assignIn;


/***/ }),

/***/ "./node_modules/lodash/constant.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/constant.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Creates a function that returns `value`.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {*} value The value to return from the new function.
 * @returns {Function} Returns the new constant function.
 * @example
 *
 * var objects = _.times(2, _.constant({ 'a': 1 }));
 *
 * console.log(objects);
 * // => [{ 'a': 1 }, { 'a': 1 }]
 *
 * console.log(objects[0] === objects[1]);
 * // => true
 */
function constant(value) {
  return function() {
    return value;
  };
}

module.exports = constant;


/***/ }),

/***/ "./node_modules/lodash/eq.js":
/*!***********************************!*\
  !*** ./node_modules/lodash/eq.js ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Performs a
 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * comparison between two values to determine if they are equivalent.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.eq(object, object);
 * // => true
 *
 * _.eq(object, other);
 * // => false
 *
 * _.eq('a', 'a');
 * // => true
 *
 * _.eq('a', Object('a'));
 * // => false
 *
 * _.eq(NaN, NaN);
 * // => true
 */
function eq(value, other) {
  return value === other || (value !== value && other !== other);
}

module.exports = eq;


/***/ }),

/***/ "./node_modules/lodash/extend.js":
/*!***************************************!*\
  !*** ./node_modules/lodash/extend.js ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! ./assignIn */ "./node_modules/lodash/assignIn.js");


/***/ }),

/***/ "./node_modules/lodash/identity.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/identity.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * This method returns the first argument it receives.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Util
 * @param {*} value Any value.
 * @returns {*} Returns `value`.
 * @example
 *
 * var object = { 'a': 1 };
 *
 * console.log(_.identity(object) === object);
 * // => true
 */
function identity(value) {
  return value;
}

module.exports = identity;


/***/ }),

/***/ "./node_modules/lodash/isArguments.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/isArguments.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"),
    isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/**
 * Checks if `value` is likely an `arguments` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 *  else `false`.
 * @example
 *
 * _.isArguments(function() { return arguments; }());
 * // => true
 *
 * _.isArguments([1, 2, 3]);
 * // => false
 */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
    !propertyIsEnumerable.call(value, 'callee');
};

module.exports = isArguments;


/***/ }),

/***/ "./node_modules/lodash/isArray.js":
/*!****************************************!*\
  !*** ./node_modules/lodash/isArray.js ***!
  \****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
 * @example
 *
 * _.isArray([1, 2, 3]);
 * // => true
 *
 * _.isArray(document.body.children);
 * // => false
 *
 * _.isArray('abc');
 * // => false
 *
 * _.isArray(_.noop);
 * // => false
 */
var isArray = Array.isArray;

module.exports = isArray;


/***/ }),

/***/ "./node_modules/lodash/isArrayLike.js":
/*!********************************************!*\
  !*** ./node_modules/lodash/isArrayLike.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"),
    isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js");

/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && isLength(value.length) && !isFunction(value);
}

module.exports = isArrayLike;


/***/ }),

/***/ "./node_modules/lodash/isBuffer.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/isBuffer.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"),
    stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js");

/** Detect free variable `exports`. */
var freeExports =  true && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;

/**
 * Checks if `value` is a buffer.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 * @example
 *
 * _.isBuffer(new Buffer(2));
 * // => true
 *
 * _.isBuffer(new Uint8Array(2));
 * // => false
 */
var isBuffer = nativeIsBuffer || stubFalse;

module.exports = isBuffer;

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))

/***/ }),

/***/ "./node_modules/lodash/isFunction.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash/isFunction.js ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
    isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");

/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    proxyTag = '[object Proxy]';

/**
 * Checks if `value` is classified as a `Function` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
 * @example
 *
 * _.isFunction(_);
 * // => true
 *
 * _.isFunction(/abc/);
 * // => false
 */
function isFunction(value) {
  if (!isObject(value)) {
    return false;
  }
  // The use of `Object#toString` avoids issues with the `typeof` operator
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
  var tag = baseGetTag(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}

module.exports = isFunction;


/***/ }),

/***/ "./node_modules/lodash/isLength.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/isLength.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

module.exports = isLength;


/***/ }),

/***/ "./node_modules/lodash/isObject.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash/isObject.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

module.exports = isObject;


/***/ }),

/***/ "./node_modules/lodash/isObjectLike.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash/isObjectLike.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

module.exports = isObjectLike;


/***/ }),

/***/ "./node_modules/lodash/isTypedArray.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash/isTypedArray.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"),
    baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"),
    nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js");

/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

/**
 * Checks if `value` is classified as a typed array.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 * @example
 *
 * _.isTypedArray(new Uint8Array);
 * // => true
 *
 * _.isTypedArray([]);
 * // => false
 */
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

module.exports = isTypedArray;


/***/ }),

/***/ "./node_modules/lodash/keysIn.js":
/*!***************************************!*\
  !*** ./node_modules/lodash/keysIn.js ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"),
    baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"),
    isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js");

/**
 * Creates an array of the own and inherited enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keysIn(new Foo);
 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
 */
function keysIn(object) {
  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}

module.exports = keysIn;


/***/ }),

/***/ "./node_modules/lodash/stubFalse.js":
/*!******************************************!*\
  !*** ./node_modules/lodash/stubFalse.js ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

/**
 * This method returns `false`.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {boolean} Returns `false`.
 * @example
 *
 * _.times(2, _.stubFalse);
 * // => [false, false]
 */
function stubFalse() {
  return false;
}

module.exports = stubFalse;


/***/ }),

/***/ "./node_modules/object-assign/index.js":
/*!*********************************************!*\
  !*** ./node_modules/object-assign/index.js ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/


/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};


/***/ }),

/***/ "./node_modules/prop-types/checkPropTypes.js":
/*!***************************************************!*\
  !*** ./node_modules/prop-types/checkPropTypes.js ***!
  \***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var printWarning = function() {};

if (true) {
  var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
  var loggedTypeFailures = {};
  var has = Function.call.bind(Object.prototype.hasOwnProperty);

  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  if (true) {
    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error;
        // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.
        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error(
              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
            );
            err.name = 'Invariant Violation';
            throw err;
          }
          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
        } catch (ex) {
          error = ex;
        }
        if (error && !(error instanceof Error)) {
          printWarning(
            (componentName || 'React class') + ': type specification of ' +
            location + ' `' + typeSpecName + '` is invalid; the type checker ' +
            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
            'You may have forgotten to pass an argument to the type checker ' +
            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
            'shape all require an argument).'
          );
        }
        if (error instanceof Error && !(error.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error.message] = true;

          var stack = getStack ? getStack() : '';

          printWarning(
            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
          );
        }
      }
    }
  }
}

/**
 * Resets warning cache when testing.
 *
 * @private
 */
checkPropTypes.resetWarningCache = function() {
  if (true) {
    loggedTypeFailures = {};
  }
}

module.exports = checkPropTypes;


/***/ }),

/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
/*!*************************************************************!*\
  !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  \*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),

/***/ "./node_modules/react-dom/cjs/react-dom.development.js":
/*!*************************************************************!*\
  !*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
  \*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.9.0
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

var React = __webpack_require__(/*! react */ "./node_modules/react/index.js");
var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/react-dom/node_modules/scheduler/index.js");
var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/react-dom/node_modules/scheduler/tracing.js");

// Do not require this module directly! Use normal `invariant` calls with
// template literal strings. The messages will be converted to ReactError during
// build, and in production they will be minified.

// Do not require this module directly! Use normal `invariant` calls with
// template literal strings. The messages will be converted to ReactError during
// build, and in production they will be minified.

function ReactError(error) {
  error.name = 'Invariant Violation';
  return error;
}

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

(function () {
  if (!React) {
    {
      throw ReactError(Error('ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.'));
    }
  }
})();

/**
 * Injectable ordering of event plugins.
 */
var eventPluginOrder = null;

/**
 * Injectable mapping from names to event plugin modules.
 */
var namesToPlugins = {};

/**
 * Recomputes the plugin list using the injected plugins and plugin ordering.
 *
 * @private
 */
function recomputePluginOrdering() {
  if (!eventPluginOrder) {
    // Wait until an `eventPluginOrder` is injected.
    return;
  }
  for (var pluginName in namesToPlugins) {
    var pluginModule = namesToPlugins[pluginName];
    var pluginIndex = eventPluginOrder.indexOf(pluginName);
    (function () {
      if (!(pluginIndex > -1)) {
        {
          throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));
        }
      }
    })();
    if (plugins[pluginIndex]) {
      continue;
    }
    (function () {
      if (!pluginModule.extractEvents) {
        {
          throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));
        }
      }
    })();
    plugins[pluginIndex] = pluginModule;
    var publishedEvents = pluginModule.eventTypes;
    for (var eventName in publishedEvents) {
      (function () {
        if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
          {
            throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));
          }
        }
      })();
    }
  }
}

/**
 * Publishes an event so that it can be dispatched by the supplied plugin.
 *
 * @param {object} dispatchConfig Dispatch configuration for the event.
 * @param {object} PluginModule Plugin publishing the event.
 * @return {boolean} True if the event was successfully published.
 * @private
 */
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
  (function () {
    if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
      {
        throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same event name, `' + eventName + '`.'));
      }
    }
  })();
  eventNameDispatchConfigs[eventName] = dispatchConfig;

  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  if (phasedRegistrationNames) {
    for (var phaseName in phasedRegistrationNames) {
      if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
        var phasedRegistrationName = phasedRegistrationNames[phaseName];
        publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
      }
    }
    return true;
  } else if (dispatchConfig.registrationName) {
    publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
    return true;
  }
  return false;
}

/**
 * Publishes a registration name that is used to identify dispatched events.
 *
 * @param {string} registrationName Registration name to add.
 * @param {object} PluginModule Plugin publishing the event.
 * @private
 */
function publishRegistrationName(registrationName, pluginModule, eventName) {
  (function () {
    if (!!registrationNameModules[registrationName]) {
      {
        throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same registration name, `' + registrationName + '`.'));
      }
    }
  })();
  registrationNameModules[registrationName] = pluginModule;
  registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;

  {
    var lowerCasedName = registrationName.toLowerCase();
    possibleRegistrationNames[lowerCasedName] = registrationName;

    if (registrationName === 'onDoubleClick') {
      possibleRegistrationNames.ondblclick = registrationName;
    }
  }
}

/**
 * Registers plugins so that they can extract and dispatch events.
 *
 * @see {EventPluginHub}
 */

/**
 * Ordered list of injected plugins.
 */
var plugins = [];

/**
 * Mapping from event name to dispatch config
 */
var eventNameDispatchConfigs = {};

/**
 * Mapping from registration name to plugin module
 */
var registrationNameModules = {};

/**
 * Mapping from registration name to event name
 */
var registrationNameDependencies = {};

/**
 * Mapping from lowercase registration names to the properly cased version,
 * used to warn in the case of missing event handlers. Available
 * only in true.
 * @type {Object}
 */
var possibleRegistrationNames = {};
// Trust the developer to only use possibleRegistrationNames in true

/**
 * Injects an ordering of plugins (by plugin name). This allows the ordering
 * to be decoupled from injection of the actual plugins so that ordering is
 * always deterministic regardless of packaging, on-the-fly injection, etc.
 *
 * @param {array} InjectedEventPluginOrder
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginOrder}
 */
function injectEventPluginOrder(injectedEventPluginOrder) {
  (function () {
    if (!!eventPluginOrder) {
      {
        throw ReactError(Error('EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.'));
      }
    }
  })();
  // Clone the ordering so it cannot be dynamically mutated.
  eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
  recomputePluginOrdering();
}

/**
 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
 * in the ordering injected by `injectEventPluginOrder`.
 *
 * Plugins can be injected as part of page initialization or on-the-fly.
 *
 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginsByName}
 */
function injectEventPluginsByName(injectedNamesToPlugins) {
  var isOrderingDirty = false;
  for (var pluginName in injectedNamesToPlugins) {
    if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
      continue;
    }
    var pluginModule = injectedNamesToPlugins[pluginName];
    if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
      (function () {
        if (!!namesToPlugins[pluginName]) {
          {
            throw ReactError(Error('EventPluginRegistry: Cannot inject two different event plugins using the same name, `' + pluginName + '`.'));
          }
        }
      })();
      namesToPlugins[pluginName] = pluginModule;
      isOrderingDirty = true;
    }
  }
  if (isOrderingDirty) {
    recomputePluginOrdering();
  }
}

var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
  var funcArgs = Array.prototype.slice.call(arguments, 3);
  try {
    func.apply(context, funcArgs);
  } catch (error) {
    this.onError(error);
  }
};

{
  // In DEV mode, we swap out invokeGuardedCallback for a special version
  // that plays more nicely with the browser's DevTools. The idea is to preserve
  // "Pause on exceptions" behavior. Because React wraps all user-provided
  // functions in invokeGuardedCallback, and the production version of
  // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  // like caught exceptions, and the DevTools won't pause unless the developer
  // takes the extra step of enabling pause on caught exceptions. This is
  // unintuitive, though, because even though React has caught the error, from
  // the developer's perspective, the error is uncaught.
  //
  // To preserve the expected "Pause on exceptions" behavior, we don't use a
  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  // DOM node, and call the user-provided callback from inside an event handler
  // for that fake event. If the callback throws, the error is "captured" using
  // a global event handler. But because the error happens in a different
  // event loop context, it does not interrupt the normal program flow.
  // Effectively, this gives us try-catch behavior without actually using
  // try-catch. Neat!

  // Check that the browser supports the APIs we need to implement our special
  // DEV version of invokeGuardedCallback
  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
    var fakeNode = document.createElement('react');

    var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
      // If document doesn't exist we know for sure we will crash in this method
      // when we call document.createEvent(). However this can cause confusing
      // errors: https://github.com/facebookincubator/create-react-app/issues/3482
      // So we preemptively throw with a better message instead.
      (function () {
        if (!(typeof document !== 'undefined')) {
          {
            throw ReactError(Error('The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.'));
          }
        }
      })();
      var evt = document.createEvent('Event');

      // Keeps track of whether the user-provided callback threw an error. We
      // set this to true at the beginning, then set it to false right after
      // calling the function. If the function errors, `didError` will never be
      // set to false. This strategy works even if the browser is flaky and
      // fails to call our global error handler, because it doesn't rely on
      // the error event at all.
      var didError = true;

      // Keeps track of the value of window.event so that we can reset it
      // during the callback to let user code access window.event in the
      // browsers that support it.
      var windowEvent = window.event;

      // Keeps track of the descriptor of window.event to restore it after event
      // dispatching: https://github.com/facebook/react/issues/13688
      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');

      // Create an event handler for our fake event. We will synchronously
      // dispatch our fake event using `dispatchEvent`. Inside the handler, we
      // call the user-provided callback.
      var funcArgs = Array.prototype.slice.call(arguments, 3);
      function callCallback() {
        // We immediately remove the callback from event listeners so that
        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
        // nested call would trigger the fake event handlers of any call higher
        // in the stack.
        fakeNode.removeEventListener(evtType, callCallback, false);

        // We check for window.hasOwnProperty('event') to prevent the
        // window.event assignment in both IE <= 10 as they throw an error
        // "Member not found" in strict mode, and in Firefox which does not
        // support window.event.
        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
          window.event = windowEvent;
        }

        func.apply(context, funcArgs);
        didError = false;
      }

      // Create a global error event handler. We use this to capture the value
      // that was thrown. It's possible that this error handler will fire more
      // than once; for example, if non-React code also calls `dispatchEvent`
      // and a handler for that event throws. We should be resilient to most of
      // those cases. Even if our error event handler fires more than once, the
      // last error event is always used. If the callback actually does error,
      // we know that the last error event is the correct one, because it's not
      // possible for anything else to have happened in between our callback
      // erroring and the code that follows the `dispatchEvent` call below. If
      // the callback doesn't error, but the error event was fired, we know to
      // ignore it because `didError` will be false, as described above.
      var error = void 0;
      // Use this to track whether the error event is ever called.
      var didSetError = false;
      var isCrossOriginError = false;

      function handleWindowError(event) {
        error = event.error;
        didSetError = true;
        if (error === null && event.colno === 0 && event.lineno === 0) {
          isCrossOriginError = true;
        }
        if (event.defaultPrevented) {
          // Some other error handler has prevented default.
          // Browsers silence the error report if this happens.
          // We'll remember this to later decide whether to log it or not.
          if (error != null && typeof error === 'object') {
            try {
              error._suppressLogging = true;
            } catch (inner) {
              // Ignore.
            }
          }
        }
      }

      // Create a fake event type.
      var evtType = 'react-' + (name ? name : 'invokeguardedcallback');

      // Attach our event handlers
      window.addEventListener('error', handleWindowError);
      fakeNode.addEventListener(evtType, callCallback, false);

      // Synchronously dispatch our fake event. If the user-provided function
      // errors, it will trigger our global error handler.
      evt.initEvent(evtType, false, false);
      fakeNode.dispatchEvent(evt);

      if (windowEventDescriptor) {
        Object.defineProperty(window, 'event', windowEventDescriptor);
      }

      if (didError) {
        if (!didSetError) {
          // The callback errored, but the error event never fired.
          error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
        } else if (isCrossOriginError) {
          error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
        }
        this.onError(error);
      }

      // Remove our event listeners
      window.removeEventListener('error', handleWindowError);
    };

    invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
  }
}

var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;

// Used by Fiber to simulate a try-catch.
var hasError = false;
var caughtError = null;

// Used by event system to capture/rethrow the first error.
var hasRethrowError = false;
var rethrowError = null;

var reporter = {
  onError: function (error) {
    hasError = true;
    caughtError = error;
  }
};

/**
 * Call a function while guarding against errors that happens within it.
 * Returns an error if it throws, otherwise null.
 *
 * In production, this is implemented using a try-catch. The reason we don't
 * use a try-catch directly is so that we can swap out a different
 * implementation in DEV mode.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  hasError = false;
  caughtError = null;
  invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}

/**
 * Same as invokeGuardedCallback, but instead of returning an error, it stores
 * it in a global so it can be rethrown by `rethrowCaughtError` later.
 * TODO: See if caughtError and rethrowError can be unified.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  invokeGuardedCallback.apply(this, arguments);
  if (hasError) {
    var error = clearCaughtError();
    if (!hasRethrowError) {
      hasRethrowError = true;
      rethrowError = error;
    }
  }
}

/**
 * During execution of guarded functions we will capture the first error which
 * we will rethrow to be handled by the top level error handler.
 */
function rethrowCaughtError() {
  if (hasRethrowError) {
    var error = rethrowError;
    hasRethrowError = false;
    rethrowError = null;
    throw error;
  }
}

function hasCaughtError() {
  return hasError;
}

function clearCaughtError() {
  if (hasError) {
    var error = caughtError;
    hasError = false;
    caughtError = null;
    return error;
  } else {
    (function () {
      {
        {
          throw ReactError(Error('clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warningWithoutStack = function () {};

{
  warningWithoutStack = function (condition, format) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    if (format === undefined) {
      throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      var argsWithFormat = args.map(function (item) {
        return '' + item;
      });
      argsWithFormat.unshift('Warning: ' + format);

      // We intentionally don't use spread (or .apply) directly because it
      // breaks IE9: https://github.com/facebook/react/issues/13610
      Function.prototype.apply.call(console.error, console, argsWithFormat);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      var argIndex = 0;
      var message = 'Warning: ' + format.replace(/%s/g, function () {
        return args[argIndex++];
      });
      throw new Error(message);
    } catch (x) {}
  };
}

var warningWithoutStack$1 = warningWithoutStack;

var getFiberCurrentPropsFromNode = null;
var getInstanceFromNode = null;
var getNodeFromInstance = null;

function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
  getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
  getInstanceFromNode = getInstanceFromNodeImpl;
  getNodeFromInstance = getNodeFromInstanceImpl;
  {
    !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  }
}

var validateEventDispatches = void 0;
{
  validateEventDispatches = function (event) {
    var dispatchListeners = event._dispatchListeners;
    var dispatchInstances = event._dispatchInstances;

    var listenersIsArr = Array.isArray(dispatchListeners);
    var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;

    var instancesIsArr = Array.isArray(dispatchInstances);
    var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;

    !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
  };
}

/**
 * Dispatch the event to the listener.
 * @param {SyntheticEvent} event SyntheticEvent to handle
 * @param {function} listener Application-level callback
 * @param {*} inst Internal component instance
 */
function executeDispatch(event, listener, inst) {
  var type = event.type || 'unknown-event';
  event.currentTarget = getNodeFromInstance(inst);
  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  event.currentTarget = null;
}

/**
 * Standard/simple iteration through an event's collected dispatches.
 */
function executeDispatchesInOrder(event) {
  var dispatchListeners = event._dispatchListeners;
  var dispatchInstances = event._dispatchInstances;
  {
    validateEventDispatches(event);
  }
  if (Array.isArray(dispatchListeners)) {
    for (var i = 0; i < dispatchListeners.length; i++) {
      if (event.isPropagationStopped()) {
        break;
      }
      // Listeners and Instances are two parallel arrays that are always in sync.
      executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
    }
  } else if (dispatchListeners) {
    executeDispatch(event, dispatchListeners, dispatchInstances);
  }
  event._dispatchListeners = null;
  event._dispatchInstances = null;
}

/**
 * @see executeDispatchesInOrderStopAtTrueImpl
 */


/**
 * Execution of a "direct" dispatch - there must be at most one dispatch
 * accumulated on the event or it is considered an error. It doesn't really make
 * sense for an event with multiple dispatches (bubbled) to keep track of the
 * return values at each dispatch execution, but it does tend to make sense when
 * dealing with "direct" dispatches.
 *
 * @return {*} The return value of executing the single dispatch.
 */


/**
 * @param {SyntheticEvent} event
 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
 */

/**
 * Accumulates items that must not be null or undefined into the first one. This
 * is used to conserve memory by avoiding array allocations, and thus sacrifices
 * API cleanness. Since `current` can be null before being passed in and not
 * null after this function, make sure to assign it back to `current`:
 *
 * `a = accumulateInto(a, b);`
 *
 * This API should be sparingly used. Try `accumulate` for something cleaner.
 *
 * @return {*|array<*>} An accumulation of items.
 */

function accumulateInto(current, next) {
  (function () {
    if (!(next != null)) {
      {
        throw ReactError(Error('accumulateInto(...): Accumulated items must not be null or undefined.'));
      }
    }
  })();

  if (current == null) {
    return next;
  }

  // Both are not empty. Warning: Never call x.concat(y) when you are not
  // certain that x is an Array (x could be a string with concat method).
  if (Array.isArray(current)) {
    if (Array.isArray(next)) {
      current.push.apply(current, next);
      return current;
    }
    current.push(next);
    return current;
  }

  if (Array.isArray(next)) {
    // A bit too dangerous to mutate `next`.
    return [current].concat(next);
  }

  return [current, next];
}

/**
 * @param {array} arr an "accumulation" of items which is either an Array or
 * a single item. Useful when paired with the `accumulate` module. This is a
 * simple utility that allows us to reason about a collection of items, but
 * handling the case when there is exactly one item (and we do not need to
 * allocate an array).
 * @param {function} cb Callback invoked with each element or a collection.
 * @param {?} [scope] Scope used as `this` in a callback.
 */
function forEachAccumulated(arr, cb, scope) {
  if (Array.isArray(arr)) {
    arr.forEach(cb, scope);
  } else if (arr) {
    cb.call(scope, arr);
  }
}

/**
 * Internal queue of events that have accumulated their dispatches and are
 * waiting to have their dispatches executed.
 */
var eventQueue = null;

/**
 * Dispatches an event and releases it back into the pool, unless persistent.
 *
 * @param {?object} event Synthetic event to be dispatched.
 * @private
 */
var executeDispatchesAndRelease = function (event) {
  if (event) {
    executeDispatchesInOrder(event);

    if (!event.isPersistent()) {
      event.constructor.release(event);
    }
  }
};
var executeDispatchesAndReleaseTopLevel = function (e) {
  return executeDispatchesAndRelease(e);
};

function runEventsInBatch(events) {
  if (events !== null) {
    eventQueue = accumulateInto(eventQueue, events);
  }

  // Set `eventQueue` to null before processing it so that we can tell if more
  // events get enqueued while processing.
  var processingEventQueue = eventQueue;
  eventQueue = null;

  if (!processingEventQueue) {
    return;
  }

  forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  (function () {
    if (!!eventQueue) {
      {
        throw ReactError(Error('processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.'));
      }
    }
  })();
  // This would be a good time to rethrow if any of the event handlers threw.
  rethrowCaughtError();
}

function isInteractive(tag) {
  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}

function shouldPreventMouseEvent(name, type, props) {
  switch (name) {
    case 'onClick':
    case 'onClickCapture':
    case 'onDoubleClick':
    case 'onDoubleClickCapture':
    case 'onMouseDown':
    case 'onMouseDownCapture':
    case 'onMouseMove':
    case 'onMouseMoveCapture':
    case 'onMouseUp':
    case 'onMouseUpCapture':
      return !!(props.disabled && isInteractive(type));
    default:
      return false;
  }
}

/**
 * This is a unified interface for event plugins to be installed and configured.
 *
 * Event plugins can implement the following properties:
 *
 *   `extractEvents` {function(string, DOMEventTarget, string, object): *}
 *     Required. When a top-level event is fired, this method is expected to
 *     extract synthetic events that will in turn be queued and dispatched.
 *
 *   `eventTypes` {object}
 *     Optional, plugins that fire events must publish a mapping of registration
 *     names that are used to register listeners. Values of this mapping must
 *     be objects that contain `registrationName` or `phasedRegistrationNames`.
 *
 *   `executeDispatch` {function(object, function, string)}
 *     Optional, allows plugins to override how an event gets dispatched. By
 *     default, the listener is simply invoked.
 *
 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
 *
 * @public
 */

/**
 * Methods for injecting dependencies.
 */
var injection = {
  /**
   * @param {array} InjectedEventPluginOrder
   * @public
   */
  injectEventPluginOrder: injectEventPluginOrder,

  /**
   * @param {object} injectedNamesToPlugins Map from names to plugin modules.
   */
  injectEventPluginsByName: injectEventPluginsByName
};

/**
 * @param {object} inst The instance, which is the source of events.
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @return {?function} The stored callback.
 */
function getListener(inst, registrationName) {
  var listener = void 0;

  // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
  // live here; needs to be moved to a better place soon
  var stateNode = inst.stateNode;
  if (!stateNode) {
    // Work in progress (ex: onload events in incremental mode).
    return null;
  }
  var props = getFiberCurrentPropsFromNode(stateNode);
  if (!props) {
    // Work in progress.
    return null;
  }
  listener = props[registrationName];
  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
    return null;
  }
  (function () {
    if (!(!listener || typeof listener === 'function')) {
      {
        throw ReactError(Error('Expected `' + registrationName + '` listener to be a function, instead got a value of `' + typeof listener + '` type.'));
      }
    }
  })();
  return listener;
}

/**
 * Allows registered plugins an opportunity to extract events from top-level
 * native browser events.
 *
 * @return {*} An accumulation of synthetic events.
 * @internal
 */
function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var events = null;
  for (var i = 0; i < plugins.length; i++) {
    // Not every plugin in the ordering may be loaded at runtime.
    var possiblePlugin = plugins[i];
    if (possiblePlugin) {
      var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
      if (extractedEvents) {
        events = accumulateInto(events, extractedEvents);
      }
    }
  }
  return events;
}

function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  runEventsInBatch(events);
}

var FunctionComponent = 0;
var ClassComponent = 1;
var IndeterminateComponent = 2; // Before we know whether it is function or class
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedSuspenseComponent = 18;
var SuspenseListComponent = 19;
var FundamentalComponent = 20;

var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactInternalInstance$' + randomKey;
var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;

function precacheFiberNode(hostInst, node) {
  node[internalInstanceKey] = hostInst;
}

/**
 * Given a DOM node, return the closest ReactDOMComponent or
 * ReactDOMTextComponent instance ancestor.
 */
function getClosestInstanceFromNode(node) {
  if (node[internalInstanceKey]) {
    return node[internalInstanceKey];
  }

  while (!node[internalInstanceKey]) {
    if (node.parentNode) {
      node = node.parentNode;
    } else {
      // Top of the tree. This node must not be part of a React tree (or is
      // unmounted, potentially).
      return null;
    }
  }

  var inst = node[internalInstanceKey];
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber, this will always be the deepest root.
    return inst;
  }

  return null;
}

/**
 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
 * instance, or null if the node was not rendered by this React.
 */
function getInstanceFromNode$1(node) {
  var inst = node[internalInstanceKey];
  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText) {
      return inst;
    } else {
      return null;
    }
  }
  return null;
}

/**
 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
 * DOM node.
 */
function getNodeFromInstance$1(inst) {
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber this, is just the state node right now. We assume it will be
    // a host component or host text.
    return inst.stateNode;
  }

  // Without this first invariant, passing a non-DOM-component triggers the next
  // invariant for a missing parent, which is super confusing.
  (function () {
    {
      {
        throw ReactError(Error('getNodeFromInstance: Invalid argument.'));
      }
    }
  })();
}

function getFiberCurrentPropsFromNode$1(node) {
  return node[internalEventHandlersKey] || null;
}

function updateFiberProps(node, props) {
  node[internalEventHandlersKey] = props;
}

function getParent(inst) {
  do {
    inst = inst.return;
    // TODO: If this is a HostRoot we might want to bail out.
    // That is depending on if we want nested subtrees (layers) to bubble
    // events to their parent. We could also go through parentNode on the
    // host node but that wouldn't work for React Native and doesn't let us
    // do the portal feature.
  } while (inst && inst.tag !== HostComponent);
  if (inst) {
    return inst;
  }
  return null;
}

/**
 * Return the lowest common ancestor of A and B, or null if they are in
 * different trees.
 */
function getLowestCommonAncestor(instA, instB) {
  var depthA = 0;
  for (var tempA = instA; tempA; tempA = getParent(tempA)) {
    depthA++;
  }
  var depthB = 0;
  for (var tempB = instB; tempB; tempB = getParent(tempB)) {
    depthB++;
  }

  // If A is deeper, crawl up.
  while (depthA - depthB > 0) {
    instA = getParent(instA);
    depthA--;
  }

  // If B is deeper, crawl up.
  while (depthB - depthA > 0) {
    instB = getParent(instB);
    depthB--;
  }

  // Walk in lockstep until we find a match.
  var depth = depthA;
  while (depth--) {
    if (instA === instB || instA === instB.alternate) {
      return instA;
    }
    instA = getParent(instA);
    instB = getParent(instB);
  }
  return null;
}

/**
 * Return if A is an ancestor of B.
 */


/**
 * Return the parent instance of the passed-in instance.
 */


/**
 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
 */
function traverseTwoPhase(inst, fn, arg) {
  var path = [];
  while (inst) {
    path.push(inst);
    inst = getParent(inst);
  }
  var i = void 0;
  for (i = path.length; i-- > 0;) {
    fn(path[i], 'captured', arg);
  }
  for (i = 0; i < path.length; i++) {
    fn(path[i], 'bubbled', arg);
  }
}

/**
 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
 * should would receive a `mouseEnter` or `mouseLeave` event.
 *
 * Does not invoke the callback on the nearest common ancestor because nothing
 * "entered" or "left" that element.
 */
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  var common = from && to ? getLowestCommonAncestor(from, to) : null;
  var pathFrom = [];
  while (true) {
    if (!from) {
      break;
    }
    if (from === common) {
      break;
    }
    var alternate = from.alternate;
    if (alternate !== null && alternate === common) {
      break;
    }
    pathFrom.push(from);
    from = getParent(from);
  }
  var pathTo = [];
  while (true) {
    if (!to) {
      break;
    }
    if (to === common) {
      break;
    }
    var _alternate = to.alternate;
    if (_alternate !== null && _alternate === common) {
      break;
    }
    pathTo.push(to);
    to = getParent(to);
  }
  for (var i = 0; i < pathFrom.length; i++) {
    fn(pathFrom[i], 'bubbled', argFrom);
  }
  for (var _i = pathTo.length; _i-- > 0;) {
    fn(pathTo[_i], 'captured', argTo);
  }
}

/**
 * Some event types have a notion of different registration names for different
 * "phases" of propagation. This finds listeners by a given phase.
 */
function listenerAtPhase(inst, event, propagationPhase) {
  var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  return getListener(inst, registrationName);
}

/**
 * A small set of propagation patterns, each of which will accept a small amount
 * of information, and generate a set of "dispatch ready event objects" - which
 * are sets of events that have already been annotated with a set of dispatched
 * listener functions/ids. The API is designed this way to discourage these
 * propagation strategies from actually executing the dispatches, since we
 * always want to collect the entire set of dispatches before executing even a
 * single one.
 */

/**
 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
 * here, allows us to not have to bind or create functions for each event.
 * Mutating the event's members allows us to not have to create a wrapping
 * "dispatch" object that pairs the event with the listener.
 */
function accumulateDirectionalDispatches(inst, phase, event) {
  {
    !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
  }
  var listener = listenerAtPhase(inst, event, phase);
  if (listener) {
    event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  }
}

/**
 * Collect dispatches (must be entirely collected before dispatching - see unit
 * tests). Lazily allocate the array to conserve memory.  We must loop through
 * each event and perform the traversal for each one. We cannot perform a
 * single traversal for the entire collection of events because each event may
 * have a different target.
 */
function accumulateTwoPhaseDispatchesSingle(event) {
  if (event && event.dispatchConfig.phasedRegistrationNames) {
    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  }
}

/**
 * Accumulates without regard to direction, does not look for phased
 * registration names. Same as `accumulateDirectDispatchesSingle` but without
 * requiring that the `dispatchMarker` be the same as the dispatched ID.
 */
function accumulateDispatches(inst, ignoredDirection, event) {
  if (inst && event && event.dispatchConfig.registrationName) {
    var registrationName = event.dispatchConfig.registrationName;
    var listener = getListener(inst, registrationName);
    if (listener) {
      event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
      event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
    }
  }
}

/**
 * Accumulates dispatches on an `SyntheticEvent`, but only for the
 * `dispatchMarker`.
 * @param {SyntheticEvent} event
 */
function accumulateDirectDispatchesSingle(event) {
  if (event && event.dispatchConfig.registrationName) {
    accumulateDispatches(event._targetInst, null, event);
  }
}

function accumulateTwoPhaseDispatches(events) {
  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}



function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}

function accumulateDirectDispatches(events) {
  forEachAccumulated(events, accumulateDirectDispatchesSingle);
}

var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');

// Do not use the below two methods directly!
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
// (It is the only module that is allowed to access these methods.)

function unsafeCastStringToDOMTopLevelType(topLevelType) {
  return topLevelType;
}

function unsafeCastDOMTopLevelTypeToString(topLevelType) {
  return topLevelType;
}

/**
 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
 *
 * @param {string} styleProp
 * @param {string} eventName
 * @returns {object}
 */
function makePrefixMap(styleProp, eventName) {
  var prefixes = {};

  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  prefixes['Moz' + styleProp] = 'moz' + eventName;

  return prefixes;
}

/**
 * A list of event names to a configurable list of vendor prefixes.
 */
var vendorPrefixes = {
  animationend: makePrefixMap('Animation', 'AnimationEnd'),
  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  animationstart: makePrefixMap('Animation', 'AnimationStart'),
  transitionend: makePrefixMap('Transition', 'TransitionEnd')
};

/**
 * Event names that have already been detected and prefixed (if applicable).
 */
var prefixedEventNames = {};

/**
 * Element to check for prefixes on.
 */
var style = {};

/**
 * Bootstrap if a DOM exists.
 */
if (canUseDOM) {
  style = document.createElement('div').style;

  // On some platforms, in particular some releases of Android 4.x,
  // the un-prefixed "animation" and "transition" properties are defined on the
  // style object but the events that fire will still be prefixed, so we need
  // to check if the un-prefixed events are usable, and if not remove them from the map.
  if (!('AnimationEvent' in window)) {
    delete vendorPrefixes.animationend.animation;
    delete vendorPrefixes.animationiteration.animation;
    delete vendorPrefixes.animationstart.animation;
  }

  // Same as above
  if (!('TransitionEvent' in window)) {
    delete vendorPrefixes.transitionend.transition;
  }
}

/**
 * Attempts to determine the correct vendor prefixed event name.
 *
 * @param {string} eventName
 * @returns {string}
 */
function getVendorPrefixedEventName(eventName) {
  if (prefixedEventNames[eventName]) {
    return prefixedEventNames[eventName];
  } else if (!vendorPrefixes[eventName]) {
    return eventName;
  }

  var prefixMap = vendorPrefixes[eventName];

  for (var styleProp in prefixMap) {
    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
      return prefixedEventNames[eventName] = prefixMap[styleProp];
    }
  }

  return eventName;
}

/**
 * To identify top level events in ReactDOM, we use constants defined by this
 * module. This is the only module that uses the unsafe* methods to express
 * that the constants actually correspond to the browser event names. This lets
 * us save some bundle size by avoiding a top level type -> event name map.
 * The rest of ReactDOM code should import top level types from this file.
 */
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');


var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');

// List of events that need to be individually attached to media elements.
// Note that events in this list will *not* be listened to at the top level
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];

function getRawEventName(topLevelType) {
  return unsafeCastDOMTopLevelTypeToString(topLevelType);
}

/**
 * These variables store information about text content of a target node,
 * allowing comparison of content before and after a given event.
 *
 * Identify the node where selection currently begins, then observe
 * both its text content and its current position in the DOM. Since the
 * browser may natively replace the target node during composition, we can
 * use its position to find its replacement.
 *
 *
 */

var root = null;
var startText = null;
var fallbackText = null;

function initialize(nativeEventTarget) {
  root = nativeEventTarget;
  startText = getText();
  return true;
}

function reset() {
  root = null;
  startText = null;
  fallbackText = null;
}

function getData() {
  if (fallbackText) {
    return fallbackText;
  }

  var start = void 0;
  var startValue = startText;
  var startLength = startValue.length;
  var end = void 0;
  var endValue = getText();
  var endLength = endValue.length;

  for (start = 0; start < startLength; start++) {
    if (startValue[start] !== endValue[start]) {
      break;
    }
  }

  var minEnd = startLength - start;
  for (end = 1; end <= minEnd; end++) {
    if (startValue[startLength - end] !== endValue[endLength - end]) {
      break;
    }
  }

  var sliceTail = end > 1 ? 1 - end : undefined;
  fallbackText = endValue.slice(start, sliceTail);
  return fallbackText;
}

function getText() {
  if ('value' in root) {
    return root.value;
  }
  return root.textContent;
}

/* eslint valid-typeof: 0 */

var EVENT_POOL_SIZE = 10;

/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var EventInterface = {
  type: null,
  target: null,
  // currentTarget is set when dispatching; no use in copying it here
  currentTarget: function () {
    return null;
  },
  eventPhase: null,
  bubbles: null,
  cancelable: null,
  timeStamp: function (event) {
    return event.timeStamp || Date.now();
  },
  defaultPrevented: null,
  isTrusted: null
};

function functionThatReturnsTrue() {
  return true;
}

function functionThatReturnsFalse() {
  return false;
}

/**
 * Synthetic events are dispatched by event plugins, typically in response to a
 * top-level event delegation handler.
 *
 * These systems should generally use pooling to reduce the frequency of garbage
 * collection. The system should check `isPersistent` to determine whether the
 * event should be released into the pool after being dispatched. Users that
 * need a persisted event should invoke `persist`.
 *
 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
 * normalizing browser quirks. Subclasses do not necessarily have to implement a
 * DOM interface; custom application-specific events can also subclass this.
 *
 * @param {object} dispatchConfig Configuration used to dispatch this event.
 * @param {*} targetInst Marker identifying the event target.
 * @param {object} nativeEvent Native browser event.
 * @param {DOMEventTarget} nativeEventTarget Target node.
 */
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  {
    // these have a getter/setter for warnings
    delete this.nativeEvent;
    delete this.preventDefault;
    delete this.stopPropagation;
    delete this.isDefaultPrevented;
    delete this.isPropagationStopped;
  }

  this.dispatchConfig = dispatchConfig;
  this._targetInst = targetInst;
  this.nativeEvent = nativeEvent;

  var Interface = this.constructor.Interface;
  for (var propName in Interface) {
    if (!Interface.hasOwnProperty(propName)) {
      continue;
    }
    {
      delete this[propName]; // this has a getter/setter for warnings
    }
    var normalize = Interface[propName];
    if (normalize) {
      this[propName] = normalize(nativeEvent);
    } else {
      if (propName === 'target') {
        this.target = nativeEventTarget;
      } else {
        this[propName] = nativeEvent[propName];
      }
    }
  }

  var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  if (defaultPrevented) {
    this.isDefaultPrevented = functionThatReturnsTrue;
  } else {
    this.isDefaultPrevented = functionThatReturnsFalse;
  }
  this.isPropagationStopped = functionThatReturnsFalse;
  return this;
}

_assign(SyntheticEvent.prototype, {
  preventDefault: function () {
    this.defaultPrevented = true;
    var event = this.nativeEvent;
    if (!event) {
      return;
    }

    if (event.preventDefault) {
      event.preventDefault();
    } else if (typeof event.returnValue !== 'unknown') {
      event.returnValue = false;
    }
    this.isDefaultPrevented = functionThatReturnsTrue;
  },

  stopPropagation: function () {
    var event = this.nativeEvent;
    if (!event) {
      return;
    }

    if (event.stopPropagation) {
      event.stopPropagation();
    } else if (typeof event.cancelBubble !== 'unknown') {
      // The ChangeEventPlugin registers a "propertychange" event for
      // IE. This event does not support bubbling or cancelling, and
      // any references to cancelBubble throw "Member not found".  A
      // typeof check of "unknown" circumvents this issue (and is also
      // IE specific).
      event.cancelBubble = true;
    }

    this.isPropagationStopped = functionThatReturnsTrue;
  },

  /**
   * We release all dispatched `SyntheticEvent`s after each event loop, adding
   * them back into the pool. This allows a way to hold onto a reference that
   * won't be added back into the pool.
   */
  persist: function () {
    this.isPersistent = functionThatReturnsTrue;
  },

  /**
   * Checks if this event should be released back into the pool.
   *
   * @return {boolean} True if this should not be released, false otherwise.
   */
  isPersistent: functionThatReturnsFalse,

  /**
   * `PooledClass` looks for `destructor` on each instance it releases.
   */
  destructor: function () {
    var Interface = this.constructor.Interface;
    for (var propName in Interface) {
      {
        Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
      }
    }
    this.dispatchConfig = null;
    this._targetInst = null;
    this.nativeEvent = null;
    this.isDefaultPrevented = functionThatReturnsFalse;
    this.isPropagationStopped = functionThatReturnsFalse;
    this._dispatchListeners = null;
    this._dispatchInstances = null;
    {
      Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
      Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
      Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
      Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
      Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
    }
  }
});

SyntheticEvent.Interface = EventInterface;

/**
 * Helper to reduce boilerplate when creating subclasses.
 */
SyntheticEvent.extend = function (Interface) {
  var Super = this;

  var E = function () {};
  E.prototype = Super.prototype;
  var prototype = new E();

  function Class() {
    return Super.apply(this, arguments);
  }
  _assign(prototype, Class.prototype);
  Class.prototype = prototype;
  Class.prototype.constructor = Class;

  Class.Interface = _assign({}, Super.Interface, Interface);
  Class.extend = Super.extend;
  addEventPoolingTo(Class);

  return Class;
};

addEventPoolingTo(SyntheticEvent);

/**
 * Helper to nullify syntheticEvent instance properties when destructing
 *
 * @param {String} propName
 * @param {?object} getVal
 * @return {object} defineProperty object
 */
function getPooledWarningPropertyDefinition(propName, getVal) {
  var isFunction = typeof getVal === 'function';
  return {
    configurable: true,
    set: set,
    get: get
  };

  function set(val) {
    var action = isFunction ? 'setting the method' : 'setting the property';
    warn(action, 'This is effectively a no-op');
    return val;
  }

  function get() {
    var action = isFunction ? 'accessing the method' : 'accessing the property';
    var result = isFunction ? 'This is a no-op function' : 'This is set to null';
    warn(action, result);
    return getVal;
  }

  function warn(action, result) {
    var warningCondition = false;
    !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
  }
}

function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  var EventConstructor = this;
  if (EventConstructor.eventPool.length) {
    var instance = EventConstructor.eventPool.pop();
    EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
    return instance;
  }
  return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
}

function releasePooledEvent(event) {
  var EventConstructor = this;
  (function () {
    if (!(event instanceof EventConstructor)) {
      {
        throw ReactError(Error('Trying to release an event instance into a pool of a different type.'));
      }
    }
  })();
  event.destructor();
  if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
    EventConstructor.eventPool.push(event);
  }
}

function addEventPoolingTo(EventConstructor) {
  EventConstructor.eventPool = [];
  EventConstructor.getPooled = getPooledEvent;
  EventConstructor.release = releasePooledEvent;
}

/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
 */
var SyntheticCompositionEvent = SyntheticEvent.extend({
  data: null
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
 *      /#events-inputevents
 */
var SyntheticInputEvent = SyntheticEvent.extend({
  data: null
});

var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;

var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;

var documentMode = null;
if (canUseDOM && 'documentMode' in document) {
  documentMode = document.documentMode;
}

// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;

// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);

var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);

// Events and their corresponding property names.
var eventTypes = {
  beforeInput: {
    phasedRegistrationNames: {
      bubbled: 'onBeforeInput',
      captured: 'onBeforeInputCapture'
    },
    dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
  },
  compositionEnd: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionEnd',
      captured: 'onCompositionEndCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  },
  compositionStart: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionStart',
      captured: 'onCompositionStartCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  },
  compositionUpdate: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionUpdate',
      captured: 'onCompositionUpdateCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  }
};

// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;

/**
 * Return whether a native keypress event is assumed to be a command.
 * This is required because Firefox fires `keypress` events for key commands
 * (cut, copy, select-all, etc.) even though no character is inserted.
 */
function isKeypressCommand(nativeEvent) {
  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
  // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  !(nativeEvent.ctrlKey && nativeEvent.altKey);
}

/**
 * Translate native top level events into event types.
 *
 * @param {string} topLevelType
 * @return {object}
 */
function getCompositionEventType(topLevelType) {
  switch (topLevelType) {
    case TOP_COMPOSITION_START:
      return eventTypes.compositionStart;
    case TOP_COMPOSITION_END:
      return eventTypes.compositionEnd;
    case TOP_COMPOSITION_UPDATE:
      return eventTypes.compositionUpdate;
  }
}

/**
 * Does our fallback best-guess model think this event signifies that
 * composition has begun?
 *
 * @param {string} topLevelType
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isFallbackCompositionStart(topLevelType, nativeEvent) {
  return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
}

/**
 * Does our fallback mode think that this event is the end of composition?
 *
 * @param {string} topLevelType
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  switch (topLevelType) {
    case TOP_KEY_UP:
      // Command keys insert or clear IME input.
      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
    case TOP_KEY_DOWN:
      // Expect IME keyCode on each keydown. If we get any other
      // code we must have exited earlier.
      return nativeEvent.keyCode !== START_KEYCODE;
    case TOP_KEY_PRESS:
    case TOP_MOUSE_DOWN:
    case TOP_BLUR:
      // Events are not possible without cancelling IME.
      return true;
    default:
      return false;
  }
}

/**
 * Google Input Tools provides composition data via a CustomEvent,
 * with the `data` property populated in the `detail` object. If this
 * is available on the event object, use it. If not, this is a plain
 * composition event and we have nothing special to extract.
 *
 * @param {object} nativeEvent
 * @return {?string}
 */
function getDataFromCustomEvent(nativeEvent) {
  var detail = nativeEvent.detail;
  if (typeof detail === 'object' && 'data' in detail) {
    return detail.data;
  }
  return null;
}

/**
 * Check if a composition event was triggered by Korean IME.
 * Our fallback mode does not work well with IE's Korean IME,
 * so just use native composition events when Korean IME is used.
 * Although CompositionEvent.locale property is deprecated,
 * it is available in IE, where our fallback mode is enabled.
 *
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isUsingKoreanIME(nativeEvent) {
  return nativeEvent.locale === 'ko';
}

// Track the current IME composition status, if any.
var isComposing = false;

/**
 * @return {?object} A SyntheticCompositionEvent.
 */
function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var eventType = void 0;
  var fallbackData = void 0;

  if (canUseCompositionEvent) {
    eventType = getCompositionEventType(topLevelType);
  } else if (!isComposing) {
    if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
      eventType = eventTypes.compositionStart;
    }
  } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
    eventType = eventTypes.compositionEnd;
  }

  if (!eventType) {
    return null;
  }

  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
    // The current composition is stored statically and must not be
    // overwritten while composition continues.
    if (!isComposing && eventType === eventTypes.compositionStart) {
      isComposing = initialize(nativeEventTarget);
    } else if (eventType === eventTypes.compositionEnd) {
      if (isComposing) {
        fallbackData = getData();
      }
    }
  }

  var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);

  if (fallbackData) {
    // Inject data generated from fallback path into the synthetic event.
    // This matches the property of native CompositionEventInterface.
    event.data = fallbackData;
  } else {
    var customData = getDataFromCustomEvent(nativeEvent);
    if (customData !== null) {
      event.data = customData;
    }
  }

  accumulateTwoPhaseDispatches(event);
  return event;
}

/**
 * @param {TopLevelType} topLevelType Number from `TopLevelType`.
 * @param {object} nativeEvent Native browser event.
 * @return {?string} The string corresponding to this `beforeInput` event.
 */
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  switch (topLevelType) {
    case TOP_COMPOSITION_END:
      return getDataFromCustomEvent(nativeEvent);
    case TOP_KEY_PRESS:
      /**
       * If native `textInput` events are available, our goal is to make
       * use of them. However, there is a special case: the spacebar key.
       * In Webkit, preventing default on a spacebar `textInput` event
       * cancels character insertion, but it *also* causes the browser
       * to fall back to its default spacebar behavior of scrolling the
       * page.
       *
       * Tracking at:
       * https://code.google.com/p/chromium/issues/detail?id=355103
       *
       * To avoid this issue, use the keypress event as if no `textInput`
       * event is available.
       */
      var which = nativeEvent.which;
      if (which !== SPACEBAR_CODE) {
        return null;
      }

      hasSpaceKeypress = true;
      return SPACEBAR_CHAR;

    case TOP_TEXT_INPUT:
      // Record the characters to be added to the DOM.
      var chars = nativeEvent.data;

      // If it's a spacebar character, assume that we have already handled
      // it at the keypress level and bail immediately. Android Chrome
      // doesn't give us keycodes, so we need to ignore it.
      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
        return null;
      }

      return chars;

    default:
      // For other native event types, do nothing.
      return null;
  }
}

/**
 * For browsers that do not provide the `textInput` event, extract the
 * appropriate string to use for SyntheticInputEvent.
 *
 * @param {number} topLevelType Number from `TopLevelEventTypes`.
 * @param {object} nativeEvent Native browser event.
 * @return {?string} The fallback string for this `beforeInput` event.
 */
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  // If we are currently composing (IME) and using a fallback to do so,
  // try to extract the composed characters from the fallback object.
  // If composition event is available, we extract a string only at
  // compositionevent, otherwise extract it at fallback events.
  if (isComposing) {
    if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
      var chars = getData();
      reset();
      isComposing = false;
      return chars;
    }
    return null;
  }

  switch (topLevelType) {
    case TOP_PASTE:
      // If a paste event occurs after a keypress, throw out the input
      // chars. Paste events should not lead to BeforeInput events.
      return null;
    case TOP_KEY_PRESS:
      /**
       * As of v27, Firefox may fire keypress events even when no character
       * will be inserted. A few possibilities:
       *
       * - `which` is `0`. Arrow keys, Esc key, etc.
       *
       * - `which` is the pressed key code, but no char is available.
       *   Ex: 'AltGr + d` in Polish. There is no modified character for
       *   this key combination and no character is inserted into the
       *   document, but FF fires the keypress for char code `100` anyway.
       *   No `input` event will occur.
       *
       * - `which` is the pressed key code, but a command combination is
       *   being used. Ex: `Cmd+C`. No character is inserted, and no
       *   `input` event will occur.
       */
      if (!isKeypressCommand(nativeEvent)) {
        // IE fires the `keypress` event when a user types an emoji via
        // Touch keyboard of Windows.  In such a case, the `char` property
        // holds an emoji character like `\uD83D\uDE0A`.  Because its length
        // is 2, the property `which` does not represent an emoji correctly.
        // In such a case, we directly return the `char` property instead of
        // using `which`.
        if (nativeEvent.char && nativeEvent.char.length > 1) {
          return nativeEvent.char;
        } else if (nativeEvent.which) {
          return String.fromCharCode(nativeEvent.which);
        }
      }
      return null;
    case TOP_COMPOSITION_END:
      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
    default:
      return null;
  }
}

/**
 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
 * `textInput` or fallback behavior.
 *
 * @return {?object} A SyntheticInputEvent.
 */
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var chars = void 0;

  if (canUseTextInputEvent) {
    chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  } else {
    chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  }

  // If no characters are being inserted, no BeforeInput event should
  // be fired.
  if (!chars) {
    return null;
  }

  var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);

  event.data = chars;
  accumulateTwoPhaseDispatches(event);
  return event;
}

/**
 * Create an `onBeforeInput` event to match
 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
 *
 * This event plugin is based on the native `textInput` event
 * available in Chrome, Safari, Opera, and IE. This event fires after
 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
 *
 * `beforeInput` is spec'd but not implemented in any browsers, and
 * the `input` event does not provide any useful information about what has
 * actually been added, contrary to the spec. Thus, `textInput` is the best
 * available event to identify the characters that have actually been inserted
 * into the target node.
 *
 * This plugin is also responsible for emitting `composition` events, thus
 * allowing us to share composition fallback code for both `beforeInput` and
 * `composition` event types.
 */
var BeforeInputEventPlugin = {
  eventTypes: eventTypes,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);

    var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);

    if (composition === null) {
      return beforeInput;
    }

    if (beforeInput === null) {
      return composition;
    }

    return [composition, beforeInput];
  }
};

// Use to restore controlled state after a change event has fired.

var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;

function restoreStateOfTarget(target) {
  // We perform this translation at the end of the event loop so that we
  // always receive the correct fiber here
  var internalInstance = getInstanceFromNode(target);
  if (!internalInstance) {
    // Unmounted
    return;
  }
  (function () {
    if (!(typeof restoreImpl === 'function')) {
      {
        throw ReactError(Error('setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
  var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
  restoreImpl(internalInstance.stateNode, internalInstance.type, props);
}

function setRestoreImplementation(impl) {
  restoreImpl = impl;
}

function enqueueStateRestore(target) {
  if (restoreTarget) {
    if (restoreQueue) {
      restoreQueue.push(target);
    } else {
      restoreQueue = [target];
    }
  } else {
    restoreTarget = target;
  }
}

function needsStateRestore() {
  return restoreTarget !== null || restoreQueue !== null;
}

function restoreStateIfNeeded() {
  if (!restoreTarget) {
    return;
  }
  var target = restoreTarget;
  var queuedTargets = restoreQueue;
  restoreTarget = null;
  restoreQueue = null;

  restoreStateOfTarget(target);
  if (queuedTargets) {
    for (var i = 0; i < queuedTargets.length; i++) {
      restoreStateOfTarget(queuedTargets[i]);
    }
  }
}

var enableUserTimingAPI = true;

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
var debugRenderPhaseSideEffects = false;

// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:
var debugRenderPhaseSideEffectsForStrictMode = true;

// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.
var replayFailedUnitOfWorkWithInvokeGuardedCallback = true;

// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
var warnAboutDeprecatedLifecycles = true;

// Gather advanced timing metrics for Profiler subtrees.
var enableProfilerTimer = true;

// Trace which interactions trigger each commit.
var enableSchedulerTracing = true;

// Only used in www builds.
var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// Disable javascript: URL strings in href for XSS protection.
var disableJavaScriptURLs = false;

// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties
var disableInputAttributeSyncing = false;

// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
var enableStableConcurrentModeAPIs = false;

var warnAboutShorthandPropertyCollision = false;

// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
// This is a flag so we can fix warnings in RN core before turning it on


// Experimental React Flare event system and event components support.
var enableFlareAPI = false;

// Experimental Host Component support.
var enableFundamentalAPI = false;

// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107


// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
var warnAboutUnmockedScheduler = false;
// Temporary flag to revert the fix in #15650
var revertPassiveEffectsChange = false;

// For tests, we flush suspense fallbacks in an act scope;
// *except* in some of our own tests, where we test incremental loading states.
var flushSuspenseFallbacksInTests = true;

// Changes priority of some events like mousemove to user-blocking priority,
// but without making them discrete. The flag exists in case it causes
// starvation problems.
var enableUserBlockingEvents = false;

// Add a callback property to suspense to notify which promises are currently
// in the update queue. This allows reporting and tracing of what is causing
// the user to see a loading state.
var enableSuspenseCallback = false;

// Part of the simplification of React.createElement so we can eventually move
// from React.createElement to React.jsx
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
var warnAboutDefaultPropsOnFunctionComponents = false;

var disableLegacyContext = false;

var disableSchedulerTimeoutBasedOnReactExpirationTime = false;

// Used as a way to call batchedUpdates when we don't have a reference to
// the renderer. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.

// Defaults
var batchedUpdatesImpl = function (fn, bookkeeping) {
  return fn(bookkeeping);
};
var discreteUpdatesImpl = function (fn, a, b, c) {
  return fn(a, b, c);
};
var flushDiscreteUpdatesImpl = function () {};
var batchedEventUpdatesImpl = batchedUpdatesImpl;

var isInsideEventHandler = false;

function finishEventHandler() {
  // Here we wait until all updates have propagated, which is important
  // when using controlled components within layers:
  // https://github.com/facebook/react/issues/1698
  // Then we restore state of any controlled component.
  var controlledComponentsHavePendingUpdates = needsStateRestore();
  if (controlledComponentsHavePendingUpdates) {
    // If a controlled event was fired, we may need to restore the state of
    // the DOM node back to the controlled value. This is necessary when React
    // bails out of the update without touching the DOM.
    flushDiscreteUpdatesImpl();
    restoreStateIfNeeded();
  }
}

function batchedUpdates(fn, bookkeeping) {
  if (isInsideEventHandler) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(bookkeeping);
  }
  isInsideEventHandler = true;
  try {
    return batchedUpdatesImpl(fn, bookkeeping);
  } finally {
    isInsideEventHandler = false;
    finishEventHandler();
  }
}

function batchedEventUpdates(fn, a, b) {
  if (isInsideEventHandler) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(a, b);
  }
  isInsideEventHandler = true;
  try {
    return batchedEventUpdatesImpl(fn, a, b);
  } finally {
    isInsideEventHandler = false;
    finishEventHandler();
  }
}

function discreteUpdates(fn, a, b, c) {
  var prevIsInsideEventHandler = isInsideEventHandler;
  isInsideEventHandler = true;
  try {
    return discreteUpdatesImpl(fn, a, b, c);
  } finally {
    isInsideEventHandler = prevIsInsideEventHandler;
    if (!isInsideEventHandler) {
      finishEventHandler();
    }
  }
}

var lastFlushedEventTimeStamp = 0;
function flushDiscreteUpdatesIfNeeded(timeStamp) {
  // event.timeStamp isn't overly reliable due to inconsistencies in
  // how different browsers have historically provided the time stamp.
  // Some browsers provide high-resolution time stamps for all events,
  // some provide low-resolution time stamps for all events. FF < 52
  // even mixes both time stamps together. Some browsers even report
  // negative time stamps or time stamps that are 0 (iOS9) in some cases.
  // Given we are only comparing two time stamps with equality (!==),
  // we are safe from the resolution differences. If the time stamp is 0
  // we bail-out of preventing the flush, which can affect semantics,
  // such as if an earlier flush removes or adds event listeners that
  // are fired in the subsequent flush. However, this is the same
  // behaviour as we had before this change, so the risks are low.
  if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {
    lastFlushedEventTimeStamp = timeStamp;
    flushDiscreteUpdatesImpl();
  }
}

function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
  batchedUpdatesImpl = _batchedUpdatesImpl;
  discreteUpdatesImpl = _discreteUpdatesImpl;
  flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
}

/**
 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 */
var supportedInputTypes = {
  color: true,
  date: true,
  datetime: true,
  'datetime-local': true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true
};

function isTextInputElement(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();

  if (nodeName === 'input') {
    return !!supportedInputTypes[elem.type];
  }

  if (nodeName === 'textarea') {
    return true;
  }

  return false;
}

/**
 * HTML nodeType values that represent the type of the node
 */

var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var DOCUMENT_NODE = 9;
var DOCUMENT_FRAGMENT_NODE = 11;

/**
 * Gets the target node from a native browser event by accounting for
 * inconsistencies in browser DOM APIs.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {DOMEventTarget} Target node.
 */
function getEventTarget(nativeEvent) {
  // Fallback to nativeEvent.srcElement for IE9
  // https://github.com/facebook/react/issues/12506
  var target = nativeEvent.target || nativeEvent.srcElement || window;

  // Normalize SVG <use> element events #4963
  if (target.correspondingUseElement) {
    target = target.correspondingUseElement;
  }

  // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  // @see http://www.quirksmode.org/js/events_properties.html
  return target.nodeType === TEXT_NODE ? target.parentNode : target;
}

/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */
function isEventSupported(eventNameSuffix) {
  if (!canUseDOM) {
    return false;
  }

  var eventName = 'on' + eventNameSuffix;
  var isSupported = eventName in document;

  if (!isSupported) {
    var element = document.createElement('div');
    element.setAttribute(eventName, 'return;');
    isSupported = typeof element[eventName] === 'function';
  }

  return isSupported;
}

function isCheckable(elem) {
  var type = elem.type;
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}

function getTracker(node) {
  return node._valueTracker;
}

function detachTracker(node) {
  node._valueTracker = null;
}

function getValueFromNode(node) {
  var value = '';
  if (!node) {
    return value;
  }

  if (isCheckable(node)) {
    value = node.checked ? 'true' : 'false';
  } else {
    value = node.value;
  }

  return value;
}

function trackValueOnNode(node) {
  var valueField = isCheckable(node) ? 'checked' : 'value';
  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);

  var currentValue = '' + node[valueField];

  // if someone has already defined a value or Safari, then bail
  // and don't track value will cause over reporting of changes,
  // but it's better then a hard failure
  // (needed for certain tests that spyOn input values and Safari)
  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
    return;
  }
  var get = descriptor.get,
      set = descriptor.set;

  Object.defineProperty(node, valueField, {
    configurable: true,
    get: function () {
      return get.call(this);
    },
    set: function (value) {
      currentValue = '' + value;
      set.call(this, value);
    }
  });
  // We could've passed this the first time
  // but it triggers a bug in IE11 and Edge 14/15.
  // Calling defineProperty() again should be equivalent.
  // https://github.com/facebook/react/issues/11768
  Object.defineProperty(node, valueField, {
    enumerable: descriptor.enumerable
  });

  var tracker = {
    getValue: function () {
      return currentValue;
    },
    setValue: function (value) {
      currentValue = '' + value;
    },
    stopTracking: function () {
      detachTracker(node);
      delete node[valueField];
    }
  };
  return tracker;
}

function track(node) {
  if (getTracker(node)) {
    return;
  }

  // TODO: Once it's just Fiber we can move this to node._wrapperState
  node._valueTracker = trackValueOnNode(node);
}

function updateValueIfChanged(node) {
  if (!node) {
    return false;
  }

  var tracker = getTracker(node);
  // if there is no tracker at this point it's unlikely
  // that trying again will succeed
  if (!tracker) {
    return true;
  }

  var lastValue = tracker.getValue();
  var nextValue = getValueFromNode(node);
  if (nextValue !== lastValue) {
    tracker.setValue(nextValue);
    return true;
  }
  return false;
}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// Prevent newer renderers from RTE when used with older react package versions.
// Current owner and dispatcher used to share the same ref,
// but PR #14548 split them out to better support the react-debug-tools package.
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  ReactSharedInternals.ReactCurrentDispatcher = {
    current: null
  };
}
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
  ReactSharedInternals.ReactCurrentBatchConfig = {
    suspense: null
  };
}

var BEFORE_SLASH_RE = /^(.*)[\\\/]/;

var describeComponentFrame = function (name, source, ownerName) {
  var sourceInfo = '';
  if (source) {
    var path = source.fileName;
    var fileName = path.replace(BEFORE_SLASH_RE, '');
    {
      // In DEV, include code for a common special case:
      // prefer "folder/index.js" instead of just "index.js".
      if (/^index\./.test(fileName)) {
        var match = path.match(BEFORE_SLASH_RE);
        if (match) {
          var pathBeforeSlash = match[1];
          if (pathBeforeSlash) {
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
            fileName = folderName + '/' + fileName;
          }
        }
      }
    }
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  } else if (ownerName) {
    sourceInfo = ' (created by ' + ownerName + ')';
  }
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
};

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;

var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?

var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';

function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }
  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }
  return null;
}

var Pending = 0;
var Resolved = 1;
var Rejected = 2;

function refineResolvedLazyComponent(lazyComponent) {
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }
  {
    if (typeof type.tag === 'number') {
      warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }
  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }
  if (typeof type === 'string') {
    return type;
  }
  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';
    case REACT_PORTAL_TYPE:
      return 'Portal';
    case REACT_PROFILER_TYPE:
      return 'Profiler';
    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';
    case REACT_SUSPENSE_TYPE:
      return 'Suspense';
    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }
  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        return 'Context.Consumer';
      case REACT_PROVIDER_TYPE:
        return 'Context.Provider';
      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');
      case REACT_MEMO_TYPE:
        return getComponentName(type.type);
      case REACT_LAZY_TYPE:
        {
          var thenable = type;
          var resolvedThenable = refineResolvedLazyComponent(thenable);
          if (resolvedThenable) {
            return getComponentName(resolvedThenable);
          }
          break;
        }
    }
  }
  return null;
}

var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

function describeFiber(fiber) {
  switch (fiber.tag) {
    case HostRoot:
    case HostPortal:
    case HostText:
    case Fragment:
    case ContextProvider:
    case ContextConsumer:
      return '';
    default:
      var owner = fiber._debugOwner;
      var source = fiber._debugSource;
      var name = getComponentName(fiber.type);
      var ownerName = null;
      if (owner) {
        ownerName = getComponentName(owner.type);
      }
      return describeComponentFrame(name, source, ownerName);
  }
}

function getStackByFiberInDevAndProd(workInProgress) {
  var info = '';
  var node = workInProgress;
  do {
    info += describeFiber(node);
    node = node.return;
  } while (node);
  return info;
}

var current = null;
var phase = null;

function getCurrentFiberOwnerNameInDevOrNull() {
  {
    if (current === null) {
      return null;
    }
    var owner = current._debugOwner;
    if (owner !== null && typeof owner !== 'undefined') {
      return getComponentName(owner.type);
    }
  }
  return null;
}

function getCurrentFiberStackInDev() {
  {
    if (current === null) {
      return '';
    }
    // Safe because if current fiber exists, we are reconciling,
    // and it is guaranteed to be the work-in-progress version.
    return getStackByFiberInDevAndProd(current);
  }
  return '';
}

function resetCurrentFiber() {
  {
    ReactDebugCurrentFrame.getCurrentStack = null;
    current = null;
    phase = null;
  }
}

function setCurrentFiber(fiber) {
  {
    ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
    current = fiber;
    phase = null;
  }
}

function setCurrentPhase(lifeCyclePhase) {
  {
    phase = lifeCyclePhase;
  }
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = warningWithoutStack$1;

{
  warning = function (condition, format) {
    if (condition) {
      return;
    }
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();
    // eslint-disable-next-line react-internal/warning-and-invariant-args

    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
  };
}

var warning$1 = warning;

// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0;

// A simple string attribute.
// Attributes that aren't in the whitelist are presumed to have this type.
var STRING = 1;

// A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.
var BOOLEANISH_STRING = 2;

// A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
var BOOLEAN = 3;

// An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.
var OVERLOADED_BOOLEAN = 4;

// An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.
var NUMERIC = 5;

// An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.
var POSITIVE_NUMERIC = 6;

/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';


var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};

function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
    return true;
  }
  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
    return false;
  }
  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
    validatedAttributeNameCache[attributeName] = true;
    return true;
  }
  illegalAttributeNameCache[attributeName] = true;
  {
    warning$1(false, 'Invalid attribute name: `%s`', attributeName);
  }
  return false;
}

function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null) {
    return propertyInfo.type === RESERVED;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
    return true;
  }
  return false;
}

function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
    return false;
  }
  switch (typeof value) {
    case 'function':
    // $FlowIssue symbol is perfectly valid here
    case 'symbol':
      // eslint-disable-line
      return true;
    case 'boolean':
      {
        if (isCustomComponentTag) {
          return false;
        }
        if (propertyInfo !== null) {
          return !propertyInfo.acceptsBooleans;
        } else {
          var prefix = name.toLowerCase().slice(0, 5);
          return prefix !== 'data-' && prefix !== 'aria-';
        }
      }
    default:
      return false;
  }
}

function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  if (value === null || typeof value === 'undefined') {
    return true;
  }
  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
    return true;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (propertyInfo !== null) {
    switch (propertyInfo.type) {
      case BOOLEAN:
        return !value;
      case OVERLOADED_BOOLEAN:
        return value === false;
      case NUMERIC:
        return isNaN(value);
      case POSITIVE_NUMERIC:
        return isNaN(value) || value < 1;
    }
  }
  return false;
}

function getPropertyInfo(name) {
  return properties.hasOwnProperty(name) ? properties[name] : null;
}

function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  this.attributeName = attributeName;
  this.attributeNamespace = attributeNamespace;
  this.mustUseProperty = mustUseProperty;
  this.propertyName = name;
  this.type = type;
  this.sanitizeURL = sanitizeURL;
}

// When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.
var properties = {};

// These props are reserved by React. They shouldn't be written to the DOM.
['children', 'dangerouslySetInnerHTML',
// TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  var name = _ref[0],
      attributeName = _ref[1];

  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are HTML boolean attributes.
['allowFullScreen', 'async',
// Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
// Microdata
'itemScope'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.
['checked',
// Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.
['capture', 'download'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are HTML attributes that must be positive numbers.
['cols', 'rows', 'size', 'span'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These are HTML attributes that must be numbers.
['rowSpan', 'start'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

var CAMELIZE = /[\-\:]([a-z])/g;
var capitalize = function (token) {
  return token[1].toUpperCase();
};

// This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML whitelist.
// Some of these attributes can be hard to find. This list was created by
// scrapping the MDN documentation.
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, null, // attributeNamespace
  false);
} // sanitizeURL
);

// String SVG attributes with the xlink namespace.
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/1999/xlink', false);
} // sanitizeURL
);

// String SVG attributes with the xml namespace.
['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/XML/1998/namespace', false);
} // sanitizeURL
);

// These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.
['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  false);
} // sanitizeURL
);

// These attributes accept URLs. These must not allow javascript: URLS.
// These will also need to accept Trusted Types object in the future.
var xlinkHref = 'xlinkHref';
properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
'xlink:href', 'http://www.w3.org/1999/xlink', true);

['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  true);
} // sanitizeURL
);

var ReactDebugCurrentFrame$1 = null;
{
  ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
}

// A javascript: URL can contain leading C0 control or \u0020 SPACE,
// and any newline or tab are filtered out as if they're not part of the URL.
// https://url.spec.whatwg.org/#url-parsing
// Tab or newline are defined as \r\n\t:
// https://infra.spec.whatwg.org/#ascii-tab-or-newline
// A C0 control is a code point in the range \u0000 NULL to \u001F
// INFORMATION SEPARATOR ONE, inclusive:
// https://infra.spec.whatwg.org/#c0-control-or-space

/* eslint-disable max-len */
var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;

var didWarn = false;

function sanitizeURL(url) {
  if (disableJavaScriptURLs) {
    (function () {
      if (!!isJavaScriptProtocol.test(url)) {
        {
          throw ReactError(Error('React has blocked a javascript: URL as a security precaution.' + (ReactDebugCurrentFrame$1.getStackAddendum())));
        }
      }
    })();
  } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) {
    didWarn = true;
    warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
  }
}

/**
 * Get the value for a property on a node. Only used in DEV for SSR validation.
 * The "expected" argument is used as a hint of what the expected value is.
 * Some properties have multiple equivalent values.
 */
function getValueForProperty(node, name, expected, propertyInfo) {
  {
    if (propertyInfo.mustUseProperty) {
      var propertyName = propertyInfo.propertyName;

      return node[propertyName];
    } else {
      if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {
        // If we haven't fully disabled javascript: URLs, and if
        // the hydration is successful of a javascript: URL, we
        // still want to warn on the client.
        sanitizeURL('' + expected);
      }

      var attributeName = propertyInfo.attributeName;

      var stringValue = null;

      if (propertyInfo.type === OVERLOADED_BOOLEAN) {
        if (node.hasAttribute(attributeName)) {
          var value = node.getAttribute(attributeName);
          if (value === '') {
            return true;
          }
          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
            return value;
          }
          if (value === '' + expected) {
            return expected;
          }
          return value;
        }
      } else if (node.hasAttribute(attributeName)) {
        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
          // We had an attribute but shouldn't have had one, so read it
          // for the error message.
          return node.getAttribute(attributeName);
        }
        if (propertyInfo.type === BOOLEAN) {
          // If this was a boolean, it doesn't matter what the value is
          // the fact that we have it is the same as the expected.
          return expected;
        }
        // Even if this property uses a namespace we use getAttribute
        // because we assume its namespaced name is the same as our config.
        // To use getAttributeNS we need the local name which we don't have
        // in our config atm.
        stringValue = node.getAttribute(attributeName);
      }

      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
        return stringValue === null ? expected : stringValue;
      } else if (stringValue === '' + expected) {
        return expected;
      } else {
        return stringValue;
      }
    }
  }
}

/**
 * Get the value for a attribute on a node. Only used in DEV for SSR validation.
 * The third argument is used as a hint of what the expected value is. Some
 * attributes have multiple equivalent values.
 */
function getValueForAttribute(node, name, expected) {
  {
    if (!isAttributeNameSafe(name)) {
      return;
    }
    if (!node.hasAttribute(name)) {
      return expected === undefined ? undefined : null;
    }
    var value = node.getAttribute(name);
    if (value === '' + expected) {
      return expected;
    }
    return value;
  }
}

/**
 * Sets the value for a property on a node.
 *
 * @param {DOMElement} node
 * @param {string} name
 * @param {*} value
 */
function setValueForProperty(node, name, value, isCustomComponentTag) {
  var propertyInfo = getPropertyInfo(name);
  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
    return;
  }
  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
    value = null;
  }
  // If the prop isn't in the special list, treat it as a simple attribute.
  if (isCustomComponentTag || propertyInfo === null) {
    if (isAttributeNameSafe(name)) {
      var _attributeName = name;
      if (value === null) {
        node.removeAttribute(_attributeName);
      } else {
        node.setAttribute(_attributeName, '' + value);
      }
    }
    return;
  }
  var mustUseProperty = propertyInfo.mustUseProperty;

  if (mustUseProperty) {
    var propertyName = propertyInfo.propertyName;

    if (value === null) {
      var type = propertyInfo.type;

      node[propertyName] = type === BOOLEAN ? false : '';
    } else {
      // Contrary to `setAttribute`, object properties are properly
      // `toString`ed by IE8/9.
      node[propertyName] = value;
    }
    return;
  }
  // The rest are treated as attributes with special cases.
  var attributeName = propertyInfo.attributeName,
      attributeNamespace = propertyInfo.attributeNamespace;

  if (value === null) {
    node.removeAttribute(attributeName);
  } else {
    var _type = propertyInfo.type;

    var attributeValue = void 0;
    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
      attributeValue = '';
    } else {
      // `setAttribute` with objects becomes only `[object]` in IE8/9,
      // ('' + value) makes it output the correct toString()-value.
      attributeValue = '' + value;
      if (propertyInfo.sanitizeURL) {
        sanitizeURL(attributeValue);
      }
    }
    if (attributeNamespace) {
      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
    } else {
      node.setAttribute(attributeName, attributeValue);
    }
  }
}

// Flow does not allow string concatenation of most non-string types. To work
// around this limitation, we use an opaque type that can only be obtained by
// passing the value through getToStringValue first.
function toString(value) {
  return '' + value;
}

function getToStringValue(value) {
  switch (typeof value) {
    case 'boolean':
    case 'number':
    case 'object':
    case 'string':
    case 'undefined':
      return value;
    default:
      // function, symbol are assigned as empty strings
      return '';
  }
}

var ReactDebugCurrentFrame$2 = null;

var ReactControlledValuePropTypes = {
  checkPropTypes: null
};

{
  ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;

  var hasReadOnlyValue = {
    button: true,
    checkbox: true,
    image: true,
    hidden: true,
    radio: true,
    reset: true,
    submit: true
  };

  var propTypes = {
    value: function (props, propName, componentName) {
      if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
        return null;
      }
      return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    },
    checked: function (props, propName, componentName) {
      if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
        return null;
      }
      return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }
  };

  /**
   * Provide a linked `value` attribute for controlled forms. You should not use
   * this outside of the ReactDOM controlled form components.
   */
  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
    checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
  };
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;

function isControlled(props) {
  var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  return usesChecked ? props.checked != null : props.value != null;
}

/**
 * Implements an <input> host component that allows setting these optional
 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
 *
 * If `checked` or `value` are not supplied (or null/undefined), user actions
 * that affect the checked state or value will trigger updates to the element.
 *
 * If they are supplied (and not null/undefined), the rendered element will not
 * trigger updates to the element. Instead, the props must change in order for
 * the rendered element to be updated.
 *
 * The rendered element will be initialized as unchecked (or `defaultChecked`)
 * with an empty value (or `defaultValue`).
 *
 * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
 */

function getHostProps(element, props) {
  var node = element;
  var checked = props.checked;

  var hostProps = _assign({}, props, {
    defaultChecked: undefined,
    defaultValue: undefined,
    value: undefined,
    checked: checked != null ? checked : node._wrapperState.initialChecked
  });

  return hostProps;
}

function initWrapperState(element, props) {
  {
    ReactControlledValuePropTypes.checkPropTypes('input', props);

    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
      warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
      didWarnCheckedDefaultChecked = true;
    }
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
      warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
      didWarnValueDefaultValue = true;
    }
  }

  var node = element;
  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;

  node._wrapperState = {
    initialChecked: props.checked != null ? props.checked : props.defaultChecked,
    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
    controlled: isControlled(props)
  };
}

function updateChecked(element, props) {
  var node = element;
  var checked = props.checked;
  if (checked != null) {
    setValueForProperty(node, 'checked', checked, false);
  }
}

function updateWrapper(element, props) {
  var node = element;
  {
    var _controlled = isControlled(props);

    if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) {
      warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
      didWarnUncontrolledToControlled = true;
    }
    if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) {
      warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
      didWarnControlledToUncontrolled = true;
    }
  }

  updateChecked(element, props);

  var value = getToStringValue(props.value);
  var type = props.type;

  if (value != null) {
    if (type === 'number') {
      if (value === 0 && node.value === '' ||
      // We explicitly want to coerce to number here if possible.
      // eslint-disable-next-line
      node.value != value) {
        node.value = toString(value);
      }
    } else if (node.value !== toString(value)) {
      node.value = toString(value);
    }
  } else if (type === 'submit' || type === 'reset') {
    // Submit/reset inputs need the attribute removed completely to avoid
    // blank-text buttons.
    node.removeAttribute('value');
    return;
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the value attribute, React only assigns a new value
    // whenever the defaultValue React prop has changed. When not present,
    // React does nothing
    if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  } else {
    // When syncing the value attribute, the value comes from a cascade of
    // properties:
    //  1. The value React property
    //  2. The defaultValue React property
    //  3. Otherwise there should be no change
    if (props.hasOwnProperty('value')) {
      setDefaultValue(node, props.type, value);
    } else if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the checked attribute, the attribute is directly
    // controllable from the defaultValue React property. It needs to be
    // updated as new props come in.
    if (props.defaultChecked == null) {
      node.removeAttribute('checked');
    } else {
      node.defaultChecked = !!props.defaultChecked;
    }
  } else {
    // When syncing the checked attribute, it only changes when it needs
    // to be removed, such as transitioning from a checkbox into a text input
    if (props.checked == null && props.defaultChecked != null) {
      node.defaultChecked = !!props.defaultChecked;
    }
  }
}

function postMountWrapper(element, props, isHydrating) {
  var node = element;

  // Do not assign value if it is already set. This prevents user text input
  // from being lost during SSR hydration.
  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
    var type = props.type;
    var isButton = type === 'submit' || type === 'reset';

    // Avoid setting value attribute on submit/reset inputs as it overrides the
    // default value provided by the browser. See: #12872
    if (isButton && (props.value === undefined || props.value === null)) {
      return;
    }

    var _initialValue = toString(node._wrapperState.initialValue);

    // Do not assign value if it is already set. This prevents user text input
    // from being lost during SSR hydration.
    if (!isHydrating) {
      if (disableInputAttributeSyncing) {
        var value = getToStringValue(props.value);

        // When not syncing the value attribute, the value property points
        // directly to the React prop. Only assign it if it exists.
        if (value != null) {
          // Always assign on buttons so that it is possible to assign an
          // empty string to clear button text.
          //
          // Otherwise, do not re-assign the value property if is empty. This
          // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
          // prematurely marking required inputs as invalid. Equality is compared
          // to the current value in case the browser provided value is not an
          // empty string.
          if (isButton || value !== node.value) {
            node.value = toString(value);
          }
        }
      } else {
        // When syncing the value attribute, the value property should use
        // the wrapperState._initialValue property. This uses:
        //
        //   1. The value React property when present
        //   2. The defaultValue React property when present
        //   3. An empty string
        if (_initialValue !== node.value) {
          node.value = _initialValue;
        }
      }
    }

    if (disableInputAttributeSyncing) {
      // When not syncing the value attribute, assign the value attribute
      // directly from the defaultValue React property (when present)
      var defaultValue = getToStringValue(props.defaultValue);
      if (defaultValue != null) {
        node.defaultValue = toString(defaultValue);
      }
    } else {
      // Otherwise, the value attribute is synchronized to the property,
      // so we assign defaultValue to the same thing as the value property
      // assignment step above.
      node.defaultValue = _initialValue;
    }
  }

  // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  // this is needed to work around a chrome bug where setting defaultChecked
  // will sometimes influence the value of checked (even after detachment).
  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  // We need to temporarily unset name to avoid disrupting radio button groups.
  var name = node.name;
  if (name !== '') {
    node.name = '';
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the checked attribute, the checked property
    // never gets assigned. It must be manually set. We don't want
    // to do this when hydrating so that existing user input isn't
    // modified
    if (!isHydrating) {
      updateChecked(element, props);
    }

    // Only assign the checked attribute if it is defined. This saves
    // a DOM write when controlling the checked attribute isn't needed
    // (text inputs, submit/reset)
    if (props.hasOwnProperty('defaultChecked')) {
      node.defaultChecked = !node.defaultChecked;
      node.defaultChecked = !!props.defaultChecked;
    }
  } else {
    // When syncing the checked attribute, both the checked property and
    // attribute are assigned at the same time using defaultChecked. This uses:
    //
    //   1. The checked React property when present
    //   2. The defaultChecked React property when present
    //   3. Otherwise, false
    node.defaultChecked = !node.defaultChecked;
    node.defaultChecked = !!node._wrapperState.initialChecked;
  }

  if (name !== '') {
    node.name = name;
  }
}

function restoreControlledState(element, props) {
  var node = element;
  updateWrapper(node, props);
  updateNamedCousins(node, props);
}

function updateNamedCousins(rootNode, props) {
  var name = props.name;
  if (props.type === 'radio' && name != null) {
    var queryRoot = rootNode;

    while (queryRoot.parentNode) {
      queryRoot = queryRoot.parentNode;
    }

    // If `rootNode.form` was non-null, then we could try `form.elements`,
    // but that sometimes behaves strangely in IE8. We could also try using
    // `form.getElementsByName`, but that will only return direct children
    // and won't include inputs that use the HTML5 `form=` attribute. Since
    // the input might not even be in a form. It might not even be in the
    // document. Let's just use the local `querySelectorAll` to ensure we don't
    // miss anything.
    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');

    for (var i = 0; i < group.length; i++) {
      var otherNode = group[i];
      if (otherNode === rootNode || otherNode.form !== rootNode.form) {
        continue;
      }
      // This will throw if radio buttons rendered by different copies of React
      // and the same name are rendered into the same form (same as #1939).
      // That's probably okay; we don't support it just as we don't support
      // mixing React radio buttons with non-React ones.
      var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
      (function () {
        if (!otherProps) {
          {
            throw ReactError(Error('ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.'));
          }
        }
      })();

      // We need update the tracked value on the named cousin since the value
      // was changed but the input saw no event or value set
      updateValueIfChanged(otherNode);

      // If this is a controlled radio button group, forcing the input that
      // was previously checked to update will cause it to be come re-checked
      // as appropriate.
      updateWrapper(otherNode, otherProps);
    }
  }
}

// In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
function setDefaultValue(node, type, value) {
  if (
  // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  type !== 'number' || node.ownerDocument.activeElement !== node) {
    if (value == null) {
      node.defaultValue = toString(node._wrapperState.initialValue);
    } else if (node.defaultValue !== toString(value)) {
      node.defaultValue = toString(value);
    }
  }
}

var eventTypes$1 = {
  change: {
    phasedRegistrationNames: {
      bubbled: 'onChange',
      captured: 'onChangeCapture'
    },
    dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
  }
};

function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
  var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
  event.type = 'change';
  // Flag this event loop as needing state restore.
  enqueueStateRestore(target);
  accumulateTwoPhaseDispatches(event);
  return event;
}
/**
 * For IE shims
 */
var activeElement = null;
var activeElementInst = null;

/**
 * SECTION: handle `change` event
 */
function shouldUseChangeEvent(elem) {
  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}

function manualDispatchChangeEvent(nativeEvent) {
  var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));

  // If change and propertychange bubbled, we'd just bind to it like all the
  // other events and have it go through ReactBrowserEventEmitter. Since it
  // doesn't, we manually listen for the events and so we have to enqueue and
  // process the abstract event manually.
  //
  // Batching is necessary here in order to ensure that all event handlers run
  // before the next rerender (including event handlers attached to ancestor
  // elements instead of directly on the input). Without this, controlled
  // components don't work properly in conjunction with event bubbling because
  // the component is rerendered and the value reverted before all the event
  // handlers can run. See https://github.com/facebook/react/issues/708.
  batchedUpdates(runEventInBatch, event);
}

function runEventInBatch(event) {
  runEventsInBatch(event);
}

function getInstIfValueChanged(targetInst) {
  var targetNode = getNodeFromInstance$1(targetInst);
  if (updateValueIfChanged(targetNode)) {
    return targetInst;
  }
}

function getTargetInstForChangeEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_CHANGE) {
    return targetInst;
  }
}

/**
 * SECTION: handle `input` event
 */
var isInputEventSupported = false;
if (canUseDOM) {
  // IE9 claims to support the input event but fails to trigger it when
  // deleting text, so we ignore its input events.
  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}

/**
 * (For IE <=9) Starts tracking propertychange events on the passed-in element
 * and override the value property so that we can distinguish user events from
 * value changes in JS.
 */
function startWatchingForValueChange(target, targetInst) {
  activeElement = target;
  activeElementInst = targetInst;
  activeElement.attachEvent('onpropertychange', handlePropertyChange);
}

/**
 * (For IE <=9) Removes the event listeners from the currently-tracked element,
 * if any exists.
 */
function stopWatchingForValueChange() {
  if (!activeElement) {
    return;
  }
  activeElement.detachEvent('onpropertychange', handlePropertyChange);
  activeElement = null;
  activeElementInst = null;
}

/**
 * (For IE <=9) Handles a propertychange event, sending a `change` event if
 * the value of the active element has changed.
 */
function handlePropertyChange(nativeEvent) {
  if (nativeEvent.propertyName !== 'value') {
    return;
  }
  if (getInstIfValueChanged(activeElementInst)) {
    manualDispatchChangeEvent(nativeEvent);
  }
}

function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
  if (topLevelType === TOP_FOCUS) {
    // In IE9, propertychange fires for most input events but is buggy and
    // doesn't fire when text is deleted, but conveniently, selectionchange
    // appears to fire in all of the remaining cases so we catch those and
    // forward the event if the value has changed
    // In either case, we don't want to call the event handler if the value
    // is changed from JS so we redefine a setter for `.value` that updates
    // our activeElementValue variable, allowing us to ignore those changes
    //
    // stopWatching() should be a noop here but we call it just in case we
    // missed a blur event somehow.
    stopWatchingForValueChange();
    startWatchingForValueChange(target, targetInst);
  } else if (topLevelType === TOP_BLUR) {
    stopWatchingForValueChange();
  }
}

// For IE8 and IE9.
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
  if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
    // On the selectionchange event, the target is just document which isn't
    // helpful for us so just check activeElement instead.
    //
    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
    // propertychange on the first input event after setting `value` from a
    // script and fires only keydown, keypress, keyup. Catching keyup usually
    // gets it and catching keydown lets us fire an event for the first
    // keystroke if user does a key repeat (it'll be a little delayed: right
    // before the second keystroke). Other input methods (e.g., paste) seem to
    // fire selectionchange normally.
    return getInstIfValueChanged(activeElementInst);
  }
}

/**
 * SECTION: handle `click` event
 */
function shouldUseClickEvent(elem) {
  // Use the `click` event to detect changes to checkbox and radio inputs.
  // This approach works across all browsers, whereas `change` does not fire
  // until `blur` in IE8.
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}

function getTargetInstForClickEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_CLICK) {
    return getInstIfValueChanged(targetInst);
  }
}

function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
    return getInstIfValueChanged(targetInst);
  }
}

function handleControlledInputBlur(node) {
  var state = node._wrapperState;

  if (!state || !state.controlled || node.type !== 'number') {
    return;
  }

  if (!disableInputAttributeSyncing) {
    // If controlled, assign the value attribute to the current value on blur
    setDefaultValue(node, 'number', node.value);
  }
}

/**
 * This plugin creates an `onChange` event that normalizes change events
 * across form elements. This event fires at a time when it's possible to
 * change the element's value without seeing a flicker.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - select
 */
var ChangeEventPlugin = {
  eventTypes: eventTypes$1,

  _isInputEventSupported: isInputEventSupported,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;

    var getTargetInstFunc = void 0,
        handleEventFunc = void 0;
    if (shouldUseChangeEvent(targetNode)) {
      getTargetInstFunc = getTargetInstForChangeEvent;
    } else if (isTextInputElement(targetNode)) {
      if (isInputEventSupported) {
        getTargetInstFunc = getTargetInstForInputOrChangeEvent;
      } else {
        getTargetInstFunc = getTargetInstForInputEventPolyfill;
        handleEventFunc = handleEventsForInputEventPolyfill;
      }
    } else if (shouldUseClickEvent(targetNode)) {
      getTargetInstFunc = getTargetInstForClickEvent;
    }

    if (getTargetInstFunc) {
      var inst = getTargetInstFunc(topLevelType, targetInst);
      if (inst) {
        var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
        return event;
      }
    }

    if (handleEventFunc) {
      handleEventFunc(topLevelType, targetNode, targetInst);
    }

    // When blurring, set the value attribute for number inputs
    if (topLevelType === TOP_BLUR) {
      handleControlledInputBlur(targetNode);
    }
  }
};

/**
 * Module that is injectable into `EventPluginHub`, that specifies a
 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
 * plugins, without having to package every one of them. This is better than
 * having plugins be ordered in the same order that they are injected because
 * that ordering would be influenced by the packaging order.
 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
 */
var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];

var SyntheticUIEvent = SyntheticEvent.extend({
  view: null,
  detail: null
});

var modifierKeyToProp = {
  Alt: 'altKey',
  Control: 'ctrlKey',
  Meta: 'metaKey',
  Shift: 'shiftKey'
};

// Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
// getModifierState. If getModifierState is not supported, we map it to a set of
// modifier keys exposed by the event. In this case, Lock-keys are not supported.
/**
 * Translation from modifier key to the associated property in the event.
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
 */

function modifierStateGetter(keyArg) {
  var syntheticEvent = this;
  var nativeEvent = syntheticEvent.nativeEvent;
  if (nativeEvent.getModifierState) {
    return nativeEvent.getModifierState(keyArg);
  }
  var keyProp = modifierKeyToProp[keyArg];
  return keyProp ? !!nativeEvent[keyProp] : false;
}

function getEventModifierState(nativeEvent) {
  return modifierStateGetter;
}

var previousScreenX = 0;
var previousScreenY = 0;
// Use flags to signal movementX/Y has already been set
var isMovementXSet = false;
var isMovementYSet = false;

/**
 * @interface MouseEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticMouseEvent = SyntheticUIEvent.extend({
  screenX: null,
  screenY: null,
  clientX: null,
  clientY: null,
  pageX: null,
  pageY: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  getModifierState: getEventModifierState,
  button: null,
  buttons: null,
  relatedTarget: function (event) {
    return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  },
  movementX: function (event) {
    if ('movementX' in event) {
      return event.movementX;
    }

    var screenX = previousScreenX;
    previousScreenX = event.screenX;

    if (!isMovementXSet) {
      isMovementXSet = true;
      return 0;
    }

    return event.type === 'mousemove' ? event.screenX - screenX : 0;
  },
  movementY: function (event) {
    if ('movementY' in event) {
      return event.movementY;
    }

    var screenY = previousScreenY;
    previousScreenY = event.screenY;

    if (!isMovementYSet) {
      isMovementYSet = true;
      return 0;
    }

    return event.type === 'mousemove' ? event.screenY - screenY : 0;
  }
});

/**
 * @interface PointerEvent
 * @see http://www.w3.org/TR/pointerevents/
 */
var SyntheticPointerEvent = SyntheticMouseEvent.extend({
  pointerId: null,
  width: null,
  height: null,
  pressure: null,
  tangentialPressure: null,
  tiltX: null,
  tiltY: null,
  twist: null,
  pointerType: null,
  isPrimary: null
});

var eventTypes$2 = {
  mouseEnter: {
    registrationName: 'onMouseEnter',
    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  },
  mouseLeave: {
    registrationName: 'onMouseLeave',
    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  },
  pointerEnter: {
    registrationName: 'onPointerEnter',
    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  },
  pointerLeave: {
    registrationName: 'onPointerLeave',
    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  }
};

var EnterLeaveEventPlugin = {
  eventTypes: eventTypes$2,

  /**
   * For almost every interaction we care about, there will be both a top-level
   * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
   * we do not extract duplicate events. However, moving the mouse into the
   * browser from outside will not fire a `mouseout` event. In this case, we use
   * the `mouseover` top-level event.
   */
  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
    var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;

    if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
      return null;
    }

    if (!isOutEvent && !isOverEvent) {
      // Must not be a mouse or pointer in or out - ignoring.
      return null;
    }

    var win = void 0;
    if (nativeEventTarget.window === nativeEventTarget) {
      // `nativeEventTarget` is probably a window object.
      win = nativeEventTarget;
    } else {
      // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
      var doc = nativeEventTarget.ownerDocument;
      if (doc) {
        win = doc.defaultView || doc.parentWindow;
      } else {
        win = window;
      }
    }

    var from = void 0;
    var to = void 0;
    if (isOutEvent) {
      from = targetInst;
      var related = nativeEvent.relatedTarget || nativeEvent.toElement;
      to = related ? getClosestInstanceFromNode(related) : null;
    } else {
      // Moving to a node from outside the window.
      from = null;
      to = targetInst;
    }

    if (from === to) {
      // Nothing pertains to our managed components.
      return null;
    }

    var eventInterface = void 0,
        leaveEventType = void 0,
        enterEventType = void 0,
        eventTypePrefix = void 0;

    if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
      eventInterface = SyntheticMouseEvent;
      leaveEventType = eventTypes$2.mouseLeave;
      enterEventType = eventTypes$2.mouseEnter;
      eventTypePrefix = 'mouse';
    } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
      eventInterface = SyntheticPointerEvent;
      leaveEventType = eventTypes$2.pointerLeave;
      enterEventType = eventTypes$2.pointerEnter;
      eventTypePrefix = 'pointer';
    }

    var fromNode = from == null ? win : getNodeFromInstance$1(from);
    var toNode = to == null ? win : getNodeFromInstance$1(to);

    var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
    leave.type = eventTypePrefix + 'leave';
    leave.target = fromNode;
    leave.relatedTarget = toNode;

    var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
    enter.type = eventTypePrefix + 'enter';
    enter.target = toNode;
    enter.relatedTarget = fromNode;

    accumulateEnterLeaveDispatches(leave, enter, from, to);

    return [leave, enter];
  }
};

/**
 * inlined Object.is polyfill to avoid requiring consumers ship their own
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
 */
function is(x, y) {
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  ;
}

var hasOwnProperty$1 = Object.prototype.hasOwnProperty;

/**
 * Performs equality by iterating through keys on an object and returning false
 * when any key has values which are not strictly equal between the arguments.
 * Returns true when the values of all keys are strictly equal.
 */
function shallowEqual(objA, objB) {
  if (is(objA, objB)) {
    return true;
  }

  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  // Test for A's keys different from B.
  for (var i = 0; i < keysA.length; i++) {
    if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}

var PLUGIN_EVENT_SYSTEM = 1;
var RESPONDER_EVENT_SYSTEM = 1 << 1;
var IS_PASSIVE = 1 << 2;
var IS_ACTIVE = 1 << 3;
var PASSIVE_NOT_SUPPORTED = 1 << 4;

function createResponderListener(responder, props) {
  var eventResponderListener = {
    responder: responder,
    props: props
  };
  {
    Object.freeze(eventResponderListener);
  }
  return eventResponderListener;
}

function isFiberSuspenseAndTimedOut(fiber) {
  return fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
}

function getSuspenseFallbackChild(fiber) {
  return fiber.child.sibling.child;
}





function createResponderInstance(responder, responderProps, responderState, target, fiber) {
  return {
    fiber: fiber,
    props: responderProps,
    responder: responder,
    rootEventTypes: null,
    state: responderState,
    target: target
  };
}

var DiscreteEvent = 0;
var UserBlockingEvent = 1;
var ContinuousEvent = 2;

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority;
var runWithPriority$1 = Scheduler.unstable_runWithPriority;


var listenToResponderEventTypesImpl = void 0;

function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {
  listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;
}

var activeTimeouts = new Map();
var rootEventTypesToEventResponderInstances = new Map();
var ownershipChangeListeners = new Set();

var globalOwner = null;

var currentTimeStamp = 0;
var currentTimers = new Map();
var currentInstance = null;
var currentEventQueue = null;
var currentEventQueuePriority = ContinuousEvent;
var currentTimerIDCounter = 0;
var currentDocument = null;

var eventResponderContext = {
  dispatchEvent: function (eventValue, eventListener, eventPriority) {
    validateResponderContext();
    validateEventValue(eventValue);
    if (eventPriority < currentEventQueuePriority) {
      currentEventQueuePriority = eventPriority;
    }
    currentEventQueue.push(createEventQueueItem(eventValue, eventListener));
  },
  isTargetWithinResponder: function (target) {
    validateResponderContext();
    if (target != null) {
      var fiber = getClosestInstanceFromNode(target);
      var responderFiber = currentInstance.fiber;

      while (fiber !== null) {
        if (fiber === responderFiber || fiber.alternate === responderFiber) {
          return true;
        }
        fiber = fiber.return;
      }
    }
    return false;
  },
  isTargetWithinResponderScope: function (target) {
    validateResponderContext();
    var componentInstance = currentInstance;
    var responder = componentInstance.responder;

    if (target != null) {
      var fiber = getClosestInstanceFromNode(target);
      var responderFiber = currentInstance.fiber;

      while (fiber !== null) {
        if (fiber === responderFiber || fiber.alternate === responderFiber) {
          return true;
        }
        if (doesFiberHaveResponder(fiber, responder)) {
          return false;
        }
        fiber = fiber.return;
      }
    }
    return false;
  },
  isTargetWithinNode: function (childTarget, parentTarget) {
    validateResponderContext();
    var childFiber = getClosestInstanceFromNode(childTarget);
    var parentFiber = getClosestInstanceFromNode(parentTarget);
    var parentAlternateFiber = parentFiber.alternate;

    var node = childFiber;
    while (node !== null) {
      if (node === parentFiber || node === parentAlternateFiber) {
        return true;
      }
      node = node.return;
    }
    return false;
  },
  addRootEventTypes: function (rootEventTypes) {
    validateResponderContext();
    var activeDocument = getActiveDocument();
    listenToResponderEventTypesImpl(rootEventTypes, activeDocument);
    for (var i = 0; i < rootEventTypes.length; i++) {
      var rootEventType = rootEventTypes[i];
      var eventResponderInstance = currentInstance;
      registerRootEventType(rootEventType, eventResponderInstance);
    }
  },
  removeRootEventTypes: function (rootEventTypes) {
    validateResponderContext();
    for (var i = 0; i < rootEventTypes.length; i++) {
      var rootEventType = rootEventTypes[i];
      var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);
      var rootEventTypesSet = currentInstance.rootEventTypes;
      if (rootEventTypesSet !== null) {
        rootEventTypesSet.delete(rootEventType);
      }
      if (rootEventResponders !== undefined) {
        rootEventResponders.delete(currentInstance);
      }
    }
  },
  hasOwnership: function () {
    validateResponderContext();
    return globalOwner === currentInstance;
  },
  requestGlobalOwnership: function () {
    validateResponderContext();
    if (globalOwner !== null) {
      return false;
    }
    globalOwner = currentInstance;
    triggerOwnershipListeners();
    return true;
  },
  releaseOwnership: function () {
    validateResponderContext();
    return releaseOwnershipForEventResponderInstance(currentInstance);
  },
  setTimeout: function (func, delay) {
    validateResponderContext();
    if (currentTimers === null) {
      currentTimers = new Map();
    }
    var timeout = currentTimers.get(delay);

    var timerId = currentTimerIDCounter++;
    if (timeout === undefined) {
      var _timers = new Map();
      var _id = setTimeout(function () {
        processTimers(_timers, delay);
      }, delay);
      timeout = {
        id: _id,
        timers: _timers
      };
      currentTimers.set(delay, timeout);
    }
    timeout.timers.set(timerId, {
      instance: currentInstance,
      func: func,
      id: timerId,
      timeStamp: currentTimeStamp
    });
    activeTimeouts.set(timerId, timeout);
    return timerId;
  },
  clearTimeout: function (timerId) {
    validateResponderContext();
    var timeout = activeTimeouts.get(timerId);

    if (timeout !== undefined) {
      var _timers2 = timeout.timers;
      _timers2.delete(timerId);
      if (_timers2.size === 0) {
        clearTimeout(timeout.id);
      }
    }
  },
  getFocusableElementsInScope: function (deep) {
    validateResponderContext();
    var focusableElements = [];
    var eventResponderInstance = currentInstance;
    var currentResponder = eventResponderInstance.responder;
    var focusScopeFiber = eventResponderInstance.fiber;
    if (deep) {
      var deepNode = focusScopeFiber.return;
      while (deepNode !== null) {
        if (doesFiberHaveResponder(deepNode, currentResponder)) {
          focusScopeFiber = deepNode;
        }
        deepNode = deepNode.return;
      }
    }
    var child = focusScopeFiber.child;

    if (child !== null) {
      collectFocusableElements(child, focusableElements);
    }
    return focusableElements;
  },

  getActiveDocument: getActiveDocument,
  objectAssign: _assign,
  getTimeStamp: function () {
    validateResponderContext();
    return currentTimeStamp;
  },
  isTargetWithinHostComponent: function (target, elementType) {
    validateResponderContext();
    var fiber = getClosestInstanceFromNode(target);

    while (fiber !== null) {
      if (fiber.tag === HostComponent && fiber.type === elementType) {
        return true;
      }
      fiber = fiber.return;
    }
    return false;
  },

  enqueueStateRestore: enqueueStateRestore
};

function validateEventValue(eventValue) {
  if (typeof eventValue === 'object' && eventValue !== null) {
    var target = eventValue.target,
        type = eventValue.type,
        _timeStamp = eventValue.timeStamp;


    if (target == null || type == null || _timeStamp == null) {
      throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.');
    }
    var showWarning = function (name) {
      {
        warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name);
      }
    };
    eventValue.preventDefault = function () {
      {
        showWarning('preventDefault()');
      }
    };
    eventValue.stopPropagation = function () {
      {
        showWarning('stopPropagation()');
      }
    };
    eventValue.isDefaultPrevented = function () {
      {
        showWarning('isDefaultPrevented()');
      }
    };
    eventValue.isPropagationStopped = function () {
      {
        showWarning('isPropagationStopped()');
      }
    };
    // $FlowFixMe: we don't need value, Flow thinks we do
    Object.defineProperty(eventValue, 'nativeEvent', {
      get: function () {
        {
          showWarning('nativeEvent');
        }
      }
    });
  }
}

function collectFocusableElements(node, focusableElements) {
  if (isFiberSuspenseAndTimedOut(node)) {
    var fallbackChild = getSuspenseFallbackChild(node);
    if (fallbackChild !== null) {
      collectFocusableElements(fallbackChild, focusableElements);
    }
  } else {
    if (isFiberHostComponentFocusable(node)) {
      focusableElements.push(node.stateNode);
    } else {
      var child = node.child;

      if (child !== null) {
        collectFocusableElements(child, focusableElements);
      }
    }
  }
  var sibling = node.sibling;

  if (sibling !== null) {
    collectFocusableElements(sibling, focusableElements);
  }
}

function createEventQueueItem(value, listener) {
  return {
    value: value,
    listener: listener
  };
}

function doesFiberHaveResponder(fiber, responder) {
  if (fiber.tag === HostComponent) {
    var dependencies = fiber.dependencies;
    if (dependencies !== null) {
      var respondersMap = dependencies.responders;
      if (respondersMap !== null && respondersMap.has(responder)) {
        return true;
      }
    }
  }
  return false;
}

function getActiveDocument() {
  return currentDocument;
}

function releaseOwnershipForEventResponderInstance(eventResponderInstance) {
  if (globalOwner === eventResponderInstance) {
    globalOwner = null;
    triggerOwnershipListeners();
    return true;
  }
  return false;
}

function isFiberHostComponentFocusable(fiber) {
  if (fiber.tag !== HostComponent) {
    return false;
  }
  var type = fiber.type,
      memoizedProps = fiber.memoizedProps;

  if (memoizedProps.tabIndex === -1 || memoizedProps.disabled) {
    return false;
  }
  if (memoizedProps.tabIndex === 0 || memoizedProps.contentEditable === true) {
    return true;
  }
  if (type === 'a' || type === 'area') {
    return !!memoizedProps.href && memoizedProps.rel !== 'ignore';
  }
  if (type === 'input') {
    return memoizedProps.type !== 'hidden' && memoizedProps.type !== 'file';
  }
  return type === 'button' || type === 'textarea' || type === 'object' || type === 'select' || type === 'iframe' || type === 'embed';
}

function processTimers(timers, delay) {
  var timersArr = Array.from(timers.values());
  currentEventQueuePriority = ContinuousEvent;
  try {
    for (var i = 0; i < timersArr.length; i++) {
      var _timersArr$i = timersArr[i],
          _instance = _timersArr$i.instance,
          _func = _timersArr$i.func,
          _id2 = _timersArr$i.id,
          _timeStamp2 = _timersArr$i.timeStamp;

      currentInstance = _instance;
      currentEventQueue = [];
      currentTimeStamp = _timeStamp2 + delay;
      try {
        _func();
      } finally {
        activeTimeouts.delete(_id2);
      }
    }
    processEventQueue();
  } finally {
    currentTimers = null;
    currentInstance = null;
    currentEventQueue = null;
    currentTimeStamp = 0;
  }
}

function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {
  var _ref = nativeEvent,
      pointerType = _ref.pointerType;

  var eventPointerType = '';
  var pointerId = null;

  if (pointerType !== undefined) {
    eventPointerType = pointerType;
    pointerId = nativeEvent.pointerId;
  } else if (nativeEvent.key !== undefined) {
    eventPointerType = 'keyboard';
  } else if (nativeEvent.button !== undefined) {
    eventPointerType = 'mouse';
  } else if (nativeEvent.changedTouches !== undefined) {
    eventPointerType = 'touch';
  }

  return {
    nativeEvent: nativeEvent,
    passive: passive,
    passiveSupported: passiveSupported,
    pointerId: pointerId,
    pointerType: eventPointerType,
    responderTarget: null,
    target: nativeEventTarget,
    type: topLevelType
  };
}

function processEvents(eventQueue) {
  for (var i = 0, length = eventQueue.length; i < length; i++) {
    var _eventQueue$i = eventQueue[i],
        _value = _eventQueue$i.value,
        _listener = _eventQueue$i.listener;

    var type = typeof _value === 'object' && _value !== null ? _value.type : '';
    invokeGuardedCallbackAndCatchFirstError(type, _listener, undefined, _value);
  }
}

function processEventQueue() {
  var eventQueue = currentEventQueue;
  if (eventQueue.length === 0) {
    return;
  }
  switch (currentEventQueuePriority) {
    case DiscreteEvent:
      {
        flushDiscreteUpdatesIfNeeded(currentTimeStamp);
        discreteUpdates(function () {
          batchedEventUpdates(processEvents, eventQueue);
        });
        break;
      }
    case UserBlockingEvent:
      {
        if (enableUserBlockingEvents) {
          runWithPriority$1(UserBlockingPriority$1, batchedEventUpdates.bind(null, processEvents, eventQueue));
        } else {
          batchedEventUpdates(processEvents, eventQueue);
        }
        break;
      }
    case ContinuousEvent:
      {
        batchedEventUpdates(processEvents, eventQueue);
        break;
      }
  }
}

function responderEventTypesContainType(eventTypes, type) {
  for (var i = 0, len = eventTypes.length; i < len; i++) {
    if (eventTypes[i] === type) {
      return true;
    }
  }
  return false;
}

function validateResponderTargetEventTypes(eventType, responder) {
  var targetEventTypes = responder.targetEventTypes;
  // Validate the target event type exists on the responder

  if (targetEventTypes !== null) {
    return responderEventTypesContainType(targetEventTypes, eventType);
  }
  return false;
}

function validateOwnership(responderInstance) {
  return globalOwner === null || globalOwner === responderInstance;
}

function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
  var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;
  var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;
  var isPassive = isPassiveEvent || !isPassiveSupported;
  var eventType = isPassive ? topLevelType : topLevelType + '_active';

  // Trigger event responders in this order:
  // - Bubble target responder phase
  // - Root responder phase

  var visitedResponders = new Set();
  var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);
  var node = targetFiber;
  while (node !== null) {
    var _node = node,
        dependencies = _node.dependencies,
        tag = _node.tag;

    if (tag === HostComponent && dependencies !== null) {
      var respondersMap = dependencies.responders;
      if (respondersMap !== null) {
        var responderInstances = Array.from(respondersMap.values());
        for (var i = 0, length = responderInstances.length; i < length; i++) {
          var responderInstance = responderInstances[i];

          if (validateOwnership(responderInstance)) {
            var props = responderInstance.props,
                responder = responderInstance.responder,
                state = responderInstance.state,
                target = responderInstance.target;

            if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder)) {
              visitedResponders.add(responder);
              var onEvent = responder.onEvent;
              if (onEvent !== null) {
                currentInstance = responderInstance;
                responderEvent.responderTarget = target;
                onEvent(responderEvent, eventResponderContext, props, state);
              }
            }
          }
        }
      }
    }
    node = node.return;
  }
  // Root phase
  var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);
  if (rootEventResponderInstances !== undefined) {
    var _responderInstances = Array.from(rootEventResponderInstances);

    for (var _i = 0; _i < _responderInstances.length; _i++) {
      var _responderInstance = _responderInstances[_i];
      if (!validateOwnership(_responderInstance)) {
        continue;
      }
      var _props = _responderInstance.props,
          _responder = _responderInstance.responder,
          _state = _responderInstance.state,
          _target = _responderInstance.target;

      var onRootEvent = _responder.onRootEvent;
      if (onRootEvent !== null) {
        currentInstance = _responderInstance;
        responderEvent.responderTarget = _target;
        onRootEvent(responderEvent, eventResponderContext, _props, _state);
      }
    }
  }
}

function triggerOwnershipListeners() {
  var listeningInstances = Array.from(ownershipChangeListeners);
  var previousInstance = currentInstance;
  var previousEventQueuePriority = currentEventQueuePriority;
  var previousEventQueue = currentEventQueue;
  try {
    for (var i = 0; i < listeningInstances.length; i++) {
      var _instance2 = listeningInstances[i];
      var props = _instance2.props,
          responder = _instance2.responder,
          state = _instance2.state;

      currentInstance = _instance2;
      currentEventQueuePriority = ContinuousEvent;
      currentEventQueue = [];
      var onOwnershipChange = responder.onOwnershipChange;
      if (onOwnershipChange !== null) {
        onOwnershipChange(eventResponderContext, props, state);
      }
    }
    processEventQueue();
  } finally {
    currentInstance = previousInstance;
    currentEventQueue = previousEventQueue;
    currentEventQueuePriority = previousEventQueuePriority;
  }
}

function mountEventResponder(responder, responderInstance, props, state) {
  if (responder.onOwnershipChange !== null) {
    ownershipChangeListeners.add(responderInstance);
  }
  var onMount = responder.onMount;
  if (onMount !== null) {
    currentEventQueuePriority = ContinuousEvent;
    currentInstance = responderInstance;
    currentEventQueue = [];
    try {
      onMount(eventResponderContext, props, state);
      processEventQueue();
    } finally {
      currentEventQueue = null;
      currentInstance = null;
      currentTimers = null;
    }
  }
}

function unmountEventResponder(responderInstance) {
  var responder = responderInstance.responder;
  var onUnmount = responder.onUnmount;
  if (onUnmount !== null) {
    var props = responderInstance.props,
        state = responderInstance.state;

    currentEventQueue = [];
    currentEventQueuePriority = ContinuousEvent;
    currentInstance = responderInstance;
    try {
      onUnmount(eventResponderContext, props, state);
      processEventQueue();
    } finally {
      currentEventQueue = null;
      currentInstance = null;
      currentTimers = null;
    }
  }
  releaseOwnershipForEventResponderInstance(responderInstance);
  if (responder.onOwnershipChange !== null) {
    ownershipChangeListeners.delete(responderInstance);
  }
  var rootEventTypesSet = responderInstance.rootEventTypes;
  if (rootEventTypesSet !== null) {
    var rootEventTypes = Array.from(rootEventTypesSet);

    for (var i = 0; i < rootEventTypes.length; i++) {
      var topLevelEventType = rootEventTypes[i];
      var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);
      if (rootEventResponderInstances !== undefined) {
        rootEventResponderInstances.delete(responderInstance);
      }
    }
  }
}

function validateResponderContext() {
  (function () {
    if (!(currentInstance !== null)) {
      {
        throw ReactError(Error('An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .'));
      }
    }
  })();
}

function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
  if (enableFlareAPI) {
    var previousEventQueue = currentEventQueue;
    var previousInstance = currentInstance;
    var previousTimers = currentTimers;
    var previousTimeStamp = currentTimeStamp;
    var previousDocument = currentDocument;
    var previousEventQueuePriority = currentEventQueuePriority;
    currentTimers = null;
    currentEventQueue = [];
    currentEventQueuePriority = ContinuousEvent;
    // nodeType 9 is DOCUMENT_NODE
    currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument;
    // We might want to control timeStamp another way here
    currentTimeStamp = nativeEvent.timeStamp;
    try {
      traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);
      processEventQueue();
    } finally {
      currentTimers = previousTimers;
      currentInstance = previousInstance;
      currentEventQueue = previousEventQueue;
      currentTimeStamp = previousTimeStamp;
      currentDocument = previousDocument;
      currentEventQueuePriority = previousEventQueuePriority;
    }
  }
}

function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {
  for (var i = 0; i < rootEventTypes.length; i++) {
    var rootEventType = rootEventTypes[i];
    registerRootEventType(rootEventType, responderInstance);
  }
}

function registerRootEventType(rootEventType, eventResponderInstance) {
  var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);
  if (rootEventResponderInstances === undefined) {
    rootEventResponderInstances = new Set();
    rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);
  }
  var rootEventTypesSet = eventResponderInstance.rootEventTypes;
  if (rootEventTypesSet === null) {
    rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();
  }
  (function () {
    if (!!rootEventTypesSet.has(rootEventType)) {
      {
        throw ReactError(Error('addRootEventTypes() found a duplicate root event type of "' + rootEventType + '". This might be because the event type exists in the event responder "rootEventTypes" array or because of a previous addRootEventTypes() using this root event type.'));
      }
    }
  })();
  rootEventTypesSet.add(rootEventType);
  rootEventResponderInstances.add(eventResponderInstance);
}

/**
 * `ReactInstanceMap` maintains a mapping from a public facing stateful
 * instance (key) and the internal representation (value). This allows public
 * methods to accept the user facing instance as an argument and map them back
 * to internal methods.
 *
 * Note that this module is currently shared and assumed to be stateless.
 * If this becomes an actual Map, that will break.
 */

/**
 * This API should be called `delete` but we'd have to make sure to always
 * transform these to strings for IE support. When this transform is fully
 * supported we can rename it.
 */


function get(key) {
  return key._reactInternalFiber;
}

function has(key) {
  return key._reactInternalFiber !== undefined;
}

function set(key, value) {
  key._reactInternalFiber = value;
}

// Don't change these two values. They're used by React Dev Tools.
var NoEffect = /*              */0;
var PerformedWork = /*         */1;

// You can change the rest (and add more).
var Placement = /*             */2;
var Update = /*                */4;
var PlacementAndUpdate = /*    */6;
var Deletion = /*              */8;
var ContentReset = /*          */16;
var Callback = /*              */32;
var DidCapture = /*            */64;
var Ref = /*                   */128;
var Snapshot = /*              */256;
var Passive = /*               */512;

// Passive & Update & Callback & Ref & Snapshot
var LifecycleEffectMask = /*   */932;

// Union of all host effects
var HostEffectMask = /*        */1023;

var Incomplete = /*            */1024;
var ShouldCapture = /*         */2048;

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;

var MOUNTING = 1;
var MOUNTED = 2;
var UNMOUNTED = 3;

function isFiberMountedImpl(fiber) {
  var node = fiber;
  if (!fiber.alternate) {
    // If there is no alternate, this might be a new tree that isn't inserted
    // yet. If it is, then it will have a pending insertion effect on it.
    if ((node.effectTag & Placement) !== NoEffect) {
      return MOUNTING;
    }
    while (node.return) {
      node = node.return;
      if ((node.effectTag & Placement) !== NoEffect) {
        return MOUNTING;
      }
    }
  } else {
    while (node.return) {
      node = node.return;
    }
  }
  if (node.tag === HostRoot) {
    // TODO: Check if this was a nested HostRoot when used with
    // renderContainerIntoSubtree.
    return MOUNTED;
  }
  // If we didn't hit the root, that means that we're in an disconnected tree
  // that has been unmounted.
  return UNMOUNTED;
}

function isFiberMounted(fiber) {
  return isFiberMountedImpl(fiber) === MOUNTED;
}

function isMounted(component) {
  {
    var owner = ReactCurrentOwner$1.current;
    if (owner !== null && owner.tag === ClassComponent) {
      var ownerFiber = owner;
      var instance = ownerFiber.stateNode;
      !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
      instance._warnedAboutRefsInRender = true;
    }
  }

  var fiber = get(component);
  if (!fiber) {
    return false;
  }
  return isFiberMountedImpl(fiber) === MOUNTED;
}

function assertIsMounted(fiber) {
  (function () {
    if (!(isFiberMountedImpl(fiber) === MOUNTED)) {
      {
        throw ReactError(Error('Unable to find node on an unmounted component.'));
      }
    }
  })();
}

function findCurrentFiberUsingSlowPath(fiber) {
  var alternate = fiber.alternate;
  if (!alternate) {
    // If there is no alternate, then we only need to check if it is mounted.
    var state = isFiberMountedImpl(fiber);
    (function () {
      if (!(state !== UNMOUNTED)) {
        {
          throw ReactError(Error('Unable to find node on an unmounted component.'));
        }
      }
    })();
    if (state === MOUNTING) {
      return null;
    }
    return fiber;
  }
  // If we have two possible branches, we'll walk backwards up to the root
  // to see what path the root points to. On the way we may hit one of the
  // special cases and we'll deal with them.
  var a = fiber;
  var b = alternate;
  while (true) {
    var parentA = a.return;
    if (parentA === null) {
      // We're at the root.
      break;
    }
    var parentB = parentA.alternate;
    if (parentB === null) {
      // There is no alternate. This is an unusual case. Currently, it only
      // happens when a Suspense component is hidden. An extra fragment fiber
      // is inserted in between the Suspense fiber and its children. Skip
      // over this extra fragment fiber and proceed to the next parent.
      var nextParent = parentA.return;
      if (nextParent !== null) {
        a = b = nextParent;
        continue;
      }
      // If there's no parent, we're at the root.
      break;
    }

    // If both copies of the parent fiber point to the same child, we can
    // assume that the child is current. This happens when we bailout on low
    // priority: the bailed out fiber's child reuses the current child.
    if (parentA.child === parentB.child) {
      var child = parentA.child;
      while (child) {
        if (child === a) {
          // We've determined that A is the current branch.
          assertIsMounted(parentA);
          return fiber;
        }
        if (child === b) {
          // We've determined that B is the current branch.
          assertIsMounted(parentA);
          return alternate;
        }
        child = child.sibling;
      }
      // We should never have an alternate for any mounting node. So the only
      // way this could possibly happen is if this was unmounted, if at all.
      (function () {
        {
          {
            throw ReactError(Error('Unable to find node on an unmounted component.'));
          }
        }
      })();
    }

    if (a.return !== b.return) {
      // The return pointer of A and the return pointer of B point to different
      // fibers. We assume that return pointers never criss-cross, so A must
      // belong to the child set of A.return, and B must belong to the child
      // set of B.return.
      a = parentA;
      b = parentB;
    } else {
      // The return pointers point to the same fiber. We'll have to use the
      // default, slow path: scan the child sets of each parent alternate to see
      // which child belongs to which set.
      //
      // Search parent A's child set
      var didFindChild = false;
      var _child = parentA.child;
      while (_child) {
        if (_child === a) {
          didFindChild = true;
          a = parentA;
          b = parentB;
          break;
        }
        if (_child === b) {
          didFindChild = true;
          b = parentA;
          a = parentB;
          break;
        }
        _child = _child.sibling;
      }
      if (!didFindChild) {
        // Search parent B's child set
        _child = parentB.child;
        while (_child) {
          if (_child === a) {
            didFindChild = true;
            a = parentB;
            b = parentA;
            break;
          }
          if (_child === b) {
            didFindChild = true;
            b = parentB;
            a = parentA;
            break;
          }
          _child = _child.sibling;
        }
        (function () {
          if (!didFindChild) {
            {
              throw ReactError(Error('Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.'));
            }
          }
        })();
      }
    }

    (function () {
      if (!(a.alternate === b)) {
        {
          throw ReactError(Error('Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }
  // If the root is not a host container, we're in a disconnected tree. I.e.
  // unmounted.
  (function () {
    if (!(a.tag === HostRoot)) {
      {
        throw ReactError(Error('Unable to find node on an unmounted component.'));
      }
    }
  })();
  if (a.stateNode.current === a) {
    // We've determined that A is the current branch.
    return fiber;
  }
  // Otherwise B has to be current branch.
  return alternate;
}

function findCurrentHostFiber(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);
  if (!currentParent) {
    return null;
  }

  // Next we'll drill down this component to find the first HostComponent/Text.
  var node = currentParent;
  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      return node;
    } else if (node.child) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === currentParent) {
      return null;
    }
    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable
  return null;
}

function findCurrentHostFiberWithNoPortals(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);
  if (!currentParent) {
    return null;
  }

  // Next we'll drill down this component to find the first HostComponent/Text.
  var node = currentParent;
  while (true) {
    if (node.tag === HostComponent || node.tag === HostText || node.tag === FundamentalComponent) {
      return node;
    } else if (node.child && node.tag !== HostPortal) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === currentParent) {
      return null;
    }
    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable
  return null;
}

function addEventBubbleListener(element, eventType, listener) {
  element.addEventListener(eventType, listener, false);
}

function addEventCaptureListener(element, eventType, listener) {
  element.addEventListener(eventType, listener, true);
}

function addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) {
  element.addEventListener(eventType, listener, {
    capture: true,
    passive: passive
  });
}

/**
 * @interface Event
 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
 */
var SyntheticAnimationEvent = SyntheticEvent.extend({
  animationName: null,
  elapsedTime: null,
  pseudoElement: null
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/clipboard-apis/
 */
var SyntheticClipboardEvent = SyntheticEvent.extend({
  clipboardData: function (event) {
    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  }
});

/**
 * @interface FocusEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticFocusEvent = SyntheticUIEvent.extend({
  relatedTarget: null
});

/**
 * `charCode` represents the actual "character code" and is safe to use with
 * `String.fromCharCode`. As such, only keys that correspond to printable
 * characters produce a valid `charCode`, the only exception to this is Enter.
 * The Tab-key is considered non-printable and does not have a `charCode`,
 * presumably because it does not produce a tab-character in browsers.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {number} Normalized `charCode` property.
 */
function getEventCharCode(nativeEvent) {
  var charCode = void 0;
  var keyCode = nativeEvent.keyCode;

  if ('charCode' in nativeEvent) {
    charCode = nativeEvent.charCode;

    // FF does not set `charCode` for the Enter-key, check against `keyCode`.
    if (charCode === 0 && keyCode === 13) {
      charCode = 13;
    }
  } else {
    // IE8 does not implement `charCode`, but `keyCode` has the correct value.
    charCode = keyCode;
  }

  // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  // report Enter as charCode 10 when ctrl is pressed.
  if (charCode === 10) {
    charCode = 13;
  }

  // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  // Must not discard the (non-)printable Enter-key.
  if (charCode >= 32 || charCode === 13) {
    return charCode;
  }

  return 0;
}

/**
 * Normalization of deprecated HTML5 `key` values
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */
var normalizeKey = {
  Esc: 'Escape',
  Spacebar: ' ',
  Left: 'ArrowLeft',
  Up: 'ArrowUp',
  Right: 'ArrowRight',
  Down: 'ArrowDown',
  Del: 'Delete',
  Win: 'OS',
  Menu: 'ContextMenu',
  Apps: 'ContextMenu',
  Scroll: 'ScrollLock',
  MozPrintableKey: 'Unidentified'
};

/**
 * Translation from legacy `keyCode` to HTML5 `key`
 * Only special keys supported, all others depend on keyboard layout or browser
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */
var translateToKey = {
  '8': 'Backspace',
  '9': 'Tab',
  '12': 'Clear',
  '13': 'Enter',
  '16': 'Shift',
  '17': 'Control',
  '18': 'Alt',
  '19': 'Pause',
  '20': 'CapsLock',
  '27': 'Escape',
  '32': ' ',
  '33': 'PageUp',
  '34': 'PageDown',
  '35': 'End',
  '36': 'Home',
  '37': 'ArrowLeft',
  '38': 'ArrowUp',
  '39': 'ArrowRight',
  '40': 'ArrowDown',
  '45': 'Insert',
  '46': 'Delete',
  '112': 'F1',
  '113': 'F2',
  '114': 'F3',
  '115': 'F4',
  '116': 'F5',
  '117': 'F6',
  '118': 'F7',
  '119': 'F8',
  '120': 'F9',
  '121': 'F10',
  '122': 'F11',
  '123': 'F12',
  '144': 'NumLock',
  '145': 'ScrollLock',
  '224': 'Meta'
};

/**
 * @param {object} nativeEvent Native browser event.
 * @return {string} Normalized `key` property.
 */
function getEventKey(nativeEvent) {
  if (nativeEvent.key) {
    // Normalize inconsistent values reported by browsers due to
    // implementations of a working draft specification.

    // FireFox implements `key` but returns `MozPrintableKey` for all
    // printable characters (normalized to `Unidentified`), ignore it.
    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
    if (key !== 'Unidentified') {
      return key;
    }
  }

  // Browser does not implement `key`, polyfill as much of it as we can.
  if (nativeEvent.type === 'keypress') {
    var charCode = getEventCharCode(nativeEvent);

    // The enter-key is technically both printable and non-printable and can
    // thus be captured by `keypress`, no other non-printable key should.
    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  }
  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
    // While user keyboard layout determines the actual meaning of each
    // `keyCode` value, almost all function keys have a universal value.
    return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  }
  return '';
}

/**
 * @interface KeyboardEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
  key: getEventKey,
  location: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  repeat: null,
  locale: null,
  getModifierState: getEventModifierState,
  // Legacy Interface
  charCode: function (event) {
    // `charCode` is the result of a KeyPress event and represents the value of
    // the actual printable character.

    // KeyPress is deprecated, but its replacement is not yet final and not
    // implemented in any major browser. Only KeyPress has charCode.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }
    return 0;
  },
  keyCode: function (event) {
    // `keyCode` is the result of a KeyDown/Up event and represents the value of
    // physical keyboard key.

    // The actual meaning of the value depends on the users' keyboard layout
    // which cannot be detected. Assuming that it is a US keyboard layout
    // provides a surprisingly accurate mapping for US and European users.
    // Due to this, it is left to the user to implement at this time.
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }
    return 0;
  },
  which: function (event) {
    // `which` is an alias for either `keyCode` or `charCode` depending on the
    // type of the event.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }
    return 0;
  }
});

/**
 * @interface DragEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticDragEvent = SyntheticMouseEvent.extend({
  dataTransfer: null
});

/**
 * @interface TouchEvent
 * @see http://www.w3.org/TR/touch-events/
 */
var SyntheticTouchEvent = SyntheticUIEvent.extend({
  touches: null,
  targetTouches: null,
  changedTouches: null,
  altKey: null,
  metaKey: null,
  ctrlKey: null,
  shiftKey: null,
  getModifierState: getEventModifierState
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
 */
var SyntheticTransitionEvent = SyntheticEvent.extend({
  propertyName: null,
  elapsedTime: null,
  pseudoElement: null
});

/**
 * @interface WheelEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticWheelEvent = SyntheticMouseEvent.extend({
  deltaX: function (event) {
    return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  },
  deltaY: function (event) {
    return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
    'wheelDelta' in event ? -event.wheelDelta : 0;
  },

  deltaZ: null,

  // Browsers without "deltaMode" is reporting in raw wheel delta where one
  // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  deltaMode: null
});

/**
 * Turns
 * ['abort', ...]
 * into
 * eventTypes = {
 *   'abort': {
 *     phasedRegistrationNames: {
 *       bubbled: 'onAbort',
 *       captured: 'onAbortCapture',
 *     },
 *     dependencies: [TOP_ABORT],
 *   },
 *   ...
 * };
 * topLevelEventsToDispatchConfig = new Map([
 *   [TOP_ABORT, { sameConfig }],
 * ]);
 */

var eventTuples = [
// Discrete events
[TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent],

// User-blocking events
[TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent],

// Continuous events
[TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]];

var eventTypes$4 = {};
var topLevelEventsToDispatchConfig = {};

for (var i = 0; i < eventTuples.length; i++) {
  var eventTuple = eventTuples[i];
  var topEvent = eventTuple[0];
  var event = eventTuple[1];
  var eventPriority = eventTuple[2];

  var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
  var onEvent = 'on' + capitalizedEvent;

  var config = {
    phasedRegistrationNames: {
      bubbled: onEvent,
      captured: onEvent + 'Capture'
    },
    dependencies: [topEvent],
    eventPriority: eventPriority
  };
  eventTypes$4[event] = config;
  topLevelEventsToDispatchConfig[topEvent] = config;
}

// Only used in DEV for exhaustiveness validation.
var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];

var SimpleEventPlugin = {
  eventTypes: eventTypes$4,

  getEventPriority: function (topLevelType) {
    var config = topLevelEventsToDispatchConfig[topLevelType];
    return config !== undefined ? config.eventPriority : ContinuousEvent;
  },


  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
    if (!dispatchConfig) {
      return null;
    }
    var EventConstructor = void 0;
    switch (topLevelType) {
      case TOP_KEY_PRESS:
        // Firefox creates a keypress event for function keys too. This removes
        // the unwanted keypress events. Enter is however both printable and
        // non-printable. One would expect Tab to be as well (but it isn't).
        if (getEventCharCode(nativeEvent) === 0) {
          return null;
        }
      /* falls through */
      case TOP_KEY_DOWN:
      case TOP_KEY_UP:
        EventConstructor = SyntheticKeyboardEvent;
        break;
      case TOP_BLUR:
      case TOP_FOCUS:
        EventConstructor = SyntheticFocusEvent;
        break;
      case TOP_CLICK:
        // Firefox creates a click event on right mouse clicks. This removes the
        // unwanted click events.
        if (nativeEvent.button === 2) {
          return null;
        }
      /* falls through */
      case TOP_AUX_CLICK:
      case TOP_DOUBLE_CLICK:
      case TOP_MOUSE_DOWN:
      case TOP_MOUSE_MOVE:
      case TOP_MOUSE_UP:
      // TODO: Disabled elements should not respond to mouse events
      /* falls through */
      case TOP_MOUSE_OUT:
      case TOP_MOUSE_OVER:
      case TOP_CONTEXT_MENU:
        EventConstructor = SyntheticMouseEvent;
        break;
      case TOP_DRAG:
      case TOP_DRAG_END:
      case TOP_DRAG_ENTER:
      case TOP_DRAG_EXIT:
      case TOP_DRAG_LEAVE:
      case TOP_DRAG_OVER:
      case TOP_DRAG_START:
      case TOP_DROP:
        EventConstructor = SyntheticDragEvent;
        break;
      case TOP_TOUCH_CANCEL:
      case TOP_TOUCH_END:
      case TOP_TOUCH_MOVE:
      case TOP_TOUCH_START:
        EventConstructor = SyntheticTouchEvent;
        break;
      case TOP_ANIMATION_END:
      case TOP_ANIMATION_ITERATION:
      case TOP_ANIMATION_START:
        EventConstructor = SyntheticAnimationEvent;
        break;
      case TOP_TRANSITION_END:
        EventConstructor = SyntheticTransitionEvent;
        break;
      case TOP_SCROLL:
        EventConstructor = SyntheticUIEvent;
        break;
      case TOP_WHEEL:
        EventConstructor = SyntheticWheelEvent;
        break;
      case TOP_COPY:
      case TOP_CUT:
      case TOP_PASTE:
        EventConstructor = SyntheticClipboardEvent;
        break;
      case TOP_GOT_POINTER_CAPTURE:
      case TOP_LOST_POINTER_CAPTURE:
      case TOP_POINTER_CANCEL:
      case TOP_POINTER_DOWN:
      case TOP_POINTER_MOVE:
      case TOP_POINTER_OUT:
      case TOP_POINTER_OVER:
      case TOP_POINTER_UP:
        EventConstructor = SyntheticPointerEvent;
        break;
      default:
        {
          if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
            warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
          }
        }
        // HTML Events
        // @see http://www.w3.org/TR/html5/index.html#events-0
        EventConstructor = SyntheticEvent;
        break;
    }
    var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
    accumulateTwoPhaseDispatches(event);
    return event;
  }
};

var passiveBrowserEventsSupported = false;

// Check if browser support events with passive listeners
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
if (enableFlareAPI && canUseDOM) {
  try {
    var options = {};
    // $FlowFixMe: Ignore Flow complaining about needing a value
    Object.defineProperty(options, 'passive', {
      get: function () {
        passiveBrowserEventsSupported = true;
      }
    });
    window.addEventListener('test', options, options);
    window.removeEventListener('test', options, options);
  } catch (e) {
    passiveBrowserEventsSupported = false;
  }
}

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
var runWithPriority = Scheduler.unstable_runWithPriority;
var getEventPriority = SimpleEventPlugin.getEventPriority;


var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
var callbackBookkeepingPool = [];

/**
 * Find the deepest React component completely containing the root of the
 * passed-in instance (for use when entire React trees are nested within each
 * other). If React trees are not nested, returns null.
 */
function findRootContainerNode(inst) {
  // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  // traversal, but caching is difficult to do correctly without using a
  // mutation observer to listen for all DOM changes.
  while (inst.return) {
    inst = inst.return;
  }
  if (inst.tag !== HostRoot) {
    // This can happen if we're in a detached tree.
    return null;
  }
  return inst.stateNode.containerInfo;
}

// Used to store ancestor hierarchy in top level callback
function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
  if (callbackBookkeepingPool.length) {
    var instance = callbackBookkeepingPool.pop();
    instance.topLevelType = topLevelType;
    instance.nativeEvent = nativeEvent;
    instance.targetInst = targetInst;
    return instance;
  }
  return {
    topLevelType: topLevelType,
    nativeEvent: nativeEvent,
    targetInst: targetInst,
    ancestors: []
  };
}

function releaseTopLevelCallbackBookKeeping(instance) {
  instance.topLevelType = null;
  instance.nativeEvent = null;
  instance.targetInst = null;
  instance.ancestors.length = 0;
  if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
    callbackBookkeepingPool.push(instance);
  }
}

function handleTopLevel(bookKeeping) {
  var targetInst = bookKeeping.targetInst;

  // Loop through the hierarchy, in case there's any nested components.
  // It's important that we build the array of ancestors before calling any
  // event handlers, because event handlers can modify the DOM, leading to
  // inconsistencies with ReactMount's node cache. See #1105.
  var ancestor = targetInst;
  do {
    if (!ancestor) {
      var _ancestors = bookKeeping.ancestors;
      _ancestors.push(ancestor);
      break;
    }
    var root = findRootContainerNode(ancestor);
    if (!root) {
      break;
    }
    bookKeeping.ancestors.push(ancestor);
    ancestor = getClosestInstanceFromNode(root);
  } while (ancestor);

  for (var i = 0; i < bookKeeping.ancestors.length; i++) {
    targetInst = bookKeeping.ancestors[i];
    var eventTarget = getEventTarget(bookKeeping.nativeEvent);
    var _topLevelType = bookKeeping.topLevelType;
    var _nativeEvent = bookKeeping.nativeEvent;

    runExtractedPluginEventsInBatch(_topLevelType, targetInst, _nativeEvent, eventTarget);
  }
}

// TODO: can we stop exporting these?
var _enabled = true;

function setEnabled(enabled) {
  _enabled = !!enabled;
}

function isEnabled() {
  return _enabled;
}

function trapBubbledEvent(topLevelType, element) {
  trapEventForPluginEventSystem(element, topLevelType, false);
}

function trapCapturedEvent(topLevelType, element) {
  trapEventForPluginEventSystem(element, topLevelType, true);
}

function trapEventForResponderEventSystem(element, topLevelType, passive) {
  if (enableFlareAPI) {
    var rawEventName = getRawEventName(topLevelType);
    var eventFlags = RESPONDER_EVENT_SYSTEM;

    // If passive option is not supported, then the event will be
    // active and not passive, but we flag it as using not being
    // supported too. This way the responder event plugins know,
    // and can provide polyfills if needed.
    if (passive) {
      if (passiveBrowserEventsSupported) {
        eventFlags |= IS_PASSIVE;
      } else {
        eventFlags |= IS_ACTIVE;
        eventFlags |= PASSIVE_NOT_SUPPORTED;
        passive = false;
      }
    } else {
      eventFlags |= IS_ACTIVE;
    }
    // Check if interactive and wrap in discreteUpdates
    var listener = dispatchEvent.bind(null, topLevelType, eventFlags);
    if (passiveBrowserEventsSupported) {
      addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive);
    } else {
      addEventCaptureListener(element, rawEventName, listener);
    }
  }
}

function trapEventForPluginEventSystem(element, topLevelType, capture) {
  var listener = void 0;
  switch (getEventPriority(topLevelType)) {
    case DiscreteEvent:
      listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
      break;
    case UserBlockingEvent:
      listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
      break;
    case ContinuousEvent:
    default:
      listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
      break;
  }

  var rawEventName = getRawEventName(topLevelType);
  if (capture) {
    addEventCaptureListener(element, rawEventName, listener);
  } else {
    addEventBubbleListener(element, rawEventName, listener);
  }
}

function dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) {
  flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
  discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent);
}

function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) {
  if (enableUserBlockingEvents) {
    runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent));
  } else {
    dispatchEvent(topLevelType, eventSystemFlags, nativeEvent);
  }
}

function dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
  var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);

  try {
    // Event queue being processed in the same cycle allows
    // `preventDefault`.
    batchedEventUpdates(handleTopLevel, bookKeeping);
  } finally {
    releaseTopLevelCallbackBookKeeping(bookKeeping);
  }
}

function dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
  if (!_enabled) {
    return;
  }
  var nativeEventTarget = getEventTarget(nativeEvent);
  var targetInst = getClosestInstanceFromNode(nativeEventTarget);

  if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {
    // If we get an event (ex: img onload) before committing that
    // component's mount, ignore it for now (that is, treat it as if it was an
    // event on a non-React tree). We might also consider queueing events and
    // dispatching them after the mount.
    targetInst = null;
  }

  if (enableFlareAPI) {
    if (eventSystemFlags === PLUGIN_EVENT_SYSTEM) {
      dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
    } else {
      // React Flare event system
      dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
    }
  } else {
    dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
  }
}

/**
 * Summary of `ReactBrowserEventEmitter` event handling:
 *
 *  - Top-level delegation is used to trap most native browser events. This
 *    may only occur in the main thread and is the responsibility of
 *    ReactDOMEventListener, which is injected and can therefore support
 *    pluggable event sources. This is the only work that occurs in the main
 *    thread.
 *
 *  - We normalize and de-duplicate events to account for browser quirks. This
 *    may be done in the worker thread.
 *
 *  - Forward these native events (with the associated top-level type used to
 *    trap it) to `EventPluginHub`, which in turn will ask plugins if they want
 *    to extract any synthetic events.
 *
 *  - The `EventPluginHub` will then process each event by annotating them with
 *    "dispatches", a sequence of listeners and IDs that care about that event.
 *
 *  - The `EventPluginHub` then dispatches the events.
 *
 * Overview of React and the event system:
 *
 * +------------+    .
 * |    DOM     |    .
 * +------------+    .
 *       |           .
 *       v           .
 * +------------+    .
 * | ReactEvent |    .
 * |  Listener  |    .
 * +------------+    .                         +-----------+
 *       |           .               +--------+|SimpleEvent|
 *       |           .               |         |Plugin     |
 * +-----|------+    .               v         +-----------+
 * |     |      |    .    +--------------+                    +------------+
 * |     +-----------.--->|EventPluginHub|                    |    Event   |
 * |            |    .    |              |     +-----------+  | Propagators|
 * | ReactEvent |    .    |              |     |TapEvent   |  |------------|
 * |  Emitter   |    .    |              |<---+|Plugin     |  |other plugin|
 * |            |    .    |              |     +-----------+  |  utilities |
 * |     +-----------.--->|              |                    +------------+
 * |     |      |    .    +--------------+
 * +-----|------+    .                ^        +-----------+
 *       |           .                |        |Enter/Leave|
 *       +           .                +-------+|Plugin     |
 * +-------------+   .                         +-----------+
 * | application |   .
 * |-------------|   .
 * |             |   .
 * |             |   .
 * +-------------+   .
 *                   .
 *    React Core     .  General Purpose Event Plugin System
 */

var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
var elementListeningSets = new PossiblyWeakMap();

function getListeningSetForElement(element) {
  var listeningSet = elementListeningSets.get(element);
  if (listeningSet === undefined) {
    listeningSet = new Set();
    elementListeningSets.set(element, listeningSet);
  }
  return listeningSet;
}

/**
 * We listen for bubbled touch events on the document object.
 *
 * Firefox v8.01 (and possibly others) exhibited strange behavior when
 * mounting `onmousemove` events at some node that was not the document
 * element. The symptoms were that if your mouse is not moving over something
 * contained within that mount point (for example on the background) the
 * top-level listeners for `onmousemove` won't be called. However, if you
 * register the `mousemove` on the document object, then it will of course
 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
 * top-level listeners to the document object only, at least for these
 * movement types of events and possibly all events.
 *
 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
 *
 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
 * they bubble to document.
 *
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @param {object} mountAt Container where to mount the listener
 */
function listenTo(registrationName, mountAt) {
  var listeningSet = getListeningSetForElement(mountAt);
  var dependencies = registrationNameDependencies[registrationName];

  for (var i = 0; i < dependencies.length; i++) {
    var dependency = dependencies[i];
    if (!listeningSet.has(dependency)) {
      switch (dependency) {
        case TOP_SCROLL:
          trapCapturedEvent(TOP_SCROLL, mountAt);
          break;
        case TOP_FOCUS:
        case TOP_BLUR:
          trapCapturedEvent(TOP_FOCUS, mountAt);
          trapCapturedEvent(TOP_BLUR, mountAt);
          // We set the flag for a single dependency later in this function,
          // but this ensures we mark both as attached rather than just one.
          listeningSet.add(TOP_BLUR);
          listeningSet.add(TOP_FOCUS);
          break;
        case TOP_CANCEL:
        case TOP_CLOSE:
          if (isEventSupported(getRawEventName(dependency))) {
            trapCapturedEvent(dependency, mountAt);
          }
          break;
        case TOP_INVALID:
        case TOP_SUBMIT:
        case TOP_RESET:
          // We listen to them on the target DOM elements.
          // Some of them bubble so we don't want them to fire twice.
          break;
        default:
          // By default, listen on the top level to all non-media events.
          // Media events don't bubble so adding the listener wouldn't do anything.
          var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1;
          if (!isMediaEvent) {
            trapBubbledEvent(dependency, mountAt);
          }
          break;
      }
      listeningSet.add(dependency);
    }
  }
}

function isListeningToAllDependencies(registrationName, mountAt) {
  var listeningSet = getListeningSetForElement(mountAt);
  var dependencies = registrationNameDependencies[registrationName];

  for (var i = 0; i < dependencies.length; i++) {
    var dependency = dependencies[i];
    if (!listeningSet.has(dependency)) {
      return false;
    }
  }
  return true;
}

function getActiveElement(doc) {
  doc = doc || (typeof document !== 'undefined' ? document : undefined);
  if (typeof doc === 'undefined') {
    return null;
  }
  try {
    return doc.activeElement || doc.body;
  } catch (e) {
    return doc.body;
  }
}

/**
 * Given any node return the first leaf node without children.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {DOMElement|DOMTextNode}
 */
function getLeafNode(node) {
  while (node && node.firstChild) {
    node = node.firstChild;
  }
  return node;
}

/**
 * Get the next sibling within a container. This will walk up the
 * DOM if a node's siblings have been exhausted.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {?DOMElement|DOMTextNode}
 */
function getSiblingNode(node) {
  while (node) {
    if (node.nextSibling) {
      return node.nextSibling;
    }
    node = node.parentNode;
  }
}

/**
 * Get object describing the nodes which contain characters at offset.
 *
 * @param {DOMElement|DOMTextNode} root
 * @param {number} offset
 * @return {?object}
 */
function getNodeForCharacterOffset(root, offset) {
  var node = getLeafNode(root);
  var nodeStart = 0;
  var nodeEnd = 0;

  while (node) {
    if (node.nodeType === TEXT_NODE) {
      nodeEnd = nodeStart + node.textContent.length;

      if (nodeStart <= offset && nodeEnd >= offset) {
        return {
          node: node,
          offset: offset - nodeStart
        };
      }

      nodeStart = nodeEnd;
    }

    node = getLeafNode(getSiblingNode(node));
  }
}

/**
 * @param {DOMElement} outerNode
 * @return {?object}
 */
function getOffsets(outerNode) {
  var ownerDocument = outerNode.ownerDocument;

  var win = ownerDocument && ownerDocument.defaultView || window;
  var selection = win.getSelection && win.getSelection();

  if (!selection || selection.rangeCount === 0) {
    return null;
  }

  var anchorNode = selection.anchorNode,
      anchorOffset = selection.anchorOffset,
      focusNode = selection.focusNode,
      focusOffset = selection.focusOffset;

  // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  // expose properties, triggering a "Permission denied error" if any of its
  // properties are accessed. The only seemingly possible way to avoid erroring
  // is to access a property that typically works for non-anonymous divs and
  // catch any error that may otherwise arise. See
  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427

  try {
    /* eslint-disable no-unused-expressions */
    anchorNode.nodeType;
    focusNode.nodeType;
    /* eslint-enable no-unused-expressions */
  } catch (e) {
    return null;
  }

  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
}

/**
 * Returns {start, end} where `start` is the character/codepoint index of
 * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
 * `end` is the index of (focusNode, focusOffset).
 *
 * Returns null if you pass in garbage input but we should probably just crash.
 *
 * Exported only for testing.
 */
function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  var length = 0;
  var start = -1;
  var end = -1;
  var indexWithinAnchor = 0;
  var indexWithinFocus = 0;
  var node = outerNode;
  var parentNode = null;

  outer: while (true) {
    var next = null;

    while (true) {
      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
        start = length + anchorOffset;
      }
      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
        end = length + focusOffset;
      }

      if (node.nodeType === TEXT_NODE) {
        length += node.nodeValue.length;
      }

      if ((next = node.firstChild) === null) {
        break;
      }
      // Moving from `node` to its first child `next`.
      parentNode = node;
      node = next;
    }

    while (true) {
      if (node === outerNode) {
        // If `outerNode` has children, this is always the second time visiting
        // it. If it has no children, this is still the first loop, and the only
        // valid selection is anchorNode and focusNode both equal to this node
        // and both offsets 0, in which case we will have handled above.
        break outer;
      }
      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
        start = length;
      }
      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
        end = length;
      }
      if ((next = node.nextSibling) !== null) {
        break;
      }
      node = parentNode;
      parentNode = node.parentNode;
    }

    // Moving from `node` to its next sibling `next`.
    node = next;
  }

  if (start === -1 || end === -1) {
    // This should never happen. (Would happen if the anchor/focus nodes aren't
    // actually inside the passed-in node.)
    return null;
  }

  return {
    start: start,
    end: end
  };
}

/**
 * In modern non-IE browsers, we can support both forward and backward
 * selections.
 *
 * Note: IE10+ supports the Selection object, but it does not support
 * the `extend` method, which means that even in modern IE, it's not possible
 * to programmatically create a backward selection. Thus, for all IE
 * versions, we use the old IE API to create our selections.
 *
 * @param {DOMElement|DOMTextNode} node
 * @param {object} offsets
 */
function setOffsets(node, offsets) {
  var doc = node.ownerDocument || document;
  var win = doc && doc.defaultView || window;

  // Edge fails with "Object expected" in some scenarios.
  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  // fails when pasting 100+ items)
  if (!win.getSelection) {
    return;
  }

  var selection = win.getSelection();
  var length = node.textContent.length;
  var start = Math.min(offsets.start, length);
  var end = offsets.end === undefined ? start : Math.min(offsets.end, length);

  // IE 11 uses modern selection, but doesn't support the extend method.
  // Flip backward selections, so we can set with a single range.
  if (!selection.extend && start > end) {
    var temp = end;
    end = start;
    start = temp;
  }

  var startMarker = getNodeForCharacterOffset(node, start);
  var endMarker = getNodeForCharacterOffset(node, end);

  if (startMarker && endMarker) {
    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
      return;
    }
    var range = doc.createRange();
    range.setStart(startMarker.node, startMarker.offset);
    selection.removeAllRanges();

    if (start > end) {
      selection.addRange(range);
      selection.extend(endMarker.node, endMarker.offset);
    } else {
      range.setEnd(endMarker.node, endMarker.offset);
      selection.addRange(range);
    }
  }
}

function isTextNode(node) {
  return node && node.nodeType === TEXT_NODE;
}

function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if ('contains' in outerNode) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}

function isInDocument(node) {
  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
}

function isSameOriginFrame(iframe) {
  try {
    // Accessing the contentDocument of a HTMLIframeElement can cause the browser
    // to throw, e.g. if it has a cross-origin src attribute.
    // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
    // iframe.contentDocument.defaultView;
    // A safety way is to access one of the cross origin properties: Window or Location
    // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl

    return typeof iframe.contentWindow.location.href === 'string';
  } catch (err) {
    return false;
  }
}

function getActiveElementDeep() {
  var win = window;
  var element = getActiveElement();
  while (element instanceof win.HTMLIFrameElement) {
    if (isSameOriginFrame(element)) {
      win = element.contentWindow;
    } else {
      return element;
    }
    element = getActiveElement(win.document);
  }
  return element;
}

/**
 * @ReactInputSelection: React input selection module. Based on Selection.js,
 * but modified to be suitable for react and has a couple of bug fixes (doesn't
 * assume buttons have range selections allowed).
 * Input selection module for React.
 */

/**
 * @hasSelectionCapabilities: we get the element types that support selection
 * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
 * and `selectionEnd` rows.
 */
function hasSelectionCapabilities(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
}

function getSelectionInformation() {
  var focusedElem = getActiveElementDeep();
  return {
    focusedElem: focusedElem,
    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null
  };
}

/**
 * @restoreSelection: If any selection information was potentially lost,
 * restore it. This is useful when performing operations that could remove dom
 * nodes and place them back in, resulting in focus being lost.
 */
function restoreSelection(priorSelectionInformation) {
  var curFocusedElem = getActiveElementDeep();
  var priorFocusedElem = priorSelectionInformation.focusedElem;
  var priorSelectionRange = priorSelectionInformation.selectionRange;
  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
      setSelection(priorFocusedElem, priorSelectionRange);
    }

    // Focusing a node can change the scroll position, which is undesirable
    var ancestors = [];
    var ancestor = priorFocusedElem;
    while (ancestor = ancestor.parentNode) {
      if (ancestor.nodeType === ELEMENT_NODE) {
        ancestors.push({
          element: ancestor,
          left: ancestor.scrollLeft,
          top: ancestor.scrollTop
        });
      }
    }

    if (typeof priorFocusedElem.focus === 'function') {
      priorFocusedElem.focus();
    }

    for (var i = 0; i < ancestors.length; i++) {
      var info = ancestors[i];
      info.element.scrollLeft = info.left;
      info.element.scrollTop = info.top;
    }
  }
}

/**
 * @getSelection: Gets the selection bounds of a focused textarea, input or
 * contentEditable node.
 * -@input: Look up selection bounds of this input
 * -@return {start: selectionStart, end: selectionEnd}
 */
function getSelection$1(input) {
  var selection = void 0;

  if ('selectionStart' in input) {
    // Modern browser with input or textarea.
    selection = {
      start: input.selectionStart,
      end: input.selectionEnd
    };
  } else {
    // Content editable or old IE textarea.
    selection = getOffsets(input);
  }

  return selection || { start: 0, end: 0 };
}

/**
 * @setSelection: Sets the selection bounds of a textarea or input and focuses
 * the input.
 * -@input     Set selection bounds of this input or textarea
 * -@offsets   Object of same form that is returned from get*
 */
function setSelection(input, offsets) {
  var start = offsets.start,
      end = offsets.end;

  if (end === undefined) {
    end = start;
  }

  if ('selectionStart' in input) {
    input.selectionStart = start;
    input.selectionEnd = Math.min(end, input.value.length);
  } else {
    setOffsets(input, offsets);
  }
}

var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;

var eventTypes$3 = {
  select: {
    phasedRegistrationNames: {
      bubbled: 'onSelect',
      captured: 'onSelectCapture'
    },
    dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
  }
};

var activeElement$1 = null;
var activeElementInst$1 = null;
var lastSelection = null;
var mouseDown = false;

/**
 * Get an object which is a unique representation of the current selection.
 *
 * The return value will not be consistent across nodes or browsers, but
 * two identical selections on the same node will return identical objects.
 *
 * @param {DOMElement} node
 * @return {object}
 */
function getSelection(node) {
  if ('selectionStart' in node && hasSelectionCapabilities(node)) {
    return {
      start: node.selectionStart,
      end: node.selectionEnd
    };
  } else {
    var win = node.ownerDocument && node.ownerDocument.defaultView || window;
    var selection = win.getSelection();
    return {
      anchorNode: selection.anchorNode,
      anchorOffset: selection.anchorOffset,
      focusNode: selection.focusNode,
      focusOffset: selection.focusOffset
    };
  }
}

/**
 * Get document associated with the event target.
 *
 * @param {object} nativeEventTarget
 * @return {Document}
 */
function getEventTargetDocument(eventTarget) {
  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
}

/**
 * Poll selection to see whether it's changed.
 *
 * @param {object} nativeEvent
 * @param {object} nativeEventTarget
 * @return {?SyntheticEvent}
 */
function constructSelectEvent(nativeEvent, nativeEventTarget) {
  // Ensure we have the right element, and that the user is not dragging a
  // selection (this matches native `select` event behavior). In HTML5, select
  // fires only on input and textarea thus if there's no focused element we
  // won't dispatch.
  var doc = getEventTargetDocument(nativeEventTarget);

  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
    return null;
  }

  // Only fire when selection has actually changed.
  var currentSelection = getSelection(activeElement$1);
  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;

    var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);

    syntheticEvent.type = 'select';
    syntheticEvent.target = activeElement$1;

    accumulateTwoPhaseDispatches(syntheticEvent);

    return syntheticEvent;
  }

  return null;
}

/**
 * This plugin creates an `onSelect` event that normalizes select events
 * across form elements.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - contentEditable
 *
 * This differs from native browser implementations in the following ways:
 * - Fires on contentEditable fields as well as inputs.
 * - Fires for collapsed selection.
 * - Fires after user input.
 */
var SelectEventPlugin = {
  eventTypes: eventTypes$3,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var doc = getEventTargetDocument(nativeEventTarget);
    // Track whether all listeners exists for this plugin. If none exist, we do
    // not extract events. See #3639.
    if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
      return null;
    }

    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;

    switch (topLevelType) {
      // Track the input node that has focus.
      case TOP_FOCUS:
        if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
          activeElement$1 = targetNode;
          activeElementInst$1 = targetInst;
          lastSelection = null;
        }
        break;
      case TOP_BLUR:
        activeElement$1 = null;
        activeElementInst$1 = null;
        lastSelection = null;
        break;
      // Don't fire the event while the user is dragging. This matches the
      // semantics of the native select event.
      case TOP_MOUSE_DOWN:
        mouseDown = true;
        break;
      case TOP_CONTEXT_MENU:
      case TOP_MOUSE_UP:
      case TOP_DRAG_END:
        mouseDown = false;
        return constructSelectEvent(nativeEvent, nativeEventTarget);
      // Chrome and IE fire non-standard event when selection is changed (and
      // sometimes when it hasn't). IE's event fires out of order with respect
      // to key and input events on deletion, so we discard it.
      //
      // Firefox doesn't support selectionchange, so check selection status
      // after each key entry. The selection changes after keydown and before
      // keyup, but we check on keydown as well in the case of holding down a
      // key, when multiple keydown events are fired but only one keyup is.
      // This is also our approach for IE handling, for the reason above.
      case TOP_SELECTION_CHANGE:
        if (skipSelectionChangeEvent) {
          break;
        }
      // falls through
      case TOP_KEY_DOWN:
      case TOP_KEY_UP:
        return constructSelectEvent(nativeEvent, nativeEventTarget);
    }

    return null;
  }
};

/**
 * Inject modules for resolving DOM hierarchy and plugin ordering.
 */
injection.injectEventPluginOrder(DOMEventPluginOrder);
setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);

/**
 * Some important event plugins included by default (without having to require
 * them).
 */
injection.injectEventPluginsByName({
  SimpleEventPlugin: SimpleEventPlugin,
  EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  ChangeEventPlugin: ChangeEventPlugin,
  SelectEventPlugin: SelectEventPlugin,
  BeforeInputEventPlugin: BeforeInputEventPlugin
});

function endsWith(subject, search) {
  var length = subject.length;
  return subject.substring(length - search.length, length) === search;
}

var didWarnSelectedSetOnOption = false;
var didWarnInvalidChild = false;

function flattenChildren(children) {
  var content = '';

  // Flatten children. We'll warn if they are invalid
  // during validateProps() which runs for hydration too.
  // Note that this would throw on non-element objects.
  // Elements are stringified (which is normally irrelevant
  // but matters for <fbt>).
  React.Children.forEach(children, function (child) {
    if (child == null) {
      return;
    }
    content += child;
    // Note: we don't warn about invalid children here.
    // Instead, this is done separately below so that
    // it happens during the hydration codepath too.
  });

  return content;
}

/**
 * Implements an <option> host component that warns when `selected` is set.
 */

function validateProps(element, props) {
  {
    // This mirrors the codepath above, but runs for hydration too.
    // Warn about invalid children here so that client and hydration are consistent.
    // TODO: this seems like it could cause a DEV-only throw for hydration
    // if children contains a non-element object. We should try to avoid that.
    if (typeof props.children === 'object' && props.children !== null) {
      React.Children.forEach(props.children, function (child) {
        if (child == null) {
          return;
        }
        if (typeof child === 'string' || typeof child === 'number') {
          return;
        }
        if (typeof child.type !== 'string') {
          return;
        }
        if (!didWarnInvalidChild) {
          didWarnInvalidChild = true;
          warning$1(false, 'Only strings and numbers are supported as <option> children.');
        }
      });
    }

    // TODO: Remove support for `selected` in <option>.
    if (props.selected != null && !didWarnSelectedSetOnOption) {
      warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
      didWarnSelectedSetOnOption = true;
    }
  }
}

function postMountWrapper$1(element, props) {
  // value="" should make a value attribute (#6219)
  if (props.value != null) {
    element.setAttribute('value', toString(getToStringValue(props.value)));
  }
}

function getHostProps$1(element, props) {
  var hostProps = _assign({ children: undefined }, props);
  var content = flattenChildren(props.children);

  if (content) {
    hostProps.children = content;
  }

  return hostProps;
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnValueDefaultValue$1 = void 0;

{
  didWarnValueDefaultValue$1 = false;
}

function getDeclarationErrorAddendum() {
  var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  if (ownerName) {
    return '\n\nCheck the render method of `' + ownerName + '`.';
  }
  return '';
}

var valuePropNames = ['value', 'defaultValue'];

/**
 * Validation function for `value` and `defaultValue`.
 */
function checkSelectPropTypes(props) {
  ReactControlledValuePropTypes.checkPropTypes('select', props);

  for (var i = 0; i < valuePropNames.length; i++) {
    var propName = valuePropNames[i];
    if (props[propName] == null) {
      continue;
    }
    var isArray = Array.isArray(props[propName]);
    if (props.multiple && !isArray) {
      warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
    } else if (!props.multiple && isArray) {
      warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
    }
  }
}

function updateOptions(node, multiple, propValue, setDefaultSelected) {
  var options = node.options;

  if (multiple) {
    var selectedValues = propValue;
    var selectedValue = {};
    for (var i = 0; i < selectedValues.length; i++) {
      // Prefix to avoid chaos with special keys.
      selectedValue['$' + selectedValues[i]] = true;
    }
    for (var _i = 0; _i < options.length; _i++) {
      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
      if (options[_i].selected !== selected) {
        options[_i].selected = selected;
      }
      if (selected && setDefaultSelected) {
        options[_i].defaultSelected = true;
      }
    }
  } else {
    // Do not set `select.value` as exact behavior isn't consistent across all
    // browsers for all cases.
    var _selectedValue = toString(getToStringValue(propValue));
    var defaultSelected = null;
    for (var _i2 = 0; _i2 < options.length; _i2++) {
      if (options[_i2].value === _selectedValue) {
        options[_i2].selected = true;
        if (setDefaultSelected) {
          options[_i2].defaultSelected = true;
        }
        return;
      }
      if (defaultSelected === null && !options[_i2].disabled) {
        defaultSelected = options[_i2];
      }
    }
    if (defaultSelected !== null) {
      defaultSelected.selected = true;
    }
  }
}

/**
 * Implements a <select> host component that allows optionally setting the
 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
 * stringable. If `multiple` is true, the prop must be an array of stringables.
 *
 * If `value` is not supplied (or null/undefined), user actions that change the
 * selected option will trigger updates to the rendered options.
 *
 * If it is supplied (and not null/undefined), the rendered options will not
 * update in response to user actions. Instead, the `value` prop must change in
 * order for the rendered options to update.
 *
 * If `defaultValue` is provided, any options with the supplied values will be
 * selected.
 */

function getHostProps$2(element, props) {
  return _assign({}, props, {
    value: undefined
  });
}

function initWrapperState$1(element, props) {
  var node = element;
  {
    checkSelectPropTypes(props);
  }

  node._wrapperState = {
    wasMultiple: !!props.multiple
  };

  {
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
      warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
      didWarnValueDefaultValue$1 = true;
    }
  }
}

function postMountWrapper$2(element, props) {
  var node = element;
  node.multiple = !!props.multiple;
  var value = props.value;
  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (props.defaultValue != null) {
    updateOptions(node, !!props.multiple, props.defaultValue, true);
  }
}

function postUpdateWrapper(element, props) {
  var node = element;
  var wasMultiple = node._wrapperState.wasMultiple;
  node._wrapperState.wasMultiple = !!props.multiple;

  var value = props.value;
  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (wasMultiple !== !!props.multiple) {
    // For simplicity, reapply `defaultValue` if `multiple` is toggled.
    if (props.defaultValue != null) {
      updateOptions(node, !!props.multiple, props.defaultValue, true);
    } else {
      // Revert the select back to its default unselected state.
      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
    }
  }
}

function restoreControlledState$2(element, props) {
  var node = element;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  }
}

var didWarnValDefaultVal = false;

/**
 * Implements a <textarea> host component that allows setting `value`, and
 * `defaultValue`. This differs from the traditional DOM API because value is
 * usually set as PCDATA children.
 *
 * If `value` is not supplied (or null/undefined), user actions that affect the
 * value will trigger updates to the element.
 *
 * If `value` is supplied (and not null/undefined), the rendered element will
 * not trigger updates to the element. Instead, the `value` prop must change in
 * order for the rendered element to be updated.
 *
 * The rendered element will be initialized with an empty value, the prop
 * `defaultValue` if specified, or the children content (deprecated).
 */

function getHostProps$3(element, props) {
  var node = element;
  (function () {
    if (!(props.dangerouslySetInnerHTML == null)) {
      {
        throw ReactError(Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.'));
      }
    }
  })();

  // Always set children to the same thing. In IE9, the selection range will
  // get reset if `textContent` is mutated.  We could add a check in setTextContent
  // to only set the value if/when the value differs from the node value (which would
  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  // solution. The value can be a boolean or object so that's why it's forced
  // to be a string.
  var hostProps = _assign({}, props, {
    value: undefined,
    defaultValue: undefined,
    children: toString(node._wrapperState.initialValue)
  });

  return hostProps;
}

function initWrapperState$2(element, props) {
  var node = element;
  {
    ReactControlledValuePropTypes.checkPropTypes('textarea', props);
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
      warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnValDefaultVal = true;
    }
  }

  var initialValue = props.value;

  // Only bother fetching default value if we're going to use it
  if (initialValue == null) {
    var defaultValue = props.defaultValue;
    // TODO (yungsters): Remove support for children content in <textarea>.
    var children = props.children;
    if (children != null) {
      {
        warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
      }
      (function () {
        if (!(defaultValue == null)) {
          {
            throw ReactError(Error('If you supply `defaultValue` on a <textarea>, do not pass children.'));
          }
        }
      })();
      if (Array.isArray(children)) {
        (function () {
          if (!(children.length <= 1)) {
            {
              throw ReactError(Error('<textarea> can only have at most one child.'));
            }
          }
        })();
        children = children[0];
      }

      defaultValue = children;
    }
    if (defaultValue == null) {
      defaultValue = '';
    }
    initialValue = defaultValue;
  }

  node._wrapperState = {
    initialValue: getToStringValue(initialValue)
  };
}

function updateWrapper$1(element, props) {
  var node = element;
  var value = getToStringValue(props.value);
  var defaultValue = getToStringValue(props.defaultValue);
  if (value != null) {
    // Cast `value` to a string to ensure the value is set correctly. While
    // browsers typically do this as necessary, jsdom doesn't.
    var newValue = toString(value);
    // To avoid side effects (such as losing text selection), only set value if changed
    if (newValue !== node.value) {
      node.value = newValue;
    }
    if (props.defaultValue == null && node.defaultValue !== newValue) {
      node.defaultValue = newValue;
    }
  }
  if (defaultValue != null) {
    node.defaultValue = toString(defaultValue);
  }
}

function postMountWrapper$3(element, props) {
  var node = element;
  // This is in postMount because we need access to the DOM node, which is not
  // available until after the component has mounted.
  var textContent = node.textContent;

  // Only set node.value if textContent is equal to the expected
  // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  // will populate textContent as well.
  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
  if (textContent === node._wrapperState.initialValue) {
    node.value = textContent;
  }
}

function restoreControlledState$3(element, props) {
  // DOM component is still mounted; update
  updateWrapper$1(element, props);
}

var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';

var Namespaces = {
  html: HTML_NAMESPACE$1,
  mathml: MATH_NAMESPACE,
  svg: SVG_NAMESPACE
};

// Assumes there is no parent namespace.
function getIntrinsicNamespace(type) {
  switch (type) {
    case 'svg':
      return SVG_NAMESPACE;
    case 'math':
      return MATH_NAMESPACE;
    default:
      return HTML_NAMESPACE$1;
  }
}

function getChildNamespace(parentNamespace, type) {
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
    // No (or default) parent namespace: potential entry point.
    return getIntrinsicNamespace(type);
  }
  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
    // We're leaving SVG.
    return HTML_NAMESPACE$1;
  }
  // By default, pass namespace below.
  return parentNamespace;
}

/* globals MSApp */

/**
 * Create a function which has 'unsafe' privileges (required by windows8 apps)
 */
var createMicrosoftUnsafeLocalFunction = function (func) {
  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
    return function (arg0, arg1, arg2, arg3) {
      MSApp.execUnsafeLocalFunction(function () {
        return func(arg0, arg1, arg2, arg3);
      });
    };
  } else {
    return func;
  }
};

// SVG temp container for IE lacking innerHTML
var reusableSVGContainer = void 0;

/**
 * Set the innerHTML property of a node
 *
 * @param {DOMElement} node
 * @param {string} html
 * @internal
 */
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  // IE does not have innerHTML for SVG nodes, so instead we inject the
  // new markup in a temp node and then move the child nodes across into
  // the target node

  if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) {
    reusableSVGContainer = reusableSVGContainer || document.createElement('div');
    reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
    var svgNode = reusableSVGContainer.firstChild;
    while (node.firstChild) {
      node.removeChild(node.firstChild);
    }
    while (svgNode.firstChild) {
      node.appendChild(svgNode.firstChild);
    }
  } else {
    node.innerHTML = html;
  }
});

/**
 * Set the textContent property of a node. For text updates, it's faster
 * to set the `nodeValue` of the Text node directly instead of using
 * `.textContent` which will remove the existing node and create a new one.
 *
 * @param {DOMElement} node
 * @param {string} text
 * @internal
 */
var setTextContent = function (node, text) {
  if (text) {
    var firstChild = node.firstChild;

    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
      firstChild.nodeValue = text;
      return;
    }
  }
  node.textContent = text;
};

// List derived from Gecko source code:
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
var shorthandToLonghand = {
  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  columns: ['columnCount', 'columnWidth'],
  flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  flexFlow: ['flexDirection', 'flexWrap'],
  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  gap: ['columnGap', 'rowGap'],
  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  gridColumnGap: ['columnGap'],
  gridGap: ['columnGap', 'rowGap'],
  gridRow: ['gridRowEnd', 'gridRowStart'],
  gridRowGap: ['rowGap'],
  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  marker: ['markerEnd', 'markerMid', 'markerStart'],
  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  maskPosition: ['maskPositionX', 'maskPositionY'],
  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  overflow: ['overflowX', 'overflowY'],
  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  placeContent: ['alignContent', 'justifyContent'],
  placeItems: ['alignItems', 'justifyItems'],
  placeSelf: ['alignSelf', 'justifySelf'],
  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  wordWrap: ['overflowWrap']
};

/**
 * CSS properties which accept numbers but are not in units of "px".
 */
var isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,

  // SVG-related properties
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};

/**
 * @param {string} prefix vendor-specific prefix, eg: Webkit
 * @param {string} key style name, eg: transitionDuration
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
 * WebkitTransitionDuration
 */
function prefixKey(prefix, key) {
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}

/**
 * Support style names that may come passed in prefixed by adding permutations
 * of vendor prefixes.
 */
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];

// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
  prefixes.forEach(function (prefix) {
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  });
});

/**
 * Convert a value into the proper css writable value. The style name `name`
 * should be logical (no hyphens), as specified
 * in `CSSProperty.isUnitlessNumber`.
 *
 * @param {string} name CSS property name such as `topMargin`.
 * @param {*} value CSS property value such as `10px`.
 * @return {string} Normalized style value with dimensions applied.
 */
function dangerousStyleValue(name, value, isCustomProperty) {
  // Note that we've removed escapeTextForBrowser() calls here since the
  // whole string will be escaped when the attribute is injected into
  // the markup. If you provide unsafe user data here they can inject
  // arbitrary CSS which may be problematic (I couldn't repro this):
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  // This is not an XSS hole but instead a potential CSS injection issue
  // which has lead to a greater discussion about how we're going to
  // trust URLs moving forward. See #2115901

  var isEmpty = value == null || typeof value === 'boolean' || value === '';
  if (isEmpty) {
    return '';
  }

  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  }

  return ('' + value).trim();
}

var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;

/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */
function hyphenateStyleName(name) {
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

var warnValidStyle = function () {};

{
  // 'msTransform' is correct, but the other prefixes should be capitalized
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  var msPattern$1 = /^-ms-/;
  var hyphenPattern = /-(.)/g;

  // style values shouldn't contain a semicolon
  var badStyleValueWithSemicolonPattern = /;\s*$/;

  var warnedStyleNames = {};
  var warnedStyleValues = {};
  var warnedForNaNValue = false;
  var warnedForInfinityValue = false;

  var camelize = function (string) {
    return string.replace(hyphenPattern, function (_, character) {
      return character.toUpperCase();
    });
  };

  var warnHyphenatedStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
    // As Andi Smith suggests
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
    // is converted to lowercase `ms`.
    camelize(name.replace(msPattern$1, 'ms-')));
  };

  var warnBadVendoredStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  };

  var warnStyleValueWithSemicolon = function (name, value) {
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
      return;
    }

    warnedStyleValues[value] = true;
    warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  };

  var warnStyleValueIsNaN = function (name, value) {
    if (warnedForNaNValue) {
      return;
    }

    warnedForNaNValue = true;
    warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
  };

  var warnStyleValueIsInfinity = function (name, value) {
    if (warnedForInfinityValue) {
      return;
    }

    warnedForInfinityValue = true;
    warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
  };

  warnValidStyle = function (name, value) {
    if (name.indexOf('-') > -1) {
      warnHyphenatedStyleName(name);
    } else if (badVendoredStyleNamePattern.test(name)) {
      warnBadVendoredStyleName(name);
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
      warnStyleValueWithSemicolon(name, value);
    }

    if (typeof value === 'number') {
      if (isNaN(value)) {
        warnStyleValueIsNaN(name, value);
      } else if (!isFinite(value)) {
        warnStyleValueIsInfinity(name, value);
      }
    }
  };
}

var warnValidStyle$1 = warnValidStyle;

/**
 * Operations for dealing with CSS properties.
 */

/**
 * This creates a string that is expected to be equivalent to the style
 * attribute generated by server-side rendering. It by-passes warnings and
 * security checks so it's not safe to use this value for anything other than
 * comparison. It is only used in DEV for SSR validation.
 */
function createDangerousStringForStyles(styles) {
  {
    var serialized = '';
    var delimiter = '';
    for (var styleName in styles) {
      if (!styles.hasOwnProperty(styleName)) {
        continue;
      }
      var styleValue = styles[styleName];
      if (styleValue != null) {
        var isCustomProperty = styleName.indexOf('--') === 0;
        serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);

        delimiter = ';';
      }
    }
    return serialized || null;
  }
}

/**
 * Sets the value for multiple styles on a node.  If a value is specified as
 * '' (empty string), the corresponding style property will be unset.
 *
 * @param {DOMElement} node
 * @param {object} styles
 */
function setValueForStyles(node, styles) {
  var style = node.style;
  for (var styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }
    var isCustomProperty = styleName.indexOf('--') === 0;
    {
      if (!isCustomProperty) {
        warnValidStyle$1(styleName, styles[styleName]);
      }
    }
    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
    if (styleName === 'float') {
      styleName = 'cssFloat';
    }
    if (isCustomProperty) {
      style.setProperty(styleName, styleValue);
    } else {
      style[styleName] = styleValue;
    }
  }
}

function isValueEmpty(value) {
  return value == null || typeof value === 'boolean' || value === '';
}

/**
 * Given {color: 'red', overflow: 'hidden'} returns {
 *   color: 'color',
 *   overflowX: 'overflow',
 *   overflowY: 'overflow',
 * }. This can be read as "the overflowY property was set by the overflow
 * shorthand". That is, the values are the property that each was derived from.
 */
function expandShorthandMap(styles) {
  var expanded = {};
  for (var key in styles) {
    var longhands = shorthandToLonghand[key] || [key];
    for (var i = 0; i < longhands.length; i++) {
      expanded[longhands[i]] = key;
    }
  }
  return expanded;
}

/**
 * When mixing shorthand and longhand property names, we warn during updates if
 * we expect an incorrect result to occur. In particular, we warn for:
 *
 * Updating a shorthand property (longhand gets overwritten):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
 *   becomes .style.font = 'baz'
 * Removing a shorthand property (longhand gets lost too):
 *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
 *   becomes .style.font = ''
 * Removing a longhand property (should revert to shorthand; doesn't):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
 *   becomes .style.fontVariant = ''
 */
function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  if (!warnAboutShorthandPropertyCollision) {
    return;
  }

  if (!nextStyles) {
    return;
  }

  var expandedUpdates = expandShorthandMap(styleUpdates);
  var expandedStyles = expandShorthandMap(nextStyles);
  var warnedAbout = {};
  for (var key in expandedUpdates) {
    var originalKey = expandedUpdates[key];
    var correctOriginalKey = expandedStyles[key];
    if (correctOriginalKey && originalKey !== correctOriginalKey) {
      var warningKey = originalKey + ',' + correctOriginalKey;
      if (warnedAbout[warningKey]) {
        continue;
      }
      warnedAbout[warningKey] = true;
      warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
    }
  }
}

// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special-case tags.

var omittedCloseTags = {
  area: true,
  base: true,
  br: true,
  col: true,
  embed: true,
  hr: true,
  img: true,
  input: true,
  keygen: true,
  link: true,
  meta: true,
  param: true,
  source: true,
  track: true,
  wbr: true
  // NOTE: menuitem's close tag should be omitted, but that causes problems.
};

// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.

var voidElementTags = _assign({
  menuitem: true
}, omittedCloseTags);

// TODO: We can remove this if we add invariantWithStack()
// or add stack by default to invariants where possible.
var HTML$1 = '__html';

var ReactDebugCurrentFrame$3 = null;
{
  ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
}

function assertValidProps(tag, props) {
  if (!props) {
    return;
  }
  // Note the use of `==` which checks for null or undefined.
  if (voidElementTags[tag]) {
    (function () {
      if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
        {
          throw ReactError(Error(tag + ' is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.' + (ReactDebugCurrentFrame$3.getStackAddendum())));
        }
      }
    })();
  }
  if (props.dangerouslySetInnerHTML != null) {
    (function () {
      if (!(props.children == null)) {
        {
          throw ReactError(Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.'));
        }
      }
    })();
    (function () {
      if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML)) {
        {
          throw ReactError(Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.'));
        }
      }
    })();
  }
  {
    !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  }
  (function () {
    if (!(props.style == null || typeof props.style === 'object')) {
      {
        throw ReactError(Error('The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.' + (ReactDebugCurrentFrame$3.getStackAddendum())));
      }
    }
  })();
}

function isCustomComponent(tagName, props) {
  if (tagName.indexOf('-') === -1) {
    return typeof props.is === 'string';
  }
  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this whitelist too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;
    default:
      return true;
  }
}

// When adding attributes to the HTML or SVG whitelist, be sure to
// also add them to this module to ensure casing and incorrect name
// warnings.
var possibleStandardNames = {
  // HTML
  accept: 'accept',
  acceptcharset: 'acceptCharset',
  'accept-charset': 'acceptCharset',
  accesskey: 'accessKey',
  action: 'action',
  allowfullscreen: 'allowFullScreen',
  alt: 'alt',
  as: 'as',
  async: 'async',
  autocapitalize: 'autoCapitalize',
  autocomplete: 'autoComplete',
  autocorrect: 'autoCorrect',
  autofocus: 'autoFocus',
  autoplay: 'autoPlay',
  autosave: 'autoSave',
  capture: 'capture',
  cellpadding: 'cellPadding',
  cellspacing: 'cellSpacing',
  challenge: 'challenge',
  charset: 'charSet',
  checked: 'checked',
  children: 'children',
  cite: 'cite',
  class: 'className',
  classid: 'classID',
  classname: 'className',
  cols: 'cols',
  colspan: 'colSpan',
  content: 'content',
  contenteditable: 'contentEditable',
  contextmenu: 'contextMenu',
  controls: 'controls',
  controlslist: 'controlsList',
  coords: 'coords',
  crossorigin: 'crossOrigin',
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  data: 'data',
  datetime: 'dateTime',
  default: 'default',
  defaultchecked: 'defaultChecked',
  defaultvalue: 'defaultValue',
  defer: 'defer',
  dir: 'dir',
  disabled: 'disabled',
  disablepictureinpicture: 'disablePictureInPicture',
  download: 'download',
  draggable: 'draggable',
  enctype: 'encType',
  for: 'htmlFor',
  form: 'form',
  formmethod: 'formMethod',
  formaction: 'formAction',
  formenctype: 'formEncType',
  formnovalidate: 'formNoValidate',
  formtarget: 'formTarget',
  frameborder: 'frameBorder',
  headers: 'headers',
  height: 'height',
  hidden: 'hidden',
  high: 'high',
  href: 'href',
  hreflang: 'hrefLang',
  htmlfor: 'htmlFor',
  httpequiv: 'httpEquiv',
  'http-equiv': 'httpEquiv',
  icon: 'icon',
  id: 'id',
  innerhtml: 'innerHTML',
  inputmode: 'inputMode',
  integrity: 'integrity',
  is: 'is',
  itemid: 'itemID',
  itemprop: 'itemProp',
  itemref: 'itemRef',
  itemscope: 'itemScope',
  itemtype: 'itemType',
  keyparams: 'keyParams',
  keytype: 'keyType',
  kind: 'kind',
  label: 'label',
  lang: 'lang',
  list: 'list',
  loop: 'loop',
  low: 'low',
  manifest: 'manifest',
  marginwidth: 'marginWidth',
  marginheight: 'marginHeight',
  max: 'max',
  maxlength: 'maxLength',
  media: 'media',
  mediagroup: 'mediaGroup',
  method: 'method',
  min: 'min',
  minlength: 'minLength',
  multiple: 'multiple',
  muted: 'muted',
  name: 'name',
  nomodule: 'noModule',
  nonce: 'nonce',
  novalidate: 'noValidate',
  open: 'open',
  optimum: 'optimum',
  pattern: 'pattern',
  placeholder: 'placeholder',
  playsinline: 'playsInline',
  poster: 'poster',
  preload: 'preload',
  profile: 'profile',
  radiogroup: 'radioGroup',
  readonly: 'readOnly',
  referrerpolicy: 'referrerPolicy',
  rel: 'rel',
  required: 'required',
  reversed: 'reversed',
  role: 'role',
  rows: 'rows',
  rowspan: 'rowSpan',
  sandbox: 'sandbox',
  scope: 'scope',
  scoped: 'scoped',
  scrolling: 'scrolling',
  seamless: 'seamless',
  selected: 'selected',
  shape: 'shape',
  size: 'size',
  sizes: 'sizes',
  span: 'span',
  spellcheck: 'spellCheck',
  src: 'src',
  srcdoc: 'srcDoc',
  srclang: 'srcLang',
  srcset: 'srcSet',
  start: 'start',
  step: 'step',
  style: 'style',
  summary: 'summary',
  tabindex: 'tabIndex',
  target: 'target',
  title: 'title',
  type: 'type',
  usemap: 'useMap',
  value: 'value',
  width: 'width',
  wmode: 'wmode',
  wrap: 'wrap',

  // SVG
  about: 'about',
  accentheight: 'accentHeight',
  'accent-height': 'accentHeight',
  accumulate: 'accumulate',
  additive: 'additive',
  alignmentbaseline: 'alignmentBaseline',
  'alignment-baseline': 'alignmentBaseline',
  allowreorder: 'allowReorder',
  alphabetic: 'alphabetic',
  amplitude: 'amplitude',
  arabicform: 'arabicForm',
  'arabic-form': 'arabicForm',
  ascent: 'ascent',
  attributename: 'attributeName',
  attributetype: 'attributeType',
  autoreverse: 'autoReverse',
  azimuth: 'azimuth',
  basefrequency: 'baseFrequency',
  baselineshift: 'baselineShift',
  'baseline-shift': 'baselineShift',
  baseprofile: 'baseProfile',
  bbox: 'bbox',
  begin: 'begin',
  bias: 'bias',
  by: 'by',
  calcmode: 'calcMode',
  capheight: 'capHeight',
  'cap-height': 'capHeight',
  clip: 'clip',
  clippath: 'clipPath',
  'clip-path': 'clipPath',
  clippathunits: 'clipPathUnits',
  cliprule: 'clipRule',
  'clip-rule': 'clipRule',
  color: 'color',
  colorinterpolation: 'colorInterpolation',
  'color-interpolation': 'colorInterpolation',
  colorinterpolationfilters: 'colorInterpolationFilters',
  'color-interpolation-filters': 'colorInterpolationFilters',
  colorprofile: 'colorProfile',
  'color-profile': 'colorProfile',
  colorrendering: 'colorRendering',
  'color-rendering': 'colorRendering',
  contentscripttype: 'contentScriptType',
  contentstyletype: 'contentStyleType',
  cursor: 'cursor',
  cx: 'cx',
  cy: 'cy',
  d: 'd',
  datatype: 'datatype',
  decelerate: 'decelerate',
  descent: 'descent',
  diffuseconstant: 'diffuseConstant',
  direction: 'direction',
  display: 'display',
  divisor: 'divisor',
  dominantbaseline: 'dominantBaseline',
  'dominant-baseline': 'dominantBaseline',
  dur: 'dur',
  dx: 'dx',
  dy: 'dy',
  edgemode: 'edgeMode',
  elevation: 'elevation',
  enablebackground: 'enableBackground',
  'enable-background': 'enableBackground',
  end: 'end',
  exponent: 'exponent',
  externalresourcesrequired: 'externalResourcesRequired',
  fill: 'fill',
  fillopacity: 'fillOpacity',
  'fill-opacity': 'fillOpacity',
  fillrule: 'fillRule',
  'fill-rule': 'fillRule',
  filter: 'filter',
  filterres: 'filterRes',
  filterunits: 'filterUnits',
  floodopacity: 'floodOpacity',
  'flood-opacity': 'floodOpacity',
  floodcolor: 'floodColor',
  'flood-color': 'floodColor',
  focusable: 'focusable',
  fontfamily: 'fontFamily',
  'font-family': 'fontFamily',
  fontsize: 'fontSize',
  'font-size': 'fontSize',
  fontsizeadjust: 'fontSizeAdjust',
  'font-size-adjust': 'fontSizeAdjust',
  fontstretch: 'fontStretch',
  'font-stretch': 'fontStretch',
  fontstyle: 'fontStyle',
  'font-style': 'fontStyle',
  fontvariant: 'fontVariant',
  'font-variant': 'fontVariant',
  fontweight: 'fontWeight',
  'font-weight': 'fontWeight',
  format: 'format',
  from: 'from',
  fx: 'fx',
  fy: 'fy',
  g1: 'g1',
  g2: 'g2',
  glyphname: 'glyphName',
  'glyph-name': 'glyphName',
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  glyphorientationvertical: 'glyphOrientationVertical',
  'glyph-orientation-vertical': 'glyphOrientationVertical',
  glyphref: 'glyphRef',
  gradienttransform: 'gradientTransform',
  gradientunits: 'gradientUnits',
  hanging: 'hanging',
  horizadvx: 'horizAdvX',
  'horiz-adv-x': 'horizAdvX',
  horizoriginx: 'horizOriginX',
  'horiz-origin-x': 'horizOriginX',
  ideographic: 'ideographic',
  imagerendering: 'imageRendering',
  'image-rendering': 'imageRendering',
  in2: 'in2',
  in: 'in',
  inlist: 'inlist',
  intercept: 'intercept',
  k1: 'k1',
  k2: 'k2',
  k3: 'k3',
  k4: 'k4',
  k: 'k',
  kernelmatrix: 'kernelMatrix',
  kernelunitlength: 'kernelUnitLength',
  kerning: 'kerning',
  keypoints: 'keyPoints',
  keysplines: 'keySplines',
  keytimes: 'keyTimes',
  lengthadjust: 'lengthAdjust',
  letterspacing: 'letterSpacing',
  'letter-spacing': 'letterSpacing',
  lightingcolor: 'lightingColor',
  'lighting-color': 'lightingColor',
  limitingconeangle: 'limitingConeAngle',
  local: 'local',
  markerend: 'markerEnd',
  'marker-end': 'markerEnd',
  markerheight: 'markerHeight',
  markermid: 'markerMid',
  'marker-mid': 'markerMid',
  markerstart: 'markerStart',
  'marker-start': 'markerStart',
  markerunits: 'markerUnits',
  markerwidth: 'markerWidth',
  mask: 'mask',
  maskcontentunits: 'maskContentUnits',
  maskunits: 'maskUnits',
  mathematical: 'mathematical',
  mode: 'mode',
  numoctaves: 'numOctaves',
  offset: 'offset',
  opacity: 'opacity',
  operator: 'operator',
  order: 'order',
  orient: 'orient',
  orientation: 'orientation',
  origin: 'origin',
  overflow: 'overflow',
  overlineposition: 'overlinePosition',
  'overline-position': 'overlinePosition',
  overlinethickness: 'overlineThickness',
  'overline-thickness': 'overlineThickness',
  paintorder: 'paintOrder',
  'paint-order': 'paintOrder',
  panose1: 'panose1',
  'panose-1': 'panose1',
  pathlength: 'pathLength',
  patterncontentunits: 'patternContentUnits',
  patterntransform: 'patternTransform',
  patternunits: 'patternUnits',
  pointerevents: 'pointerEvents',
  'pointer-events': 'pointerEvents',
  points: 'points',
  pointsatx: 'pointsAtX',
  pointsaty: 'pointsAtY',
  pointsatz: 'pointsAtZ',
  prefix: 'prefix',
  preservealpha: 'preserveAlpha',
  preserveaspectratio: 'preserveAspectRatio',
  primitiveunits: 'primitiveUnits',
  property: 'property',
  r: 'r',
  radius: 'radius',
  refx: 'refX',
  refy: 'refY',
  renderingintent: 'renderingIntent',
  'rendering-intent': 'renderingIntent',
  repeatcount: 'repeatCount',
  repeatdur: 'repeatDur',
  requiredextensions: 'requiredExtensions',
  requiredfeatures: 'requiredFeatures',
  resource: 'resource',
  restart: 'restart',
  result: 'result',
  results: 'results',
  rotate: 'rotate',
  rx: 'rx',
  ry: 'ry',
  scale: 'scale',
  security: 'security',
  seed: 'seed',
  shaperendering: 'shapeRendering',
  'shape-rendering': 'shapeRendering',
  slope: 'slope',
  spacing: 'spacing',
  specularconstant: 'specularConstant',
  specularexponent: 'specularExponent',
  speed: 'speed',
  spreadmethod: 'spreadMethod',
  startoffset: 'startOffset',
  stddeviation: 'stdDeviation',
  stemh: 'stemh',
  stemv: 'stemv',
  stitchtiles: 'stitchTiles',
  stopcolor: 'stopColor',
  'stop-color': 'stopColor',
  stopopacity: 'stopOpacity',
  'stop-opacity': 'stopOpacity',
  strikethroughposition: 'strikethroughPosition',
  'strikethrough-position': 'strikethroughPosition',
  strikethroughthickness: 'strikethroughThickness',
  'strikethrough-thickness': 'strikethroughThickness',
  string: 'string',
  stroke: 'stroke',
  strokedasharray: 'strokeDasharray',
  'stroke-dasharray': 'strokeDasharray',
  strokedashoffset: 'strokeDashoffset',
  'stroke-dashoffset': 'strokeDashoffset',
  strokelinecap: 'strokeLinecap',
  'stroke-linecap': 'strokeLinecap',
  strokelinejoin: 'strokeLinejoin',
  'stroke-linejoin': 'strokeLinejoin',
  strokemiterlimit: 'strokeMiterlimit',
  'stroke-miterlimit': 'strokeMiterlimit',
  strokewidth: 'strokeWidth',
  'stroke-width': 'strokeWidth',
  strokeopacity: 'strokeOpacity',
  'stroke-opacity': 'strokeOpacity',
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
  suppresshydrationwarning: 'suppressHydrationWarning',
  surfacescale: 'surfaceScale',
  systemlanguage: 'systemLanguage',
  tablevalues: 'tableValues',
  targetx: 'targetX',
  targety: 'targetY',
  textanchor: 'textAnchor',
  'text-anchor': 'textAnchor',
  textdecoration: 'textDecoration',
  'text-decoration': 'textDecoration',
  textlength: 'textLength',
  textrendering: 'textRendering',
  'text-rendering': 'textRendering',
  to: 'to',
  transform: 'transform',
  typeof: 'typeof',
  u1: 'u1',
  u2: 'u2',
  underlineposition: 'underlinePosition',
  'underline-position': 'underlinePosition',
  underlinethickness: 'underlineThickness',
  'underline-thickness': 'underlineThickness',
  unicode: 'unicode',
  unicodebidi: 'unicodeBidi',
  'unicode-bidi': 'unicodeBidi',
  unicoderange: 'unicodeRange',
  'unicode-range': 'unicodeRange',
  unitsperem: 'unitsPerEm',
  'units-per-em': 'unitsPerEm',
  unselectable: 'unselectable',
  valphabetic: 'vAlphabetic',
  'v-alphabetic': 'vAlphabetic',
  values: 'values',
  vectoreffect: 'vectorEffect',
  'vector-effect': 'vectorEffect',
  version: 'version',
  vertadvy: 'vertAdvY',
  'vert-adv-y': 'vertAdvY',
  vertoriginx: 'vertOriginX',
  'vert-origin-x': 'vertOriginX',
  vertoriginy: 'vertOriginY',
  'vert-origin-y': 'vertOriginY',
  vhanging: 'vHanging',
  'v-hanging': 'vHanging',
  videographic: 'vIdeographic',
  'v-ideographic': 'vIdeographic',
  viewbox: 'viewBox',
  viewtarget: 'viewTarget',
  visibility: 'visibility',
  vmathematical: 'vMathematical',
  'v-mathematical': 'vMathematical',
  vocab: 'vocab',
  widths: 'widths',
  wordspacing: 'wordSpacing',
  'word-spacing': 'wordSpacing',
  writingmode: 'writingMode',
  'writing-mode': 'writingMode',
  x1: 'x1',
  x2: 'x2',
  x: 'x',
  xchannelselector: 'xChannelSelector',
  xheight: 'xHeight',
  'x-height': 'xHeight',
  xlinkactuate: 'xlinkActuate',
  'xlink:actuate': 'xlinkActuate',
  xlinkarcrole: 'xlinkArcrole',
  'xlink:arcrole': 'xlinkArcrole',
  xlinkhref: 'xlinkHref',
  'xlink:href': 'xlinkHref',
  xlinkrole: 'xlinkRole',
  'xlink:role': 'xlinkRole',
  xlinkshow: 'xlinkShow',
  'xlink:show': 'xlinkShow',
  xlinktitle: 'xlinkTitle',
  'xlink:title': 'xlinkTitle',
  xlinktype: 'xlinkType',
  'xlink:type': 'xlinkType',
  xmlbase: 'xmlBase',
  'xml:base': 'xmlBase',
  xmllang: 'xmlLang',
  'xml:lang': 'xmlLang',
  xmlns: 'xmlns',
  'xml:space': 'xmlSpace',
  xmlnsxlink: 'xmlnsXlink',
  'xmlns:xlink': 'xmlnsXlink',
  xmlspace: 'xmlSpace',
  y1: 'y1',
  y2: 'y2',
  y: 'y',
  ychannelselector: 'yChannelSelector',
  z: 'z',
  zoomandpan: 'zoomAndPan'
};

var ariaProperties = {
  'aria-current': 0, // state
  'aria-details': 0,
  'aria-disabled': 0, // state
  'aria-hidden': 0, // state
  'aria-invalid': 0, // state
  'aria-keyshortcuts': 0,
  'aria-label': 0,
  'aria-roledescription': 0,
  // Widget Attributes
  'aria-autocomplete': 0,
  'aria-checked': 0,
  'aria-expanded': 0,
  'aria-haspopup': 0,
  'aria-level': 0,
  'aria-modal': 0,
  'aria-multiline': 0,
  'aria-multiselectable': 0,
  'aria-orientation': 0,
  'aria-placeholder': 0,
  'aria-pressed': 0,
  'aria-readonly': 0,
  'aria-required': 0,
  'aria-selected': 0,
  'aria-sort': 0,
  'aria-valuemax': 0,
  'aria-valuemin': 0,
  'aria-valuenow': 0,
  'aria-valuetext': 0,
  // Live Region Attributes
  'aria-atomic': 0,
  'aria-busy': 0,
  'aria-live': 0,
  'aria-relevant': 0,
  // Drag-and-Drop Attributes
  'aria-dropeffect': 0,
  'aria-grabbed': 0,
  // Relationship Attributes
  'aria-activedescendant': 0,
  'aria-colcount': 0,
  'aria-colindex': 0,
  'aria-colspan': 0,
  'aria-controls': 0,
  'aria-describedby': 0,
  'aria-errormessage': 0,
  'aria-flowto': 0,
  'aria-labelledby': 0,
  'aria-owns': 0,
  'aria-posinset': 0,
  'aria-rowcount': 0,
  'aria-rowindex': 0,
  'aria-rowspan': 0,
  'aria-setsize': 0
};

var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty$2 = Object.prototype.hasOwnProperty;

function validateProperty(tagName, name) {
  if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
    return true;
  }

  if (rARIACamel.test(name)) {
    var ariaName = 'aria-' + name.slice(4).toLowerCase();
    var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (correctName == null) {
      warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
      warnedProperties[name] = true;
      return true;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== correctName) {
      warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
      warnedProperties[name] = true;
      return true;
    }
  }

  if (rARIA.test(name)) {
    var lowerCasedName = name.toLowerCase();
    var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (standardName == null) {
      warnedProperties[name] = true;
      return false;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== standardName) {
      warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
      warnedProperties[name] = true;
      return true;
    }
  }

  return true;
}

function warnInvalidARIAProps(type, props) {
  var invalidProps = [];

  for (var key in props) {
    var isValid = validateProperty(type, key);
    if (!isValid) {
      invalidProps.push(key);
    }
  }

  var unknownPropString = invalidProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');

  if (invalidProps.length === 1) {
    warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  } else if (invalidProps.length > 1) {
    warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  }
}

function validateProperties(type, props) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnInvalidARIAProps(type, props);
}

var didWarnValueNull = false;

function validateProperties$1(type, props) {
  if (type !== 'input' && type !== 'textarea' && type !== 'select') {
    return;
  }

  if (props != null && props.value === null && !didWarnValueNull) {
    didWarnValueNull = true;
    if (type === 'select' && props.multiple) {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
    } else {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
    }
  }
}

var validateProperty$1 = function () {};

{
  var warnedProperties$1 = {};
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
  var EVENT_NAME_REGEX = /^on./;
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

  validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
      return true;
    }

    var lowerCasedName = name.toLowerCase();
    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
      warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
      warnedProperties$1[name] = true;
      return true;
    }

    // We can't rely on the event system being injected on the server.
    if (canUseEventSystem) {
      if (registrationNameModules.hasOwnProperty(name)) {
        return true;
      }
      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
      if (registrationName != null) {
        warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
        warnedProperties$1[name] = true;
        return true;
      }
      if (EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (EVENT_NAME_REGEX.test(name)) {
      // If no event plugins have been injected, we are in a server environment.
      // So we can't tell if the event name is correct for sure, but we can filter
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Let the ARIA attribute hook validate ARIA attributes
    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
      return true;
    }

    if (lowerCasedName === 'innerhtml') {
      warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'aria') {
      warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
      warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'number' && isNaN(value)) {
      warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
      warnedProperties$1[name] = true;
      return true;
    }

    var propertyInfo = getPropertyInfo(name);
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;

    // Known attributes should match the casing specified in the property config.
    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      var standardName = possibleStandardNames[lowerCasedName];
      if (standardName !== name) {
        warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (!isReserved && name !== lowerCasedName) {
      // Unknown attributes should have lowercase casing since that's how they
      // will be cased anyway with server rendering.
      warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      if (value) {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
      } else {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Now that we've validated casing, do not validate
    // data types for reserved props
    if (isReserved) {
      return true;
    }

    // Warn when a known attribute is a bad type
    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      warnedProperties$1[name] = true;
      return false;
    }

    // Warn when passing the strings 'false' or 'true' into a boolean prop
    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
      warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
      warnedProperties$1[name] = true;
      return true;
    }

    return true;
  };
}

var warnUnknownProperties = function (type, props, canUseEventSystem) {
  var unknownProps = [];
  for (var key in props) {
    var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
    if (!isValid) {
      unknownProps.push(key);
    }
  }

  var unknownPropString = unknownProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');
  if (unknownProps.length === 1) {
    warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  } else if (unknownProps.length > 1) {
    warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  }
};

function validateProperties$2(type, props, canUseEventSystem) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnUnknownProperties(type, props, canUseEventSystem);
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnInvalidHydration = false;
var didWarnShadyDOM = false;

var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
var AUTOFOCUS = 'autoFocus';
var CHILDREN = 'children';
var STYLE$1 = 'style';
var HTML = '__html';
var LISTENERS = 'listeners';

var HTML_NAMESPACE = Namespaces.html;


var warnedUnknownTags = void 0;
var suppressHydrationWarning = void 0;

var validatePropertiesInDevelopment = void 0;
var warnForTextDifference = void 0;
var warnForPropDifference = void 0;
var warnForExtraAttributes = void 0;
var warnForInvalidEventListener = void 0;
var canDiffStyleForHydrationWarning = void 0;

var normalizeMarkupForTextOrAttribute = void 0;
var normalizeHTML = void 0;

{
  warnedUnknownTags = {
    // Chrome is the only major browser not shipping <time>. But as of July
    // 2017 it intends to ship it due to widespread usage. We intentionally
    // *don't* warn for <time> even if it's unrecognized by Chrome because
    // it soon will be, and many apps have been using it anyway.
    time: true,
    // There are working polyfills for <dialog>. Let people use it.
    dialog: true,
    // Electron ships a custom <webview> tag to display external web content in
    // an isolated frame and process.
    // This tag is not present in non Electron environments such as JSDom which
    // is often used for testing purposes.
    // @see https://electronjs.org/docs/api/webview-tag
    webview: true
  };

  validatePropertiesInDevelopment = function (type, props) {
    validateProperties(type, props);
    validateProperties$1(type, props);
    validateProperties$2(type, props, /* canUseEventSystem */true);
  };

  // IE 11 parses & normalizes the style attribute as opposed to other
  // browsers. It adds spaces and sorts the properties in some
  // non-alphabetical order. Handling that would require sorting CSS
  // properties in the client & server versions or applying
  // `expectedStyle` to a temporary DOM node to read its `style` attribute
  // normalized. Since it only affects IE, we're skipping style warnings
  // in that browser completely in favor of doing all that work.
  // See https://github.com/facebook/react/issues/11807
  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;

  // HTML parsing normalizes CR and CRLF to LF.
  // It also can turn \u0000 into \uFFFD inside attributes.
  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  // If we have a mismatch, it might be caused by that.
  // We will still patch up in this case but not fire the warning.
  var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;

  normalizeMarkupForTextOrAttribute = function (markup) {
    var markupString = typeof markup === 'string' ? markup : '' + markup;
    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  };

  warnForTextDifference = function (serverText, clientText) {
    if (didWarnInvalidHydration) {
      return;
    }
    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
    if (normalizedServerText === normalizedClientText) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  };

  warnForPropDifference = function (propName, serverValue, clientValue) {
    if (didWarnInvalidHydration) {
      return;
    }
    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
    if (normalizedServerValue === normalizedClientValue) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  };

  warnForExtraAttributes = function (attributeNames) {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    var names = [];
    attributeNames.forEach(function (name) {
      names.push(name);
    });
    warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
  };

  warnForInvalidEventListener = function (registrationName, listener) {
    if (listener === false) {
      warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
    } else {
      warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
    }
  };

  // Parse the HTML and read it back to normalize the HTML string so that it
  // can be used for comparison.
  normalizeHTML = function (parent, html) {
    // We could have created a separate document here to avoid
    // re-initializing custom elements if they exist. But this breaks
    // how <noscript> is being handled. So we use the same document.
    // See the discussion in https://github.com/facebook/react/pull/11157.
    var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
    testElement.innerHTML = html;
    return testElement.innerHTML;
  };
}

function ensureListeningTo(rootContainerElement, registrationName) {
  var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
  var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
  listenTo(registrationName, doc);
}

function getOwnerDocumentFromRootContainer(rootContainerElement) {
  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
}

function noop() {}

function trapClickOnNonInteractiveElement(node) {
  // Mobile Safari does not fire properly bubble click events on
  // non-interactive elements, which means delegated click listeners do not
  // fire. The workaround for this bug involves attaching an empty click
  // listener on the target node.
  // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  // Just set it using the onclick property so that we don't have to manage any
  // bookkeeping for it. Not sure if we need to clear it when the listener is
  // removed.
  // TODO: Only do this for the relevant Safaris maybe?
  node.onclick = noop;
}

function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  for (var propKey in nextProps) {
    if (!nextProps.hasOwnProperty(propKey)) {
      continue;
    }
    var nextProp = nextProps[propKey];
    if (propKey === STYLE$1) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }
      // Relies on `updateStylesByID` not mutating `styleUpdates`.
      setValueForStyles(domElement, nextProp);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML] : undefined;
      if (nextHtml != null) {
        setInnerHTML(domElement, nextHtml);
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string') {
        // Avoid setting initial textContent when the text is empty. In IE11 setting
        // textContent on a <textarea> will cause the placeholder to not
        // show within the <textarea> until it has been focused and blurred again.
        // https://github.com/facebook/react/issues/6731#issuecomment-254874553
        var canSetTextContent = tag !== 'textarea' || nextProp !== '';
        if (canSetTextContent) {
          setTextContent(domElement, nextProp);
        }
      } else if (typeof nextProp === 'number') {
        setTextContent(domElement, '' + nextProp);
      }
    } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (propKey === AUTOFOCUS) {
      // We polyfill it separately on the client during commit.
      // We could have excluded it in the property list instead of
      // adding a special case here, but then it wouldn't be emitted
      // on server rendering (but we *do* want to emit it in SSR).
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
    } else if (nextProp != null) {
      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
    }
  }
}

function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  // TODO: Handle wasCustomComponentTag
  for (var i = 0; i < updatePayload.length; i += 2) {
    var propKey = updatePayload[i];
    var propValue = updatePayload[i + 1];
    if (propKey === STYLE$1) {
      setValueForStyles(domElement, propValue);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      setInnerHTML(domElement, propValue);
    } else if (propKey === CHILDREN) {
      setTextContent(domElement, propValue);
    } else {
      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
    }
  }
}

function createElement(type, props, rootContainerElement, parentNamespace) {
  var isCustomComponentTag = void 0;

  // We create tags in the namespace of their parent container, except HTML
  // tags get no namespace.
  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  var domElement = void 0;
  var namespaceURI = parentNamespace;
  if (namespaceURI === HTML_NAMESPACE) {
    namespaceURI = getIntrinsicNamespace(type);
  }
  if (namespaceURI === HTML_NAMESPACE) {
    {
      isCustomComponentTag = isCustomComponent(type, props);
      // Should this check be gated by parent namespace? Not sure we want to
      // allow <SVG> or <mATH>.
      !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
    }

    if (type === 'script') {
      // Create the script via .innerHTML so its "parser-inserted" flag is
      // set to true and it does not execute
      var div = ownerDocument.createElement('div');
      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
      // This is guaranteed to yield a script element.
      var firstChild = div.firstChild;
      domElement = div.removeChild(firstChild);
    } else if (typeof props.is === 'string') {
      // $FlowIssue `createElement` should be updated for Web Components
      domElement = ownerDocument.createElement(type, { is: props.is });
    } else {
      // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
      // See discussion in https://github.com/facebook/react/pull/6896
      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
      domElement = ownerDocument.createElement(type);
      // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
      // attributes on `select`s needs to be added before `option`s are inserted.
      // This prevents:
      // - a bug where the `select` does not scroll to the correct option because singular
      //  `select` elements automatically pick the first item #13222
      // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
      // See https://github.com/facebook/react/issues/13222
      // and https://github.com/facebook/react/issues/14239
      if (type === 'select') {
        var node = domElement;
        if (props.multiple) {
          node.multiple = true;
        } else if (props.size) {
          // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
          // it is possible that no option is selected.
          //
          // This is only necessary when a select in "single selection mode".
          node.size = props.size;
        }
      }
    }
  } else {
    domElement = ownerDocument.createElementNS(namespaceURI, type);
  }

  {
    if (namespaceURI === HTML_NAMESPACE) {
      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
        warnedUnknownTags[type] = true;
        warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
      }
    }
  }

  return domElement;
}

function createTextNode(text, rootContainerElement) {
  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
}

function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  var isCustomComponentTag = isCustomComponent(tag, rawProps);
  {
    validatePropertiesInDevelopment(tag, rawProps);
    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
      warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnShadyDOM = true;
    }
  }

  // TODO: Make sure that we check isMounted before firing any of these events.
  var props = void 0;
  switch (tag) {
    case 'iframe':
    case 'object':
    case 'embed':
      trapBubbledEvent(TOP_LOAD, domElement);
      props = rawProps;
      break;
    case 'video':
    case 'audio':
      // Create listener for each media event
      for (var i = 0; i < mediaEventTypes.length; i++) {
        trapBubbledEvent(mediaEventTypes[i], domElement);
      }
      props = rawProps;
      break;
    case 'source':
      trapBubbledEvent(TOP_ERROR, domElement);
      props = rawProps;
      break;
    case 'img':
    case 'image':
    case 'link':
      trapBubbledEvent(TOP_ERROR, domElement);
      trapBubbledEvent(TOP_LOAD, domElement);
      props = rawProps;
      break;
    case 'form':
      trapBubbledEvent(TOP_RESET, domElement);
      trapBubbledEvent(TOP_SUBMIT, domElement);
      props = rawProps;
      break;
    case 'details':
      trapBubbledEvent(TOP_TOGGLE, domElement);
      props = rawProps;
      break;
    case 'input':
      initWrapperState(domElement, rawProps);
      props = getHostProps(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'option':
      validateProps(domElement, rawProps);
      props = getHostProps$1(domElement, rawProps);
      break;
    case 'select':
      initWrapperState$1(domElement, rawProps);
      props = getHostProps$2(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      props = getHostProps$3(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    default:
      props = rawProps;
  }

  assertValidProps(tag, props);

  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, false);
      break;
    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement, rawProps);
      break;
    case 'option':
      postMountWrapper$1(domElement, rawProps);
      break;
    case 'select':
      postMountWrapper$2(domElement, rawProps);
      break;
    default:
      if (typeof props.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }
}

// Calculate the diff between the two objects.
function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  {
    validatePropertiesInDevelopment(tag, nextRawProps);
  }

  var updatePayload = null;

  var lastProps = void 0;
  var nextProps = void 0;
  switch (tag) {
    case 'input':
      lastProps = getHostProps(domElement, lastRawProps);
      nextProps = getHostProps(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'option':
      lastProps = getHostProps$1(domElement, lastRawProps);
      nextProps = getHostProps$1(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'select':
      lastProps = getHostProps$2(domElement, lastRawProps);
      nextProps = getHostProps$2(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'textarea':
      lastProps = getHostProps$3(domElement, lastRawProps);
      nextProps = getHostProps$3(domElement, nextRawProps);
      updatePayload = [];
      break;
    default:
      lastProps = lastRawProps;
      nextProps = nextRawProps;
      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }

  assertValidProps(tag, nextProps);

  var propKey = void 0;
  var styleName = void 0;
  var styleUpdates = null;
  for (propKey in lastProps) {
    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
      continue;
    }
    if (propKey === STYLE$1) {
      var lastStyle = lastProps[propKey];
      for (styleName in lastStyle) {
        if (lastStyle.hasOwnProperty(styleName)) {
          if (!styleUpdates) {
            styleUpdates = {};
          }
          styleUpdates[styleName] = '';
        }
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {
      // Noop. This is handled by the clear text mechanism.
    } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (propKey === AUTOFOCUS) {
      // Noop. It doesn't work on updates anyway.
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      // This is a special case. If any listener updates we need to ensure
      // that the "current" fiber pointer gets updated so we need a commit
      // to update this element.
      if (!updatePayload) {
        updatePayload = [];
      }
    } else {
      // For all other deleted properties we add it to the queue. We use
      // the whitelist in the commit phase instead.
      (updatePayload = updatePayload || []).push(propKey, null);
    }
  }
  for (propKey in nextProps) {
    var nextProp = nextProps[propKey];
    var lastProp = lastProps != null ? lastProps[propKey] : undefined;
    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
      continue;
    }
    if (propKey === STYLE$1) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }
      if (lastProp) {
        // Unset styles on `lastProp` but not on `nextProp`.
        for (styleName in lastProp) {
          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
            if (!styleUpdates) {
              styleUpdates = {};
            }
            styleUpdates[styleName] = '';
          }
        }
        // Update styles that changed since `lastProp`.
        for (styleName in nextProp) {
          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
            if (!styleUpdates) {
              styleUpdates = {};
            }
            styleUpdates[styleName] = nextProp[styleName];
          }
        }
      } else {
        // Relies on `updateStylesByID` not mutating `styleUpdates`.
        if (!styleUpdates) {
          if (!updatePayload) {
            updatePayload = [];
          }
          updatePayload.push(propKey, styleUpdates);
        }
        styleUpdates = nextProp;
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML] : undefined;
      var lastHtml = lastProp ? lastProp[HTML] : undefined;
      if (nextHtml != null) {
        if (lastHtml !== nextHtml) {
          (updatePayload = updatePayload || []).push(propKey, '' + nextHtml);
        }
      } else {
        // TODO: It might be too late to clear this if we have children
        // inserted already.
      }
    } else if (propKey === CHILDREN) {
      if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
      }
    } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        // We eagerly listen to this even though we haven't committed yet.
        if ( true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
      if (!updatePayload && lastProp !== nextProp) {
        // This is a special case. If any listener updates we need to ensure
        // that the "current" props pointer gets updated so we need a commit
        // to update this element.
        updatePayload = [];
      }
    } else {
      // For any other property we always add it to the queue and then we
      // filter it out using the whitelist during the commit.
      (updatePayload = updatePayload || []).push(propKey, nextProp);
    }
  }
  if (styleUpdates) {
    {
      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
    }
    (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
  }
  return updatePayload;
}

// Apply the diff.
function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  // Update checked *before* name.
  // In the middle of an update, it is possible to have multiple checked.
  // When a checked radio tries to change name, browser makes another radio's checked false.
  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
    updateChecked(domElement, nextRawProps);
  }

  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
  // Apply the diff.
  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);

  // TODO: Ensure that an update gets scheduled if any of the special props
  // changed.
  switch (tag) {
    case 'input':
      // Update the wrapper around inputs *after* updating props. This has to
      // happen after `updateDOMProperties`. Otherwise HTML5 input validations
      // raise warnings and prevent the new value from being assigned.
      updateWrapper(domElement, nextRawProps);
      break;
    case 'textarea':
      updateWrapper$1(domElement, nextRawProps);
      break;
    case 'select':
      // <select> value update needs to occur after <option> children
      // reconciliation
      postUpdateWrapper(domElement, nextRawProps);
      break;
  }
}

function getPossibleStandardName(propName) {
  {
    var lowerCasedName = propName.toLowerCase();
    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      return null;
    }
    return possibleStandardNames[lowerCasedName] || null;
  }
  return null;
}

function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  var isCustomComponentTag = void 0;
  var extraAttributeNames = void 0;

  {
    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
    isCustomComponentTag = isCustomComponent(tag, rawProps);
    validatePropertiesInDevelopment(tag, rawProps);
    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
      warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnShadyDOM = true;
    }
  }

  // TODO: Make sure that we check isMounted before firing any of these events.
  switch (tag) {
    case 'iframe':
    case 'object':
    case 'embed':
      trapBubbledEvent(TOP_LOAD, domElement);
      break;
    case 'video':
    case 'audio':
      // Create listener for each media event
      for (var i = 0; i < mediaEventTypes.length; i++) {
        trapBubbledEvent(mediaEventTypes[i], domElement);
      }
      break;
    case 'source':
      trapBubbledEvent(TOP_ERROR, domElement);
      break;
    case 'img':
    case 'image':
    case 'link':
      trapBubbledEvent(TOP_ERROR, domElement);
      trapBubbledEvent(TOP_LOAD, domElement);
      break;
    case 'form':
      trapBubbledEvent(TOP_RESET, domElement);
      trapBubbledEvent(TOP_SUBMIT, domElement);
      break;
    case 'details':
      trapBubbledEvent(TOP_TOGGLE, domElement);
      break;
    case 'input':
      initWrapperState(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'option':
      validateProps(domElement, rawProps);
      break;
    case 'select':
      initWrapperState$1(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
  }

  assertValidProps(tag, rawProps);

  {
    extraAttributeNames = new Set();
    var attributes = domElement.attributes;
    for (var _i = 0; _i < attributes.length; _i++) {
      var name = attributes[_i].name.toLowerCase();
      switch (name) {
        // Built-in SSR attribute is whitelisted
        case 'data-reactroot':
          break;
        // Controlled attributes are not validated
        // TODO: Only ignore them on controlled tags.
        case 'value':
          break;
        case 'checked':
          break;
        case 'selected':
          break;
        default:
          // Intentionally use the original name.
          // See discussion in https://github.com/facebook/react/pull/10676.
          extraAttributeNames.add(attributes[_i].name);
      }
    }
  }

  var updatePayload = null;
  for (var propKey in rawProps) {
    if (!rawProps.hasOwnProperty(propKey)) {
      continue;
    }
    var nextProp = rawProps[propKey];
    if (propKey === CHILDREN) {
      // For text content children we compare against textContent. This
      // might match additional HTML that is hidden when we read it using
      // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
      // satisfies our requirement. Our requirement is not to produce perfect
      // HTML and attributes. Ideally we should preserve structure but it's
      // ok not to if the visible content is still enough to indicate what
      // even listeners these nodes might be wired up to.
      // TODO: Warn if there is more than a single textNode as a child.
      // TODO: Should we use domElement.firstChild.nodeValue to compare?
      if (typeof nextProp === 'string') {
        if (domElement.textContent !== nextProp) {
          if ( true && !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }
          updatePayload = [CHILDREN, nextProp];
        }
      } else if (typeof nextProp === 'number') {
        if (domElement.textContent !== '' + nextProp) {
          if ( true && !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }
          updatePayload = [CHILDREN, '' + nextProp];
        }
      }
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
    } else if ( true &&
    // Convince Flow we've calculated it (it's DEV-only in this method.)
    typeof isCustomComponentTag === 'boolean') {
      // Validate that the properties correspond to their expected values.
      var serverValue = void 0;
      var propertyInfo = getPropertyInfo(propKey);
      if (suppressHydrationWarning) {
        // Don't bother comparing. We're ignoring all these warnings.
      } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 ||
      // Controlled attributes are not validated
      // TODO: Only ignore them on controlled tags.
      propKey === 'value' || propKey === 'checked' || propKey === 'selected') {
        // Noop
      } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
        var serverHTML = domElement.innerHTML;
        var nextHtml = nextProp ? nextProp[HTML] : undefined;
        var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
        if (expectedHTML !== serverHTML) {
          warnForPropDifference(propKey, serverHTML, expectedHTML);
        }
      } else if (propKey === STYLE$1) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey);

        if (canDiffStyleForHydrationWarning) {
          var expectedStyle = createDangerousStringForStyles(nextProp);
          serverValue = domElement.getAttribute('style');
          if (expectedStyle !== serverValue) {
            warnForPropDifference(propKey, serverValue, expectedStyle);
          }
        }
      } else if (isCustomComponentTag) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey.toLowerCase());
        serverValue = getValueForAttribute(domElement, propKey, nextProp);

        if (nextProp !== serverValue) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
        var isMismatchDueToBadCasing = false;
        if (propertyInfo !== null) {
          // $FlowFixMe - Should be inferred as not undefined.
          extraAttributeNames.delete(propertyInfo.attributeName);
          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
        } else {
          var ownNamespace = parentNamespace;
          if (ownNamespace === HTML_NAMESPACE) {
            ownNamespace = getIntrinsicNamespace(tag);
          }
          if (ownNamespace === HTML_NAMESPACE) {
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey.toLowerCase());
          } else {
            var standardName = getPossibleStandardName(propKey);
            if (standardName !== null && standardName !== propKey) {
              // If an SVG prop is supplied with bad casing, it will
              // be successfully parsed from HTML, but will produce a mismatch
              // (and would be incorrectly rendered on the client).
              // However, we already warn about bad casing elsewhere.
              // So we'll skip the misleading extra mismatch warning in this case.
              isMismatchDueToBadCasing = true;
              // $FlowFixMe - Should be inferred as not undefined.
              extraAttributeNames.delete(standardName);
            }
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey);
          }
          serverValue = getValueForAttribute(domElement, propKey, nextProp);
        }

        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      }
    }
  }

  {
    // $FlowFixMe - Should be inferred as not undefined.
    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
      // $FlowFixMe - Should be inferred as not undefined.
      warnForExtraAttributes(extraAttributeNames);
    }
  }

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, true);
      break;
    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement, rawProps);
      break;
    case 'select':
    case 'option':
      // For input and textarea we current always set the value property at
      // post mount to force it to diverge from attributes. However, for
      // option and select we don't quite do the same thing and select
      // is not resilient to the DOM state changing so we don't do that here.
      // TODO: Consider not doing this for input and textarea.
      break;
    default:
      if (typeof rawProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }

  return updatePayload;
}

function diffHydratedText(textNode, text) {
  var isDifferent = textNode.nodeValue !== text;
  return isDifferent;
}

function warnForUnmatchedText(textNode, text) {
  {
    warnForTextDifference(textNode.nodeValue, text);
  }
}

function warnForDeletedHydratableElement(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  }
}

function warnForDeletedHydratableText(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  }
}

function warnForInsertedHydratedElement(parentNode, tag, props) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  }
}

function warnForInsertedHydratedText(parentNode, text) {
  {
    if (text === '') {
      // We expect to insert empty text nodes since they're not represented in
      // the HTML.
      // TODO: Remove this special case if we can just avoid inserting empty
      // text nodes.
      return;
    }
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  }
}

function restoreControlledState$1(domElement, tag, props) {
  switch (tag) {
    case 'input':
      restoreControlledState(domElement, props);
      return;
    case 'textarea':
      restoreControlledState$3(domElement, props);
      return;
    case 'select':
      restoreControlledState$2(domElement, props);
      return;
  }
}

function listenToEventResponderEventTypes(eventTypes, element) {
  if (enableFlareAPI) {
    // Get the listening Set for this element. We use this to track
    // what events we're listening to.
    var listeningSet = getListeningSetForElement(element);

    // Go through each target event type of the event responder
    for (var i = 0, length = eventTypes.length; i < length; ++i) {
      var eventType = eventTypes[i];
      var isPassive = !endsWith(eventType, '_active');
      var eventKey = isPassive ? eventType + '_passive' : eventType;
      var targetEventType = isPassive ? eventType : eventType.substring(0, eventType.length - 7);
      if (!listeningSet.has(eventKey)) {
        trapEventForResponderEventSystem(element, targetEventType, isPassive);
        listeningSet.add(eventKey);
      }
    }
  }
}

// We can remove this once the event API is stable and out of a flag
if (enableFlareAPI) {
  setListenToResponderEventTypes(listenToEventResponderEventTypes);
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var validateDOMNesting = function () {};
var updatedAncestorInfo = function () {};

{
  // This validation code was written based on the HTML5 parsing spec:
  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  //
  // Note: this does not catch all invalid nesting, nor does it try to (as it's
  // not clear what practical benefit doing so provides); instead, we warn only
  // for cases where the parser will give a parse tree differing from what React
  // intended. For example, <b><div></div></b> is invalid but we don't warn
  // because it still parses correctly; we do warn for other cases like nested
  // <p> tags where the beginning of the second element implicitly closes the
  // first, causing a confusing mess.

  // https://html.spec.whatwg.org/multipage/syntax.html#special
  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];

  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',

  // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  // TODO: Distinguish by namespace here -- for <title>, including it here
  // errs on the side of fewer warnings
  'foreignObject', 'desc', 'title'];

  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  var buttonScopeTags = inScopeTags.concat(['button']);

  // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];

  var emptyAncestorInfo = {
    current: null,

    formTag: null,
    aTagInScope: null,
    buttonTagInScope: null,
    nobrTagInScope: null,
    pTagInButtonScope: null,

    listItemTagAutoclosing: null,
    dlItemTagAutoclosing: null
  };

  updatedAncestorInfo = function (oldInfo, tag) {
    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
    var info = { tag: tag };

    if (inScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.aTagInScope = null;
      ancestorInfo.buttonTagInScope = null;
      ancestorInfo.nobrTagInScope = null;
    }
    if (buttonScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.pTagInButtonScope = null;
    }

    // See rules for 'li', 'dd', 'dt' start tags in
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
      ancestorInfo.listItemTagAutoclosing = null;
      ancestorInfo.dlItemTagAutoclosing = null;
    }

    ancestorInfo.current = info;

    if (tag === 'form') {
      ancestorInfo.formTag = info;
    }
    if (tag === 'a') {
      ancestorInfo.aTagInScope = info;
    }
    if (tag === 'button') {
      ancestorInfo.buttonTagInScope = info;
    }
    if (tag === 'nobr') {
      ancestorInfo.nobrTagInScope = info;
    }
    if (tag === 'p') {
      ancestorInfo.pTagInButtonScope = info;
    }
    if (tag === 'li') {
      ancestorInfo.listItemTagAutoclosing = info;
    }
    if (tag === 'dd' || tag === 'dt') {
      ancestorInfo.dlItemTagAutoclosing = info;
    }

    return ancestorInfo;
  };

  /**
   * Returns whether
   */
  var isTagValidWithParent = function (tag, parentTag) {
    // First, let's check if we're in an unusual parsing mode...
    switch (parentTag) {
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
      case 'select':
        return tag === 'option' || tag === 'optgroup' || tag === '#text';
      case 'optgroup':
        return tag === 'option' || tag === '#text';
      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
      // but
      case 'option':
        return tag === '#text';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
      // No special behavior since these rules fall back to "in body" mode for
      // all except special table nodes which cause bad parsing behavior anyway.

      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
      case 'tr':
        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
      case 'tbody':
      case 'thead':
      case 'tfoot':
        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
      case 'colgroup':
        return tag === 'col' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
      case 'table':
        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
      case 'head':
        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
      case 'html':
        return tag === 'head' || tag === 'body' || tag === 'frameset';
      case 'frameset':
        return tag === 'frame';
      case '#document':
        return tag === 'html';
    }

    // Probably in the "in body" parsing mode, so we outlaw only tag combos
    // where the parsing rules cause implicit opens or closes to be added.
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
    switch (tag) {
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';

      case 'rp':
      case 'rt':
        return impliedEndTags.indexOf(parentTag) === -1;

      case 'body':
      case 'caption':
      case 'col':
      case 'colgroup':
      case 'frameset':
      case 'frame':
      case 'head':
      case 'html':
      case 'tbody':
      case 'td':
      case 'tfoot':
      case 'th':
      case 'thead':
      case 'tr':
        // These tags are only valid with a few parents that have special child
        // parsing rules -- if we're down here, then none of those matched and
        // so we allow it only if we don't know what the parent is, as all other
        // cases are invalid.
        return parentTag == null;
    }

    return true;
  };

  /**
   * Returns whether
   */
  var findInvalidAncestorForTag = function (tag, ancestorInfo) {
    switch (tag) {
      case 'address':
      case 'article':
      case 'aside':
      case 'blockquote':
      case 'center':
      case 'details':
      case 'dialog':
      case 'dir':
      case 'div':
      case 'dl':
      case 'fieldset':
      case 'figcaption':
      case 'figure':
      case 'footer':
      case 'header':
      case 'hgroup':
      case 'main':
      case 'menu':
      case 'nav':
      case 'ol':
      case 'p':
      case 'section':
      case 'summary':
      case 'ul':
      case 'pre':
      case 'listing':
      case 'table':
      case 'hr':
      case 'xmp':
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return ancestorInfo.pTagInButtonScope;

      case 'form':
        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;

      case 'li':
        return ancestorInfo.listItemTagAutoclosing;

      case 'dd':
      case 'dt':
        return ancestorInfo.dlItemTagAutoclosing;

      case 'button':
        return ancestorInfo.buttonTagInScope;

      case 'a':
        // Spec says something about storing a list of markers, but it sounds
        // equivalent to this check.
        return ancestorInfo.aTagInScope;

      case 'nobr':
        return ancestorInfo.nobrTagInScope;
    }

    return null;
  };

  var didWarn$1 = {};

  validateDOMNesting = function (childTag, childText, ancestorInfo) {
    ancestorInfo = ancestorInfo || emptyAncestorInfo;
    var parentInfo = ancestorInfo.current;
    var parentTag = parentInfo && parentInfo.tag;

    if (childText != null) {
      !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
      childTag = '#text';
    }

    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
    var invalidParentOrAncestor = invalidParent || invalidAncestor;
    if (!invalidParentOrAncestor) {
      return;
    }

    var ancestorTag = invalidParentOrAncestor.tag;
    var addendum = getCurrentFiberStackInDev();

    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
    if (didWarn$1[warnKey]) {
      return;
    }
    didWarn$1[warnKey] = true;

    var tagDisplayName = childTag;
    var whitespaceInfo = '';
    if (childTag === '#text') {
      if (/\S/.test(childText)) {
        tagDisplayName = 'Text nodes';
      } else {
        tagDisplayName = 'Whitespace text nodes';
        whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
      }
    } else {
      tagDisplayName = '<' + childTag + '>';
    }

    if (invalidParent) {
      var info = '';
      if (ancestorTag === 'table' && childTag === 'tr') {
        info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
      }
      warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
    } else {
      warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
    }
  };
}

// Renderers that don't support persistence
// can re-export everything from this module.

function shim() {
  (function () {
    {
      {
        throw ReactError(Error('The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
}

// Persistence (when unsupported)
var supportsPersistence = false;
var cloneInstance = shim;
var cloneFundamentalInstance = shim;
var createContainerChildSet = shim;
var appendChildToContainerChildSet = shim;
var finalizeContainerChildren = shim;
var replaceContainerChildren = shim;
var cloneHiddenInstance = shim;
var cloneHiddenTextInstance = shim;

var SUPPRESS_HYDRATION_WARNING = void 0;
{
  SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
}

var SUSPENSE_START_DATA = '$';
var SUSPENSE_END_DATA = '/$';
var SUSPENSE_PENDING_START_DATA = '$?';
var SUSPENSE_FALLBACK_START_DATA = '$!';

var STYLE = 'style';

var eventsEnabled = null;
var selectionInformation = null;

function shouldAutoFocusHostComponent(type, props) {
  switch (type) {
    case 'button':
    case 'input':
    case 'select':
    case 'textarea':
      return !!props.autoFocus;
  }
  return false;
}

function getRootHostContext(rootContainerInstance) {
  var type = void 0;
  var namespace = void 0;
  var nodeType = rootContainerInstance.nodeType;
  switch (nodeType) {
    case DOCUMENT_NODE:
    case DOCUMENT_FRAGMENT_NODE:
      {
        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
        var root = rootContainerInstance.documentElement;
        namespace = root ? root.namespaceURI : getChildNamespace(null, '');
        break;
      }
    default:
      {
        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
        var ownNamespace = container.namespaceURI || null;
        type = container.tagName;
        namespace = getChildNamespace(ownNamespace, type);
        break;
      }
  }
  {
    var validatedTag = type.toLowerCase();
    var _ancestorInfo = updatedAncestorInfo(null, validatedTag);
    return { namespace: namespace, ancestorInfo: _ancestorInfo };
  }
  return namespace;
}

function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  {
    var parentHostContextDev = parentHostContext;
    var _namespace = getChildNamespace(parentHostContextDev.namespace, type);
    var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
    return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };
  }
  var parentNamespace = parentHostContext;
  return getChildNamespace(parentNamespace, type);
}

function getPublicInstance(instance) {
  return instance;
}

function prepareForCommit(containerInfo) {
  eventsEnabled = isEnabled();
  selectionInformation = getSelectionInformation();
  setEnabled(false);
}

function resetAfterCommit(containerInfo) {
  restoreSelection(selectionInformation);
  selectionInformation = null;
  setEnabled(eventsEnabled);
  eventsEnabled = null;
}

function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  var parentNamespace = void 0;
  {
    // TODO: take namespace into account when validating.
    var hostContextDev = hostContext;
    validateDOMNesting(type, null, hostContextDev.ancestorInfo);
    if (typeof props.children === 'string' || typeof props.children === 'number') {
      var string = '' + props.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
    parentNamespace = hostContextDev.namespace;
  }
  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  precacheFiberNode(internalInstanceHandle, domElement);
  updateFiberProps(domElement, props);
  return domElement;
}

function appendInitialChild(parentInstance, child) {
  parentInstance.appendChild(child);
}

function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  setInitialProperties(domElement, type, props, rootContainerInstance);
  return shouldAutoFocusHostComponent(type, props);
}

function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  {
    var hostContextDev = hostContext;
    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
      var string = '' + newProps.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
  }
  return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
}

function shouldSetTextContent(type, props) {
  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
}

function shouldDeprioritizeSubtree(type, props) {
  return !!props.hidden;
}

function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  {
    var hostContextDev = hostContext;
    validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  }
  var textNode = createTextNode(text, rootContainerInstance);
  precacheFiberNode(internalInstanceHandle, textNode);
  return textNode;
}

var isPrimaryRenderer = true;
var warnsIfNotActing = true;
// This initialization code may run even on server environments
// if a component just imports ReactDOM (e.g. for findDOMNode).
// Some environments might not have setTimeout or clearTimeout.
var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
var noTimeout = -1;

// -------------------
//     Mutation
// -------------------

var supportsMutation = true;

function commitMount(domElement, type, newProps, internalInstanceHandle) {
  // Despite the naming that might imply otherwise, this method only
  // fires if there is an `Update` effect scheduled during mounting.
  // This happens if `finalizeInitialChildren` returns `true` (which it
  // does to implement the `autoFocus` attribute on the client). But
  // there are also other cases when this might happen (such as patching
  // up text content during hydration mismatch). So we'll check this again.
  if (shouldAutoFocusHostComponent(type, newProps)) {
    domElement.focus();
  }
}

function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  // Update the props handle so that we know which props are the ones with
  // with current event handlers.
  updateFiberProps(domElement, newProps);
  // Apply the diff to the DOM node.
  updateProperties(domElement, updatePayload, type, oldProps, newProps);
}

function resetTextContent(domElement) {
  setTextContent(domElement, '');
}

function commitTextUpdate(textInstance, oldText, newText) {
  textInstance.nodeValue = newText;
}

function appendChild(parentInstance, child) {
  parentInstance.appendChild(child);
}

function appendChildToContainer(container, child) {
  var parentNode = void 0;
  if (container.nodeType === COMMENT_NODE) {
    parentNode = container.parentNode;
    parentNode.insertBefore(child, container);
  } else {
    parentNode = container;
    parentNode.appendChild(child);
  }
  // This container might be used for a portal.
  // If something inside a portal is clicked, that click should bubble
  // through the React tree. However, on Mobile Safari the click would
  // never bubble through the *DOM* tree unless an ancestor with onclick
  // event exists. So we wouldn't see it and dispatch it.
  // This is why we ensure that non React root containers have inline onclick
  // defined.
  // https://github.com/facebook/react/issues/11918
  var reactRootContainer = container._reactRootContainer;
  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
    // TODO: This cast may not be sound for SVG, MathML or custom elements.
    trapClickOnNonInteractiveElement(parentNode);
  }
}

function insertBefore(parentInstance, child, beforeChild) {
  parentInstance.insertBefore(child, beforeChild);
}

function insertInContainerBefore(container, child, beforeChild) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.insertBefore(child, beforeChild);
  } else {
    container.insertBefore(child, beforeChild);
  }
}

function removeChild(parentInstance, child) {
  parentInstance.removeChild(child);
}

function removeChildFromContainer(container, child) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.removeChild(child);
  } else {
    container.removeChild(child);
  }
}

function clearSuspenseBoundary(parentInstance, suspenseInstance) {
  var node = suspenseInstance;
  // Delete all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.
  var depth = 0;
  do {
    var nextNode = node.nextSibling;
    parentInstance.removeChild(node);
    if (nextNode && nextNode.nodeType === COMMENT_NODE) {
      var data = nextNode.data;
      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          parentInstance.removeChild(nextNode);
          return;
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
        depth++;
      }
    }
    node = nextNode;
  } while (node);
  // TODO: Warn, we didn't find the end comment boundary.
}

function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
  if (container.nodeType === COMMENT_NODE) {
    clearSuspenseBoundary(container.parentNode, suspenseInstance);
  } else if (container.nodeType === ELEMENT_NODE) {
    clearSuspenseBoundary(container, suspenseInstance);
  } else {
    // Document nodes should never contain suspense boundaries.
  }
}

function hideInstance(instance) {
  // TODO: Does this work for all element types? What about MathML? Should we
  // pass host context to this method?
  instance = instance;
  var style = instance.style;
  if (typeof style.setProperty === 'function') {
    style.setProperty('display', 'none', 'important');
  } else {
    style.display = 'none';
  }
}

function hideTextInstance(textInstance) {
  textInstance.nodeValue = '';
}

function unhideInstance(instance, props) {
  instance = instance;
  var styleProp = props[STYLE];
  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  instance.style.display = dangerousStyleValue('display', display);
}

function unhideTextInstance(textInstance, text) {
  textInstance.nodeValue = text;
}

// -------------------
//     Hydration
// -------------------

var supportsHydration = true;

function canHydrateInstance(instance, type, props) {
  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
    return null;
  }
  // This has now been refined to an element node.
  return instance;
}

function canHydrateTextInstance(instance, text) {
  if (text === '' || instance.nodeType !== TEXT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  }
  // This has now been refined to a text node.
  return instance;
}

function canHydrateSuspenseInstance(instance) {
  if (instance.nodeType !== COMMENT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  }
  // This has now been refined to a suspense node.
  return instance;
}

function isSuspenseInstancePending(instance) {
  return instance.data === SUSPENSE_PENDING_START_DATA;
}

function isSuspenseInstanceFallback(instance) {
  return instance.data === SUSPENSE_FALLBACK_START_DATA;
}

function registerSuspenseInstanceRetry(instance, callback) {
  instance._reactRetry = callback;
}

function getNextHydratable(node) {
  // Skip non-hydratable nodes.
  for (; node != null; node = node.nextSibling) {
    var nodeType = node.nodeType;
    if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
      break;
    }
    if (enableSuspenseServerRenderer) {
      if (nodeType === COMMENT_NODE) {
        break;
      }
      var nodeData = node.data;
      if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
        break;
      }
    }
  }
  return node;
}

function getNextHydratableSibling(instance) {
  return getNextHydratable(instance.nextSibling);
}

function getFirstHydratableChild(parentInstance) {
  return getNextHydratable(parentInstance.firstChild);
}

function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, instance);
  // TODO: Possibly defer this until the commit phase where all the events
  // get attached.
  updateFiberProps(instance, props);
  var parentNamespace = void 0;
  {
    var hostContextDev = hostContext;
    parentNamespace = hostContextDev.namespace;
  }
  return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
}

function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, textInstance);
  return diffHydratedText(textInstance, text);
}

function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  var node = suspenseInstance.nextSibling;
  // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.
  var depth = 0;
  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;
      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          return getNextHydratableSibling(node);
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA) {
        depth++;
      }
    }
    node = node.nextSibling;
  }
  // TODO: Warn, we didn't find the end comment boundary.
  return null;
}

function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  {
    warnForUnmatchedText(textInstance, text);
  }
}

function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForUnmatchedText(textInstance, text);
  }
}

function didNotHydrateContainerInstance(parentContainer, instance) {
  {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentContainer, instance);
    } else if (instance.nodeType === COMMENT_NODE) {
      // TODO: warnForDeletedHydratableSuspenseBoundary
    } else {
      warnForDeletedHydratableText(parentContainer, instance);
    }
  }
}

function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentInstance, instance);
    } else if (instance.nodeType === COMMENT_NODE) {
      // TODO: warnForDeletedHydratableSuspenseBoundary
    } else {
      warnForDeletedHydratableText(parentInstance, instance);
    }
  }
}

function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  {
    warnForInsertedHydratedElement(parentContainer, type, props);
  }
}

function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  {
    warnForInsertedHydratedText(parentContainer, text);
  }
}



function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForInsertedHydratedElement(parentInstance, type, props);
  }
}

function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForInsertedHydratedText(parentInstance, text);
  }
}

function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    // TODO: warnForInsertedHydratedSuspense(parentInstance);
  }
}

function mountResponderInstance(responder, responderInstance, responderProps, responderState, instance, rootContainerInstance) {
  // Listen to events
  var doc = rootContainerInstance.ownerDocument;
  var documentBody = doc.body || doc;
  var _ref = responder,
      rootEventTypes = _ref.rootEventTypes,
      targetEventTypes = _ref.targetEventTypes;

  if (targetEventTypes !== null) {
    listenToEventResponderEventTypes(targetEventTypes, documentBody);
  }
  if (rootEventTypes !== null) {
    addRootEventTypesForResponderInstance(responderInstance, rootEventTypes);
    listenToEventResponderEventTypes(rootEventTypes, documentBody);
  }
  mountEventResponder(responder, responderInstance, responderProps, responderState);
  return responderInstance;
}

function unmountResponderInstance(responderInstance) {
  if (enableFlareAPI) {
    // TODO stop listening to targetEventTypes
    unmountEventResponder(responderInstance);
  }
}

function getFundamentalComponentInstance(fundamentalInstance) {
  if (enableFundamentalAPI) {
    var currentFiber = fundamentalInstance.currentFiber,
        impl = fundamentalInstance.impl,
        _props = fundamentalInstance.props,
        state = fundamentalInstance.state;

    var instance = impl.getInstance(null, _props, state);
    precacheFiberNode(currentFiber, instance);
    return instance;
  }
  // Because of the flag above, this gets around the Flow error;
  return null;
}

function mountFundamentalComponent(fundamentalInstance) {
  if (enableFundamentalAPI) {
    var impl = fundamentalInstance.impl,
        instance = fundamentalInstance.instance,
        _props2 = fundamentalInstance.props,
        state = fundamentalInstance.state;

    var onMount = impl.onMount;
    if (onMount !== undefined) {
      onMount(null, instance, _props2, state);
    }
  }
}

function shouldUpdateFundamentalComponent(fundamentalInstance) {
  if (enableFundamentalAPI) {
    var impl = fundamentalInstance.impl,
        prevProps = fundamentalInstance.prevProps,
        _props3 = fundamentalInstance.props,
        state = fundamentalInstance.state;

    var shouldUpdate = impl.shouldUpdate;
    if (shouldUpdate !== undefined) {
      return shouldUpdate(null, prevProps, _props3, state);
    }
  }
  return true;
}

function updateFundamentalComponent(fundamentalInstance) {
  if (enableFundamentalAPI) {
    var impl = fundamentalInstance.impl,
        instance = fundamentalInstance.instance,
        prevProps = fundamentalInstance.prevProps,
        _props4 = fundamentalInstance.props,
        state = fundamentalInstance.state;

    var onUpdate = impl.onUpdate;
    if (onUpdate !== undefined) {
      onUpdate(null, instance, prevProps, _props4, state);
    }
  }
}

function unmountFundamentalComponent(fundamentalInstance) {
  if (enableFundamentalAPI) {
    var impl = fundamentalInstance.impl,
        instance = fundamentalInstance.instance,
        _props5 = fundamentalInstance.props,
        state = fundamentalInstance.state;

    var onUnmount = impl.onUnmount;
    if (onUnmount !== undefined) {
      onUnmount(null, instance, _props5, state);
    }
  }
}

// Prefix measurements so that it's possible to filter them.
// Longer prefixes are hard to read in DevTools.
var reactEmoji = '\u269B';
var warningEmoji = '\u26D4';
var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';

// Keep track of current fiber so that we know the path to unwind on pause.
// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
var currentFiber = null;
// If we're in the middle of user code, which fiber and method is it?
// Reusing `currentFiber` would be confusing for this because user code fiber
// can change during commit phase too, but we don't need to unwind it (since
// lifecycles in the commit phase don't resemble a tree).
var currentPhase = null;
var currentPhaseFiber = null;
// Did lifecycle hook schedule an update? This is often a performance problem,
// so we will keep track of it, and include it in the report.
// Track commits caused by cascading updates.
var isCommitting = false;
var hasScheduledUpdateInCurrentCommit = false;
var hasScheduledUpdateInCurrentPhase = false;
var commitCountInCurrentWorkLoop = 0;
var effectCountInCurrentCommit = 0;
var isWaitingForCallback = false;
// During commits, we only show a measurement once per method name
// to avoid stretch the commit phase with measurement overhead.
var labelsInCurrentCommit = new Set();

var formatMarkName = function (markName) {
  return reactEmoji + ' ' + markName;
};

var formatLabel = function (label, warning) {
  var prefix = warning ? warningEmoji + ' ' : reactEmoji + ' ';
  var suffix = warning ? ' Warning: ' + warning : '';
  return '' + prefix + label + suffix;
};

var beginMark = function (markName) {
  performance.mark(formatMarkName(markName));
};

var clearMark = function (markName) {
  performance.clearMarks(formatMarkName(markName));
};

var endMark = function (label, markName, warning) {
  var formattedMarkName = formatMarkName(markName);
  var formattedLabel = formatLabel(label, warning);
  try {
    performance.measure(formattedLabel, formattedMarkName);
  } catch (err) {}
  // If previous mark was missing for some reason, this will throw.
  // This could only happen if React crashed in an unexpected place earlier.
  // Don't pile on with more errors.

  // Clear marks immediately to avoid growing buffer.
  performance.clearMarks(formattedMarkName);
  performance.clearMeasures(formattedLabel);
};

var getFiberMarkName = function (label, debugID) {
  return label + ' (#' + debugID + ')';
};

var getFiberLabel = function (componentName, isMounted, phase) {
  if (phase === null) {
    // These are composite component total time measurements.
    return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']';
  } else {
    // Composite component methods.
    return componentName + '.' + phase;
  }
};

var beginFiberMark = function (fiber, phase) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);

  if (isCommitting && labelsInCurrentCommit.has(label)) {
    // During the commit phase, we don't show duplicate labels because
    // there is a fixed overhead for every measurement, and we don't
    // want to stretch the commit phase beyond necessary.
    return false;
  }
  labelsInCurrentCommit.add(label);

  var markName = getFiberMarkName(label, debugID);
  beginMark(markName);
  return true;
};

var clearFiberMark = function (fiber, phase) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);
  var markName = getFiberMarkName(label, debugID);
  clearMark(markName);
};

var endFiberMark = function (fiber, phase, warning) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);
  var markName = getFiberMarkName(label, debugID);
  endMark(label, markName, warning);
};

var shouldIgnoreFiber = function (fiber) {
  // Host components should be skipped in the timeline.
  // We could check typeof fiber.type, but does this work with RN?
  switch (fiber.tag) {
    case HostRoot:
    case HostComponent:
    case HostText:
    case HostPortal:
    case Fragment:
    case ContextProvider:
    case ContextConsumer:
    case Mode:
      return true;
    default:
      return false;
  }
};

var clearPendingPhaseMeasurement = function () {
  if (currentPhase !== null && currentPhaseFiber !== null) {
    clearFiberMark(currentPhaseFiber, currentPhase);
  }
  currentPhaseFiber = null;
  currentPhase = null;
  hasScheduledUpdateInCurrentPhase = false;
};

var pauseTimers = function () {
  // Stops all currently active measurements so that they can be resumed
  // if we continue in a later deferred loop from the same unit of work.
  var fiber = currentFiber;
  while (fiber) {
    if (fiber._debugIsCurrentlyTiming) {
      endFiberMark(fiber, null, null);
    }
    fiber = fiber.return;
  }
};

var resumeTimersRecursively = function (fiber) {
  if (fiber.return !== null) {
    resumeTimersRecursively(fiber.return);
  }
  if (fiber._debugIsCurrentlyTiming) {
    beginFiberMark(fiber, null);
  }
};

var resumeTimers = function () {
  // Resumes all measurements that were active during the last deferred loop.
  if (currentFiber !== null) {
    resumeTimersRecursively(currentFiber);
  }
};

function recordEffect() {
  if (enableUserTimingAPI) {
    effectCountInCurrentCommit++;
  }
}

function recordScheduleUpdate() {
  if (enableUserTimingAPI) {
    if (isCommitting) {
      hasScheduledUpdateInCurrentCommit = true;
    }
    if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
      hasScheduledUpdateInCurrentPhase = true;
    }
  }
}

function startRequestCallbackTimer() {
  if (enableUserTimingAPI) {
    if (supportsUserTiming && !isWaitingForCallback) {
      isWaitingForCallback = true;
      beginMark('(Waiting for async callback...)');
    }
  }
}

function stopRequestCallbackTimer(didExpire) {
  if (enableUserTimingAPI) {
    if (supportsUserTiming) {
      isWaitingForCallback = false;
      var warning = didExpire ? 'Update expired; will flush synchronously' : null;
      endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning);
    }
  }
}

function startWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, this is the fiber to unwind from.
    currentFiber = fiber;
    if (!beginFiberMark(fiber, null)) {
      return;
    }
    fiber._debugIsCurrentlyTiming = true;
  }
}

function cancelWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // Remember we shouldn't complete measurement for this fiber.
    // Otherwise flamechart will be deep even for small updates.
    fiber._debugIsCurrentlyTiming = false;
    clearFiberMark(fiber, null);
  }
}

function stopWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, its parent is the fiber to unwind from.
    currentFiber = fiber.return;
    if (!fiber._debugIsCurrentlyTiming) {
      return;
    }
    fiber._debugIsCurrentlyTiming = false;
    endFiberMark(fiber, null, null);
  }
}

function stopFailedWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, its parent is the fiber to unwind from.
    currentFiber = fiber.return;
    if (!fiber._debugIsCurrentlyTiming) {
      return;
    }
    fiber._debugIsCurrentlyTiming = false;
    var warning = fiber.tag === SuspenseComponent || fiber.tag === DehydratedSuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
    endFiberMark(fiber, null, warning);
  }
}

function startPhaseTimer(fiber, phase) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    clearPendingPhaseMeasurement();
    if (!beginFiberMark(fiber, phase)) {
      return;
    }
    currentPhaseFiber = fiber;
    currentPhase = phase;
  }
}

function stopPhaseTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    if (currentPhase !== null && currentPhaseFiber !== null) {
      var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
      endFiberMark(currentPhaseFiber, currentPhase, warning);
    }
    currentPhase = null;
    currentPhaseFiber = null;
  }
}

function startWorkLoopTimer(nextUnitOfWork) {
  if (enableUserTimingAPI) {
    currentFiber = nextUnitOfWork;
    if (!supportsUserTiming) {
      return;
    }
    commitCountInCurrentWorkLoop = 0;
    // This is top level call.
    // Any other measurements are performed within.
    beginMark('(React Tree Reconciliation)');
    // Resume any measurements that were in progress during the last loop.
    resumeTimers();
  }
}

function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var warning = null;
    if (interruptedBy !== null) {
      if (interruptedBy.tag === HostRoot) {
        warning = 'A top-level update interrupted the previous render';
      } else {
        var componentName = getComponentName(interruptedBy.type) || 'Unknown';
        warning = 'An update to ' + componentName + ' interrupted the previous render';
      }
    } else if (commitCountInCurrentWorkLoop > 1) {
      warning = 'There were cascading updates';
    }
    commitCountInCurrentWorkLoop = 0;
    var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)';
    // Pause any measurements until the next loop.
    pauseTimers();
    endMark(label, '(React Tree Reconciliation)', warning);
  }
}

function startCommitTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    isCommitting = true;
    hasScheduledUpdateInCurrentCommit = false;
    labelsInCurrentCommit.clear();
    beginMark('(Committing Changes)');
  }
}

function stopCommitTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }

    var warning = null;
    if (hasScheduledUpdateInCurrentCommit) {
      warning = 'Lifecycle hook scheduled a cascading update';
    } else if (commitCountInCurrentWorkLoop > 0) {
      warning = 'Caused by a cascading update in earlier commit';
    }
    hasScheduledUpdateInCurrentCommit = false;
    commitCountInCurrentWorkLoop++;
    isCommitting = false;
    labelsInCurrentCommit.clear();

    endMark('(Committing Changes)', '(Committing Changes)', warning);
  }
}

function startCommitSnapshotEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Committing Snapshot Effects)');
  }
}

function stopCommitSnapshotEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Committing Snapshot Effects: ' + count + ' Total)', '(Committing Snapshot Effects)', null);
  }
}

function startCommitHostEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Committing Host Effects)');
  }
}

function stopCommitHostEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null);
  }
}

function startCommitLifeCyclesTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Calling Lifecycle Methods)');
  }
}

function stopCommitLifeCyclesTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null);
  }
}

var valueStack = [];

var fiberStack = void 0;

{
  fiberStack = [];
}

var index = -1;

function createCursor(defaultValue) {
  return {
    current: defaultValue
  };
}

function pop(cursor, fiber) {
  if (index < 0) {
    {
      warningWithoutStack$1(false, 'Unexpected pop.');
    }
    return;
  }

  {
    if (fiber !== fiberStack[index]) {
      warningWithoutStack$1(false, 'Unexpected Fiber popped.');
    }
  }

  cursor.current = valueStack[index];

  valueStack[index] = null;

  {
    fiberStack[index] = null;
  }

  index--;
}

function push(cursor, value, fiber) {
  index++;

  valueStack[index] = cursor.current;

  {
    fiberStack[index] = fiber;
  }

  cursor.current = value;
}

var warnedAboutMissingGetChildContext = void 0;

{
  warnedAboutMissingGetChildContext = {};
}

var emptyContextObject = {};
{
  Object.freeze(emptyContextObject);
}

// A cursor to the current merged context object on the stack.
var contextStackCursor = createCursor(emptyContextObject);
// A cursor to a boolean indicating whether the context has changed.
var didPerformWorkStackCursor = createCursor(false);
// Keep track of the previous context object that was on the stack.
// We use this to get access to the parent context after we have already
// pushed the next context provider, and now need to merge their contexts.
var previousContext = emptyContextObject;

function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  if (disableLegacyContext) {
    return emptyContextObject;
  } else {
    if (didPushOwnContextIfProvider && isContextProvider(Component)) {
      // If the fiber is a context provider itself, when we read its context
      // we may have already pushed its own child context on the stack. A context
      // provider should not "see" its own child context. Therefore we read the
      // previous (parent) context instead for a context provider.
      return previousContext;
    }
    return contextStackCursor.current;
  }
}

function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  if (disableLegacyContext) {
    return;
  } else {
    var instance = workInProgress.stateNode;
    instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
    instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
  }
}

function getMaskedContext(workInProgress, unmaskedContext) {
  if (disableLegacyContext) {
    return emptyContextObject;
  } else {
    var type = workInProgress.type;
    var contextTypes = type.contextTypes;
    if (!contextTypes) {
      return emptyContextObject;
    }

    // Avoid recreating masked context unless unmasked context has changed.
    // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
    // This may trigger infinite loops if componentWillReceiveProps calls setState.
    var instance = workInProgress.stateNode;
    if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
      return instance.__reactInternalMemoizedMaskedChildContext;
    }

    var context = {};
    for (var key in contextTypes) {
      context[key] = unmaskedContext[key];
    }

    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
    }

    // Cache unmasked context so we can avoid recreating masked context unless necessary.
    // Context is created before the class component is instantiated so check for instance.
    if (instance) {
      cacheContext(workInProgress, unmaskedContext, context);
    }

    return context;
  }
}

function hasContextChanged() {
  if (disableLegacyContext) {
    return false;
  } else {
    return didPerformWorkStackCursor.current;
  }
}

function isContextProvider(type) {
  if (disableLegacyContext) {
    return false;
  } else {
    var childContextTypes = type.childContextTypes;
    return childContextTypes !== null && childContextTypes !== undefined;
  }
}

function popContext(fiber) {
  if (disableLegacyContext) {
    return;
  } else {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function popTopLevelContextObject(fiber) {
  if (disableLegacyContext) {
    return;
  } else {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function pushTopLevelContextObject(fiber, context, didChange) {
  if (disableLegacyContext) {
    return;
  } else {
    (function () {
      if (!(contextStackCursor.current === emptyContextObject)) {
        {
          throw ReactError(Error('Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();

    push(contextStackCursor, context, fiber);
    push(didPerformWorkStackCursor, didChange, fiber);
  }
}

function processChildContext(fiber, type, parentContext) {
  if (disableLegacyContext) {
    return parentContext;
  } else {
    var instance = fiber.stateNode;
    var childContextTypes = type.childContextTypes;

    // TODO (bvaughn) Replace this behavior with an invariant() in the future.
    // It has only been added in Fiber to match the (unintentional) behavior in Stack.
    if (typeof instance.getChildContext !== 'function') {
      {
        var componentName = getComponentName(type) || 'Unknown';

        if (!warnedAboutMissingGetChildContext[componentName]) {
          warnedAboutMissingGetChildContext[componentName] = true;
          warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
        }
      }
      return parentContext;
    }

    var childContext = void 0;
    {
      setCurrentPhase('getChildContext');
    }
    startPhaseTimer(fiber, 'getChildContext');
    childContext = instance.getChildContext();
    stopPhaseTimer();
    {
      setCurrentPhase(null);
    }
    for (var contextKey in childContext) {
      (function () {
        if (!(contextKey in childContextTypes)) {
          {
            throw ReactError(Error((getComponentName(type) || 'Unknown') + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'));
          }
        }
      })();
    }
    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(childContextTypes, childContext, 'child context', name,
      // In practice, there is one case in which we won't get a stack. It's when
      // somebody calls unstable_renderSubtreeIntoContainer() and we process
      // context from the parent component instance. The stack will be missing
      // because it's outside of the reconciliation, and so the pointer has not
      // been set. This is rare and doesn't matter. We'll also remove that API.
      getCurrentFiberStackInDev);
    }

    return _assign({}, parentContext, childContext);
  }
}

function pushContextProvider(workInProgress) {
  if (disableLegacyContext) {
    return false;
  } else {
    var instance = workInProgress.stateNode;
    // We push the context as early as possible to ensure stack integrity.
    // If the instance does not exist yet, we will push null at first,
    // and replace it on the stack later when invalidating the context.
    var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;

    // Remember the parent context so we can merge with it later.
    // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
    previousContext = contextStackCursor.current;
    push(contextStackCursor, memoizedMergedChildContext, workInProgress);
    push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);

    return true;
  }
}

function invalidateContextProvider(workInProgress, type, didChange) {
  if (disableLegacyContext) {
    return;
  } else {
    var instance = workInProgress.stateNode;
    (function () {
      if (!instance) {
        {
          throw ReactError(Error('Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();

    if (didChange) {
      // Merge parent and own context.
      // Skip this if we're not updating due to sCU.
      // This avoids unnecessarily recomputing memoized values.
      var mergedContext = processChildContext(workInProgress, type, previousContext);
      instance.__reactInternalMemoizedMergedChildContext = mergedContext;

      // Replace the old (or empty) context with the new one.
      // It is important to unwind the context in the reverse order.
      pop(didPerformWorkStackCursor, workInProgress);
      pop(contextStackCursor, workInProgress);
      // Now push the new context and mark that it has changed.
      push(contextStackCursor, mergedContext, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    } else {
      pop(didPerformWorkStackCursor, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    }
  }
}

function findCurrentUnmaskedContext(fiber) {
  if (disableLegacyContext) {
    return emptyContextObject;
  } else {
    // Currently this is only used with renderSubtreeIntoContainer; not sure if it
    // makes sense elsewhere
    (function () {
      if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
        {
          throw ReactError(Error('Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();

    var node = fiber;
    do {
      switch (node.tag) {
        case HostRoot:
          return node.stateNode.context;
        case ClassComponent:
          {
            var Component = node.type;
            if (isContextProvider(Component)) {
              return node.stateNode.__reactInternalMemoizedMergedChildContext;
            }
            break;
          }
      }
      node = node.return;
    } while (node !== null);
    (function () {
      {
        {
          throw ReactError(Error('Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }
}

var LegacyRoot = 0;
var BatchedRoot = 1;
var ConcurrentRoot = 2;

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority;
var Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback;
var Scheduler_cancelCallback = Scheduler.unstable_cancelCallback;
var Scheduler_shouldYield = Scheduler.unstable_shouldYield;
var Scheduler_requestPaint = Scheduler.unstable_requestPaint;
var Scheduler_now = Scheduler.unstable_now;
var Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
var Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority;
var Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
var Scheduler_NormalPriority = Scheduler.unstable_NormalPriority;
var Scheduler_LowPriority = Scheduler.unstable_LowPriority;
var Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;


if (enableSchedulerTracing) {
  // Provide explicit error message when production+profiling bundle of e.g.
  // react-dom is used with production (non-profiling) bundle of
  // scheduler/tracing
  (function () {
    if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
      {
        throw ReactError(Error('It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling'));
      }
    }
  })();
}

var fakeCallbackNode = {};

// Except for NoPriority, these correspond to Scheduler priorities. We use
// ascending numbers so we can compare them like numbers. They start at 90 to
// avoid clashing with Scheduler's priorities.
var ImmediatePriority = 99;
var UserBlockingPriority$2 = 98;
var NormalPriority = 97;
var LowPriority = 96;
var IdlePriority = 95;
// NoPriority is the absence of priority. Also React-only.
var NoPriority = 90;

var shouldYield = Scheduler_shouldYield;
var requestPaint =
// Fall back gracefully if we're running an older version of Scheduler.
Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};

var syncQueue = null;
var immediateQueueCallbackNode = null;
var isFlushingSyncQueue = false;
var initialTimeMs = Scheduler_now();

// If the initial timestamp is reasonably small, use Scheduler's `now` directly.
// This will be the case for modern browsers that support `performance.now`. In
// older browsers, Scheduler falls back to `Date.now`, which returns a Unix
// timestamp. In that case, subtract the module initialization time to simulate
// the behavior of performance.now and keep our times small enough to fit
// within 32 bits.
// TODO: Consider lifting this into Scheduler.
var now = initialTimeMs < 10000 ? Scheduler_now : function () {
  return Scheduler_now() - initialTimeMs;
};

function getCurrentPriorityLevel() {
  switch (Scheduler_getCurrentPriorityLevel()) {
    case Scheduler_ImmediatePriority:
      return ImmediatePriority;
    case Scheduler_UserBlockingPriority:
      return UserBlockingPriority$2;
    case Scheduler_NormalPriority:
      return NormalPriority;
    case Scheduler_LowPriority:
      return LowPriority;
    case Scheduler_IdlePriority:
      return IdlePriority;
    default:
      (function () {
        {
          {
            throw ReactError(Error('Unknown priority level.'));
          }
        }
      })();
  }
}

function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  switch (reactPriorityLevel) {
    case ImmediatePriority:
      return Scheduler_ImmediatePriority;
    case UserBlockingPriority$2:
      return Scheduler_UserBlockingPriority;
    case NormalPriority:
      return Scheduler_NormalPriority;
    case LowPriority:
      return Scheduler_LowPriority;
    case IdlePriority:
      return Scheduler_IdlePriority;
    default:
      (function () {
        {
          {
            throw ReactError(Error('Unknown priority level.'));
          }
        }
      })();
  }
}

function runWithPriority$2(reactPriorityLevel, fn) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_runWithPriority(priorityLevel, fn);
}

function scheduleCallback(reactPriorityLevel, callback, options) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_scheduleCallback(priorityLevel, callback, options);
}

function scheduleSyncCallback(callback) {
  // Push this callback into an internal queue. We'll flush these either in
  // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
  if (syncQueue === null) {
    syncQueue = [callback];
    // Flush the queue in the next tick, at the earliest.
    immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
  } else {
    // Push onto existing queue. Don't need to schedule a callback because
    // we already scheduled one when we created the queue.
    syncQueue.push(callback);
  }
  return fakeCallbackNode;
}

function cancelCallback(callbackNode) {
  if (callbackNode !== fakeCallbackNode) {
    Scheduler_cancelCallback(callbackNode);
  }
}

function flushSyncCallbackQueue() {
  if (immediateQueueCallbackNode !== null) {
    Scheduler_cancelCallback(immediateQueueCallbackNode);
  }
  flushSyncCallbackQueueImpl();
}

function flushSyncCallbackQueueImpl() {
  if (!isFlushingSyncQueue && syncQueue !== null) {
    // Prevent re-entrancy.
    isFlushingSyncQueue = true;
    var i = 0;
    try {
      var _isSync = true;
      var queue = syncQueue;
      runWithPriority$2(ImmediatePriority, function () {
        for (; i < queue.length; i++) {
          var callback = queue[i];
          do {
            callback = callback(_isSync);
          } while (callback !== null);
        }
      });
      syncQueue = null;
    } catch (error) {
      // If something throws, leave the remaining callbacks on the queue.
      if (syncQueue !== null) {
        syncQueue = syncQueue.slice(i + 1);
      }
      // Resume flushing in the next tick
      Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
      throw error;
    } finally {
      isFlushingSyncQueue = false;
    }
  }
}

var NoMode = 0;
var StrictMode = 1;
// TODO: Remove BatchedMode and ConcurrentMode by reading from the root
// tag instead
var BatchedMode = 2;
var ConcurrentMode = 4;
var ProfileMode = 8;

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var MAX_SIGNED_31_BIT_INT = 1073741823;

var NoWork = 0;
var Never = 1;
var Sync = MAX_SIGNED_31_BIT_INT;
var Batched = Sync - 1;

var UNIT_SIZE = 10;
var MAGIC_NUMBER_OFFSET = Batched - 1;

// 1 unit of expiration time represents 10ms.
function msToExpirationTime(ms) {
  // Always add an offset so that we don't clash with the magic number for NoWork.
  return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
}

function expirationTimeToMs(expirationTime) {
  return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
}

function ceiling(num, precision) {
  return ((num / precision | 0) + 1) * precision;
}

function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
  return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
}

// TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update
// the names to reflect.
var LOW_PRIORITY_EXPIRATION = 5000;
var LOW_PRIORITY_BATCH_SIZE = 250;

function computeAsyncExpiration(currentTime) {
  return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
}

function computeSuspenseExpiration(currentTime, timeoutMs) {
  // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?
  return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
}

// We intentionally set a higher expiration time for interactive updates in
// dev than in production.
//
// If the main thread is being blocked so long that you hit the expiration,
// it's a problem that could be solved with better scheduling.
//
// People will be more likely to notice this and fix it with the long
// expiration time in development.
//
// In production we opt for better UX at the risk of masking scheduling
// problems, by expiring fast.
var HIGH_PRIORITY_EXPIRATION = 500;
var HIGH_PRIORITY_BATCH_SIZE = 100;

function computeInteractiveExpiration(currentTime) {
  return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
}

function inferPriorityFromExpirationTime(currentTime, expirationTime) {
  if (expirationTime === Sync) {
    return ImmediatePriority;
  }
  if (expirationTime === Never) {
    return IdlePriority;
  }
  var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
  if (msUntil <= 0) {
    return ImmediatePriority;
  }
  if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
    return UserBlockingPriority$2;
  }
  if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
    return NormalPriority;
  }

  // TODO: Handle LowPriority

  // Assume anything lower has idle priority
  return IdlePriority;
}

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

var ReactStrictModeWarnings = {
  recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  flushPendingUnsafeLifecycleWarnings: function () {},
  recordLegacyContextWarning: function (fiber, instance) {},
  flushLegacyContextWarning: function () {},
  discardPendingWarnings: function () {}
};

{
  var findStrictRoot = function (fiber) {
    var maybeStrictRoot = null;

    var node = fiber;
    while (node !== null) {
      if (node.mode & StrictMode) {
        maybeStrictRoot = node;
      }
      node = node.return;
    }

    return maybeStrictRoot;
  };

  var setToSortedString = function (set) {
    var array = [];
    set.forEach(function (value) {
      array.push(value);
    });
    return array.sort().join(', ');
  };

  var pendingComponentWillMountWarnings = [];
  var pendingUNSAFE_ComponentWillMountWarnings = [];
  var pendingComponentWillReceivePropsWarnings = [];
  var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  var pendingComponentWillUpdateWarnings = [];
  var pendingUNSAFE_ComponentWillUpdateWarnings = [];

  // Tracks components we have already warned about.
  var didWarnAboutUnsafeLifecycles = new Set();

  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
    // Dedup strategy: Warn once per component.
    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
      return;
    }

    if (typeof instance.componentWillMount === 'function' &&
    // Don't warn about react-lifecycles-compat polyfilled components.
    instance.componentWillMount.__suppressDeprecationWarning !== true) {
      pendingComponentWillMountWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
      pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
    }

    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
      pendingComponentWillReceivePropsWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
    }

    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
      pendingComponentWillUpdateWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
      pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
    // We do an initial pass to gather component names
    var componentWillMountUniqueNames = new Set();
    if (pendingComponentWillMountWarnings.length > 0) {
      pendingComponentWillMountWarnings.forEach(function (fiber) {
        componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillMountWarnings = [];
    }

    var UNSAFE_componentWillMountUniqueNames = new Set();
    if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
      pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
        UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillMountWarnings = [];
    }

    var componentWillReceivePropsUniqueNames = new Set();
    if (pendingComponentWillReceivePropsWarnings.length > 0) {
      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
        componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });

      pendingComponentWillReceivePropsWarnings = [];
    }

    var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
    if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
        UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });

      pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    }

    var componentWillUpdateUniqueNames = new Set();
    if (pendingComponentWillUpdateWarnings.length > 0) {
      pendingComponentWillUpdateWarnings.forEach(function (fiber) {
        componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });

      pendingComponentWillUpdateWarnings = [];
    }

    var UNSAFE_componentWillUpdateUniqueNames = new Set();
    if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
      pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
        UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });

      pendingUNSAFE_ComponentWillUpdateWarnings = [];
    }

    // Finally, we flush all the warnings
    // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
    if (UNSAFE_componentWillMountUniqueNames.size > 0) {
      var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
      warningWithoutStack$1(false, 'Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
    }

    if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
      warningWithoutStack$1(false, 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
    }

    if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
      warningWithoutStack$1(false, 'Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
    }

    if (componentWillMountUniqueNames.size > 0) {
      var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);

      lowPriorityWarning$1(false, 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
    }

    if (componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);

      lowPriorityWarning$1(false, 'componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
    }

    if (componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);

      lowPriorityWarning$1(false, 'componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
    }
  };

  var pendingLegacyContextWarning = new Map();

  // Tracks components we have already warned about.
  var didWarnAboutLegacyContext = new Set();

  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
    var strictRoot = findStrictRoot(fiber);
    if (strictRoot === null) {
      warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
      return;
    }

    // Dedup strategy: Warn once per component.
    if (didWarnAboutLegacyContext.has(fiber.type)) {
      return;
    }

    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);

    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
      if (warningsForRoot === undefined) {
        warningsForRoot = [];
        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
      }
      warningsForRoot.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushLegacyContextWarning = function () {
    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
      var uniqueNames = new Set();
      fiberArray.forEach(function (fiber) {
        uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutLegacyContext.add(fiber.type);
      });

      var sortedNames = setToSortedString(uniqueNames);
      var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);

      warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree: %s' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-legacy-context', strictRootComponentStack, sortedNames);
    });
  };

  ReactStrictModeWarnings.discardPendingWarnings = function () {
    pendingComponentWillMountWarnings = [];
    pendingUNSAFE_ComponentWillMountWarnings = [];
    pendingComponentWillReceivePropsWarnings = [];
    pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    pendingComponentWillUpdateWarnings = [];
    pendingUNSAFE_ComponentWillUpdateWarnings = [];
    pendingLegacyContextWarning = new Map();
  };
}

// Resolves type to a family.


// Used by React Refresh runtime through DevTools Global Hook.


var resolveFamily = null;
// $FlowFixMe Flow gets confused by a WeakSet feature check below.
var failedBoundaries = null;

var setRefreshHandler = function (handler) {
  {
    resolveFamily = handler;
  }
};

function resolveFunctionForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }
    var family = resolveFamily(type);
    if (family === undefined) {
      return type;
    }
    // Use the latest known implementation.
    return family.current;
  }
}

function resolveClassForHotReloading(type) {
  // No implementation differences.
  return resolveFunctionForHotReloading(type);
}

function resolveForwardRefForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }
    var family = resolveFamily(type);
    if (family === undefined) {
      // Check if we're dealing with a real forwardRef. Don't want to crash early.
      if (type !== null && type !== undefined && typeof type.render === 'function') {
        // ForwardRef is special because its resolved .type is an object,
        // but it's possible that we only have its inner render function in the map.
        // If that inner render function is different, we'll build a new forwardRef type.
        var currentRender = resolveFunctionForHotReloading(type.render);
        if (type.render !== currentRender) {
          var syntheticType = {
            $$typeof: REACT_FORWARD_REF_TYPE,
            render: currentRender
          };
          if (type.displayName !== undefined) {
            syntheticType.displayName = type.displayName;
          }
          return syntheticType;
        }
      }
      return type;
    }
    // Use the latest known implementation.
    return family.current;
  }
}

function isCompatibleFamilyForHotReloading(fiber, element) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return false;
    }

    var prevType = fiber.elementType;
    var nextType = element.type;

    // If we got here, we know types aren't === equal.
    var needsCompareFamilies = false;

    var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;

    switch (fiber.tag) {
      case ClassComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          }
          break;
        }
      case FunctionComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            // We don't know the inner type yet.
            // We're going to assume that the lazy inner type is stable,
            // and so it is sufficient to avoid reconciling it away.
            // We're not going to unwrap or actually use the new lazy type.
            needsCompareFamilies = true;
          }
          break;
        }
      case ForwardRef:
        {
          if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }
          break;
        }
      case MemoComponent:
      case SimpleMemoComponent:
        {
          if ($$typeofNextType === REACT_MEMO_TYPE) {
            // TODO: if it was but can no longer be simple,
            // we shouldn't set this.
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }
          break;
        }
      default:
        return false;
    }

    // Check if both types have a family and it's the same one.
    if (needsCompareFamilies) {
      // Note: memo() and forwardRef() we'll compare outer rather than inner type.
      // This means both of them need to be registered to preserve state.
      // If we unwrapped and compared the inner types for wrappers instead,
      // then we would risk falsely saying two separate memo(Foo)
      // calls are equivalent because they wrap the same Foo function.
      var prevFamily = resolveFamily(prevType);
      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
        return true;
      }
    }
    return false;
  }
}

function markFailedErrorBoundaryForHotReloading(fiber) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }
    if (typeof WeakSet !== 'function') {
      return;
    }
    if (failedBoundaries === null) {
      failedBoundaries = new WeakSet();
    }
    failedBoundaries.add(fiber);
  }
}

var scheduleRefresh = function (root, update) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }
    var _staleFamilies = update.staleFamilies,
        _updatedFamilies = update.updatedFamilies;

    flushPassiveEffects();
    flushSync(function () {
      scheduleFibersWithFamiliesRecursively(root.current, _updatedFamilies, _staleFamilies);
    });
  }
};

var scheduleRoot = function (root, element) {
  {
    if (root.context !== emptyContextObject) {
      // Super edge case: root has a legacy _renderSubtree context
      // but we don't know the parentComponent so we can't pass it.
      // Just ignore. We'll delete this with _renderSubtree code path later.
      return;
    }
    flushPassiveEffects();
    updateContainerAtExpirationTime(element, root, null, Sync, null);
  }
};

function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
  {
    var alternate = fiber.alternate,
        child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;


    var candidateType = null;
    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;
      case ForwardRef:
        candidateType = type.render;
        break;
      default:
        break;
    }

    if (resolveFamily === null) {
      throw new Error('Expected resolveFamily to be set during hot reload.');
    }

    var needsRender = false;
    var needsRemount = false;
    if (candidateType !== null) {
      var family = resolveFamily(candidateType);
      if (family !== undefined) {
        if (staleFamilies.has(family)) {
          needsRemount = true;
        } else if (updatedFamilies.has(family)) {
          needsRender = true;
        }
      }
    }
    if (failedBoundaries !== null) {
      if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
        needsRemount = true;
      }
    }

    if (needsRemount) {
      fiber._debugNeedsRemount = true;
    }
    if (needsRemount || needsRender) {
      scheduleWork(fiber, Sync);
    }
    if (child !== null && !needsRemount) {
      scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
    }
    if (sibling !== null) {
      scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
    }
  }
}

var findHostInstancesForRefresh = function (root, families) {
  {
    var hostInstances = new Set();
    var types = new Set(families.map(function (family) {
      return family.current;
    }));
    findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
    return hostInstances;
  }
};

function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
  {
    var child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;


    var candidateType = null;
    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;
      case ForwardRef:
        candidateType = type.render;
        break;
      default:
        break;
    }

    var didMatch = false;
    if (candidateType !== null) {
      if (types.has(candidateType)) {
        didMatch = true;
      }
    }

    if (didMatch) {
      // We have a match. This only drills down to the closest host components.
      // There's no need to search deeper because for the purpose of giving
      // visual feedback, "flashing" outermost parent rectangles is sufficient.
      findHostInstancesForFiberShallowly(fiber, hostInstances);
    } else {
      // If there's no match, maybe there will be one further down in the child tree.
      if (child !== null) {
        findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
      }
    }

    if (sibling !== null) {
      findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
    }
  }
}

function findHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
    if (foundHostInstances) {
      return;
    }
    // If we didn't find any host children, fallback to closest host parent.
    var node = fiber;
    while (true) {
      switch (node.tag) {
        case HostComponent:
          hostInstances.add(node.stateNode);
          return;
        case HostPortal:
          hostInstances.add(node.stateNode.containerInfo);
          return;
        case HostRoot:
          hostInstances.add(node.stateNode.containerInfo);
          return;
      }
      if (node.return === null) {
        throw new Error('Expected to reach root first.');
      }
      node = node.return;
    }
  }
}

function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var node = fiber;
    var foundHostInstances = false;
    while (true) {
      if (node.tag === HostComponent) {
        // We got a match.
        foundHostInstances = true;
        hostInstances.add(node.stateNode);
        // There may still be more, so keep searching.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === fiber) {
        return foundHostInstances;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === fiber) {
          return foundHostInstances;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
  return false;
}

function resolveDefaultProps(Component, baseProps) {
  if (Component && Component.defaultProps) {
    // Resolve default props. Taken from ReactElement
    var props = _assign({}, baseProps);
    var defaultProps = Component.defaultProps;
    for (var propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
    return props;
  }
  return baseProps;
}

function readLazyComponentType(lazyComponent) {
  var status = lazyComponent._status;
  var result = lazyComponent._result;
  switch (status) {
    case Resolved:
      {
        var Component = result;
        return Component;
      }
    case Rejected:
      {
        var error = result;
        throw error;
      }
    case Pending:
      {
        var thenable = result;
        throw thenable;
      }
    default:
      {
        lazyComponent._status = Pending;
        var ctor = lazyComponent._ctor;
        var _thenable = ctor();
        _thenable.then(function (moduleObject) {
          if (lazyComponent._status === Pending) {
            var defaultExport = moduleObject.default;
            {
              if (defaultExport === undefined) {
                warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n  ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
              }
            }
            lazyComponent._status = Resolved;
            lazyComponent._result = defaultExport;
          }
        }, function (error) {
          if (lazyComponent._status === Pending) {
            lazyComponent._status = Rejected;
            lazyComponent._result = error;
          }
        });
        // Handle synchronous thenables.
        switch (lazyComponent._status) {
          case Resolved:
            return lazyComponent._result;
          case Rejected:
            throw lazyComponent._result;
        }
        lazyComponent._result = _thenable;
        throw _thenable;
      }
  }
}

var valueCursor = createCursor(null);

var rendererSigil = void 0;
{
  // Use this to detect multiple renderers using the same context
  rendererSigil = {};
}

var currentlyRenderingFiber = null;
var lastContextDependency = null;
var lastContextWithAllBitsObserved = null;

var isDisallowedContextReadInDEV = false;

function resetContextDependencies() {
  // This is called right before React yields execution, to ensure `readContext`
  // cannot be called outside the render phase.
  currentlyRenderingFiber = null;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;
  {
    isDisallowedContextReadInDEV = false;
  }
}

function enterDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = true;
  }
}

function exitDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = false;
  }
}

function pushProvider(providerFiber, nextValue) {
  var context = providerFiber.type._context;

  if (isPrimaryRenderer) {
    push(valueCursor, context._currentValue, providerFiber);

    context._currentValue = nextValue;
    {
      !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
      context._currentRenderer = rendererSigil;
    }
  } else {
    push(valueCursor, context._currentValue2, providerFiber);

    context._currentValue2 = nextValue;
    {
      !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
      context._currentRenderer2 = rendererSigil;
    }
  }
}

function popProvider(providerFiber) {
  var currentValue = valueCursor.current;

  pop(valueCursor, providerFiber);

  var context = providerFiber.type._context;
  if (isPrimaryRenderer) {
    context._currentValue = currentValue;
  } else {
    context._currentValue2 = currentValue;
  }
}

function calculateChangedBits(context, newValue, oldValue) {
  if (is(oldValue, newValue)) {
    // No change
    return 0;
  } else {
    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;

    {
      !((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
    }
    return changedBits | 0;
  }
}

function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  // Update the child expiration time of all the ancestors, including
  // the alternates.
  var node = parent;
  while (node !== null) {
    var alternate = node.alternate;
    if (node.childExpirationTime < renderExpirationTime) {
      node.childExpirationTime = renderExpirationTime;
      if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
        alternate.childExpirationTime = renderExpirationTime;
      }
    } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
      alternate.childExpirationTime = renderExpirationTime;
    } else {
      // Neither alternate was updated, which means the rest of the
      // ancestor path already has sufficient priority.
      break;
    }
    node = node.return;
  }
}

function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
  var fiber = workInProgress.child;
  if (fiber !== null) {
    // Set the return pointer of the child to the work-in-progress fiber.
    fiber.return = workInProgress;
  }
  while (fiber !== null) {
    var nextFiber = void 0;

    // Visit this fiber.
    var list = fiber.dependencies;
    if (list !== null) {
      nextFiber = fiber.child;

      var dependency = list.firstContext;
      while (dependency !== null) {
        // Check if the context matches.
        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
          // Match! Schedule an update on this fiber.

          if (fiber.tag === ClassComponent) {
            // Schedule a force update on the work-in-progress.
            var update = createUpdate(renderExpirationTime, null);
            update.tag = ForceUpdate;
            // TODO: Because we don't have a work-in-progress, this will add the
            // update to the current fiber, too, which means it will persist even if
            // this render is thrown away. Since it's a race condition, not sure it's
            // worth fixing.
            enqueueUpdate(fiber, update);
          }

          if (fiber.expirationTime < renderExpirationTime) {
            fiber.expirationTime = renderExpirationTime;
          }
          var alternate = fiber.alternate;
          if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
            alternate.expirationTime = renderExpirationTime;
          }

          scheduleWorkOnParentPath(fiber.return, renderExpirationTime);

          // Mark the expiration time on the list, too.
          if (list.expirationTime < renderExpirationTime) {
            list.expirationTime = renderExpirationTime;
          }

          // Since we already found a match, we can stop traversing the
          // dependency list.
          break;
        }
        dependency = dependency.next;
      }
    } else if (fiber.tag === ContextProvider) {
      // Don't scan deeper if this is a matching provider
      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
    } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedSuspenseComponent) {
      // If a dehydrated suspense component is in this subtree, we don't know
      // if it will have any context consumers in it. The best we can do is
      // mark it as having updates on its children.
      if (fiber.expirationTime < renderExpirationTime) {
        fiber.expirationTime = renderExpirationTime;
      }
      var _alternate = fiber.alternate;
      if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) {
        _alternate.expirationTime = renderExpirationTime;
      }
      // This is intentionally passing this fiber as the parent
      // because we want to schedule this fiber as having work
      // on its children. We'll use the childExpirationTime on
      // this fiber to indicate that a context has changed.
      scheduleWorkOnParentPath(fiber, renderExpirationTime);
      nextFiber = fiber.sibling;
    } else {
      // Traverse down.
      nextFiber = fiber.child;
    }

    if (nextFiber !== null) {
      // Set the return pointer of the child to the work-in-progress fiber.
      nextFiber.return = fiber;
    } else {
      // No child. Traverse to next sibling.
      nextFiber = fiber;
      while (nextFiber !== null) {
        if (nextFiber === workInProgress) {
          // We're back to the root of this subtree. Exit.
          nextFiber = null;
          break;
        }
        var sibling = nextFiber.sibling;
        if (sibling !== null) {
          // Set the return pointer of the sibling to the work-in-progress fiber.
          sibling.return = nextFiber.return;
          nextFiber = sibling;
          break;
        }
        // No more siblings. Traverse up.
        nextFiber = nextFiber.return;
      }
    }
    fiber = nextFiber;
  }
}

function prepareToReadContext(workInProgress, renderExpirationTime) {
  currentlyRenderingFiber = workInProgress;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;

  var dependencies = workInProgress.dependencies;
  if (dependencies !== null) {
    var firstContext = dependencies.firstContext;
    if (firstContext !== null) {
      if (dependencies.expirationTime >= renderExpirationTime) {
        // Context list has a pending update. Mark that this fiber performed work.
        markWorkInProgressReceivedUpdate();
      }
      // Reset the work-in-progress list
      dependencies.firstContext = null;
    }
  }
}

function readContext(context, observedBits) {
  {
    // This warning would fire if you read context inside a Hook like useMemo.
    // Unlike the class check below, it's not enforced in production for perf.
    !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
  }

  if (lastContextWithAllBitsObserved === context) {
    // Nothing to do. We already observe everything in this context.
  } else if (observedBits === false || observedBits === 0) {
    // Do not observe any updates.
  } else {
    var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types.
    if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
      // Observe all updates.
      lastContextWithAllBitsObserved = context;
      resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
    } else {
      resolvedObservedBits = observedBits;
    }

    var contextItem = {
      context: context,
      observedBits: resolvedObservedBits,
      next: null
    };

    if (lastContextDependency === null) {
      (function () {
        if (!(currentlyRenderingFiber !== null)) {
          {
            throw ReactError(Error('Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().'));
          }
        }
      })();

      // This is the first dependency for this component. Create a new list.
      lastContextDependency = contextItem;
      currentlyRenderingFiber.dependencies = {
        expirationTime: NoWork,
        firstContext: contextItem,
        responders: null
      };
    } else {
      // Append a new context item.
      lastContextDependency = lastContextDependency.next = contextItem;
    }
  }
  return isPrimaryRenderer ? context._currentValue : context._currentValue2;
}

// UpdateQueue is a linked list of prioritized updates.
//
// Like fibers, update queues come in pairs: a current queue, which represents
// the visible state of the screen, and a work-in-progress queue, which can be
// mutated and processed asynchronously before it is committed — a form of
// double buffering. If a work-in-progress render is discarded before finishing,
// we create a new work-in-progress by cloning the current queue.
//
// Both queues share a persistent, singly-linked list structure. To schedule an
// update, we append it to the end of both queues. Each queue maintains a
// pointer to first update in the persistent list that hasn't been processed.
// The work-in-progress pointer always has a position equal to or greater than
// the current queue, since we always work on that one. The current queue's
// pointer is only updated during the commit phase, when we swap in the
// work-in-progress.
//
// For example:
//
//   Current pointer:           A - B - C - D - E - F
//   Work-in-progress pointer:              D - E - F
//                                          ^
//                                          The work-in-progress queue has
//                                          processed more updates than current.
//
// The reason we append to both queues is because otherwise we might drop
// updates without ever processing them. For example, if we only add updates to
// the work-in-progress queue, some updates could be lost whenever a work-in
// -progress render restarts by cloning from current. Similarly, if we only add
// updates to the current queue, the updates will be lost whenever an already
// in-progress queue commits and swaps with the current queue. However, by
// adding to both queues, we guarantee that the update will be part of the next
// work-in-progress. (And because the work-in-progress queue becomes the
// current queue once it commits, there's no danger of applying the same
// update twice.)
//
// Prioritization
// --------------
//
// Updates are not sorted by priority, but by insertion; new updates are always
// appended to the end of the list.
//
// The priority is still important, though. When processing the update queue
// during the render phase, only the updates with sufficient priority are
// included in the result. If we skip an update because it has insufficient
// priority, it remains in the queue to be processed later, during a lower
// priority render. Crucially, all updates subsequent to a skipped update also
// remain in the queue *regardless of their priority*. That means high priority
// updates are sometimes processed twice, at two separate priorities. We also
// keep track of a base state, that represents the state before the first
// update in the queue is applied.
//
// For example:
//
//   Given a base state of '', and the following queue of updates
//
//     A1 - B2 - C1 - D2
//
//   where the number indicates the priority, and the update is applied to the
//   previous state by appending a letter, React will process these updates as
//   two separate renders, one per distinct priority level:
//
//   First render, at priority 1:
//     Base state: ''
//     Updates: [A1, C1]
//     Result state: 'AC'
//
//   Second render, at priority 2:
//     Base state: 'A'            <-  The base state does not include C1,
//                                    because B2 was skipped.
//     Updates: [B2, C1, D2]      <-  C1 was rebased on top of B2
//     Result state: 'ABCD'
//
// Because we process updates in insertion order, and rebase high priority
// updates when preceding updates are skipped, the final result is deterministic
// regardless of priority. Intermediate state may vary according to system
// resources, but the final state is always the same.

var UpdateState = 0;
var ReplaceState = 1;
var ForceUpdate = 2;
var CaptureUpdate = 3;

// Global state that is reset at the beginning of calling `processUpdateQueue`.
// It should only be read right after calling `processUpdateQueue`, via
// `checkHasForceUpdateAfterProcessing`.
var hasForceUpdate = false;

var didWarnUpdateInsideUpdate = void 0;
var currentlyProcessingQueue = void 0;

{
  didWarnUpdateInsideUpdate = false;
  currentlyProcessingQueue = null;
  
}

function createUpdateQueue(baseState) {
  var queue = {
    baseState: baseState,
    firstUpdate: null,
    lastUpdate: null,
    firstCapturedUpdate: null,
    lastCapturedUpdate: null,
    firstEffect: null,
    lastEffect: null,
    firstCapturedEffect: null,
    lastCapturedEffect: null
  };
  return queue;
}

function cloneUpdateQueue(currentQueue) {
  var queue = {
    baseState: currentQueue.baseState,
    firstUpdate: currentQueue.firstUpdate,
    lastUpdate: currentQueue.lastUpdate,

    // TODO: With resuming, if we bail out and resuse the child tree, we should
    // keep these effects.
    firstCapturedUpdate: null,
    lastCapturedUpdate: null,

    firstEffect: null,
    lastEffect: null,

    firstCapturedEffect: null,
    lastCapturedEffect: null
  };
  return queue;
}

function createUpdate(expirationTime, suspenseConfig) {
  var update = {
    expirationTime: expirationTime,
    suspenseConfig: suspenseConfig,

    tag: UpdateState,
    payload: null,
    callback: null,

    next: null,
    nextEffect: null
  };
  {
    update.priority = getCurrentPriorityLevel();
  }
  return update;
}

function appendUpdateToQueue(queue, update) {
  // Append the update to the end of the list.
  if (queue.lastUpdate === null) {
    // Queue is empty
    queue.firstUpdate = queue.lastUpdate = update;
  } else {
    queue.lastUpdate.next = update;
    queue.lastUpdate = update;
  }
}

function enqueueUpdate(fiber, update) {
  // Update queues are created lazily.
  var alternate = fiber.alternate;
  var queue1 = void 0;
  var queue2 = void 0;
  if (alternate === null) {
    // There's only one fiber.
    queue1 = fiber.updateQueue;
    queue2 = null;
    if (queue1 === null) {
      queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
    }
  } else {
    // There are two owners.
    queue1 = fiber.updateQueue;
    queue2 = alternate.updateQueue;
    if (queue1 === null) {
      if (queue2 === null) {
        // Neither fiber has an update queue. Create new ones.
        queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
        queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
      } else {
        // Only one fiber has an update queue. Clone to create a new one.
        queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
      }
    } else {
      if (queue2 === null) {
        // Only one fiber has an update queue. Clone to create a new one.
        queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
      } else {
        // Both owners have an update queue.
      }
    }
  }
  if (queue2 === null || queue1 === queue2) {
    // There's only a single queue.
    appendUpdateToQueue(queue1, update);
  } else {
    // There are two queues. We need to append the update to both queues,
    // while accounting for the persistent structure of the list — we don't
    // want the same update to be added multiple times.
    if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
      // One of the queues is not empty. We must add the update to both queues.
      appendUpdateToQueue(queue1, update);
      appendUpdateToQueue(queue2, update);
    } else {
      // Both queues are non-empty. The last update is the same in both lists,
      // because of structural sharing. So, only append to one of the lists.
      appendUpdateToQueue(queue1, update);
      // But we still need to update the `lastUpdate` pointer of queue2.
      queue2.lastUpdate = update;
    }
  }

  {
    if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
      warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
      didWarnUpdateInsideUpdate = true;
    }
  }
}

function enqueueCapturedUpdate(workInProgress, update) {
  // Captured updates go into a separate list, and only on the work-in-
  // progress queue.
  var workInProgressQueue = workInProgress.updateQueue;
  if (workInProgressQueue === null) {
    workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
  } else {
    // TODO: I put this here rather than createWorkInProgress so that we don't
    // clone the queue unnecessarily. There's probably a better way to
    // structure this.
    workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
  }

  // Append the update to the end of the list.
  if (workInProgressQueue.lastCapturedUpdate === null) {
    // This is the first render phase update
    workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
  } else {
    workInProgressQueue.lastCapturedUpdate.next = update;
    workInProgressQueue.lastCapturedUpdate = update;
  }
}

function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
  var current = workInProgress.alternate;
  if (current !== null) {
    // If the work-in-progress queue is equal to the current queue,
    // we need to clone it first.
    if (queue === current.updateQueue) {
      queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
    }
  }
  return queue;
}

function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  switch (update.tag) {
    case ReplaceState:
      {
        var _payload = update.payload;
        if (typeof _payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
            if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
              _payload.call(instance, prevState, nextProps);
            }
          }
          var nextState = _payload.call(instance, prevState, nextProps);
          {
            exitDisallowedContextReadInDEV();
          }
          return nextState;
        }
        // State object
        return _payload;
      }
    case CaptureUpdate:
      {
        workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
      }
    // Intentional fallthrough
    case UpdateState:
      {
        var _payload2 = update.payload;
        var partialState = void 0;
        if (typeof _payload2 === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
            if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
              _payload2.call(instance, prevState, nextProps);
            }
          }
          partialState = _payload2.call(instance, prevState, nextProps);
          {
            exitDisallowedContextReadInDEV();
          }
        } else {
          // Partial state object
          partialState = _payload2;
        }
        if (partialState === null || partialState === undefined) {
          // Null and undefined are treated as no-ops.
          return prevState;
        }
        // Merge the partial state and the previous state.
        return _assign({}, prevState, partialState);
      }
    case ForceUpdate:
      {
        hasForceUpdate = true;
        return prevState;
      }
  }
  return prevState;
}

function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
  hasForceUpdate = false;

  queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);

  {
    currentlyProcessingQueue = queue;
  }

  // These values may change as we process the queue.
  var newBaseState = queue.baseState;
  var newFirstUpdate = null;
  var newExpirationTime = NoWork;

  // Iterate through the list of updates to compute the result.
  var update = queue.firstUpdate;
  var resultState = newBaseState;
  while (update !== null) {
    var updateExpirationTime = update.expirationTime;
    if (updateExpirationTime < renderExpirationTime) {
      // This update does not have sufficient priority. Skip it.
      if (newFirstUpdate === null) {
        // This is the first skipped update. It will be the first update in
        // the new list.
        newFirstUpdate = update;
        // Since this is the first update that was skipped, the current result
        // is the new base state.
        newBaseState = resultState;
      }
      // Since this update will remain in the list, update the remaining
      // expiration time.
      if (newExpirationTime < updateExpirationTime) {
        newExpirationTime = updateExpirationTime;
      }
    } else {
      // This update does have sufficient priority.

      // Mark the event time of this update as relevant to this render pass.
      // TODO: This should ideally use the true event time of this update rather than
      // its priority which is a derived and not reverseable value.
      // TODO: We should skip this update if it was already committed but currently
      // we have no way of detecting the difference between a committed and suspended
      // update here.
      markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);

      // Process it and compute a new result.
      resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
      var _callback = update.callback;
      if (_callback !== null) {
        workInProgress.effectTag |= Callback;
        // Set this to null, in case it was mutated during an aborted render.
        update.nextEffect = null;
        if (queue.lastEffect === null) {
          queue.firstEffect = queue.lastEffect = update;
        } else {
          queue.lastEffect.nextEffect = update;
          queue.lastEffect = update;
        }
      }
    }
    // Continue to the next update.
    update = update.next;
  }

  // Separately, iterate though the list of captured updates.
  var newFirstCapturedUpdate = null;
  update = queue.firstCapturedUpdate;
  while (update !== null) {
    var _updateExpirationTime = update.expirationTime;
    if (_updateExpirationTime < renderExpirationTime) {
      // This update does not have sufficient priority. Skip it.
      if (newFirstCapturedUpdate === null) {
        // This is the first skipped captured update. It will be the first
        // update in the new list.
        newFirstCapturedUpdate = update;
        // If this is the first update that was skipped, the current result is
        // the new base state.
        if (newFirstUpdate === null) {
          newBaseState = resultState;
        }
      }
      // Since this update will remain in the list, update the remaining
      // expiration time.
      if (newExpirationTime < _updateExpirationTime) {
        newExpirationTime = _updateExpirationTime;
      }
    } else {
      // This update does have sufficient priority. Process it and compute
      // a new result.
      resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
      var _callback2 = update.callback;
      if (_callback2 !== null) {
        workInProgress.effectTag |= Callback;
        // Set this to null, in case it was mutated during an aborted render.
        update.nextEffect = null;
        if (queue.lastCapturedEffect === null) {
          queue.firstCapturedEffect = queue.lastCapturedEffect = update;
        } else {
          queue.lastCapturedEffect.nextEffect = update;
          queue.lastCapturedEffect = update;
        }
      }
    }
    update = update.next;
  }

  if (newFirstUpdate === null) {
    queue.lastUpdate = null;
  }
  if (newFirstCapturedUpdate === null) {
    queue.lastCapturedUpdate = null;
  } else {
    workInProgress.effectTag |= Callback;
  }
  if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
    // We processed every update, without skipping. That means the new base
    // state is the same as the result state.
    newBaseState = resultState;
  }

  queue.baseState = newBaseState;
  queue.firstUpdate = newFirstUpdate;
  queue.firstCapturedUpdate = newFirstCapturedUpdate;

  // Set the remaining expiration time to be whatever is remaining in the queue.
  // This should be fine because the only two other things that contribute to
  // expiration time are props and context. We're already in the middle of the
  // begin phase by the time we start processing the queue, so we've already
  // dealt with the props. Context in components that specify
  // shouldComponentUpdate is tricky; but we'll have to account for
  // that regardless.
  workInProgress.expirationTime = newExpirationTime;
  workInProgress.memoizedState = resultState;

  {
    currentlyProcessingQueue = null;
  }
}

function callCallback(callback, context) {
  (function () {
    if (!(typeof callback === 'function')) {
      {
        throw ReactError(Error('Invalid argument passed as callback. Expected a function. Instead received: ' + callback));
      }
    }
  })();
  callback.call(context);
}

function resetHasForceUpdateBeforeProcessing() {
  hasForceUpdate = false;
}

function checkHasForceUpdateAfterProcessing() {
  return hasForceUpdate;
}

function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
  // If the finished render included captured updates, and there are still
  // lower priority updates left over, we need to keep the captured updates
  // in the queue so that they are rebased and not dropped once we process the
  // queue again at the lower priority.
  if (finishedQueue.firstCapturedUpdate !== null) {
    // Join the captured update list to the end of the normal list.
    if (finishedQueue.lastUpdate !== null) {
      finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
      finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
    }
    // Clear the list of captured updates.
    finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
  }

  // Commit the effects
  commitUpdateEffects(finishedQueue.firstEffect, instance);
  finishedQueue.firstEffect = finishedQueue.lastEffect = null;

  commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
  finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
}

function commitUpdateEffects(effect, instance) {
  while (effect !== null) {
    var _callback3 = effect.callback;
    if (_callback3 !== null) {
      effect.callback = null;
      callCallback(_callback3, instance);
    }
    effect = effect.nextEffect;
  }
}

var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;


function requestCurrentSuspenseConfig() {
  return ReactCurrentBatchConfig.suspense;
}

var fakeInternalInstance = {};
var isArray$1 = Array.isArray;

// React.Component uses a shared frozen object by default.
// We'll use it to determine whether we need to initialize legacy refs.
var emptyRefsObject = new React.Component().refs;

var didWarnAboutStateAssignmentForComponent = void 0;
var didWarnAboutUninitializedState = void 0;
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0;
var didWarnAboutLegacyLifecyclesAndDerivedState = void 0;
var didWarnAboutUndefinedDerivedState = void 0;
var warnOnUndefinedDerivedState = void 0;
var warnOnInvalidCallback$1 = void 0;
var didWarnAboutDirectlyAssigningPropsToState = void 0;
var didWarnAboutContextTypeAndContextTypes = void 0;
var didWarnAboutInvalidateContextType = void 0;

{
  didWarnAboutStateAssignmentForComponent = new Set();
  didWarnAboutUninitializedState = new Set();
  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  didWarnAboutDirectlyAssigningPropsToState = new Set();
  didWarnAboutUndefinedDerivedState = new Set();
  didWarnAboutContextTypeAndContextTypes = new Set();
  didWarnAboutInvalidateContextType = new Set();

  var didWarnOnInvalidCallback = new Set();

  warnOnInvalidCallback$1 = function (callback, callerName) {
    if (callback === null || typeof callback === 'function') {
      return;
    }
    var key = callerName + '_' + callback;
    if (!didWarnOnInvalidCallback.has(key)) {
      didWarnOnInvalidCallback.add(key);
      warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  };

  warnOnUndefinedDerivedState = function (type, partialState) {
    if (partialState === undefined) {
      var componentName = getComponentName(type) || 'Component';
      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
        didWarnAboutUndefinedDerivedState.add(componentName);
        warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
      }
    }
  };

  // This is so gross but it's at least non-critical and can be removed if
  // it causes problems. This is meant to give a nicer error message for
  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  // ...)) which otherwise throws a "_processChildContext is not a function"
  // exception.
  Object.defineProperty(fakeInternalInstance, '_processChildContext', {
    enumerable: false,
    value: function () {
      (function () {
        {
          {
            throw ReactError(Error('_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'));
          }
        }
      })();
    }
  });
  Object.freeze(fakeInternalInstance);
}

function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  var prevState = workInProgress.memoizedState;

  {
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Invoke the function an extra time to help detect side-effects.
      getDerivedStateFromProps(nextProps, prevState);
    }
  }

  var partialState = getDerivedStateFromProps(nextProps, prevState);

  {
    warnOnUndefinedDerivedState(ctor, partialState);
  }
  // Merge the partial state and the previous state.
  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  workInProgress.memoizedState = memoizedState;

  // Once the update queue is empty, persist the derived state onto the
  // base state.
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
    updateQueue.baseState = memoizedState;
  }
}

var classComponentUpdater = {
  isMounted: isMounted,
  enqueueSetState: function (inst, payload, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var suspenseConfig = requestCurrentSuspenseConfig();
    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);

    var update = createUpdate(expirationTime, suspenseConfig);
    update.payload = payload;
    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'setState');
      }
      update.callback = callback;
    }

    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  },
  enqueueReplaceState: function (inst, payload, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var suspenseConfig = requestCurrentSuspenseConfig();
    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);

    var update = createUpdate(expirationTime, suspenseConfig);
    update.tag = ReplaceState;
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'replaceState');
      }
      update.callback = callback;
    }

    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  },
  enqueueForceUpdate: function (inst, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var suspenseConfig = requestCurrentSuspenseConfig();
    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);

    var update = createUpdate(expirationTime, suspenseConfig);
    update.tag = ForceUpdate;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'forceUpdate');
      }
      update.callback = callback;
    }

    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  }
};

function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  var instance = workInProgress.stateNode;
  if (typeof instance.shouldComponentUpdate === 'function') {
    startPhaseTimer(workInProgress, 'shouldComponentUpdate');
    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
    stopPhaseTimer();

    {
      !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
    }

    return shouldUpdate;
  }

  if (ctor.prototype && ctor.prototype.isPureReactComponent) {
    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  }

  return true;
}

function checkClassInstance(workInProgress, ctor, newProps) {
  var instance = workInProgress.stateNode;
  {
    var name = getComponentName(ctor) || 'Component';
    var renderPresent = instance.render;

    if (!renderPresent) {
      if (ctor.prototype && typeof ctor.prototype.render === 'function') {
        warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
      } else {
        warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
      }
    }

    var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
    !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
    var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
    !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
    var noInstancePropTypes = !instance.propTypes;
    !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
    var noInstanceContextType = !instance.contextType;
    !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;

    if (disableLegacyContext) {
      if (ctor.childContextTypes) {
        warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', name);
      }
      if (ctor.contextTypes) {
        warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', name);
      }
    } else {
      var noInstanceContextTypes = !instance.contextTypes;
      !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;

      if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
        didWarnAboutContextTypeAndContextTypes.add(ctor);
        warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
      }
    }

    var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
    !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
      warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
    }
    var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
    !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
    var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
    !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
    var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
    !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
    var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
    !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
    var hasMutatedProps = instance.props !== newProps;
    !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
    var noInstanceDefaultProps = !instance.defaultProps;
    !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;

    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
      warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
    }

    var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
    !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
    var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
    !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
    var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
    !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
    var _state = instance.state;
    if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
      warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
    }
    if (typeof instance.getChildContext === 'function') {
      !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
    }
  }
}

function adoptClassInstance(workInProgress, instance) {
  instance.updater = classComponentUpdater;
  workInProgress.stateNode = instance;
  // The instance needs access to the fiber so that it can schedule updates
  set(instance, workInProgress);
  {
    instance._reactInternalInstance = fakeInternalInstance;
  }
}

function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
  var isLegacyContextConsumer = false;
  var unmaskedContext = emptyContextObject;
  var context = emptyContextObject;
  var contextType = ctor.contextType;

  {
    if ('contextType' in ctor) {
      var isValid =
      // Allow null for conditional declaration
      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>

      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
        didWarnAboutInvalidateContextType.add(ctor);

        var addendum = '';
        if (contextType === undefined) {
          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
        } else if (typeof contextType !== 'object') {
          addendum = ' However, it is set to a ' + typeof contextType + '.';
        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
          addendum = ' Did you accidentally pass the Context.Provider instead?';
        } else if (contextType._context !== undefined) {
          // <Context.Consumer>
          addendum = ' Did you accidentally pass the Context.Consumer instead?';
        } else {
          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
        }
        warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
      }
    }
  }

  if (typeof contextType === 'object' && contextType !== null) {
    context = readContext(contextType);
  } else if (!disableLegacyContext) {
    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    var contextTypes = ctor.contextTypes;
    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  }

  // Instantiate twice to help detect side-effects.
  {
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      new ctor(props, context); // eslint-disable-line no-new
    }
  }

  var instance = new ctor(props, context);
  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  adoptClassInstance(workInProgress, instance);

  {
    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
      var componentName = getComponentName(ctor) || 'Component';
      if (!didWarnAboutUninitializedState.has(componentName)) {
        didWarnAboutUninitializedState.add(componentName);
        warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
      }
    }

    // If new component APIs are defined, "unsafe" lifecycles won't be called.
    // Warn about these lifecycles if they are present.
    // Don't warn about react-lifecycles-compat polyfilled methods though.
    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
      var foundWillMountName = null;
      var foundWillReceivePropsName = null;
      var foundWillUpdateName = null;
      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
        foundWillMountName = 'componentWillMount';
      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
        foundWillMountName = 'UNSAFE_componentWillMount';
      }
      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
        foundWillReceivePropsName = 'componentWillReceiveProps';
      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
      }
      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
        foundWillUpdateName = 'componentWillUpdate';
      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        foundWillUpdateName = 'UNSAFE_componentWillUpdate';
      }
      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
        var _componentName = getComponentName(ctor) || 'Component';
        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
          warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n  ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n  ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n  ' + foundWillUpdateName : '');
        }
      }
    }
  }

  // Cache unmasked context so we can avoid recreating masked context unless necessary.
  // ReactFiberContext usually updates this cache but can't for newly-created instances.
  if (isLegacyContextConsumer) {
    cacheContext(workInProgress, unmaskedContext, context);
  }

  return instance;
}

function callComponentWillMount(workInProgress, instance) {
  startPhaseTimer(workInProgress, 'componentWillMount');
  var oldState = instance.state;

  if (typeof instance.componentWillMount === 'function') {
    instance.componentWillMount();
  }
  if (typeof instance.UNSAFE_componentWillMount === 'function') {
    instance.UNSAFE_componentWillMount();
  }

  stopPhaseTimer();

  if (oldState !== instance.state) {
    {
      warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
    }
    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  var oldState = instance.state;
  startPhaseTimer(workInProgress, 'componentWillReceiveProps');
  if (typeof instance.componentWillReceiveProps === 'function') {
    instance.componentWillReceiveProps(newProps, nextContext);
  }
  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  }
  stopPhaseTimer();

  if (instance.state !== oldState) {
    {
      var componentName = getComponentName(workInProgress.type) || 'Component';
      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
        didWarnAboutStateAssignmentForComponent.add(componentName);
        warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
      }
    }
    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

// Invokes the mount life-cycles on a previously never rendered instance.
function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  {
    checkClassInstance(workInProgress, ctor, newProps);
  }

  var instance = workInProgress.stateNode;
  instance.props = newProps;
  instance.state = workInProgress.memoizedState;
  instance.refs = emptyRefsObject;

  var contextType = ctor.contextType;
  if (typeof contextType === 'object' && contextType !== null) {
    instance.context = readContext(contextType);
  } else if (disableLegacyContext) {
    instance.context = emptyContextObject;
  } else {
    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    instance.context = getMaskedContext(workInProgress, unmaskedContext);
  }

  {
    if (instance.state === newProps) {
      var componentName = getComponentName(ctor) || 'Component';
      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
        didWarnAboutDirectlyAssigningPropsToState.add(componentName);
        warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
    }

    if (warnAboutDeprecatedLifecycles) {
      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
    }
  }

  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    instance.state = workInProgress.memoizedState;
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    instance.state = workInProgress.memoizedState;
  }

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
    callComponentWillMount(workInProgress, instance);
    // If we had additional state updates during this life-cycle, let's
    // process them now.
    updateQueue = workInProgress.updateQueue;
    if (updateQueue !== null) {
      processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
      instance.state = workInProgress.memoizedState;
    }
  }

  if (typeof instance.componentDidMount === 'function') {
    workInProgress.effectTag |= Update;
  }
}

function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  var instance = workInProgress.stateNode;

  var oldProps = workInProgress.memoizedProps;
  instance.props = oldProps;

  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;
  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else if (!disableLegacyContext) {
    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';

  // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();

  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    newState = workInProgress.memoizedState;
  }
  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }
    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
      startPhaseTimer(workInProgress, 'componentWillMount');
      if (typeof instance.componentWillMount === 'function') {
        instance.componentWillMount();
      }
      if (typeof instance.UNSAFE_componentWillMount === 'function') {
        instance.UNSAFE_componentWillMount();
      }
      stopPhaseTimer();
    }
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }

    // If shouldComponentUpdate returned false, we should still update the
    // memoized state to indicate that this work can be reused.
    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  }

  // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.
  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;

  return shouldUpdate;
}

// Invokes the update life-cycles and returns false if it shouldn't rerender.
function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
  var instance = workInProgress.stateNode;

  var oldProps = workInProgress.memoizedProps;
  instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);

  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;
  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else if (!disableLegacyContext) {
    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';

  // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();

  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    newState = workInProgress.memoizedState;
  }

  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }
    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
      startPhaseTimer(workInProgress, 'componentWillUpdate');
      if (typeof instance.componentWillUpdate === 'function') {
        instance.componentWillUpdate(newProps, newState, nextContext);
      }
      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
      }
      stopPhaseTimer();
    }
    if (typeof instance.componentDidUpdate === 'function') {
      workInProgress.effectTag |= Update;
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      workInProgress.effectTag |= Snapshot;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }

    // If shouldComponentUpdate returned false, we should still update the
    // memoized props/state to indicate that this work can be reused.
    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  }

  // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.
  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;

  return shouldUpdate;
}

var didWarnAboutMaps = void 0;
var didWarnAboutGenerators = void 0;
var didWarnAboutStringRefInStrictMode = void 0;
var ownerHasKeyUseWarning = void 0;
var ownerHasFunctionTypeWarning = void 0;
var warnForMissingKey = function (child) {};

{
  didWarnAboutMaps = false;
  didWarnAboutGenerators = false;
  didWarnAboutStringRefInStrictMode = {};

  /**
   * Warn if there's no key explicitly set on dynamic arrays of children or
   * object keys are not valid. This allows us to keep track of children between
   * updates.
   */
  ownerHasKeyUseWarning = {};
  ownerHasFunctionTypeWarning = {};

  warnForMissingKey = function (child) {
    if (child === null || typeof child !== 'object') {
      return;
    }
    if (!child._store || child._store.validated || child.key != null) {
      return;
    }
    (function () {
      if (!(typeof child._store === 'object')) {
        {
          throw ReactError(Error('React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
    child._store.validated = true;

    var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
      return;
    }
    ownerHasKeyUseWarning[currentComponentErrorInfo] = true;

    warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
  };
}

var isArray = Array.isArray;

function coerceRef(returnFiber, current$$1, element) {
  var mixedRef = element.ref;
  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
    {
      if (returnFiber.mode & StrictMode) {
        var componentName = getComponentName(returnFiber.type) || 'Component';
        if (!didWarnAboutStringRefInStrictMode[componentName]) {
          warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber));
          didWarnAboutStringRefInStrictMode[componentName] = true;
        }
      }
    }

    if (element._owner) {
      var owner = element._owner;
      var inst = void 0;
      if (owner) {
        var ownerFiber = owner;
        (function () {
          if (!(ownerFiber.tag === ClassComponent)) {
            {
              throw ReactError(Error('Function components cannot have refs. Did you mean to use React.forwardRef()?'));
            }
          }
        })();
        inst = ownerFiber.stateNode;
      }
      (function () {
        if (!inst) {
          {
            throw ReactError(Error('Missing owner for string ref ' + mixedRef + '. This error is likely caused by a bug in React. Please file an issue.'));
          }
        }
      })();
      var stringRef = '' + mixedRef;
      // Check if previous string ref matches new string ref
      if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
        return current$$1.ref;
      }
      var ref = function (value) {
        var refs = inst.refs;
        if (refs === emptyRefsObject) {
          // This is a lazy pooled frozen object, so we need to initialize.
          refs = inst.refs = {};
        }
        if (value === null) {
          delete refs[stringRef];
        } else {
          refs[stringRef] = value;
        }
      };
      ref._stringRef = stringRef;
      return ref;
    } else {
      (function () {
        if (!(typeof mixedRef === 'string')) {
          {
            throw ReactError(Error('Expected ref to be a function, a string, an object returned by React.createRef(), or null.'));
          }
        }
      })();
      (function () {
        if (!element._owner) {
          {
            throw ReactError(Error('Element ref was specified as a string (' + mixedRef + ') but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.'));
          }
        }
      })();
    }
  }
  return mixedRef;
}

function throwOnInvalidObjectType(returnFiber, newChild) {
  if (returnFiber.type !== 'textarea') {
    var addendum = '';
    {
      addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
    }
    (function () {
      {
        {
          throw ReactError(Error('Objects are not valid as a React child (found: ' + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ').' + addendum));
        }
      }
    })();
  }
}

function warnOnFunctionType() {
  var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();

  if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
    return;
  }
  ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;

  warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
}

// This wrapper function exists because I expect to clone the code in each path
// to be able to optimize each path individually by branching early. This needs
// a compiler or we can do it manually. Helpers that don't need this branching
// live outside of this function.
function ChildReconciler(shouldTrackSideEffects) {
  function deleteChild(returnFiber, childToDelete) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return;
    }
    // Deletions are added in reversed order so we add it to the front.
    // At this point, the return fiber's effect list is empty except for
    // deletions, so we can just append the deletion to the list. The remaining
    // effects aren't added until the complete phase. Once we implement
    // resuming, this may not be true.
    var last = returnFiber.lastEffect;
    if (last !== null) {
      last.nextEffect = childToDelete;
      returnFiber.lastEffect = childToDelete;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
    }
    childToDelete.nextEffect = null;
    childToDelete.effectTag = Deletion;
  }

  function deleteRemainingChildren(returnFiber, currentFirstChild) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return null;
    }

    // TODO: For the shouldClone case, this could be micro-optimized a bit by
    // assuming that after the first child we've already added everything.
    var childToDelete = currentFirstChild;
    while (childToDelete !== null) {
      deleteChild(returnFiber, childToDelete);
      childToDelete = childToDelete.sibling;
    }
    return null;
  }

  function mapRemainingChildren(returnFiber, currentFirstChild) {
    // Add the remaining children to a temporary map so that we can find them by
    // keys quickly. Implicit (null) keys get added to this set with their index
    var existingChildren = new Map();

    var existingChild = currentFirstChild;
    while (existingChild !== null) {
      if (existingChild.key !== null) {
        existingChildren.set(existingChild.key, existingChild);
      } else {
        existingChildren.set(existingChild.index, existingChild);
      }
      existingChild = existingChild.sibling;
    }
    return existingChildren;
  }

  function useFiber(fiber, pendingProps, expirationTime) {
    // We currently set sibling to null and index to 0 here because it is easy
    // to forget to do before returning it. E.g. for the single child case.
    var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
    clone.index = 0;
    clone.sibling = null;
    return clone;
  }

  function placeChild(newFiber, lastPlacedIndex, newIndex) {
    newFiber.index = newIndex;
    if (!shouldTrackSideEffects) {
      // Noop.
      return lastPlacedIndex;
    }
    var current$$1 = newFiber.alternate;
    if (current$$1 !== null) {
      var oldIndex = current$$1.index;
      if (oldIndex < lastPlacedIndex) {
        // This is a move.
        newFiber.effectTag = Placement;
        return lastPlacedIndex;
      } else {
        // This item can stay in place.
        return oldIndex;
      }
    } else {
      // This is an insertion.
      newFiber.effectTag = Placement;
      return lastPlacedIndex;
    }
  }

  function placeSingleChild(newFiber) {
    // This is simpler for the single child case. We only need to do a
    // placement for inserting new children.
    if (shouldTrackSideEffects && newFiber.alternate === null) {
      newFiber.effectTag = Placement;
    }
    return newFiber;
  }

  function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
    if (current$$1 === null || current$$1.tag !== HostText) {
      // Insert
      var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, textContent, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateElement(returnFiber, current$$1, element, expirationTime) {
    if (current$$1 !== null && (current$$1.elementType === element.type || (
    // Keep this check inline so it only runs on the false path:
    isCompatibleFamilyForHotReloading(current$$1, element)))) {
      // Move based on index
      var existing = useFiber(current$$1, element.props, expirationTime);
      existing.ref = coerceRef(returnFiber, current$$1, element);
      existing.return = returnFiber;
      {
        existing._debugSource = element._source;
        existing._debugOwner = element._owner;
      }
      return existing;
    } else {
      // Insert
      var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
      created.ref = coerceRef(returnFiber, current$$1, element);
      created.return = returnFiber;
      return created;
    }
  }

  function updatePortal(returnFiber, current$$1, portal, expirationTime) {
    if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
      // Insert
      var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, portal.children || [], expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
    if (current$$1 === null || current$$1.tag !== Fragment) {
      // Insert
      var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, fragment, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function createChild(returnFiber, newChild, expirationTime) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
            _created.ref = coerceRef(returnFiber, null, newChild);
            _created.return = returnFiber;
            return _created;
          }
        case REACT_PORTAL_TYPE:
          {
            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
            _created2.return = returnFiber;
            return _created2;
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
        _created3.return = returnFiber;
        return _created3;
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
    // Update the fiber if the keys match, otherwise return null.

    var key = oldFiber !== null ? oldFiber.key : null;

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      if (key !== null) {
        return null;
      }
      return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            if (newChild.key === key) {
              if (newChild.type === REACT_FRAGMENT_TYPE) {
                return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
              }
              return updateElement(returnFiber, oldFiber, newChild, expirationTime);
            } else {
              return null;
            }
          }
        case REACT_PORTAL_TYPE:
          {
            if (newChild.key === key) {
              return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
            } else {
              return null;
            }
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        if (key !== null) {
          return null;
        }

        return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys, so we neither have to check the old nor
      // new node for the key. If both are text nodes, they match.
      var matchedFiber = existingChildren.get(newIdx) || null;
      return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
            if (newChild.type === REACT_FRAGMENT_TYPE) {
              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
            }
            return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
          }
        case REACT_PORTAL_TYPE:
          {
            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
            return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        var _matchedFiber3 = existingChildren.get(newIdx) || null;
        return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  /**
   * Warns if there is a duplicate or missing key
   */
  function warnOnInvalidKey(child, knownKeys) {
    {
      if (typeof child !== 'object' || child === null) {
        return knownKeys;
      }
      switch (child.$$typeof) {
        case REACT_ELEMENT_TYPE:
        case REACT_PORTAL_TYPE:
          warnForMissingKey(child);
          var key = child.key;
          if (typeof key !== 'string') {
            break;
          }
          if (knownKeys === null) {
            knownKeys = new Set();
            knownKeys.add(key);
            break;
          }
          if (!knownKeys.has(key)) {
            knownKeys.add(key);
            break;
          }
          warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
          break;
        default:
          break;
      }
    }
    return knownKeys;
  }

  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
    // This algorithm can't optimize by searching from both ends since we
    // don't have backpointers on fibers. I'm trying to see how far we can get
    // with that model. If it ends up not being worth the tradeoffs, we can
    // add it later.

    // Even with a two ended optimization, we'd want to optimize for the case
    // where there are few changes and brute force the comparison instead of
    // going for the Map. It'd like to explore hitting that path first in
    // forward-only mode and only go for the Map once we notice that we need
    // lots of look ahead. This doesn't handle reversal as well as two ended
    // search but that's unusual. Besides, for the two ended optimization to
    // work on Iterables, we'd need to copy the whole set.

    // In this first iteration, we'll just live with hitting the bad case
    // (adding everything to a Map) in for every insert/move.

    // If you change this code, also update reconcileChildrenIterator() which
    // uses the same algorithm.

    {
      // First, validate keys.
      var knownKeys = null;
      for (var i = 0; i < newChildren.length; i++) {
        var child = newChildren[i];
        knownKeys = warnOnInvalidKey(child, knownKeys);
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;

    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;
    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }
      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }
        break;
      }
      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }
      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (newIdx === newChildren.length) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; newIdx < newChildren.length; newIdx++) {
        var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
        if (_newFiber === null) {
          continue;
        }
        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber;
        } else {
          previousNewFiber.sibling = _newFiber;
        }
        previousNewFiber = _newFiber;
      }
      return resultingFirstChild;
    }

    // Add all children to a key map for quick lookups.
    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);

    // Keep scanning and use the map to restore deleted items as moves.
    for (; newIdx < newChildren.length; newIdx++) {
      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
      if (_newFiber2 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber2.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
          }
        }
        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber2;
        } else {
          previousNewFiber.sibling = _newFiber2;
        }
        previousNewFiber = _newFiber2;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
    // This is the same implementation as reconcileChildrenArray(),
    // but using the iterator instead.

    var iteratorFn = getIteratorFn(newChildrenIterable);
    (function () {
      if (!(typeof iteratorFn === 'function')) {
        {
          throw ReactError(Error('An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();

    {
      // We don't support rendering Generators because it's a mutation.
      // See https://github.com/facebook/react/issues/12995
      if (typeof Symbol === 'function' &&
      // $FlowFixMe Flow doesn't know about toStringTag
      newChildrenIterable[Symbol.toStringTag] === 'Generator') {
        !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
        didWarnAboutGenerators = true;
      }

      // Warn about using Maps as children
      if (newChildrenIterable.entries === iteratorFn) {
        !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
        didWarnAboutMaps = true;
      }

      // First, validate keys.
      // We'll get a different iterator later for the main pass.
      var _newChildren = iteratorFn.call(newChildrenIterable);
      if (_newChildren) {
        var knownKeys = null;
        var _step = _newChildren.next();
        for (; !_step.done; _step = _newChildren.next()) {
          var child = _step.value;
          knownKeys = warnOnInvalidKey(child, knownKeys);
        }
      }
    }

    var newChildren = iteratorFn.call(newChildrenIterable);
    (function () {
      if (!(newChildren != null)) {
        {
          throw ReactError(Error('An iterable object provided no iterator.'));
        }
      }
    })();

    var resultingFirstChild = null;
    var previousNewFiber = null;

    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;

    var step = newChildren.next();
    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }
      var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }
        break;
      }
      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }
      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (step.done) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; !step.done; newIdx++, step = newChildren.next()) {
        var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
        if (_newFiber3 === null) {
          continue;
        }
        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber3;
        } else {
          previousNewFiber.sibling = _newFiber3;
        }
        previousNewFiber = _newFiber3;
      }
      return resultingFirstChild;
    }

    // Add all children to a key map for quick lookups.
    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);

    // Keep scanning and use the map to restore deleted items as moves.
    for (; !step.done; newIdx++, step = newChildren.next()) {
      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
      if (_newFiber4 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber4.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
          }
        }
        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber4;
        } else {
          previousNewFiber.sibling = _newFiber4;
        }
        previousNewFiber = _newFiber4;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
    // There's no need to check for keys on text nodes since we don't have a
    // way to define them.
    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
      // We already have an existing node so let's just update it and delete
      // the rest.
      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
      var existing = useFiber(currentFirstChild, textContent, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
    // The existing first child is not a text node so we need to create one
    // and delete the existing ones.
    deleteRemainingChildren(returnFiber, currentFirstChild);
    var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
    created.return = returnFiber;
    return created;
  }

  function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
    var key = element.key;
    var child = currentFirstChild;
    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || (
        // Keep this check inline so it only runs on the false path:
        isCompatibleFamilyForHotReloading(child, element))) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
          existing.ref = coerceRef(returnFiber, child, element);
          existing.return = returnFiber;
          {
            existing._debugSource = element._source;
            existing._debugOwner = element._owner;
          }
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }
      child = child.sibling;
    }

    if (element.type === REACT_FRAGMENT_TYPE) {
      var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
      created.return = returnFiber;
      return created;
    } else {
      var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
      _created4.return = returnFiber;
      return _created4;
    }
  }

  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
    var key = portal.key;
    var child = currentFirstChild;
    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, portal.children || [], expirationTime);
          existing.return = returnFiber;
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }
      child = child.sibling;
    }

    var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
    created.return = returnFiber;
    return created;
  }

  // This API will tag the children with the side-effect of the reconciliation
  // itself. They will be added to the side-effect list as we pass through the
  // children and the parent.
  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
    // This function is not recursive.
    // If the top level item is an array, we treat it as a set of children,
    // not as a fragment. Nested arrays on the other hand will be treated as
    // fragment nodes. Recursion happens at the normal flow.

    // Handle top level unkeyed fragments as if they were arrays.
    // This leads to an ambiguity between <>{[...]}</> and <>...</>.
    // We treat the ambiguous cases above the same.
    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
    if (isUnkeyedTopLevelFragment) {
      newChild = newChild.props.children;
    }

    // Handle object types
    var isObject = typeof newChild === 'object' && newChild !== null;

    if (isObject) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
        case REACT_PORTAL_TYPE:
          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
      }
    }

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
    }

    if (isArray(newChild)) {
      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
    }

    if (getIteratorFn(newChild)) {
      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
    }

    if (isObject) {
      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }
    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
      // If the new child is undefined, and the return fiber is a composite
      // component, throw an error. If Fiber return types are disabled,
      // we already threw above.
      switch (returnFiber.tag) {
        case ClassComponent:
          {
            {
              var instance = returnFiber.stateNode;
              if (instance.render._isMockFunction) {
                // We allow auto-mocks to proceed as if they're returning null.
                break;
              }
            }
          }
        // Intentionally fall through to the next case, which handles both
        // functions and classes
        // eslint-disable-next-lined no-fallthrough
        case FunctionComponent:
          {
            var Component = returnFiber.type;
            (function () {
              {
                {
                  throw ReactError(Error((Component.displayName || Component.name || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));
                }
              }
            })();
          }
      }
    }

    // Remaining cases are all treated as empty.
    return deleteRemainingChildren(returnFiber, currentFirstChild);
  }

  return reconcileChildFibers;
}

var reconcileChildFibers = ChildReconciler(true);
var mountChildFibers = ChildReconciler(false);

function cloneChildFibers(current$$1, workInProgress) {
  (function () {
    if (!(current$$1 === null || workInProgress.child === current$$1.child)) {
      {
        throw ReactError(Error('Resuming work not yet implemented.'));
      }
    }
  })();

  if (workInProgress.child === null) {
    return;
  }

  var currentChild = workInProgress.child;
  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
  workInProgress.child = newChild;

  newChild.return = workInProgress;
  while (currentChild.sibling !== null) {
    currentChild = currentChild.sibling;
    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
    newChild.return = workInProgress;
  }
  newChild.sibling = null;
}

// Reset a workInProgress child set to prepare it for a second pass.
function resetChildFibers(workInProgress, renderExpirationTime) {
  var child = workInProgress.child;
  while (child !== null) {
    resetWorkInProgress(child, renderExpirationTime);
    child = child.sibling;
  }
}

var NO_CONTEXT = {};

var contextStackCursor$1 = createCursor(NO_CONTEXT);
var contextFiberStackCursor = createCursor(NO_CONTEXT);
var rootInstanceStackCursor = createCursor(NO_CONTEXT);

function requiredContext(c) {
  (function () {
    if (!(c !== NO_CONTEXT)) {
      {
        throw ReactError(Error('Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
  return c;
}

function getRootHostContainer() {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  return rootInstance;
}

function pushHostContainer(fiber, nextRootInstance) {
  // Push current root instance onto the stack;
  // This allows us to reset root when portals are popped.
  push(rootInstanceStackCursor, nextRootInstance, fiber);
  // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.
  push(contextFiberStackCursor, fiber, fiber);

  // Finally, we need to push the host context to the stack.
  // However, we can't just call getRootHostContext() and push it because
  // we'd have a different number of entries on the stack depending on
  // whether getRootHostContext() throws somewhere in renderer code or not.
  // So we push an empty value first. This lets us safely unwind on errors.
  push(contextStackCursor$1, NO_CONTEXT, fiber);
  var nextRootContext = getRootHostContext(nextRootInstance);
  // Now that we know this function doesn't throw, replace it.
  pop(contextStackCursor$1, fiber);
  push(contextStackCursor$1, nextRootContext, fiber);
}

function popHostContainer(fiber) {
  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
  pop(rootInstanceStackCursor, fiber);
}

function getHostContext() {
  var context = requiredContext(contextStackCursor$1.current);
  return context;
}

function pushHostContext(fiber) {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  var context = requiredContext(contextStackCursor$1.current);
  var nextContext = getChildHostContext(context, fiber.type, rootInstance);

  // Don't push this Fiber's context unless it's unique.
  if (context === nextContext) {
    return;
  }

  // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.
  push(contextFiberStackCursor, fiber, fiber);
  push(contextStackCursor$1, nextContext, fiber);
}

function popHostContext(fiber) {
  // Do not pop unless this Fiber provided the current context.
  // pushHostContext() only pushes Fibers that provide unique contexts.
  if (contextFiberStackCursor.current !== fiber) {
    return;
  }

  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
}

var DefaultSuspenseContext = 0;

// The Suspense Context is split into two parts. The lower bits is
// inherited deeply down the subtree. The upper bits only affect
// this immediate suspense boundary and gets reset each new
// boundary or suspense list.
var SubtreeSuspenseContextMask = 1;

// Subtree Flags:

// InvisibleParentSuspenseContext indicates that one of our parent Suspense
// boundaries is not currently showing visible main content.
// Either because it is already showing a fallback or is not mounted at all.
// We can use this to determine if it is desirable to trigger a fallback at
// the parent. If not, then we might need to trigger undesirable boundaries
// and/or suspend the commit to avoid hiding the parent content.
var InvisibleParentSuspenseContext = 1;

// Shallow Flags:

// ForceSuspenseFallback can be used by SuspenseList to force newly added
// items into their fallback state during one of the render passes.
var ForceSuspenseFallback = 2;

var suspenseStackCursor = createCursor(DefaultSuspenseContext);

function hasSuspenseContext(parentContext, flag) {
  return (parentContext & flag) !== 0;
}

function setDefaultShallowSuspenseContext(parentContext) {
  return parentContext & SubtreeSuspenseContextMask;
}

function setShallowSuspenseContext(parentContext, shallowContext) {
  return parentContext & SubtreeSuspenseContextMask | shallowContext;
}

function addSubtreeSuspenseContext(parentContext, subtreeContext) {
  return parentContext | subtreeContext;
}

function pushSuspenseContext(fiber, newContext) {
  push(suspenseStackCursor, newContext, fiber);
}

function popSuspenseContext(fiber) {
  pop(suspenseStackCursor, fiber);
}

// TODO: This is now an empty object. Should we switch this to a boolean?
// Alternatively we can make this use an effect tag similar to SuspenseList.


function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
  // If it was the primary children that just suspended, capture and render the
  var nextState = workInProgress.memoizedState;
  if (nextState !== null) {
    return false;
  }
  var props = workInProgress.memoizedProps;
  // In order to capture, the Suspense component must have a fallback prop.
  if (props.fallback === undefined) {
    return false;
  }
  // Regular boundaries always capture.
  if (props.unstable_avoidThisFallback !== true) {
    return true;
  }
  // If it's a boundary we should avoid, then we prefer to bubble up to the
  // parent boundary if it is currently invisible.
  if (hasInvisibleParent) {
    return false;
  }
  // If the parent is not able to handle it, we must handle it.
  return true;
}

function findFirstSuspended(row) {
  var node = row;
  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;
      if (state !== null) {
        return node;
      }
    } else if (node.tag === SuspenseListComponent &&
    // revealOrder undefined can't be trusted because it don't
    // keep track of whether it suspended or not.
    node.memoizedProps.revealOrder !== undefined) {
      var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
      if (didSuspend) {
        return node;
      }
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === row) {
      return null;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === row) {
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  return null;
}

var NoEffect$1 = /*             */0;
var UnmountSnapshot = /*      */2;
var UnmountMutation = /*      */4;
var MountMutation = /*        */8;
var UnmountLayout = /*        */16;
var MountLayout = /*          */32;
var MountPassive = /*         */64;
var UnmountPassive = /*       */128;

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;


var didWarnAboutMismatchedHooksForComponent = void 0;
{
  didWarnAboutMismatchedHooksForComponent = new Set();
}

// These are set right before calling the component.
var renderExpirationTime$1 = NoWork;
// The work-in-progress fiber. I've named it differently to distinguish it from
// the work-in-progress hook.
var currentlyRenderingFiber$1 = null;

// Hooks are stored as a linked list on the fiber's memoizedState field. The
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
var workInProgressHook = null;
var nextWorkInProgressHook = null;

var remainingExpirationTime = NoWork;
var componentUpdateQueue = null;
var sideEffectTag = 0;

// Updates scheduled during render will trigger an immediate re-render at the
// end of the current pass. We can't store these updates on the normal queue,
// because if the work is aborted, they should be discarded. Because this is
// a relatively rare case, we also don't want to add an additional field to
// either the hook or queue object types. So we store them in a lazily create
// map of queue -> render-phase updates, which are discarded once the component
// completes without re-rendering.

// Whether an update was scheduled during the currently executing render pass.
var didScheduleRenderPhaseUpdate = false;
// Lazily created map of render-phase updates
var renderPhaseUpdates = null;
// Counter to prevent infinite loops.
var numberOfReRenders = 0;
var RE_RENDER_LIMIT = 25;

// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;

// In DEV, this list ensures that hooks are called in the same order between renders.
// The list stores the order of hooks used during the initial render (mount).
// Subsequent renders (updates) reference this list.
var hookTypesDev = null;
var hookTypesUpdateIndexDev = -1;

// In DEV, this tracks whether currently rendering component needs to ignore
// the dependencies for Hooks that need them (e.g. useEffect or useMemo).
// When true, such Hooks will always be "remounted". Only used during hot reload.
var ignorePreviousDependencies = false;

function mountHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev === null) {
      hookTypesDev = [hookName];
    } else {
      hookTypesDev.push(hookName);
    }
  }
}

function updateHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev !== null) {
      hookTypesUpdateIndexDev++;
      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
        warnOnHookMismatchInDev(hookName);
      }
    }
  }
}

function checkDepsAreArrayDev(deps) {
  {
    if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
      // Verify deps, but only on mount to avoid extra checks.
      // It's unlikely their type would change as usually you define them inline.
      warning$1(false, '%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
    }
  }
}

function warnOnHookMismatchInDev(currentHookName) {
  {
    var componentName = getComponentName(currentlyRenderingFiber$1.type);
    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
      didWarnAboutMismatchedHooksForComponent.add(componentName);

      if (hookTypesDev !== null) {
        var table = '';

        var secondColumnStart = 30;

        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
          var oldHookName = hookTypesDev[i];
          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;

          var row = i + 1 + '. ' + oldHookName;

          // Extra space so second column lines up
          // lol @ IE not supporting String#repeat
          while (row.length < secondColumnStart) {
            row += ' ';
          }

          row += newHookName + '\n';

          table += row;
        }

        warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + '   Previous render            Next render\n' + '   ------------------------------------------------------\n' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
      }
    }
  }
}

function throwInvalidHookError() {
  (function () {
    {
      {
        throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.'));
      }
    }
  })();
}

function areHookInputsEqual(nextDeps, prevDeps) {
  {
    if (ignorePreviousDependencies) {
      // Only true when this component is being hot reloaded.
      return false;
    }
  }

  if (prevDeps === null) {
    {
      warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
    }
    return false;
  }

  {
    // Don't bother comparing lengths in prod because these arrays should be
    // passed inline.
    if (nextDeps.length !== prevDeps.length) {
      warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, '[' + prevDeps.join(', ') + ']', '[' + nextDeps.join(', ') + ']');
    }
  }
  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
    if (is(nextDeps[i], prevDeps[i])) {
      continue;
    }
    return false;
  }
  return true;
}

function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
  renderExpirationTime$1 = nextRenderExpirationTime;
  currentlyRenderingFiber$1 = workInProgress;
  nextCurrentHook = current !== null ? current.memoizedState : null;

  {
    hookTypesDev = current !== null ? current._debugHookTypes : null;
    hookTypesUpdateIndexDev = -1;
    // Used for hot reloading:
    ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
  }

  // The following should have already been reset
  // currentHook = null;
  // workInProgressHook = null;

  // remainingExpirationTime = NoWork;
  // componentUpdateQueue = null;

  // didScheduleRenderPhaseUpdate = false;
  // renderPhaseUpdates = null;
  // numberOfReRenders = 0;
  // sideEffectTag = 0;

  // TODO Warn if no hooks are used at all during mount, then some are used during update.
  // Currently we will identify the update render as a mount because nextCurrentHook === null.
  // This is tricky because it's valid for certain types of components (e.g. React.lazy)

  // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
  // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  // so nextCurrentHook would be null during updates and mounts.
  {
    if (nextCurrentHook !== null) {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
    } else if (hookTypesDev !== null) {
      // This dispatcher handles an edge case where a component is updating,
      // but no stateful hooks have been used.
      // We want to match the production code behavior (which will use HooksDispatcherOnMount),
      // but with the extra DEV validation to ensure hooks ordering hasn't changed.
      // This dispatcher does that.
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
    } else {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
    }
  }

  var children = Component(props, refOrContext);

  if (didScheduleRenderPhaseUpdate) {
    do {
      didScheduleRenderPhaseUpdate = false;
      numberOfReRenders += 1;

      // Start over from the beginning of the list
      nextCurrentHook = current !== null ? current.memoizedState : null;
      nextWorkInProgressHook = firstWorkInProgressHook;

      currentHook = null;
      workInProgressHook = null;
      componentUpdateQueue = null;

      {
        // Also validate hook order for cascading updates.
        hookTypesUpdateIndexDev = -1;
      }

      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;

      children = Component(props, refOrContext);
    } while (didScheduleRenderPhaseUpdate);

    renderPhaseUpdates = null;
    numberOfReRenders = 0;
  }

  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  var renderedWork = currentlyRenderingFiber$1;

  renderedWork.memoizedState = firstWorkInProgressHook;
  renderedWork.expirationTime = remainingExpirationTime;
  renderedWork.updateQueue = componentUpdateQueue;
  renderedWork.effectTag |= sideEffectTag;

  {
    renderedWork._debugHookTypes = hookTypesDev;
  }

  // This check uses currentHook so that it works the same in DEV and prod bundles.
  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;

  renderExpirationTime$1 = NoWork;
  currentlyRenderingFiber$1 = null;

  currentHook = null;
  nextCurrentHook = null;
  firstWorkInProgressHook = null;
  workInProgressHook = null;
  nextWorkInProgressHook = null;

  {
    currentHookNameInDev = null;
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
  }

  remainingExpirationTime = NoWork;
  componentUpdateQueue = null;
  sideEffectTag = 0;

  // These were reset above
  // didScheduleRenderPhaseUpdate = false;
  // renderPhaseUpdates = null;
  // numberOfReRenders = 0;

  (function () {
    if (!!didRenderTooFewHooks) {
      {
        throw ReactError(Error('Rendered fewer hooks than expected. This may be caused by an accidental early return statement.'));
      }
    }
  })();

  return children;
}

function bailoutHooks(current, workInProgress, expirationTime) {
  workInProgress.updateQueue = current.updateQueue;
  workInProgress.effectTag &= ~(Passive | Update);
  if (current.expirationTime <= expirationTime) {
    current.expirationTime = NoWork;
  }
}

function resetHooks() {
  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  // This is used to reset the state of this module when a component throws.
  // It's also called inside mountIndeterminateComponent if we determine the
  // component is a module-style component.
  renderExpirationTime$1 = NoWork;
  currentlyRenderingFiber$1 = null;

  currentHook = null;
  nextCurrentHook = null;
  firstWorkInProgressHook = null;
  workInProgressHook = null;
  nextWorkInProgressHook = null;

  {
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;

    currentHookNameInDev = null;
  }

  remainingExpirationTime = NoWork;
  componentUpdateQueue = null;
  sideEffectTag = 0;

  didScheduleRenderPhaseUpdate = false;
  renderPhaseUpdates = null;
  numberOfReRenders = 0;
}

function mountWorkInProgressHook() {
  var hook = {
    memoizedState: null,

    baseState: null,
    queue: null,
    baseUpdate: null,

    next: null
  };

  if (workInProgressHook === null) {
    // This is the first hook in the list
    firstWorkInProgressHook = workInProgressHook = hook;
  } else {
    // Append to the end of the list
    workInProgressHook = workInProgressHook.next = hook;
  }
  return workInProgressHook;
}

function updateWorkInProgressHook() {
  // This function is used both for updates and for re-renders triggered by a
  // render phase update. It assumes there is either a current hook we can
  // clone, or a work-in-progress hook from a previous render pass that we can
  // use as a base. When we reach the end of the base list, we must switch to
  // the dispatcher used for mounts.
  if (nextWorkInProgressHook !== null) {
    // There's already a work-in-progress. Reuse it.
    workInProgressHook = nextWorkInProgressHook;
    nextWorkInProgressHook = workInProgressHook.next;

    currentHook = nextCurrentHook;
    nextCurrentHook = currentHook !== null ? currentHook.next : null;
  } else {
    // Clone from the current hook.
    (function () {
      if (!(nextCurrentHook !== null)) {
        {
          throw ReactError(Error('Rendered more hooks than during the previous render.'));
        }
      }
    })();
    currentHook = nextCurrentHook;

    var newHook = {
      memoizedState: currentHook.memoizedState,

      baseState: currentHook.baseState,
      queue: currentHook.queue,
      baseUpdate: currentHook.baseUpdate,

      next: null
    };

    if (workInProgressHook === null) {
      // This is the first hook in the list.
      workInProgressHook = firstWorkInProgressHook = newHook;
    } else {
      // Append to the end of the list.
      workInProgressHook = workInProgressHook.next = newHook;
    }
    nextCurrentHook = currentHook.next;
  }
  return workInProgressHook;
}

function createFunctionComponentUpdateQueue() {
  return {
    lastEffect: null
  };
}

function basicStateReducer(state, action) {
  return typeof action === 'function' ? action(state) : action;
}

function mountReducer(reducer, initialArg, init) {
  var hook = mountWorkInProgressHook();
  var initialState = void 0;
  if (init !== undefined) {
    initialState = init(initialArg);
  } else {
    initialState = initialArg;
  }
  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    last: null,
    dispatch: null,
    lastRenderedReducer: reducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null,
  // Flow doesn't know this is non-null, but we do.
  currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;
  (function () {
    if (!(queue !== null)) {
      {
        throw ReactError(Error('Should have a queue. This is likely a bug in React. Please file an issue.'));
      }
    }
  })();

  queue.lastRenderedReducer = reducer;

  if (numberOfReRenders > 0) {
    // This is a re-render. Apply the new render phase updates to the previous
    var _dispatch = queue.dispatch;
    if (renderPhaseUpdates !== null) {
      // Render phase updates are stored in a map of queue -> linked list
      var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
      if (firstRenderPhaseUpdate !== undefined) {
        renderPhaseUpdates.delete(queue);
        var newState = hook.memoizedState;
        var update = firstRenderPhaseUpdate;
        do {
          // Process this render phase update. We don't have to check the
          // priority because it will always be the same as the current
          // render's.
          var _action = update.action;
          newState = reducer(newState, _action);
          update = update.next;
        } while (update !== null);

        // Mark that the fiber performed work, but only if the new state is
        // different from the current state.
        if (!is(newState, hook.memoizedState)) {
          markWorkInProgressReceivedUpdate();
        }

        hook.memoizedState = newState;
        // Don't persist the state accumulated from the render phase updates to
        // the base state unless the queue is empty.
        // TODO: Not sure if this is the desired semantics, but it's what we
        // do for gDSFP. I can't remember why.
        if (hook.baseUpdate === queue.last) {
          hook.baseState = newState;
        }

        queue.lastRenderedState = newState;

        return [newState, _dispatch];
      }
    }
    return [hook.memoizedState, _dispatch];
  }

  // The last update in the entire queue
  var last = queue.last;
  // The last update that is part of the base state.
  var baseUpdate = hook.baseUpdate;
  var baseState = hook.baseState;

  // Find the first unprocessed update.
  var first = void 0;
  if (baseUpdate !== null) {
    if (last !== null) {
      // For the first update, the queue is a circular linked list where
      // `queue.last.next = queue.first`. Once the first update commits, and
      // the `baseUpdate` is no longer empty, we can unravel the list.
      last.next = null;
    }
    first = baseUpdate.next;
  } else {
    first = last !== null ? last.next : null;
  }
  if (first !== null) {
    var _newState = baseState;
    var newBaseState = null;
    var newBaseUpdate = null;
    var prevUpdate = baseUpdate;
    var _update = first;
    var didSkip = false;
    do {
      var updateExpirationTime = _update.expirationTime;
      if (updateExpirationTime < renderExpirationTime$1) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        if (!didSkip) {
          didSkip = true;
          newBaseUpdate = prevUpdate;
          newBaseState = _newState;
        }
        // Update the remaining priority in the queue.
        if (updateExpirationTime > remainingExpirationTime) {
          remainingExpirationTime = updateExpirationTime;
        }
      } else {
        // This update does have sufficient priority.

        // Mark the event time of this update as relevant to this render pass.
        // TODO: This should ideally use the true event time of this update rather than
        // its priority which is a derived and not reverseable value.
        // TODO: We should skip this update if it was already committed but currently
        // we have no way of detecting the difference between a committed and suspended
        // update here.
        markRenderEventTimeAndConfig(updateExpirationTime, _update.suspenseConfig);

        // Process this update.
        if (_update.eagerReducer === reducer) {
          // If this update was processed eagerly, and its reducer matches the
          // current reducer, we can use the eagerly computed state.
          _newState = _update.eagerState;
        } else {
          var _action2 = _update.action;
          _newState = reducer(_newState, _action2);
        }
      }
      prevUpdate = _update;
      _update = _update.next;
    } while (_update !== null && _update !== first);

    if (!didSkip) {
      newBaseUpdate = prevUpdate;
      newBaseState = _newState;
    }

    // Mark that the fiber performed work, but only if the new state is
    // different from the current state.
    if (!is(_newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = _newState;
    hook.baseUpdate = newBaseUpdate;
    hook.baseState = newBaseState;

    queue.lastRenderedState = _newState;
  }

  var dispatch = queue.dispatch;
  return [hook.memoizedState, dispatch];
}

function mountState(initialState) {
  var hook = mountWorkInProgressHook();
  if (typeof initialState === 'function') {
    initialState = initialState();
  }
  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    last: null,
    dispatch: null,
    lastRenderedReducer: basicStateReducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null,
  // Flow doesn't know this is non-null, but we do.
  currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateState(initialState) {
  return updateReducer(basicStateReducer, initialState);
}

function pushEffect(tag, create, destroy, deps) {
  var effect = {
    tag: tag,
    create: create,
    destroy: destroy,
    deps: deps,
    // Circular
    next: null
  };
  if (componentUpdateQueue === null) {
    componentUpdateQueue = createFunctionComponentUpdateQueue();
    componentUpdateQueue.lastEffect = effect.next = effect;
  } else {
    var _lastEffect = componentUpdateQueue.lastEffect;
    if (_lastEffect === null) {
      componentUpdateQueue.lastEffect = effect.next = effect;
    } else {
      var firstEffect = _lastEffect.next;
      _lastEffect.next = effect;
      effect.next = firstEffect;
      componentUpdateQueue.lastEffect = effect;
    }
  }
  return effect;
}

function mountRef(initialValue) {
  var hook = mountWorkInProgressHook();
  var ref = { current: initialValue };
  {
    Object.seal(ref);
  }
  hook.memoizedState = ref;
  return ref;
}

function updateRef(initialValue) {
  var hook = updateWorkInProgressHook();
  return hook.memoizedState;
}

function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  sideEffectTag |= fiberEffectTag;
  hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps);
}

function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var destroy = undefined;

  if (currentHook !== null) {
    var prevEffect = currentHook.memoizedState;
    destroy = prevEffect.destroy;
    if (nextDeps !== null) {
      var prevDeps = prevEffect.deps;
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        pushEffect(NoEffect$1, create, destroy, nextDeps);
        return;
      }
    }
  }

  sideEffectTag |= fiberEffectTag;
  hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps);
}

function mountEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }
  return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
}

function updateEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }
  return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
}

function mountLayoutEffect(create, deps) {
  return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
}

function updateLayoutEffect(create, deps) {
  return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
}

function imperativeHandleEffect(create, ref) {
  if (typeof ref === 'function') {
    var refCallback = ref;
    var _inst = create();
    refCallback(_inst);
    return function () {
      refCallback(null);
    };
  } else if (ref !== null && ref !== undefined) {
    var refObject = ref;
    {
      !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0;
    }
    var _inst2 = create();
    refObject.current = _inst2;
    return function () {
      refObject.current = null;
    };
  }
}

function mountImperativeHandle(ref, create, deps) {
  {
    !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  }

  // TODO: If deps are provided, should we skip comparing the ref itself?
  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;

  return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function updateImperativeHandle(ref, create, deps) {
  {
    !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  }

  // TODO: If deps are provided, should we skip comparing the ref itself?
  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;

  return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function mountDebugValue(value, formatterFn) {
  // This hook is normally a no-op.
  // The react-debug-hooks package injects its own implementation
  // so that e.g. DevTools can display custom hook values.
}

var updateDebugValue = mountDebugValue;

function mountCallback(callback, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function updateCallback(callback, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;
  if (prevState !== null) {
    if (nextDeps !== null) {
      var prevDeps = prevState[1];
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function mountMemo(nextCreate, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function updateMemo(nextCreate, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;
  if (prevState !== null) {
    // Assume these are defined. If they're not, areHookInputsEqual will warn.
    if (nextDeps !== null) {
      var prevDeps = prevState[1];
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function dispatchAction(fiber, queue, action) {
  (function () {
    if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
      {
        throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.'));
      }
    }
  })();

  {
    !(arguments.length <= 3) ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0;
  }

  var alternate = fiber.alternate;
  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
    // This is a render phase update. Stash it in a lazily-created map of
    // queue -> linked list of updates. After this render pass, we'll restart
    // and apply the stashed updates on top of the work-in-progress hook.
    didScheduleRenderPhaseUpdate = true;
    var update = {
      expirationTime: renderExpirationTime$1,
      suspenseConfig: null,
      action: action,
      eagerReducer: null,
      eagerState: null,
      next: null
    };
    {
      update.priority = getCurrentPriorityLevel();
    }
    if (renderPhaseUpdates === null) {
      renderPhaseUpdates = new Map();
    }
    var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
    if (firstRenderPhaseUpdate === undefined) {
      renderPhaseUpdates.set(queue, update);
    } else {
      // Append the update to the end of the list.
      var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
      while (lastRenderPhaseUpdate.next !== null) {
        lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
      }
      lastRenderPhaseUpdate.next = update;
    }
  } else {
    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }

    var currentTime = requestCurrentTime();
    var _suspenseConfig = requestCurrentSuspenseConfig();
    var _expirationTime = computeExpirationForFiber(currentTime, fiber, _suspenseConfig);

    var _update2 = {
      expirationTime: _expirationTime,
      suspenseConfig: _suspenseConfig,
      action: action,
      eagerReducer: null,
      eagerState: null,
      next: null
    };

    {
      _update2.priority = getCurrentPriorityLevel();
    }

    // Append the update to the end of the list.
    var _last = queue.last;
    if (_last === null) {
      // This is the first update. Create a circular list.
      _update2.next = _update2;
    } else {
      var first = _last.next;
      if (first !== null) {
        // Still circular.
        _update2.next = first;
      }
      _last.next = _update2;
    }
    queue.last = _update2;

    if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
      // The queue is currently empty, which means we can eagerly compute the
      // next state before entering the render phase. If the new state is the
      // same as the current state, we may be able to bail out entirely.
      var _lastRenderedReducer = queue.lastRenderedReducer;
      if (_lastRenderedReducer !== null) {
        var prevDispatcher = void 0;
        {
          prevDispatcher = ReactCurrentDispatcher$1.current;
          ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
        }
        try {
          var currentState = queue.lastRenderedState;
          var _eagerState = _lastRenderedReducer(currentState, action);
          // Stash the eagerly computed state, and the reducer used to compute
          // it, on the update object. If the reducer hasn't changed by the
          // time we enter the render phase, then the eager state can be used
          // without calling the reducer again.
          _update2.eagerReducer = _lastRenderedReducer;
          _update2.eagerState = _eagerState;
          if (is(_eagerState, currentState)) {
            // Fast path. We can bail out without scheduling React to re-render.
            // It's still possible that we'll need to rebase this update later,
            // if the component re-renders for a different reason and by that
            // time the reducer has changed.
            return;
          }
        } catch (error) {
          // Suppress the error. It will throw again in the render phase.
        } finally {
          {
            ReactCurrentDispatcher$1.current = prevDispatcher;
          }
        }
      }
    }
    {
      // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
      if ('undefined' !== typeof jest) {
        warnIfNotScopedWithMatchingAct(fiber);
        warnIfNotCurrentlyActingUpdatesInDev(fiber);
      }
    }
    scheduleWork(fiber, _expirationTime);
  }
}

var ContextOnlyDispatcher = {
  readContext: readContext,

  useCallback: throwInvalidHookError,
  useContext: throwInvalidHookError,
  useEffect: throwInvalidHookError,
  useImperativeHandle: throwInvalidHookError,
  useLayoutEffect: throwInvalidHookError,
  useMemo: throwInvalidHookError,
  useReducer: throwInvalidHookError,
  useRef: throwInvalidHookError,
  useState: throwInvalidHookError,
  useDebugValue: throwInvalidHookError,
  useResponder: throwInvalidHookError
};

var HooksDispatcherOnMountInDEV = null;
var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;

{
  var warnInvalidContextAccess = function () {
    warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
  };

  var warnInvalidHookAccess = function () {
    warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
  };

  HooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      mountHookTypesDev();
      return mountDebugValue(value, formatterFn);
    },
    useResponder: function (responder, props) {
      currentHookNameInDev = 'useResponder';
      mountHookTypesDev();
      return createResponderListener(responder, props);
    }
  };

  HooksDispatcherOnMountWithHookTypesInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return mountDebugValue(value, formatterFn);
    },
    useResponder: function (responder, props) {
      currentHookNameInDev = 'useResponder';
      updateHookTypesDev();
      return createResponderListener(responder, props);
    }
  };

  HooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue(value, formatterFn);
    },
    useResponder: function (responder, props) {
      currentHookNameInDev = 'useResponder';
      updateHookTypesDev();
      return createResponderListener(responder, props);
    }
  };

  InvalidNestedHooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDebugValue(value, formatterFn);
    },
    useResponder: function (responder, props) {
      currentHookNameInDev = 'useResponder';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return createResponderListener(responder, props);
    }
  };

  InvalidNestedHooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue(value, formatterFn);
    },
    useResponder: function (responder, props) {
      currentHookNameInDev = 'useResponder';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return createResponderListener(responder, props);
    }
  };
}

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
var now$1 = Scheduler.unstable_now;


var commitTime = 0;
var profilerStartTime = -1;

function getCommitTime() {
  return commitTime;
}

function recordCommitTime() {
  if (!enableProfilerTimer) {
    return;
  }
  commitTime = now$1();
}

function startProfilerTimer(fiber) {
  if (!enableProfilerTimer) {
    return;
  }

  profilerStartTime = now$1();

  if (fiber.actualStartTime < 0) {
    fiber.actualStartTime = now$1();
  }
}

function stopProfilerTimerIfRunning(fiber) {
  if (!enableProfilerTimer) {
    return;
  }
  profilerStartTime = -1;
}

function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
  if (!enableProfilerTimer) {
    return;
  }

  if (profilerStartTime >= 0) {
    var elapsedTime = now$1() - profilerStartTime;
    fiber.actualDuration += elapsedTime;
    if (overrideBaseTime) {
      fiber.selfBaseDuration = elapsedTime;
    }
    profilerStartTime = -1;
  }
}

// The deepest Fiber on the stack involved in a hydration context.
// This may have been an insertion or a hydration.
var hydrationParentFiber = null;
var nextHydratableInstance = null;
var isHydrating = false;

function enterHydrationState(fiber) {
  if (!supportsHydration) {
    return false;
  }

  var parentInstance = fiber.stateNode.containerInfo;
  nextHydratableInstance = getFirstHydratableChild(parentInstance);
  hydrationParentFiber = fiber;
  isHydrating = true;
  return true;
}

function reenterHydrationStateFromDehydratedSuspenseInstance(fiber) {
  if (!supportsHydration) {
    return false;
  }

  var suspenseInstance = fiber.stateNode;
  nextHydratableInstance = getNextHydratableSibling(suspenseInstance);
  popToNextHostParent(fiber);
  isHydrating = true;
  return true;
}

function deleteHydratableInstance(returnFiber, instance) {
  {
    switch (returnFiber.tag) {
      case HostRoot:
        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
        break;
      case HostComponent:
        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
        break;
    }
  }

  var childToDelete = createFiberFromHostInstanceForDeletion();
  childToDelete.stateNode = instance;
  childToDelete.return = returnFiber;
  childToDelete.effectTag = Deletion;

  // This might seem like it belongs on progressedFirstDeletion. However,
  // these children are not part of the reconciliation list of children.
  // Even if we abort and rereconcile the children, that will try to hydrate
  // again and the nodes are still in the host tree so these will be
  // recreated.
  if (returnFiber.lastEffect !== null) {
    returnFiber.lastEffect.nextEffect = childToDelete;
    returnFiber.lastEffect = childToDelete;
  } else {
    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  }
}

function insertNonHydratedInstance(returnFiber, fiber) {
  fiber.effectTag |= Placement;
  {
    switch (returnFiber.tag) {
      case HostRoot:
        {
          var parentContainer = returnFiber.stateNode.containerInfo;
          switch (fiber.tag) {
            case HostComponent:
              var type = fiber.type;
              var props = fiber.pendingProps;
              didNotFindHydratableContainerInstance(parentContainer, type, props);
              break;
            case HostText:
              var text = fiber.pendingProps;
              didNotFindHydratableContainerTextInstance(parentContainer, text);
              break;
            case SuspenseComponent:
              
              break;
          }
          break;
        }
      case HostComponent:
        {
          var parentType = returnFiber.type;
          var parentProps = returnFiber.memoizedProps;
          var parentInstance = returnFiber.stateNode;
          switch (fiber.tag) {
            case HostComponent:
              var _type = fiber.type;
              var _props = fiber.pendingProps;
              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
              break;
            case HostText:
              var _text = fiber.pendingProps;
              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
              break;
            case SuspenseComponent:
              didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance);
              break;
          }
          break;
        }
      default:
        return;
    }
  }
}

function tryHydrate(fiber, nextInstance) {
  switch (fiber.tag) {
    case HostComponent:
      {
        var type = fiber.type;
        var props = fiber.pendingProps;
        var instance = canHydrateInstance(nextInstance, type, props);
        if (instance !== null) {
          fiber.stateNode = instance;
          return true;
        }
        return false;
      }
    case HostText:
      {
        var text = fiber.pendingProps;
        var textInstance = canHydrateTextInstance(nextInstance, text);
        if (textInstance !== null) {
          fiber.stateNode = textInstance;
          return true;
        }
        return false;
      }
    case SuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
          if (suspenseInstance !== null) {
            // Downgrade the tag to a dehydrated component until we've hydrated it.
            fiber.tag = DehydratedSuspenseComponent;
            fiber.stateNode = suspenseInstance;
            return true;
          }
        }
        return false;
      }
    default:
      return false;
  }
}

function tryToClaimNextHydratableInstance(fiber) {
  if (!isHydrating) {
    return;
  }
  var nextInstance = nextHydratableInstance;
  if (!nextInstance) {
    // Nothing to hydrate. Make it an insertion.
    insertNonHydratedInstance(hydrationParentFiber, fiber);
    isHydrating = false;
    hydrationParentFiber = fiber;
    return;
  }
  var firstAttemptedInstance = nextInstance;
  if (!tryHydrate(fiber, nextInstance)) {
    // If we can't hydrate this instance let's try the next one.
    // We use this as a heuristic. It's based on intuition and not data so it
    // might be flawed or unnecessary.
    nextInstance = getNextHydratableSibling(firstAttemptedInstance);
    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
      // Nothing to hydrate. Make it an insertion.
      insertNonHydratedInstance(hydrationParentFiber, fiber);
      isHydrating = false;
      hydrationParentFiber = fiber;
      return;
    }
    // We matched the next one, we'll now assume that the first one was
    // superfluous and we'll delete it. Since we can't eagerly delete it
    // we'll have to schedule a deletion. To do that, this node needs a dummy
    // fiber associated with it.
    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  }
  hydrationParentFiber = fiber;
  nextHydratableInstance = getFirstHydratableChild(nextInstance);
}

function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
  if (!supportsHydration) {
    (function () {
      {
        {
          throw ReactError(Error('Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }

  var instance = fiber.stateNode;
  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
  // TODO: Type this specific to this type of component.
  fiber.updateQueue = updatePayload;
  // If the update payload indicates that there is a change or if there
  // is a new ref we mark this as an update.
  if (updatePayload !== null) {
    return true;
  }
  return false;
}

function prepareToHydrateHostTextInstance(fiber) {
  if (!supportsHydration) {
    (function () {
      {
        {
          throw ReactError(Error('Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }

  var textInstance = fiber.stateNode;
  var textContent = fiber.memoizedProps;
  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
  {
    if (shouldUpdate) {
      // We assume that prepareToHydrateHostTextInstance is called in a context where the
      // hydration parent is the parent host component of this host text.
      var returnFiber = hydrationParentFiber;
      if (returnFiber !== null) {
        switch (returnFiber.tag) {
          case HostRoot:
            {
              var parentContainer = returnFiber.stateNode.containerInfo;
              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
              break;
            }
          case HostComponent:
            {
              var parentType = returnFiber.type;
              var parentProps = returnFiber.memoizedProps;
              var parentInstance = returnFiber.stateNode;
              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
              break;
            }
        }
      }
    }
  }
  return shouldUpdate;
}

function skipPastDehydratedSuspenseInstance(fiber) {
  if (!supportsHydration) {
    (function () {
      {
        {
          throw ReactError(Error('Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'));
        }
      }
    })();
  }
  var suspenseInstance = fiber.stateNode;
  (function () {
    if (!suspenseInstance) {
      {
        throw ReactError(Error('Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
  nextHydratableInstance = getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

function popToNextHostParent(fiber) {
  var parent = fiber.return;
  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== DehydratedSuspenseComponent) {
    parent = parent.return;
  }
  hydrationParentFiber = parent;
}

function popHydrationState(fiber) {
  if (!supportsHydration) {
    return false;
  }
  if (fiber !== hydrationParentFiber) {
    // We're deeper than the current hydration context, inside an inserted
    // tree.
    return false;
  }
  if (!isHydrating) {
    // If we're not currently hydrating but we're in a hydration context, then
    // we were an insertion and now need to pop up reenter hydration of our
    // siblings.
    popToNextHostParent(fiber);
    isHydrating = true;
    return false;
  }

  var type = fiber.type;

  // If we have any remaining hydratable nodes, we need to delete them now.
  // We only do this deeper than head and body since they tend to have random
  // other nodes in them. We also ignore components with pure text content in
  // side of them.
  // TODO: Better heuristic.
  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
    var nextInstance = nextHydratableInstance;
    while (nextInstance) {
      deleteHydratableInstance(fiber, nextInstance);
      nextInstance = getNextHydratableSibling(nextInstance);
    }
  }

  popToNextHostParent(fiber);
  nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  return true;
}

function resetHydrationState() {
  if (!supportsHydration) {
    return;
  }

  hydrationParentFiber = null;
  nextHydratableInstance = null;
  isHydrating = false;
}

var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;

var didReceiveUpdate = false;

var didWarnAboutBadClass = void 0;
var didWarnAboutModulePatternComponent = void 0;
var didWarnAboutContextTypeOnFunctionComponent = void 0;
var didWarnAboutGetDerivedStateOnFunctionComponent = void 0;
var didWarnAboutFunctionRefs = void 0;
var didWarnAboutReassigningProps = void 0;
var didWarnAboutMaxDuration = void 0;
var didWarnAboutRevealOrder = void 0;
var didWarnAboutTailOptions = void 0;
var didWarnAboutDefaultPropsOnFunctionComponent = void 0;

{
  didWarnAboutBadClass = {};
  didWarnAboutModulePatternComponent = {};
  didWarnAboutContextTypeOnFunctionComponent = {};
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
  didWarnAboutFunctionRefs = {};
  didWarnAboutReassigningProps = false;
  didWarnAboutMaxDuration = false;
  didWarnAboutRevealOrder = {};
  didWarnAboutTailOptions = {};
  didWarnAboutDefaultPropsOnFunctionComponent = {};
}

function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  if (current$$1 === null) {
    // If this is a fresh new component that hasn't been rendered yet, we
    // won't update its child set by applying minimal side-effects. Instead,
    // we will add them all to the child before it gets rendered. That means
    // we can optimize this reconciliation pass by not tracking side-effects.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    // If the current child is the same as the work in progress, it means that
    // we haven't yet started any work on these children. Therefore, we use
    // the clone algorithm to create a copy of all the current children.

    // If we had any progressed work already, that is invalid at this point so
    // let's throw it out.
    workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime);
  }
}

function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  // This function is fork of reconcileChildren. It's used in cases where we
  // want to reconcile without matching against the existing set. This has the
  // effect of all current children being unmounted; even if the type and key
  // are the same, the old child is unmounted and a new child is created.
  //
  // To do this, we're going to go through the reconcile algorithm twice. In
  // the first pass, we schedule a deletion for all the current children by
  // passing null.
  workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime);
  // In the second pass, we mount the new children. The trick here is that we
  // pass null in place of where we usually pass the current child set. This has
  // the effect of remounting all children regardless of whether their their
  // identity matches.
  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
}

function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens after the first render suspends.
  // We'll need to figure out if this is fine or can cause issues.

  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  var render = Component.render;
  var ref = workInProgress.ref;

  // The rest is a fork of updateFunctionComponent
  var nextChildren = void 0;
  prepareToReadContext(workInProgress, renderExpirationTime);
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Only double-render components with Hooks
      if (workInProgress.memoizedState !== null) {
        nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
      }
    }
    setCurrentPhase(null);
  }

  if (current$$1 !== null && !didReceiveUpdate) {
    bailoutHooks(current$$1, workInProgress, renderExpirationTime);
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  if (current$$1 === null) {
    var type = Component.type;
    if (isSimpleFunctionComponent(type) && Component.compare === null &&
    // SimpleMemoComponent codepath doesn't resolve outer props either.
    Component.defaultProps === undefined) {
      var resolvedType = type;
      {
        resolvedType = resolveFunctionForHotReloading(type);
      }
      // If this is a plain function component without default props,
      // and with only the default shallow comparison, we upgrade it
      // to a SimpleMemoComponent to allow fast path updates.
      workInProgress.tag = SimpleMemoComponent;
      workInProgress.type = resolvedType;
      {
        validateFunctionComponentInDev(workInProgress, type);
      }
      return updateSimpleMemoComponent(current$$1, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);
    }
    {
      var innerPropTypes = type.propTypes;
      if (innerPropTypes) {
        // Inner memo component props aren't currently validated in createElement.
        // We could move it there, but we'd still need this for lazy code path.
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(type), getCurrentFiberStackInDev);
      }
    }
    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
    child.ref = workInProgress.ref;
    child.return = workInProgress;
    workInProgress.child = child;
    return child;
  }
  {
    var _type = Component.type;
    var _innerPropTypes = _type.propTypes;
    if (_innerPropTypes) {
      // Inner memo component props aren't currently validated in createElement.
      // We could move it there, but we'd still need this for lazy code path.
      checkPropTypes(_innerPropTypes, nextProps, // Resolved props
      'prop', getComponentName(_type), getCurrentFiberStackInDev);
    }
  }
  var currentChild = current$$1.child; // This is always exactly one child
  if (updateExpirationTime < renderExpirationTime) {
    // This will be the props with resolved defaultProps,
    // unlike current.memoizedProps which will be the unresolved ones.
    var prevProps = currentChild.memoizedProps;
    // Default to shallow comparison
    var compare = Component.compare;
    compare = compare !== null ? compare : shallowEqual;
    if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
      return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
    }
  }
  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime);
  newChild.ref = workInProgress.ref;
  newChild.return = workInProgress;
  workInProgress.child = newChild;
  return newChild;
}

function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens when the inner render suspends.
  // We'll need to figure out if this is fine or can cause issues.

  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var outerMemoType = workInProgress.elementType;
      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
        // We warn when you define propTypes on lazy()
        // so let's just skip over it to find memo() outer wrapper.
        // Inner props for memo are validated later.
        outerMemoType = refineResolvedLazyComponent(outerMemoType);
      }
      var outerPropTypes = outerMemoType && outerMemoType.propTypes;
      if (outerPropTypes) {
        checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
        'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
      }
      // Inner propTypes will be validated in the function component path.
    }
  }
  if (current$$1 !== null) {
    var prevProps = current$$1.memoizedProps;
    if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref && (
    // Prevent bailout if the implementation changed due to hot reload:
    workInProgress.type === current$$1.type)) {
      didReceiveUpdate = false;
      if (updateExpirationTime < renderExpirationTime) {
        return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
      }
    }
  }
  return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
}

function updateFragment(current$$1, workInProgress, renderExpirationTime) {
  var nextChildren = workInProgress.pendingProps;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateMode(current$$1, workInProgress, renderExpirationTime) {
  var nextChildren = workInProgress.pendingProps.children;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
  if (enableProfilerTimer) {
    workInProgress.effectTag |= Update;
  }
  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function markRef(current$$1, workInProgress) {
  var ref = workInProgress.ref;
  if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) {
    // Schedule a Ref effect
    workInProgress.effectTag |= Ref;
  }
}

function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  var context = void 0;
  if (!disableLegacyContext) {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  var nextChildren = void 0;
  prepareToReadContext(workInProgress, renderExpirationTime);
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Only double-render components with Hooks
      if (workInProgress.memoizedState !== null) {
        nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
      }
    }
    setCurrentPhase(null);
  }

  if (current$$1 !== null && !didReceiveUpdate) {
    bailoutHooks(current$$1, workInProgress, renderExpirationTime);
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.
  var hasContext = void 0;
  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }
  prepareToReadContext(workInProgress, renderExpirationTime);

  var instance = workInProgress.stateNode;
  var shouldUpdate = void 0;
  if (instance === null) {
    if (current$$1 !== null) {
      // An class component without an instance only mounts if it suspended
      // inside a non- concurrent tree, in an inconsistent state. We want to
      // tree it like a new mount, even though an empty version of it already
      // committed. Disconnect the alternate pointers.
      current$$1.alternate = null;
      workInProgress.alternate = null;
      // Since this is conceptually a new fiber, schedule a Placement effect
      workInProgress.effectTag |= Placement;
    }
    // In the initial pass we might need to construct the instance.
    constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
    mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
    shouldUpdate = true;
  } else if (current$$1 === null) {
    // In a resume, we'll already have an instance we can reuse.
    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  } else {
    shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
  }
  var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
  {
    var inst = workInProgress.stateNode;
    if (inst.props !== nextProps) {
      !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
      didWarnAboutReassigningProps = true;
    }
  }
  return nextUnitOfWork;
}

function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
  // Refs should update even if shouldComponentUpdate returns false
  markRef(current$$1, workInProgress);

  var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;

  if (!shouldUpdate && !didCaptureError) {
    // Context providers should defer to sCU for rendering
    if (hasContext) {
      invalidateContextProvider(workInProgress, Component, false);
    }

    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  var instance = workInProgress.stateNode;

  // Rerender
  ReactCurrentOwner$3.current = workInProgress;
  var nextChildren = void 0;
  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
    // If we captured an error, but getDerivedStateFrom catch is not defined,
    // unmount all the children. componentDidCatch will schedule an update to
    // re-render a fallback. This is temporary until we migrate everyone to
    // the new API.
    // TODO: Warn in a future release.
    nextChildren = null;

    if (enableProfilerTimer) {
      stopProfilerTimerIfRunning(workInProgress);
    }
  } else {
    {
      setCurrentPhase('render');
      nextChildren = instance.render();
      if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
        instance.render();
      }
      setCurrentPhase(null);
    }
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  if (current$$1 !== null && didCaptureError) {
    // If we're recovering from an error, reconcile without reusing any of
    // the existing children. Conceptually, the normal children and the children
    // that are shown on error are two different sets, so we shouldn't reuse
    // normal children even if their identities match.
    forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime);
  } else {
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  }

  // Memoize state using the values we just used to render.
  // TODO: Restructure so we never read values from the instance.
  workInProgress.memoizedState = instance.state;

  // The context might have changed so we need to recalculate it.
  if (hasContext) {
    invalidateContextProvider(workInProgress, Component, true);
  }

  return workInProgress.child;
}

function pushHostRootContext(workInProgress) {
  var root = workInProgress.stateNode;
  if (root.pendingContext) {
    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  } else if (root.context) {
    // Should always be set
    pushTopLevelContextObject(workInProgress, root.context, false);
  }
  pushHostContainer(workInProgress, root.containerInfo);
}

function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
  pushHostRootContext(workInProgress);
  var updateQueue = workInProgress.updateQueue;
  (function () {
    if (!(updateQueue !== null)) {
      {
        throw ReactError(Error('If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
  var nextProps = workInProgress.pendingProps;
  var prevState = workInProgress.memoizedState;
  var prevChildren = prevState !== null ? prevState.element : null;
  processUpdateQueue(workInProgress, updateQueue, nextProps, null, renderExpirationTime);
  var nextState = workInProgress.memoizedState;
  // Caution: React DevTools currently depends on this property
  // being called "element".
  var nextChildren = nextState.element;
  if (nextChildren === prevChildren) {
    // If the state is the same as before, that's a bailout because we had
    // no work that expires at this time.
    resetHydrationState();
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }
  var root = workInProgress.stateNode;
  if ((current$$1 === null || current$$1.child === null) && root.hydrate && enterHydrationState(workInProgress)) {
    // If we don't have any current children this might be the first pass.
    // We always try to hydrate. If this isn't a hydration pass there won't
    // be any children to hydrate which is effectively the same thing as
    // not hydrating.

    // This is a bit of a hack. We track the host root as a placement to
    // know that we're currently in a mounting state. That way isMounted
    // works as expected. We must reset this before committing.
    // TODO: Delete this when we delete isMounted and findDOMNode.
    workInProgress.effectTag |= Placement;

    // Ensure that children mount into this root without tracking
    // side-effects. This ensures that we don't store Placement effects on
    // nodes that will be hydrated.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    // Otherwise reset hydration state in case we aborted and resumed another
    // root.
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
    resetHydrationState();
  }
  return workInProgress.child;
}

function updateHostComponent(current$$1, workInProgress, renderExpirationTime) {
  pushHostContext(workInProgress);

  if (current$$1 === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }

  var type = workInProgress.type;
  var nextProps = workInProgress.pendingProps;
  var prevProps = current$$1 !== null ? current$$1.memoizedProps : null;

  var nextChildren = nextProps.children;
  var isDirectTextChild = shouldSetTextContent(type, nextProps);

  if (isDirectTextChild) {
    // We special case a direct text child of a host node. This is a common
    // case. We won't handle it as a reified child. We will instead handle
    // this in the host environment that also have access to this prop. That
    // avoids allocating another HostText fiber and traversing it.
    nextChildren = null;
  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
    // If we're switching from a direct text child to a normal child, or to
    // empty, we need to schedule the text content to be reset.
    workInProgress.effectTag |= ContentReset;
  }

  markRef(current$$1, workInProgress);

  // Check the host config to see if the children are offscreen/hidden.
  if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
    if (enableSchedulerTracing) {
      markSpawnedWork(Never);
    }
    // Schedule this fiber to re-render at offscreen priority. Then bailout.
    workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
    return null;
  }

  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateHostText(current$$1, workInProgress) {
  if (current$$1 === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }
  // Nothing to do here. This is terminal. We'll do the completion step
  // immediately after.
  return null;
}

function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
  if (_current !== null) {
    // An lazy component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  var props = workInProgress.pendingProps;
  // We can't start a User Timing measurement with correct label yet.
  // Cancel and resume right after we know the tag.
  cancelWorkTimer(workInProgress);
  var Component = readLazyComponentType(elementType);
  // Store the unwrapped component in the type.
  workInProgress.type = Component;
  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  startWorkTimer(workInProgress);
  var resolvedProps = resolveDefaultProps(Component, props);
  var child = void 0;
  switch (resolvedTag) {
    case FunctionComponent:
      {
        {
          validateFunctionComponentInDev(workInProgress, Component);
          workInProgress.type = Component = resolveFunctionForHotReloading(Component);
        }
        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case ClassComponent:
      {
        {
          workInProgress.type = Component = resolveClassForHotReloading(Component);
        }
        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case ForwardRef:
      {
        {
          workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
        }
        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case MemoComponent:
      {
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = Component.propTypes;
            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
              'prop', getComponentName(Component), getCurrentFiberStackInDev);
            }
          }
        }
        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
        updateExpirationTime, renderExpirationTime);
        break;
      }
    default:
      {
        var hint = '';
        {
          if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
            hint = ' Did you wrap a component in React.lazy() more than once?';
          }
        }
        // This message intentionally doesn't mention ForwardRef or MemoComponent
        // because the fact that it's a separate type of work is an
        // implementation detail.
        (function () {
          {
            {
              throw ReactError(Error('Element type is invalid. Received a promise that resolves to: ' + Component + '. Lazy element type must resolve to a class or function.' + hint));
            }
          }
        })();
      }
  }
  return child;
}

function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
  if (_current !== null) {
    // An incomplete component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  // Promote the fiber to a class and try rendering again.
  workInProgress.tag = ClassComponent;

  // The rest of this function is a fork of `updateClassComponent`

  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.
  var hasContext = void 0;
  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }
  prepareToReadContext(workInProgress, renderExpirationTime);

  constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);

  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
}

function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
  if (_current !== null) {
    // An indeterminate component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  var props = workInProgress.pendingProps;
  var context = void 0;
  if (!disableLegacyContext) {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  prepareToReadContext(workInProgress, renderExpirationTime);
  var value = void 0;

  {
    if (Component.prototype && typeof Component.prototype.render === 'function') {
      var componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutBadClass[componentName]) {
        warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
        didWarnAboutBadClass[componentName] = true;
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
    }

    ReactCurrentOwner$3.current = workInProgress;
    value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  }
  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;

  if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
    {
      var _componentName = getComponentName(Component) || 'Unknown';
      if (!didWarnAboutModulePatternComponent[_componentName]) {
        warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
        didWarnAboutModulePatternComponent[_componentName] = true;
      }
    }

    // Proceed under the assumption that this is a class instance
    workInProgress.tag = ClassComponent;

    // Throw out any hooks that were used.
    resetHooks();

    // Push context providers early to prevent context stack mismatches.
    // During mounting we don't know the child context yet as the instance doesn't exist.
    // We will invalidate the child context in finishClassComponent() right after rendering.
    var hasContext = false;
    if (isContextProvider(Component)) {
      hasContext = true;
      pushContextProvider(workInProgress);
    } else {
      hasContext = false;
    }

    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;

    var getDerivedStateFromProps = Component.getDerivedStateFromProps;
    if (typeof getDerivedStateFromProps === 'function') {
      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
    }

    adoptClassInstance(workInProgress, value);
    mountClassInstance(workInProgress, Component, props, renderExpirationTime);
    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  } else {
    // Proceed under the assumption that this is a function component
    workInProgress.tag = FunctionComponent;
    {
      if (disableLegacyContext && Component.contextTypes) {
        warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(Component) || 'Unknown');
      }

      if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
        // Only double-render components with Hooks
        if (workInProgress.memoizedState !== null) {
          value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
        }
      }
    }
    reconcileChildren(null, workInProgress, value, renderExpirationTime);
    {
      validateFunctionComponentInDev(workInProgress, Component);
    }
    return workInProgress.child;
  }
}

function validateFunctionComponentInDev(workInProgress, Component) {
  if (Component) {
    !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
  }
  if (workInProgress.ref !== null) {
    var info = '';
    var ownerName = getCurrentFiberOwnerNameInDevOrNull();
    if (ownerName) {
      info += '\n\nCheck the render method of `' + ownerName + '`.';
    }

    var warningKey = ownerName || workInProgress._debugID || '';
    var debugSource = workInProgress._debugSource;
    if (debugSource) {
      warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
    }
    if (!didWarnAboutFunctionRefs[warningKey]) {
      didWarnAboutFunctionRefs[warningKey] = true;
      warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
    }
  }

  if (warnAboutDefaultPropsOnFunctionComponents && Component.defaultProps !== undefined) {
    var componentName = getComponentName(Component) || 'Unknown';

    if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
      warningWithoutStack$1(false, '%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName);
      didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
    }
  }

  if (typeof Component.getDerivedStateFromProps === 'function') {
    var _componentName2 = getComponentName(Component) || 'Unknown';

    if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
      warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName2);
      didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
    }
  }

  if (typeof Component.contextType === 'object' && Component.contextType !== null) {
    var _componentName3 = getComponentName(Component) || 'Unknown';

    if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
      warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName3);
      didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
    }
  }
}

// TODO: This is now an empty object. Should we just make it a boolean?
var SUSPENDED_MARKER = {};

function shouldRemainOnFallback(suspenseContext, current$$1, workInProgress) {
  // If the context is telling us that we should show a fallback, and we're not
  // already showing content, then we should show the fallback instead.
  return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current$$1 === null || current$$1.memoizedState !== null);
}

function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
  var mode = workInProgress.mode;
  var nextProps = workInProgress.pendingProps;

  // This is used by DevTools to force a boundary to suspend.
  {
    if (shouldSuspend(workInProgress)) {
      workInProgress.effectTag |= DidCapture;
    }
  }

  var suspenseContext = suspenseStackCursor.current;

  var nextState = null;
  var nextDidTimeout = false;

  if ((workInProgress.effectTag & DidCapture) !== NoEffect || shouldRemainOnFallback(suspenseContext, current$$1, workInProgress)) {
    // Something in this boundary's subtree already suspended. Switch to
    // rendering the fallback children.
    nextState = SUSPENDED_MARKER;
    nextDidTimeout = true;
    workInProgress.effectTag &= ~DidCapture;
  } else {
    // Attempting the main content
    if (current$$1 === null || current$$1.memoizedState !== null) {
      // This is a new mount or this boundary is already showing a fallback state.
      // Mark this subtree context as having at least one invisible parent that could
      // handle the fallback state.
      // Boundaries without fallbacks or should be avoided are not considered since
      // they cannot handle preferred fallback states.
      if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
        suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
      }
    }
  }

  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);

  pushSuspenseContext(workInProgress, suspenseContext);

  {
    if ('maxDuration' in nextProps) {
      if (!didWarnAboutMaxDuration) {
        didWarnAboutMaxDuration = true;
        warning$1(false, 'maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
      }
    }
  }

  // This next part is a bit confusing. If the children timeout, we switch to
  // showing the fallback children in place of the "primary" children.
  // However, we don't want to delete the primary children because then their
  // state will be lost (both the React state and the host state, e.g.
  // uncontrolled form inputs). Instead we keep them mounted and hide them.
  // Both the fallback children AND the primary children are rendered at the
  // same time. Once the primary children are un-suspended, we can delete
  // the fallback children — don't need to preserve their state.
  //
  // The two sets of children are siblings in the host environment, but
  // semantically, for purposes of reconciliation, they are two separate sets.
  // So we store them using two fragment fibers.
  //
  // However, we want to avoid allocating extra fibers for every placeholder.
  // They're only necessary when the children time out, because that's the
  // only time when both sets are mounted.
  //
  // So, the extra fragment fibers are only used if the children time out.
  // Otherwise, we render the primary children directly. This requires some
  // custom reconciliation logic to preserve the state of the primary
  // children. It's essentially a very basic form of re-parenting.

  // `child` points to the child fiber. In the normal case, this is the first
  // fiber of the primary children set. In the timed-out case, it's a
  // a fragment fiber containing the primary children.
  var child = void 0;
  // `next` points to the next fiber React should render. In the normal case,
  // it's the same as `child`: the first fiber of the primary children set.
  // In the timed-out case, it's a fragment fiber containing the *fallback*
  // children -- we skip over the primary children entirely.
  var next = void 0;
  if (current$$1 === null) {
    if (enableSuspenseServerRenderer) {
      // If we're currently hydrating, try to hydrate this boundary.
      // But only if this has a fallback.
      if (nextProps.fallback !== undefined) {
        tryToClaimNextHydratableInstance(workInProgress);
        // This could've changed the tag if this was a dehydrated suspense component.
        if (workInProgress.tag === DehydratedSuspenseComponent) {
          popSuspenseContext(workInProgress);
          return updateDehydratedSuspenseComponent(null, workInProgress, renderExpirationTime);
        }
      }
    }

    // This is the initial mount. This branch is pretty simple because there's
    // no previous state that needs to be preserved.
    if (nextDidTimeout) {
      // Mount separate fragments for primary and fallback children.
      var nextFallbackChildren = nextProps.fallback;
      var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
      primaryChildFragment.return = workInProgress;

      if ((workInProgress.mode & BatchedMode) === NoMode) {
        // Outside of batched mode, we commit the effects from the
        var progressedState = workInProgress.memoizedState;
        var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
        primaryChildFragment.child = progressedPrimaryChild;
        var progressedChild = progressedPrimaryChild;
        while (progressedChild !== null) {
          progressedChild.return = primaryChildFragment;
          progressedChild = progressedChild.sibling;
        }
      }

      var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
      fallbackChildFragment.return = workInProgress;
      primaryChildFragment.sibling = fallbackChildFragment;
      child = primaryChildFragment;
      // Skip the primary children, and continue working on the
      // fallback children.
      next = fallbackChildFragment;
    } else {
      // Mount the primary children without an intermediate fragment fiber.
      var nextPrimaryChildren = nextProps.children;
      child = next = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
    }
  } else {
    // This is an update. This branch is more complicated because we need to
    // ensure the state of the primary children is preserved.
    var prevState = current$$1.memoizedState;
    var prevDidTimeout = prevState !== null;
    if (prevDidTimeout) {
      // The current tree already timed out. That means each child set is
      var currentPrimaryChildFragment = current$$1.child;
      var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
      if (nextDidTimeout) {
        // Still timed out. Reuse the current primary children by cloning
        // its fragment. We're going to skip over these entirely.
        var _nextFallbackChildren = nextProps.fallback;
        var _primaryChildFragment = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, NoWork);
        _primaryChildFragment.return = workInProgress;

        if ((workInProgress.mode & BatchedMode) === NoMode) {
          // Outside of batched mode, we commit the effects from the
          var _progressedState = workInProgress.memoizedState;
          var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
          if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
            _primaryChildFragment.child = _progressedPrimaryChild;
            var _progressedChild = _progressedPrimaryChild;
            while (_progressedChild !== null) {
              _progressedChild.return = _primaryChildFragment;
              _progressedChild = _progressedChild.sibling;
            }
          }
        }

        // Because primaryChildFragment is a new fiber that we're inserting as the
        // parent of a new tree, we need to set its treeBaseDuration.
        if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
          // treeBaseDuration is the sum of all the child tree base durations.
          var treeBaseDuration = 0;
          var hiddenChild = _primaryChildFragment.child;
          while (hiddenChild !== null) {
            treeBaseDuration += hiddenChild.treeBaseDuration;
            hiddenChild = hiddenChild.sibling;
          }
          _primaryChildFragment.treeBaseDuration = treeBaseDuration;
        }

        // Clone the fallback child fragment, too. These we'll continue
        // working on.
        var _fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren, currentFallbackChildFragment.expirationTime);
        _fallbackChildFragment.return = workInProgress;
        _primaryChildFragment.sibling = _fallbackChildFragment;
        child = _primaryChildFragment;
        _primaryChildFragment.childExpirationTime = NoWork;
        // Skip the primary children, and continue working on the
        // fallback children.
        next = _fallbackChildFragment;
      } else {
        // No longer suspended. Switch back to showing the primary children,
        // and remove the intermediate fragment fiber.
        var _nextPrimaryChildren = nextProps.children;
        var currentPrimaryChild = currentPrimaryChildFragment.child;
        var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime);

        // If this render doesn't suspend, we need to delete the fallback
        // children. Wait until the complete phase, after we've confirmed the
        // fallback is no longer needed.
        // TODO: Would it be better to store the fallback fragment on
        // the stateNode?

        // Continue rendering the children, like we normally do.
        child = next = primaryChild;
      }
    } else {
      // The current tree has not already timed out. That means the primary
      // children are not wrapped in a fragment fiber.
      var _currentPrimaryChild = current$$1.child;
      if (nextDidTimeout) {
        // Timed out. Wrap the children in a fragment fiber to keep them
        // separate from the fallback children.
        var _nextFallbackChildren2 = nextProps.fallback;
        var _primaryChildFragment2 = createFiberFromFragment(
        // It shouldn't matter what the pending props are because we aren't
        // going to render this fragment.
        null, mode, NoWork, null);
        _primaryChildFragment2.return = workInProgress;
        _primaryChildFragment2.child = _currentPrimaryChild;
        if (_currentPrimaryChild !== null) {
          _currentPrimaryChild.return = _primaryChildFragment2;
        }

        // Even though we're creating a new fiber, there are no new children,
        // because we're reusing an already mounted tree. So we don't need to
        // schedule a placement.
        // primaryChildFragment.effectTag |= Placement;

        if ((workInProgress.mode & BatchedMode) === NoMode) {
          // Outside of batched mode, we commit the effects from the
          var _progressedState2 = workInProgress.memoizedState;
          var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
          _primaryChildFragment2.child = _progressedPrimaryChild2;
          var _progressedChild2 = _progressedPrimaryChild2;
          while (_progressedChild2 !== null) {
            _progressedChild2.return = _primaryChildFragment2;
            _progressedChild2 = _progressedChild2.sibling;
          }
        }

        // Because primaryChildFragment is a new fiber that we're inserting as the
        // parent of a new tree, we need to set its treeBaseDuration.
        if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
          // treeBaseDuration is the sum of all the child tree base durations.
          var _treeBaseDuration = 0;
          var _hiddenChild = _primaryChildFragment2.child;
          while (_hiddenChild !== null) {
            _treeBaseDuration += _hiddenChild.treeBaseDuration;
            _hiddenChild = _hiddenChild.sibling;
          }
          _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
        }

        // Create a fragment from the fallback children, too.
        var _fallbackChildFragment2 = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null);
        _fallbackChildFragment2.return = workInProgress;
        _primaryChildFragment2.sibling = _fallbackChildFragment2;
        _fallbackChildFragment2.effectTag |= Placement;
        child = _primaryChildFragment2;
        _primaryChildFragment2.childExpirationTime = NoWork;
        // Skip the primary children, and continue working on the
        // fallback children.
        next = _fallbackChildFragment2;
      } else {
        // Still haven't timed out.  Continue rendering the children, like we
        // normally do.
        var _nextPrimaryChildren2 = nextProps.children;
        next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
      }
    }
    workInProgress.stateNode = current$$1.stateNode;
  }

  workInProgress.memoizedState = nextState;
  workInProgress.child = child;
  return next;
}

function retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime) {
  // Detach from the current dehydrated boundary.
  current$$1.alternate = null;
  workInProgress.alternate = null;

  // Insert a deletion in the effect list.
  var returnFiber = workInProgress.return;
  (function () {
    if (!(returnFiber !== null)) {
      {
        throw ReactError(Error('Suspense boundaries are never on the root. This is probably a bug in React.'));
      }
    }
  })();
  var last = returnFiber.lastEffect;
  if (last !== null) {
    last.nextEffect = current$$1;
    returnFiber.lastEffect = current$$1;
  } else {
    returnFiber.firstEffect = returnFiber.lastEffect = current$$1;
  }
  current$$1.nextEffect = null;
  current$$1.effectTag = Deletion;

  popSuspenseContext(workInProgress);

  // Upgrade this work in progress to a real Suspense component.
  workInProgress.tag = SuspenseComponent;
  workInProgress.stateNode = null;
  workInProgress.memoizedState = null;
  // This is now an insertion.
  workInProgress.effectTag |= Placement;
  // Retry as a real Suspense component.
  return updateSuspenseComponent(null, workInProgress, renderExpirationTime);
}

function updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
  pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
  var suspenseInstance = workInProgress.stateNode;
  if (current$$1 === null) {
    // During the first pass, we'll bail out and not drill into the children.
    // Instead, we'll leave the content in place and try to hydrate it later.
    if (isSuspenseInstanceFallback(suspenseInstance)) {
      // This is a client-only boundary. Since we won't get any content from the server
      // for this, we need to schedule that at a higher priority based on when it would
      // have timed out. In theory we could render it in this pass but it would have the
      // wrong priority associated with it and will prevent hydration of parent path.
      // Instead, we'll leave work left on it to render it in a separate commit.

      // TODO This time should be the time at which the server rendered response that is
      // a parent to this boundary was displayed. However, since we currently don't have
      // a protocol to transfer that time, we'll just estimate it by using the current
      // time. This will mean that Suspense timeouts are slightly shifted to later than
      // they should be.
      var serverDisplayTime = requestCurrentTime();
      // Schedule a normal pri update to render this content.
      workInProgress.expirationTime = computeAsyncExpiration(serverDisplayTime);
    } else {
      // We'll continue hydrating the rest at offscreen priority since we'll already
      // be showing the right content coming from the server, it is no rush.
      workInProgress.expirationTime = Never;
    }
    return null;
  }
  if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
    // Something suspended. Leave the existing children in place.
    // TODO: In non-concurrent mode, should we commit the nodes we have hydrated so far?
    workInProgress.child = null;
    return null;
  }
  if (isSuspenseInstanceFallback(suspenseInstance)) {
    // This boundary is in a permanent fallback state. In this case, we'll never
    // get an update and we'll never be able to hydrate the final content. Let's just try the
    // client side render instead.
    return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
  }
  // We use childExpirationTime to indicate that a child might depend on context, so if
  // any context has changed, we need to treat is as if the input might have changed.
  var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime;
  if (didReceiveUpdate || hasContextChanged$$1) {
    // This boundary has changed since the first render. This means that we are now unable to
    // hydrate it. We might still be able to hydrate it using an earlier expiration time but
    // during this render we can't. Instead, we're going to delete the whole subtree and
    // instead inject a new real Suspense boundary to take its place, which may render content
    // or fallback. The real Suspense boundary will suspend for a while so we have some time
    // to ensure it can produce real content, but all state and pending events will be lost.
    return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
  } else if (isSuspenseInstancePending(suspenseInstance)) {
    // This component is still pending more data from the server, so we can't hydrate its
    // content. We treat it as if this component suspended itself. It might seem as if
    // we could just try to render it client-side instead. However, this will perform a
    // lot of unnecessary work and is unlikely to complete since it often will suspend
    // on missing data anyway. Additionally, the server might be able to render more
    // than we can on the client yet. In that case we'd end up with more fallback states
    // on the client than if we just leave it alone. If the server times out or errors
    // these should update this boundary to the permanent Fallback state instead.
    // Mark it as having captured (i.e. suspended).
    workInProgress.effectTag |= DidCapture;
    // Leave the children in place. I.e. empty.
    workInProgress.child = null;
    // Register a callback to retry this boundary once the server has sent the result.
    registerSuspenseInstanceRetry(suspenseInstance, retryTimedOutBoundary.bind(null, current$$1));
    return null;
  } else {
    // This is the first attempt.
    reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress);
    var nextProps = workInProgress.pendingProps;
    var nextChildren = nextProps.children;
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
    return workInProgress.child;
  }
}

function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {
  // Mark any Suspense boundaries with fallbacks as having work to do.
  // If they were previously forced into fallbacks, they may now be able
  // to unblock.
  var node = firstChild;
  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;
      if (state !== null) {
        if (node.expirationTime < renderExpirationTime) {
          node.expirationTime = renderExpirationTime;
        }
        var alternate = node.alternate;
        if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
          alternate.expirationTime = renderExpirationTime;
        }
        scheduleWorkOnParentPath(node.return, renderExpirationTime);
      }
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === workInProgress) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === workInProgress) {
        return;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function findLastContentRow(firstChild) {
  // This is going to find the last row among these children that is already
  // showing content on the screen, as opposed to being in fallback state or
  // new. If a row has multiple Suspense boundaries, any of them being in the
  // fallback state, counts as the whole row being in a fallback state.
  // Note that the "rows" will be workInProgress, but any nested children
  // will still be current since we haven't rendered them yet. The mounted
  // order may not be the same as the new order. We use the new order.
  var row = firstChild;
  var lastContentRow = null;
  while (row !== null) {
    var currentRow = row.alternate;
    // New rows can't be content rows.
    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
      lastContentRow = row;
    }
    row = row.sibling;
  }
  return lastContentRow;
}

function validateRevealOrder(revealOrder) {
  {
    if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
      didWarnAboutRevealOrder[revealOrder] = true;
      if (typeof revealOrder === 'string') {
        switch (revealOrder.toLowerCase()) {
          case 'together':
          case 'forwards':
          case 'backwards':
            {
              warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
              break;
            }
          case 'forward':
          case 'backward':
            {
              warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
              break;
            }
          default:
            warning$1(false, '"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
            break;
        }
      } else {
        warning$1(false, '%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
      }
    }
  }
}

function validateTailOptions(tailMode, revealOrder) {
  {
    if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
      if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
        didWarnAboutTailOptions[tailMode] = true;
        warning$1(false, '"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
      } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
        didWarnAboutTailOptions[tailMode] = true;
        warning$1(false, '<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
      }
    }
  }
}

function validateSuspenseListNestedChild(childSlot, index) {
  {
    var isArray = Array.isArray(childSlot);
    var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';
    if (isArray || isIterable) {
      var type = isArray ? 'array' : 'iterable';
      warning$1(false, 'A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);
      return false;
    }
  }
  return true;
}

function validateSuspenseListChildren(children, revealOrder) {
  {
    if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
      if (Array.isArray(children)) {
        for (var i = 0; i < children.length; i++) {
          if (!validateSuspenseListNestedChild(children[i], i)) {
            return;
          }
        }
      } else {
        var iteratorFn = getIteratorFn(children);
        if (typeof iteratorFn === 'function') {
          var childrenIterator = iteratorFn.call(children);
          if (childrenIterator) {
            var step = childrenIterator.next();
            var _i = 0;
            for (; !step.done; step = childrenIterator.next()) {
              if (!validateSuspenseListNestedChild(step.value, _i)) {
                return;
              }
              _i++;
            }
          }
        } else {
          warning$1(false, 'A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
        }
      }
    }
  }
}

function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) {
  var renderState = workInProgress.memoizedState;
  if (renderState === null) {
    workInProgress.memoizedState = {
      isBackwards: isBackwards,
      rendering: null,
      last: lastContentRow,
      tail: tail,
      tailExpiration: 0,
      tailMode: tailMode
    };
  } else {
    // We can reuse the existing object from previous renders.
    renderState.isBackwards = isBackwards;
    renderState.rendering = null;
    renderState.last = lastContentRow;
    renderState.tail = tail;
    renderState.tailExpiration = 0;
    renderState.tailMode = tailMode;
  }
}

// This can end up rendering this component multiple passes.
// The first pass splits the children fibers into two sets. A head and tail.
// We first render the head. If anything is in fallback state, we do another
// pass through beginWork to rerender all children (including the tail) with
// the force suspend context. If the first render didn't have anything in
// in fallback state. Then we render each row in the tail one-by-one.
// That happens in the completeWork phase without going back to beginWork.
function updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime) {
  var nextProps = workInProgress.pendingProps;
  var revealOrder = nextProps.revealOrder;
  var tailMode = nextProps.tail;
  var newChildren = nextProps.children;

  validateRevealOrder(revealOrder);
  validateTailOptions(tailMode, revealOrder);
  validateSuspenseListChildren(newChildren, revealOrder);

  reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);

  var suspenseContext = suspenseStackCursor.current;

  var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
  if (shouldForceFallback) {
    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
    workInProgress.effectTag |= DidCapture;
  } else {
    var didSuspendBefore = current$$1 !== null && (current$$1.effectTag & DidCapture) !== NoEffect;
    if (didSuspendBefore) {
      // If we previously forced a fallback, we need to schedule work
      // on any nested boundaries to let them know to try to render
      // again. This is the same as context updating.
      propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);
    }
    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  }
  pushSuspenseContext(workInProgress, suspenseContext);

  if ((workInProgress.mode & BatchedMode) === NoMode) {
    // Outside of batched mode, SuspenseList doesn't work so we just
    // use make it a noop by treating it as the default revealOrder.
    workInProgress.memoizedState = null;
  } else {
    switch (revealOrder) {
      case 'forwards':
        {
          var lastContentRow = findLastContentRow(workInProgress.child);
          var tail = void 0;
          if (lastContentRow === null) {
            // The whole list is part of the tail.
            // TODO: We could fast path by just rendering the tail now.
            tail = workInProgress.child;
            workInProgress.child = null;
          } else {
            // Disconnect the tail rows after the content row.
            // We're going to render them separately later.
            tail = lastContentRow.sibling;
            lastContentRow.sibling = null;
          }
          initSuspenseListRenderState(workInProgress, false, // isBackwards
          tail, lastContentRow, tailMode);
          break;
        }
      case 'backwards':
        {
          // We're going to find the first row that has existing content.
          // At the same time we're going to reverse the list of everything
          // we pass in the meantime. That's going to be our tail in reverse
          // order.
          var _tail = null;
          var row = workInProgress.child;
          workInProgress.child = null;
          while (row !== null) {
            var currentRow = row.alternate;
            // New rows can't be content rows.
            if (currentRow !== null && findFirstSuspended(currentRow) === null) {
              // This is the beginning of the main content.
              workInProgress.child = row;
              break;
            }
            var nextRow = row.sibling;
            row.sibling = _tail;
            _tail = row;
            row = nextRow;
          }
          // TODO: If workInProgress.child is null, we can continue on the tail immediately.
          initSuspenseListRenderState(workInProgress, true, // isBackwards
          _tail, null, // last
          tailMode);
          break;
        }
      case 'together':
        {
          initSuspenseListRenderState(workInProgress, false, // isBackwards
          null, // tail
          null, // last
          undefined);
          break;
        }
      default:
        {
          // The default reveal order is the same as not having
          // a boundary.
          workInProgress.memoizedState = null;
        }
    }
  }
  return workInProgress.child;
}

function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) {
  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  var nextChildren = workInProgress.pendingProps;
  if (current$$1 === null) {
    // Portals are special because we don't append the children during mount
    // but at commit. Therefore we need to track insertions which the normal
    // flow doesn't do during mount. This doesn't happen at the root because
    // the root always starts with a "current" with a null child.
    // TODO: Consider unifying this with how the root works.
    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  }
  return workInProgress.child;
}

function updateContextProvider(current$$1, workInProgress, renderExpirationTime) {
  var providerType = workInProgress.type;
  var context = providerType._context;

  var newProps = workInProgress.pendingProps;
  var oldProps = workInProgress.memoizedProps;

  var newValue = newProps.value;

  {
    var providerPropTypes = workInProgress.type.propTypes;

    if (providerPropTypes) {
      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
    }
  }

  pushProvider(workInProgress, newValue);

  if (oldProps !== null) {
    var oldValue = oldProps.value;
    var changedBits = calculateChangedBits(context, newValue, oldValue);
    if (changedBits === 0) {
      // No change. Bailout early if children are the same.
      if (oldProps.children === newProps.children && !hasContextChanged()) {
        return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
      }
    } else {
      // The context value changed. Search for matching consumers and schedule
      // them to update.
      propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
    }
  }

  var newChildren = newProps.children;
  reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  return workInProgress.child;
}

var hasWarnedAboutUsingContextAsConsumer = false;

function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) {
  var context = workInProgress.type;
  // The logic below for Context differs depending on PROD or DEV mode. In
  // DEV mode, we create a separate object for Context.Consumer that acts
  // like a proxy to Context. This proxy object adds unnecessary code in PROD
  // so we use the old behaviour (Context.Consumer references Context) to
  // reduce size and overhead. The separate object references context via
  // a property called "_context", which also gives us the ability to check
  // in DEV mode if this property exists or not and warn if it does not.
  {
    if (context._context === undefined) {
      // This may be because it's a Context (rather than a Consumer).
      // Or it may be because it's older React where they're the same thing.
      // We only want to warn if we're sure it's a new React.
      if (context !== context.Consumer) {
        if (!hasWarnedAboutUsingContextAsConsumer) {
          hasWarnedAboutUsingContextAsConsumer = true;
          warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
        }
      }
    } else {
      context = context._context;
    }
  }
  var newProps = workInProgress.pendingProps;
  var render = newProps.children;

  {
    !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
  }

  prepareToReadContext(workInProgress, renderExpirationTime);
  var newValue = readContext(context, newProps.unstable_observedBits);
  var newChildren = void 0;
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    newChildren = render(newValue);
    setCurrentPhase(null);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime) {
  var fundamentalImpl = workInProgress.type.impl;
  if (fundamentalImpl.reconcileChildren === false) {
    return null;
  }
  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;

  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function markWorkInProgressReceivedUpdate() {
  didReceiveUpdate = true;
}

function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) {
  cancelWorkTimer(workInProgress);

  if (current$$1 !== null) {
    // Reuse previous dependencies
    workInProgress.dependencies = current$$1.dependencies;
  }

  if (enableProfilerTimer) {
    // Don't update "base" render times for bailouts.
    stopProfilerTimerIfRunning(workInProgress);
  }

  // Check if the children have any pending work.
  var childExpirationTime = workInProgress.childExpirationTime;
  if (childExpirationTime < renderExpirationTime) {
    // The children don't have any work either. We can skip them.
    // TODO: Once we add back resuming, we should check if the children are
    // a work-in-progress set. If so, we need to transfer their effects.
    return null;
  } else {
    // This fiber doesn't have work, but its subtree does. Clone the child
    // fibers and continue.
    cloneChildFibers(current$$1, workInProgress);
    return workInProgress.child;
  }
}

function remountFiber(current$$1, oldWorkInProgress, newWorkInProgress) {
  {
    var returnFiber = oldWorkInProgress.return;
    if (returnFiber === null) {
      throw new Error('Cannot swap the root fiber.');
    }

    // Disconnect from the old current.
    // It will get deleted.
    current$$1.alternate = null;
    oldWorkInProgress.alternate = null;

    // Connect to the new tree.
    newWorkInProgress.index = oldWorkInProgress.index;
    newWorkInProgress.sibling = oldWorkInProgress.sibling;
    newWorkInProgress.return = oldWorkInProgress.return;
    newWorkInProgress.ref = oldWorkInProgress.ref;

    // Replace the child/sibling pointers above it.
    if (oldWorkInProgress === returnFiber.child) {
      returnFiber.child = newWorkInProgress;
    } else {
      var prevSibling = returnFiber.child;
      if (prevSibling === null) {
        throw new Error('Expected parent to have a child.');
      }
      while (prevSibling.sibling !== oldWorkInProgress) {
        prevSibling = prevSibling.sibling;
        if (prevSibling === null) {
          throw new Error('Expected to find the previous sibling.');
        }
      }
      prevSibling.sibling = newWorkInProgress;
    }

    // Delete the old fiber and place the new one.
    // Since the old fiber is disconnected, we have to schedule it manually.
    var last = returnFiber.lastEffect;
    if (last !== null) {
      last.nextEffect = current$$1;
      returnFiber.lastEffect = current$$1;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = current$$1;
    }
    current$$1.nextEffect = null;
    current$$1.effectTag = Deletion;

    newWorkInProgress.effectTag |= Placement;

    // Restart work from the new fiber.
    return newWorkInProgress;
  }
}

function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
  var updateExpirationTime = workInProgress.expirationTime;

  {
    if (workInProgress._debugNeedsRemount && current$$1 !== null) {
      // This will restart the begin phase with a new fiber.
      return remountFiber(current$$1, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));
    }
  }

  if (current$$1 !== null) {
    var oldProps = current$$1.memoizedProps;
    var newProps = workInProgress.pendingProps;

    if (oldProps !== newProps || hasContextChanged() || (
    // Force a re-render if the implementation changed due to hot reload:
    workInProgress.type !== current$$1.type)) {
      // If props or context changed, mark the fiber as having performed work.
      // This may be unset if the props are determined to be equal later (memo).
      didReceiveUpdate = true;
    } else if (updateExpirationTime < renderExpirationTime) {
      didReceiveUpdate = false;
      // This fiber does not have any pending work. Bailout without entering
      // the begin phase. There's still some bookkeeping we that needs to be done
      // in this optimized path, mostly pushing stuff onto the stack.
      switch (workInProgress.tag) {
        case HostRoot:
          pushHostRootContext(workInProgress);
          resetHydrationState();
          break;
        case HostComponent:
          pushHostContext(workInProgress);
          if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {
            if (enableSchedulerTracing) {
              markSpawnedWork(Never);
            }
            // Schedule this fiber to re-render at offscreen priority. Then bailout.
            workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
            return null;
          }
          break;
        case ClassComponent:
          {
            var Component = workInProgress.type;
            if (isContextProvider(Component)) {
              pushContextProvider(workInProgress);
            }
            break;
          }
        case HostPortal:
          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
          break;
        case ContextProvider:
          {
            var newValue = workInProgress.memoizedProps.value;
            pushProvider(workInProgress, newValue);
            break;
          }
        case Profiler:
          if (enableProfilerTimer) {
            workInProgress.effectTag |= Update;
          }
          break;
        case SuspenseComponent:
          {
            var state = workInProgress.memoizedState;
            var didTimeout = state !== null;
            if (didTimeout) {
              // If this boundary is currently timed out, we need to decide
              // whether to retry the primary children, or to skip over it and
              // go straight to the fallback. Check the priority of the primary
              var primaryChildFragment = workInProgress.child;
              var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
              if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
                // The primary children have pending work. Use the normal path
                // to attempt to render the primary children again.
                return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
              } else {
                pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                // The primary children do not have pending work with sufficient
                // priority. Bailout.
                var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
                if (child !== null) {
                  // The fallback children have pending work. Skip over the
                  // primary children and work on the fallback.
                  return child.sibling;
                } else {
                  return null;
                }
              }
            } else {
              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
            }
            break;
          }
        case DehydratedSuspenseComponent:
          {
            if (enableSuspenseServerRenderer) {
              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
              // We know that this component will suspend again because if it has
              // been unsuspended it has committed as a regular Suspense component.
              // If it needs to be retried, it should have work scheduled on it.
              workInProgress.effectTag |= DidCapture;
            }
            break;
          }
        case SuspenseListComponent:
          {
            var didSuspendBefore = (current$$1.effectTag & DidCapture) !== NoEffect;

            var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;

            if (didSuspendBefore) {
              if (hasChildWork) {
                // If something was in fallback state last time, and we have all the
                // same children then we're still in progressive loading state.
                // Something might get unblocked by state updates or retries in the
                // tree which will affect the tail. So we need to use the normal
                // path to compute the correct tail.
                return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
              }
              // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.
              workInProgress.effectTag |= DidCapture;
            }

            // If nothing suspended before and we're rendering the same children,
            // then the tail doesn't matter. Anything new that suspends will work
            // in the "together" mode, so we can continue from the state we had.
            var renderState = workInProgress.memoizedState;
            if (renderState !== null) {
              // Reset to the "together" mode in case we've started a different
              // update in the past but didn't complete it.
              renderState.rendering = null;
              renderState.tail = null;
            }
            pushSuspenseContext(workInProgress, suspenseStackCursor.current);

            if (hasChildWork) {
              break;
            } else {
              // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.
              return null;
            }
          }
      }
      return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
    }
  } else {
    didReceiveUpdate = false;
  }

  // Before entering the begin phase, clear the expiration time.
  workInProgress.expirationTime = NoWork;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      {
        return mountIndeterminateComponent(current$$1, workInProgress, workInProgress.type, renderExpirationTime);
      }
    case LazyComponent:
      {
        var elementType = workInProgress.elementType;
        return mountLazyComponent(current$$1, workInProgress, elementType, updateExpirationTime, renderExpirationTime);
      }
    case FunctionComponent:
      {
        var _Component = workInProgress.type;
        var unresolvedProps = workInProgress.pendingProps;
        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
        return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime);
      }
    case ClassComponent:
      {
        var _Component2 = workInProgress.type;
        var _unresolvedProps = workInProgress.pendingProps;
        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
        return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
      }
    case HostRoot:
      return updateHostRoot(current$$1, workInProgress, renderExpirationTime);
    case HostComponent:
      return updateHostComponent(current$$1, workInProgress, renderExpirationTime);
    case HostText:
      return updateHostText(current$$1, workInProgress);
    case SuspenseComponent:
      return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
    case HostPortal:
      return updatePortalComponent(current$$1, workInProgress, renderExpirationTime);
    case ForwardRef:
      {
        var type = workInProgress.type;
        var _unresolvedProps2 = workInProgress.pendingProps;
        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
        return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime);
      }
    case Fragment:
      return updateFragment(current$$1, workInProgress, renderExpirationTime);
    case Mode:
      return updateMode(current$$1, workInProgress, renderExpirationTime);
    case Profiler:
      return updateProfiler(current$$1, workInProgress, renderExpirationTime);
    case ContextProvider:
      return updateContextProvider(current$$1, workInProgress, renderExpirationTime);
    case ContextConsumer:
      return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
    case MemoComponent:
      {
        var _type2 = workInProgress.type;
        var _unresolvedProps3 = workInProgress.pendingProps;
        // Resolve outer props first, then resolve inner props.
        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = _type2.propTypes;
            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
              'prop', getComponentName(_type2), getCurrentFiberStackInDev);
            }
          }
        }
        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
        return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
      }
    case SimpleMemoComponent:
      {
        return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
      }
    case IncompleteClassComponent:
      {
        var _Component3 = workInProgress.type;
        var _unresolvedProps4 = workInProgress.pendingProps;
        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
        return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          return updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
        }
        break;
      }
    case SuspenseListComponent:
      {
        return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
      }
    case FundamentalComponent:
      {
        if (enableFundamentalAPI) {
          return updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime);
        }
        break;
      }
  }
  (function () {
    {
      {
        throw ReactError(Error('Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
}

function createFundamentalStateInstance(currentFiber, props, impl, state) {
  return {
    currentFiber: currentFiber,
    impl: impl,
    instance: null,
    prevProps: null,
    props: props,
    state: state
  };
}

var emptyObject = {};
var isArray$2 = Array.isArray;

function markUpdate(workInProgress) {
  // Tag the fiber with an update effect. This turns a Placement into
  // a PlacementAndUpdate.
  workInProgress.effectTag |= Update;
}

function markRef$1(workInProgress) {
  workInProgress.effectTag |= Ref;
}

var appendAllChildren = void 0;
var updateHostContainer = void 0;
var updateHostComponent$1 = void 0;
var updateHostText$1 = void 0;
if (supportsMutation) {
  // Mutation mode

  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      if (node.tag === HostComponent || node.tag === HostText) {
        appendInitialChild(parent, node.stateNode);
      } else if (node.tag === FundamentalComponent) {
        appendInitialChild(parent, node.stateNode.instance);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  updateHostContainer = function (workInProgress) {
    // Noop
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // If we have an alternate, that means this is an update and we need to
    // schedule a side-effect to do the updates.
    var oldProps = current.memoizedProps;
    if (oldProps === newProps) {
      // In mutation mode, this is sufficient for a bailout because
      // we won't touch this node even if children changed.
      return;
    }

    // If we get updated because one of our children updated, we don't
    // have newProps so we'll have to reuse them.
    // TODO: Split the update API as separate for the props vs. children.
    // Even better would be if children weren't special cased at all tho.
    var instance = workInProgress.stateNode;
    var currentHostContext = getHostContext();
    // TODO: Experiencing an error where oldProps is null. Suggests a host
    // component is hitting the resume path. Figure out why. Possibly
    // related to `hidden`.
    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
    // TODO: Type this specific to this type of component.
    workInProgress.updateQueue = updatePayload;
    // If the update payload indicates that there is a change or if there
    // is a new ref we mark this as an update. All the work is done in commitWork.
    if (updatePayload) {
      markUpdate(workInProgress);
    }
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // If the text differs, mark it as an update. All the work in done in commitWork.
    if (oldText !== newText) {
      markUpdate(workInProgress);
    }
  };
} else if (supportsPersistence) {
  // Persistent host tree mode

  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      // eslint-disable-next-line no-labels
      branches: if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var props = node.memoizedProps;
          var type = node.type;
          instance = cloneHiddenInstance(instance, type, props, node);
        }
        appendInitialChild(parent, instance);
      } else if (node.tag === HostText) {
        var _instance = node.stateNode;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var text = node.memoizedProps;
          _instance = cloneHiddenTextInstance(_instance, text, node);
        }
        appendInitialChild(parent, _instance);
      } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
        var _instance2 = node.stateNode.instance;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var _props = node.memoizedProps;
          var _type = node.type;
          _instance2 = cloneHiddenInstance(_instance2, _type, _props, node);
        }
        appendInitialChild(parent, _instance2);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.tag === SuspenseComponent) {
        if ((node.effectTag & Update) !== NoEffect) {
          // Need to toggle the visibility of the primary children.
          var newIsHidden = node.memoizedState !== null;
          if (newIsHidden) {
            var primaryChildParent = node.child;
            if (primaryChildParent !== null) {
              if (primaryChildParent.child !== null) {
                primaryChildParent.child.return = primaryChildParent;
                appendAllChildren(parent, primaryChildParent, true, newIsHidden);
              }
              var fallbackChildParent = primaryChildParent.sibling;
              if (fallbackChildParent !== null) {
                fallbackChildParent.return = node;
                node = fallbackChildParent;
                continue;
              }
            }
          }
        }
        if (node.child !== null) {
          // Continue traversing like normal
          node.child.return = node;
          node = node.child;
          continue;
        }
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      // $FlowFixMe This is correct but Flow is confused by the labeled break.
      node = node;
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  // An unfortunate fork of appendAllChildren because we have two different parent types.
  var appendAllChildrenToContainer = function (containerChildSet, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      // eslint-disable-next-line no-labels
      branches: if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var props = node.memoizedProps;
          var type = node.type;
          instance = cloneHiddenInstance(instance, type, props, node);
        }
        appendChildToContainerChildSet(containerChildSet, instance);
      } else if (node.tag === HostText) {
        var _instance3 = node.stateNode;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var text = node.memoizedProps;
          _instance3 = cloneHiddenTextInstance(_instance3, text, node);
        }
        appendChildToContainerChildSet(containerChildSet, _instance3);
      } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
        var _instance4 = node.stateNode.instance;
        if (needsVisibilityToggle && isHidden) {
          // This child is inside a timed out tree. Hide it.
          var _props2 = node.memoizedProps;
          var _type2 = node.type;
          _instance4 = cloneHiddenInstance(_instance4, _type2, _props2, node);
        }
        appendChildToContainerChildSet(containerChildSet, _instance4);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.tag === SuspenseComponent) {
        if ((node.effectTag & Update) !== NoEffect) {
          // Need to toggle the visibility of the primary children.
          var newIsHidden = node.memoizedState !== null;
          if (newIsHidden) {
            var primaryChildParent = node.child;
            if (primaryChildParent !== null) {
              if (primaryChildParent.child !== null) {
                primaryChildParent.child.return = primaryChildParent;
                appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, newIsHidden);
              }
              var fallbackChildParent = primaryChildParent.sibling;
              if (fallbackChildParent !== null) {
                fallbackChildParent.return = node;
                node = fallbackChildParent;
                continue;
              }
            }
          }
        }
        if (node.child !== null) {
          // Continue traversing like normal
          node.child.return = node;
          node = node.child;
          continue;
        }
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      // $FlowFixMe This is correct but Flow is confused by the labeled break.
      node = node;
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };
  updateHostContainer = function (workInProgress) {
    var portalOrRoot = workInProgress.stateNode;
    var childrenUnchanged = workInProgress.firstEffect === null;
    if (childrenUnchanged) {
      // No changes, just reuse the existing instance.
    } else {
      var container = portalOrRoot.containerInfo;
      var newChildSet = createContainerChildSet(container);
      // If children might have changed, we have to add them all to the set.
      appendAllChildrenToContainer(newChildSet, workInProgress, false, false);
      portalOrRoot.pendingChildren = newChildSet;
      // Schedule an update on the container to swap out the container.
      markUpdate(workInProgress);
      finalizeContainerChildren(container, newChildSet);
    }
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    var currentInstance = current.stateNode;
    var oldProps = current.memoizedProps;
    // If there are no effects associated with this node, then none of our children had any updates.
    // This guarantees that we can reuse all of them.
    var childrenUnchanged = workInProgress.firstEffect === null;
    if (childrenUnchanged && oldProps === newProps) {
      // No changes, just reuse the existing instance.
      // Note that this might release a previous clone.
      workInProgress.stateNode = currentInstance;
      return;
    }
    var recyclableInstance = workInProgress.stateNode;
    var currentHostContext = getHostContext();
    var updatePayload = null;
    if (oldProps !== newProps) {
      updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
    }
    if (childrenUnchanged && updatePayload === null) {
      // No changes, just reuse the existing instance.
      // Note that this might release a previous clone.
      workInProgress.stateNode = currentInstance;
      return;
    }
    var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
    if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
      markUpdate(workInProgress);
    }
    workInProgress.stateNode = newInstance;
    if (childrenUnchanged) {
      // If there are no other effects in this tree, we need to flag this node as having one.
      // Even though we're not going to use it for anything.
      // Otherwise parents won't know that there are new children to propagate upwards.
      markUpdate(workInProgress);
    } else {
      // If children might have changed, we have to add them all to the set.
      appendAllChildren(newInstance, workInProgress, false, false);
    }
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    if (oldText !== newText) {
      // If the text content differs, we'll create a new text instance for it.
      var rootContainerInstance = getRootHostContainer();
      var currentHostContext = getHostContext();
      workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress);
      // We'll have to mark it as having an effect, even though we won't use the effect for anything.
      // This lets the parents know that at least one of their children has changed.
      markUpdate(workInProgress);
    }
  };
} else {
  // No host operations
  updateHostContainer = function (workInProgress) {
    // Noop
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // Noop
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // Noop
  };
}

function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  switch (renderState.tailMode) {
    case 'hidden':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var tailNode = renderState.tail;
        var lastTailNode = null;
        while (tailNode !== null) {
          if (tailNode.alternate !== null) {
            lastTailNode = tailNode;
          }
          tailNode = tailNode.sibling;
        }
        // Next we're simply going to delete all insertions after the
        // last rendered item.
        if (lastTailNode === null) {
          // All remaining items in the tail are insertions.
          renderState.tail = null;
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          lastTailNode.sibling = null;
        }
        break;
      }
    case 'collapsed':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var _tailNode = renderState.tail;
        var _lastTailNode = null;
        while (_tailNode !== null) {
          if (_tailNode.alternate !== null) {
            _lastTailNode = _tailNode;
          }
          _tailNode = _tailNode.sibling;
        }
        // Next we're simply going to delete all insertions after the
        // last rendered item.
        if (_lastTailNode === null) {
          // All remaining items in the tail are insertions.
          if (!hasRenderedATailFallback && renderState.tail !== null) {
            // We suspended during the head. We want to show at least one
            // row at the tail. So we'll keep on and cut off the rest.
            renderState.tail.sibling = null;
          } else {
            renderState.tail = null;
          }
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          _lastTailNode.sibling = null;
        }
        break;
      }
  }
}

function completeWork(current, workInProgress, renderExpirationTime) {
  var newProps = workInProgress.pendingProps;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      break;
    case LazyComponent:
      break;
    case SimpleMemoComponent:
    case FunctionComponent:
      break;
    case ClassComponent:
      {
        var Component = workInProgress.type;
        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }
        break;
      }
    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        var fiberRoot = workInProgress.stateNode;
        if (fiberRoot.pendingContext) {
          fiberRoot.context = fiberRoot.pendingContext;
          fiberRoot.pendingContext = null;
        }
        if (current === null || current.child === null) {
          // If we hydrated, pop so that we can delete any remaining children
          // that weren't hydrated.
          popHydrationState(workInProgress);
          // This resets the hacky state to fix isMounted before committing.
          // TODO: Delete this when we delete isMounted and findDOMNode.
          workInProgress.effectTag &= ~Placement;
        }
        updateHostContainer(workInProgress);
        break;
      }
    case HostComponent:
      {
        popHostContext(workInProgress);
        var rootContainerInstance = getRootHostContainer();
        var type = workInProgress.type;
        if (current !== null && workInProgress.stateNode != null) {
          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);

          if (enableFlareAPI) {
            var prevListeners = current.memoizedProps.listeners;
            var nextListeners = newProps.listeners;
            var instance = workInProgress.stateNode;
            if (prevListeners !== nextListeners) {
              updateEventListeners(nextListeners, instance, rootContainerInstance, workInProgress);
            }
          }

          if (current.ref !== workInProgress.ref) {
            markRef$1(workInProgress);
          }
        } else {
          if (!newProps) {
            (function () {
              if (!(workInProgress.stateNode !== null)) {
                {
                  throw ReactError(Error('We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.'));
                }
              }
            })();
            // This can happen when we abort work.
            break;
          }

          var currentHostContext = getHostContext();
          // TODO: Move createInstance to beginWork and keep it on a context
          // "stack" as the parent. Then append children as we go in beginWork
          // or completeWork depending on we want to add then top->down or
          // bottom->up. Top->down is faster in IE11.
          var wasHydrated = popHydrationState(workInProgress);
          if (wasHydrated) {
            // TODO: Move this and createInstance step into the beginPhase
            // to consolidate.
            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
              // If changes to the hydrated node needs to be applied at the
              // commit-phase we mark this as such.
              markUpdate(workInProgress);
            }
          } else {
            var _instance5 = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);

            appendAllChildren(_instance5, workInProgress, false, false);

            if (enableFlareAPI) {
              var listeners = newProps.listeners;
              if (listeners != null) {
                updateEventListeners(listeners, _instance5, rootContainerInstance, workInProgress);
              }
            }

            // Certain renderers require commit-time effects for initial mount.
            // (eg DOM renderer supports auto-focus for certain elements).
            // Make sure such renderers get scheduled for later work.
            if (finalizeInitialChildren(_instance5, type, newProps, rootContainerInstance, currentHostContext)) {
              markUpdate(workInProgress);
            }
            workInProgress.stateNode = _instance5;
          }

          if (workInProgress.ref !== null) {
            // If there is a ref on a host node we need to schedule a callback
            markRef$1(workInProgress);
          }
        }
        break;
      }
    case HostText:
      {
        var newText = newProps;
        if (current && workInProgress.stateNode != null) {
          var oldText = current.memoizedProps;
          // If we have an alternate, that means this is an update and we need
          // to schedule a side-effect to do the updates.
          updateHostText$1(current, workInProgress, oldText, newText);
        } else {
          if (typeof newText !== 'string') {
            (function () {
              if (!(workInProgress.stateNode !== null)) {
                {
                  throw ReactError(Error('We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.'));
                }
              }
            })();
            // This can happen when we abort work.
          }
          var _rootContainerInstance = getRootHostContainer();
          var _currentHostContext = getHostContext();
          var _wasHydrated = popHydrationState(workInProgress);
          if (_wasHydrated) {
            if (prepareToHydrateHostTextInstance(workInProgress)) {
              markUpdate(workInProgress);
            }
          } else {
            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
          }
        }
        break;
      }
    case ForwardRef:
      break;
    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);
        var nextState = workInProgress.memoizedState;
        if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
          // Something suspended. Re-render with the fallback children.
          workInProgress.expirationTime = renderExpirationTime;
          // Do not reset the effect list.
          return workInProgress;
        }

        var nextDidTimeout = nextState !== null;
        var prevDidTimeout = false;
        if (current === null) {
          // In cases where we didn't find a suitable hydration boundary we never
          // downgraded this to a DehydratedSuspenseComponent, but we still need to
          // pop the hydration state since we might be inside the insertion tree.
          popHydrationState(workInProgress);
        } else {
          var prevState = current.memoizedState;
          prevDidTimeout = prevState !== null;
          if (!nextDidTimeout && prevState !== null) {
            // We just switched from the fallback to the normal children.
            // Delete the fallback.
            // TODO: Would it be better to store the fallback fragment on
            var currentFallbackChild = current.child.sibling;
            if (currentFallbackChild !== null) {
              // Deletions go at the beginning of the return fiber's effect list
              var first = workInProgress.firstEffect;
              if (first !== null) {
                workInProgress.firstEffect = currentFallbackChild;
                currentFallbackChild.nextEffect = first;
              } else {
                workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
                currentFallbackChild.nextEffect = null;
              }
              currentFallbackChild.effectTag = Deletion;
            }
          }
        }

        if (nextDidTimeout && !prevDidTimeout) {
          // If this subtreee is running in batched mode we can suspend,
          // otherwise we won't suspend.
          // TODO: This will still suspend a synchronous tree if anything
          // in the concurrent tree already suspended during this render.
          // This is a known bug.
          if ((workInProgress.mode & BatchedMode) !== NoMode) {
            // TODO: Move this back to throwException because this is too late
            // if this is a large tree which is common for initial loads. We
            // don't know if we should restart a render or not until we get
            // this marker, and this is too late.
            // If this render already had a ping or lower pri updates,
            // and this is the first time we know we're going to suspend we
            // should be able to immediately restart from within throwException.
            var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
            if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
              // If this was in an invisible tree or a new render, then showing
              // this boundary is ok.
              renderDidSuspend();
            } else {
              // Otherwise, we're going to have to hide content so we should
              // suspend for longer if possible.
              renderDidSuspendDelayIfPossible();
            }
          }
        }

        if (supportsPersistence) {
          // TODO: Only schedule updates if not prevDidTimeout.
          if (nextDidTimeout) {
            // If this boundary just timed out, schedule an effect to attach a
            // retry listener to the proimse. This flag is also used to hide the
            // primary children.
            workInProgress.effectTag |= Update;
          }
        }
        if (supportsMutation) {
          // TODO: Only schedule updates if these values are non equal, i.e. it changed.
          if (nextDidTimeout || prevDidTimeout) {
            // If this boundary just timed out, schedule an effect to attach a
            // retry listener to the proimse. This flag is also used to hide the
            // primary children. In mutation mode, we also need the flag to
            // *unhide* children that were previously hidden, so check if the
            // is currently timed out, too.
            workInProgress.effectTag |= Update;
          }
        }
        if (enableSuspenseCallback && workInProgress.updateQueue !== null && workInProgress.memoizedProps.suspenseCallback != null) {
          // Always notify the callback
          workInProgress.effectTag |= Update;
        }
        break;
      }
    case Fragment:
      break;
    case Mode:
      break;
    case Profiler:
      break;
    case HostPortal:
      popHostContainer(workInProgress);
      updateHostContainer(workInProgress);
      break;
    case ContextProvider:
      // Pop provider fiber
      popProvider(workInProgress);
      break;
    case ContextConsumer:
      break;
    case MemoComponent:
      break;
    case IncompleteClassComponent:
      {
        // Same as class component case. I put it down here so that the tags are
        // sequential to ensure this switch is compiled to a jump table.
        var _Component = workInProgress.type;
        if (isContextProvider(_Component)) {
          popContext(workInProgress);
        }
        break;
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          popSuspenseContext(workInProgress);
          if (current === null) {
            var _wasHydrated2 = popHydrationState(workInProgress);
            (function () {
              if (!_wasHydrated2) {
                {
                  throw ReactError(Error('A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.'));
                }
              }
            })();
            if (enableSchedulerTracing) {
              markSpawnedWork(Never);
            }
            skipPastDehydratedSuspenseInstance(workInProgress);
          } else if ((workInProgress.effectTag & DidCapture) === NoEffect) {
            // This boundary did not suspend so it's now hydrated.
            // To handle any future suspense cases, we're going to now upgrade it
            // to a Suspense component. We detach it from the existing current fiber.
            current.alternate = null;
            workInProgress.alternate = null;
            workInProgress.tag = SuspenseComponent;
            workInProgress.memoizedState = null;
            workInProgress.stateNode = null;
          }
        }
        break;
      }
    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress);

        var renderState = workInProgress.memoizedState;

        if (renderState === null) {
          // We're running in the default, "independent" mode. We don't do anything
          // in this mode.
          break;
        }

        var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;

        var renderedTail = renderState.rendering;
        if (renderedTail === null) {
          // We just rendered the head.
          if (!didSuspendAlready) {
            // This is the first pass. We need to figure out if anything is still
            // suspended in the rendered set.

            // If new content unsuspended, but there's still some content that
            // didn't. Then we need to do a second pass that forces everything
            // to keep showing their fallbacks.

            // We might be suspended if something in this render pass suspended, or
            // something in the previous committed pass suspended. Otherwise,
            // there's no chance so we can skip the expensive call to
            // findFirstSuspended.
            var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);
            if (!cannotBeSuspended) {
              var row = workInProgress.child;
              while (row !== null) {
                var suspended = findFirstSuspended(row);
                if (suspended !== null) {
                  didSuspendAlready = true;
                  workInProgress.effectTag |= DidCapture;
                  cutOffTailIfNeeded(renderState, false);

                  // If this is a newly suspended tree, it might not get committed as
                  // part of the second pass. In that case nothing will subscribe to
                  // its thennables. Instead, we'll transfer its thennables to the
                  // SuspenseList so that it can retry if they resolve.
                  // There might be multiple of these in the list but since we're
                  // going to wait for all of them anyway, it doesn't really matter
                  // which ones gets to ping. In theory we could get clever and keep
                  // track of how many dependencies remain but it gets tricky because
                  // in the meantime, we can add/remove/change items and dependencies.
                  // We might bail out of the loop before finding any but that
                  // doesn't matter since that means that the other boundaries that
                  // we did find already has their listeners attached.
                  var newThennables = suspended.updateQueue;
                  if (newThennables !== null) {
                    workInProgress.updateQueue = newThennables;
                    workInProgress.effectTag |= Update;
                  }

                  // Rerender the whole list, but this time, we'll force fallbacks
                  // to stay in place.
                  // Reset the effect list before doing the second pass since that's now invalid.
                  workInProgress.firstEffect = workInProgress.lastEffect = null;
                  // Reset the child fibers to their original state.
                  resetChildFibers(workInProgress, renderExpirationTime);

                  // Set up the Suspense Context to force suspense and immediately
                  // rerender the children.
                  pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                  return workInProgress.child;
                }
                row = row.sibling;
              }
            }
          } else {
            cutOffTailIfNeeded(renderState, false);
          }
          // Next we're going to render the tail.
        } else {
          // Append the rendered row to the child list.
          if (!didSuspendAlready) {
            var _suspended = findFirstSuspended(renderedTail);
            if (_suspended !== null) {
              workInProgress.effectTag |= DidCapture;
              didSuspendAlready = true;
              cutOffTailIfNeeded(renderState, true);
              // This might have been modified.
              if (renderState.tail === null && renderState.tailMode === 'hidden') {
                // We need to delete the row we just rendered.
                // Ensure we transfer the update queue to the parent.
                var _newThennables = _suspended.updateQueue;
                if (_newThennables !== null) {
                  workInProgress.updateQueue = _newThennables;
                  workInProgress.effectTag |= Update;
                }
                // Reset the effect list to what it w as before we rendered this
                // child. The nested children have already appended themselves.
                var lastEffect = workInProgress.lastEffect = renderState.lastEffect;
                // Remove any effects that were appended after this point.
                if (lastEffect !== null) {
                  lastEffect.nextEffect = null;
                }
                // We're done.
                return null;
              }
            } else if (now() > renderState.tailExpiration && renderExpirationTime > Never) {
              // We have now passed our CPU deadline and we'll just give up further
              // attempts to render the main content and only render fallbacks.
              // The assumption is that this is usually faster.
              workInProgress.effectTag |= DidCapture;
              didSuspendAlready = true;

              cutOffTailIfNeeded(renderState, false);

              // Since nothing actually suspended, there will nothing to ping this
              // to get it started back up to attempt the next item. If we can show
              // them, then they really have the same priority as this render.
              // So we'll pick it back up the very next render pass once we've had
              // an opportunity to yield for paint.

              var nextPriority = renderExpirationTime - 1;
              workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;
              if (enableSchedulerTracing) {
                markSpawnedWork(nextPriority);
              }
            }
          }
          if (renderState.isBackwards) {
            // The effect list of the backwards tail will have been added
            // to the end. This breaks the guarantee that life-cycles fire in
            // sibling order but that isn't a strong guarantee promised by React.
            // Especially since these might also just pop in during future commits.
            // Append to the beginning of the list.
            renderedTail.sibling = workInProgress.child;
            workInProgress.child = renderedTail;
          } else {
            var previousSibling = renderState.last;
            if (previousSibling !== null) {
              previousSibling.sibling = renderedTail;
            } else {
              workInProgress.child = renderedTail;
            }
            renderState.last = renderedTail;
          }
        }

        if (renderState.tail !== null) {
          // We still have tail rows to render.
          if (renderState.tailExpiration === 0) {
            // Heuristic for how long we're willing to spend rendering rows
            // until we just give up and show what we have so far.
            var TAIL_EXPIRATION_TIMEOUT_MS = 500;
            renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS;
          }
          // Pop a row.
          var next = renderState.tail;
          renderState.rendering = next;
          renderState.tail = next.sibling;
          renderState.lastEffect = workInProgress.lastEffect;
          next.sibling = null;

          // Restore the context.
          // TODO: We can probably just avoid popping it instead and only
          // setting it the first time we go from not suspended to suspended.
          var suspenseContext = suspenseStackCursor.current;
          if (didSuspendAlready) {
            suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
          } else {
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
          }
          pushSuspenseContext(workInProgress, suspenseContext);
          // Do a pass over the next row.
          return next;
        }
        break;
      }
    case FundamentalComponent:
      {
        if (enableFundamentalAPI) {
          var fundamentalImpl = workInProgress.type.impl;
          var fundamentalInstance = workInProgress.stateNode;

          if (fundamentalInstance === null) {
            var getInitialState = fundamentalImpl.getInitialState;
            var fundamentalState = void 0;
            if (getInitialState !== undefined) {
              fundamentalState = getInitialState(newProps);
            }
            fundamentalInstance = workInProgress.stateNode = createFundamentalStateInstance(workInProgress, newProps, fundamentalImpl, fundamentalState || {});
            var _instance6 = getFundamentalComponentInstance(fundamentalInstance);
            fundamentalInstance.instance = _instance6;
            if (fundamentalImpl.reconcileChildren === false) {
              return null;
            }
            appendAllChildren(_instance6, workInProgress, false, false);
            mountFundamentalComponent(fundamentalInstance);
          } else {
            // We fire update in commit phase
            var prevProps = fundamentalInstance.props;
            fundamentalInstance.prevProps = prevProps;
            fundamentalInstance.props = newProps;
            fundamentalInstance.currentFiber = workInProgress;
            if (supportsPersistence) {
              var _instance7 = cloneFundamentalInstance(fundamentalInstance);
              fundamentalInstance.instance = _instance7;
              appendAllChildren(_instance7, workInProgress, false, false);
            }
            var shouldUpdate = shouldUpdateFundamentalComponent(fundamentalInstance);
            if (shouldUpdate) {
              markUpdate(workInProgress);
            }
          }
        }
        break;
      }
    default:
      (function () {
        {
          {
            throw ReactError(Error('Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'));
          }
        }
      })();
  }

  return null;
}

function mountEventResponder$1(responder, responderProps, instance, rootContainerInstance, fiber, respondersMap) {
  var responderState = emptyObject;
  var getInitialState = responder.getInitialState;
  if (getInitialState !== null) {
    responderState = getInitialState(responderProps);
  }
  var responderInstance = createResponderInstance(responder, responderProps, responderState, instance, fiber);
  mountResponderInstance(responder, responderInstance, responderProps, responderState, instance, rootContainerInstance);
  respondersMap.set(responder, responderInstance);
}

function updateEventListener(listener, fiber, visistedResponders, respondersMap, instance, rootContainerInstance) {
  var responder = void 0;
  var props = void 0;

  if (listener) {
    responder = listener.responder;
    props = listener.props;
  }
  (function () {
    if (!(responder && responder.$$typeof === REACT_RESPONDER_TYPE)) {
      {
        throw ReactError(Error('An invalid value was used as an event listener. Expect one or many event listeners created via React.unstable_useResponer().'));
      }
    }
  })();
  var listenerProps = props;
  if (visistedResponders.has(responder)) {
    // show warning
    {
      warning$1(false, 'Duplicate event responder "%s" found in event listeners. ' + 'Event listeners passed to elements cannot use the same event responder more than once.', responder.displayName);
    }
    return;
  }
  visistedResponders.add(responder);
  var responderInstance = respondersMap.get(responder);

  if (responderInstance === undefined) {
    // Mount
    mountEventResponder$1(responder, listenerProps, instance, rootContainerInstance, fiber, respondersMap);
  } else {
    // Update
    responderInstance.props = listenerProps;
    responderInstance.fiber = fiber;
  }
}

function updateEventListeners(listeners, instance, rootContainerInstance, fiber) {
  var visistedResponders = new Set();
  var dependencies = fiber.dependencies;
  if (listeners != null) {
    if (dependencies === null) {
      dependencies = fiber.dependencies = {
        expirationTime: NoWork,
        firstContext: null,
        responders: new Map()
      };
    }
    var respondersMap = dependencies.responders;
    if (respondersMap === null) {
      respondersMap = new Map();
    }
    if (isArray$2(listeners)) {
      for (var i = 0, length = listeners.length; i < length; i++) {
        var listener = listeners[i];
        updateEventListener(listener, fiber, visistedResponders, respondersMap, instance, rootContainerInstance);
      }
    } else {
      updateEventListener(listeners, fiber, visistedResponders, respondersMap, instance, rootContainerInstance);
    }
  }
  if (dependencies !== null) {
    var _respondersMap = dependencies.responders;
    if (_respondersMap !== null) {
      // Unmount
      var mountedResponders = Array.from(_respondersMap.keys());
      for (var _i = 0, _length = mountedResponders.length; _i < _length; _i++) {
        var mountedResponder = mountedResponders[_i];
        if (!visistedResponders.has(mountedResponder)) {
          var responderInstance = _respondersMap.get(mountedResponder);
          unmountResponderInstance(responderInstance);
          _respondersMap.delete(mountedResponder);
        }
      }
    }
  }
}

function unwindWork(workInProgress, renderExpirationTime) {
  switch (workInProgress.tag) {
    case ClassComponent:
      {
        var Component = workInProgress.type;
        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }
        var effectTag = workInProgress.effectTag;
        if (effectTag & ShouldCapture) {
          workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
          return workInProgress;
        }
        return null;
      }
    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        var _effectTag = workInProgress.effectTag;
        (function () {
          if (!((_effectTag & DidCapture) === NoEffect)) {
            {
              throw ReactError(Error('The root failed to unmount after an error. This is likely a bug in React. Please file an issue.'));
            }
          }
        })();
        workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
        return workInProgress;
      }
    case HostComponent:
      {
        // TODO: popHydrationState
        popHostContext(workInProgress);
        return null;
      }
    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);
        var _effectTag2 = workInProgress.effectTag;
        if (_effectTag2 & ShouldCapture) {
          workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture;
          // Captured a suspense effect. Re-render the boundary.
          return workInProgress;
        }
        return null;
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          // TODO: popHydrationState
          popSuspenseContext(workInProgress);
          var _effectTag3 = workInProgress.effectTag;
          if (_effectTag3 & ShouldCapture) {
            workInProgress.effectTag = _effectTag3 & ~ShouldCapture | DidCapture;
            // Captured a suspense effect. Re-render the boundary.
            return workInProgress;
          }
        }
        return null;
      }
    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress);
        // SuspenseList doesn't actually catch anything. It should've been
        // caught by a nested boundary. If not, it should bubble through.
        return null;
      }
    case HostPortal:
      popHostContainer(workInProgress);
      return null;
    case ContextProvider:
      popProvider(workInProgress);
      return null;
    default:
      return null;
  }
}

function unwindInterruptedWork(interruptedWork) {
  switch (interruptedWork.tag) {
    case ClassComponent:
      {
        var childContextTypes = interruptedWork.type.childContextTypes;
        if (childContextTypes !== null && childContextTypes !== undefined) {
          popContext(interruptedWork);
        }
        break;
      }
    case HostRoot:
      {
        popHostContainer(interruptedWork);
        popTopLevelContextObject(interruptedWork);
        break;
      }
    case HostComponent:
      {
        popHostContext(interruptedWork);
        break;
      }
    case HostPortal:
      popHostContainer(interruptedWork);
      break;
    case SuspenseComponent:
      popSuspenseContext(interruptedWork);
      break;
    case DehydratedSuspenseComponent:
      if (enableSuspenseServerRenderer) {
        // TODO: popHydrationState
        popSuspenseContext(interruptedWork);
      }
      break;
    case SuspenseListComponent:
      popSuspenseContext(interruptedWork);
      break;
    case ContextProvider:
      popProvider(interruptedWork);
      break;
    default:
      break;
  }
}

function createCapturedValue(value, source) {
  // If the value is an error, call this function immediately after it is thrown
  // so the stack is accurate.
  return {
    value: value,
    source: source,
    stack: getStackByFiberInDevAndProd(source)
  };
}

// This module is forked in different environments.
// By default, return `true` to log errors to the console.
// Forks can return `false` if this isn't desirable.
function showErrorDialog(capturedError) {
  return true;
}

function logCapturedError(capturedError) {
  var logError = showErrorDialog(capturedError);

  // Allow injected showErrorDialog() to prevent default console.error logging.
  // This enables renderers like ReactNative to better manage redbox behavior.
  if (logError === false) {
    return;
  }

  var error = capturedError.error;
  {
    var componentName = capturedError.componentName,
        componentStack = capturedError.componentStack,
        errorBoundaryName = capturedError.errorBoundaryName,
        errorBoundaryFound = capturedError.errorBoundaryFound,
        willRetry = capturedError.willRetry;

    // Browsers support silencing uncaught errors by calling
    // `preventDefault()` in window `error` handler.
    // We record this information as an expando on the error.

    if (error != null && error._suppressLogging) {
      if (errorBoundaryFound && willRetry) {
        // The error is recoverable and was silenced.
        // Ignore it and don't print the stack addendum.
        // This is handy for testing error boundaries without noise.
        return;
      }
      // The error is fatal. Since the silencing might have
      // been accidental, we'll surface it anyway.
      // However, the browser would have silenced the original error
      // so we'll print it first, and then print the stack addendum.
      console.error(error);
      // For a more detailed description of this block, see:
      // https://github.com/facebook/react/pull/13384
    }

    var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:';

    var errorBoundaryMessage = void 0;
    // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
    if (errorBoundaryFound && errorBoundaryName) {
      if (willRetry) {
        errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');
      } else {
        errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\n' + 'Recreating the tree from scratch failed so React will unmount the tree.';
      }
    } else {
      errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
    }
    var combinedMessage = '' + componentNameMessage + componentStack + '\n\n' + ('' + errorBoundaryMessage);

    // In development, we provide our own message with just the component stack.
    // We don't include the original error message and JS stack because the browser
    // has already printed it. Even if the application swallows the error, it is still
    // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
    console.error(combinedMessage);
  }
}

var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
{
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
}

var PossiblyWeakSet$1 = typeof WeakSet === 'function' ? WeakSet : Set;

function logError(boundary, errorInfo) {
  var source = errorInfo.source;
  var stack = errorInfo.stack;
  if (stack === null && source !== null) {
    stack = getStackByFiberInDevAndProd(source);
  }

  var capturedError = {
    componentName: source !== null ? getComponentName(source.type) : null,
    componentStack: stack !== null ? stack : '',
    error: errorInfo.value,
    errorBoundary: null,
    errorBoundaryName: null,
    errorBoundaryFound: false,
    willRetry: false
  };

  if (boundary !== null && boundary.tag === ClassComponent) {
    capturedError.errorBoundary = boundary.stateNode;
    capturedError.errorBoundaryName = getComponentName(boundary.type);
    capturedError.errorBoundaryFound = true;
    capturedError.willRetry = true;
  }

  try {
    logCapturedError(capturedError);
  } catch (e) {
    // This method must not throw, or React internal state will get messed up.
    // If console.error is overridden, or logCapturedError() shows a dialog that throws,
    // we want to report this error outside of the normal stack as a last resort.
    // https://github.com/facebook/react/issues/13188
    setTimeout(function () {
      throw e;
    });
  }
}

var callComponentWillUnmountWithTimer = function (current$$1, instance) {
  startPhaseTimer(current$$1, 'componentWillUnmount');
  instance.props = current$$1.memoizedProps;
  instance.state = current$$1.memoizedState;
  instance.componentWillUnmount();
  stopPhaseTimer();
};

// Capture errors so they don't interrupt unmounting.
function safelyCallComponentWillUnmount(current$$1, instance) {
  {
    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current$$1, instance);
    if (hasCaughtError()) {
      var unmountError = clearCaughtError();
      captureCommitPhaseError(current$$1, unmountError);
    }
  }
}

function safelyDetachRef(current$$1) {
  var ref = current$$1.ref;
  if (ref !== null) {
    if (typeof ref === 'function') {
      {
        invokeGuardedCallback(null, ref, null, null);
        if (hasCaughtError()) {
          var refError = clearCaughtError();
          captureCommitPhaseError(current$$1, refError);
        }
      }
    } else {
      ref.current = null;
    }
  }
}

function safelyCallDestroy(current$$1, destroy) {
  {
    invokeGuardedCallback(null, destroy, null);
    if (hasCaughtError()) {
      var error = clearCaughtError();
      captureCommitPhaseError(current$$1, error);
    }
  }
}

function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
      {
        commitHookEffectList(UnmountSnapshot, NoEffect$1, finishedWork);
        return;
      }
    case ClassComponent:
      {
        if (finishedWork.effectTag & Snapshot) {
          if (current$$1 !== null) {
            var prevProps = current$$1.memoizedProps;
            var prevState = current$$1.memoizedState;
            startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
            var instance = finishedWork.stateNode;
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
            {
              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
                didWarnSet.add(finishedWork.type);
                warningWithoutStack$1(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
              }
            }
            instance.__reactInternalSnapshotBeforeUpdate = snapshot;
            stopPhaseTimer();
          }
        }
        return;
      }
    case HostRoot:
    case HostComponent:
    case HostText:
    case HostPortal:
    case IncompleteClassComponent:
      // Nothing to do for these component types
      return;
    default:
      {
        (function () {
          {
            {
              throw ReactError(Error('This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
      }
  }
}

function commitHookEffectList(unmountTag, mountTag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;
    do {
      if ((effect.tag & unmountTag) !== NoEffect$1) {
        // Unmount
        var destroy = effect.destroy;
        effect.destroy = undefined;
        if (destroy !== undefined) {
          destroy();
        }
      }
      if ((effect.tag & mountTag) !== NoEffect$1) {
        // Mount
        var create = effect.create;
        effect.destroy = create();

        {
          var _destroy = effect.destroy;
          if (_destroy !== undefined && typeof _destroy !== 'function') {
            var addendum = void 0;
            if (_destroy === null) {
              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
            } else if (typeof _destroy.then === 'function') {
              addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + '  async function fetchData() {\n' + '    // You can await here\n' + '    const response = await MyAPI.getData(someId);\n' + '    // ...\n' + '  }\n' + '  fetchData();\n' + '}, [someId]); // Or [] if effect doesn\'t need props or state\n\n' + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
            } else {
              addendum = ' You returned: ' + _destroy;
            }
            warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
          }
        }
      }
      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function commitPassiveHookEffects(finishedWork) {
  if ((finishedWork.effectTag & Passive) !== NoEffect) {
    switch (finishedWork.tag) {
      case FunctionComponent:
      case ForwardRef:
      case SimpleMemoComponent:
        {
          commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork);
          commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
          break;
        }
      default:
        break;
    }
  }
}

function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpirationTime) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
      {
        commitHookEffectList(UnmountLayout, MountLayout, finishedWork);
        break;
      }
    case ClassComponent:
      {
        var instance = finishedWork.stateNode;
        if (finishedWork.effectTag & Update) {
          if (current$$1 === null) {
            startPhaseTimer(finishedWork, 'componentDidMount');
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            instance.componentDidMount();
            stopPhaseTimer();
          } else {
            var prevProps = finishedWork.elementType === finishedWork.type ? current$$1.memoizedProps : resolveDefaultProps(finishedWork.type, current$$1.memoizedProps);
            var prevState = current$$1.memoizedState;
            startPhaseTimer(finishedWork, 'componentDidUpdate');
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
            stopPhaseTimer();
          }
        }
        var updateQueue = finishedWork.updateQueue;
        if (updateQueue !== null) {
          {
            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
              !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
            }
          }
          // We could update instance props and state here,
          // but instead we rely on them being set during last render.
          // TODO: revisit this when we implement resuming.
          commitUpdateQueue(finishedWork, updateQueue, instance, committedExpirationTime);
        }
        return;
      }
    case HostRoot:
      {
        var _updateQueue = finishedWork.updateQueue;
        if (_updateQueue !== null) {
          var _instance = null;
          if (finishedWork.child !== null) {
            switch (finishedWork.child.tag) {
              case HostComponent:
                _instance = getPublicInstance(finishedWork.child.stateNode);
                break;
              case ClassComponent:
                _instance = finishedWork.child.stateNode;
                break;
            }
          }
          commitUpdateQueue(finishedWork, _updateQueue, _instance, committedExpirationTime);
        }
        return;
      }
    case HostComponent:
      {
        var _instance2 = finishedWork.stateNode;

        // Renderers may schedule work to be done after host components are mounted
        // (eg DOM renderer may schedule auto-focus for inputs and form controls).
        // These effects should only be committed when components are first mounted,
        // aka when there is no current/alternate.
        if (current$$1 === null && finishedWork.effectTag & Update) {
          var type = finishedWork.type;
          var props = finishedWork.memoizedProps;
          commitMount(_instance2, type, props, finishedWork);
        }

        return;
      }
    case HostText:
      {
        // We have no life-cycles associated with text.
        return;
      }
    case HostPortal:
      {
        // We have no life-cycles associated with portals.
        return;
      }
    case Profiler:
      {
        if (enableProfilerTimer) {
          var onRender = finishedWork.memoizedProps.onRender;

          if (typeof onRender === 'function') {
            if (enableSchedulerTracing) {
              onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
            } else {
              onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
            }
          }
        }
        return;
      }
    case SuspenseComponent:
    case SuspenseListComponent:
    case IncompleteClassComponent:
    case FundamentalComponent:
      return;
    default:
      {
        (function () {
          {
            {
              throw ReactError(Error('This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
      }
  }
}

function hideOrUnhideAllChildren(finishedWork, isHidden) {
  if (supportsMutation) {
    // We only have the top Fiber that was inserted but we need to recurse down its
    var node = finishedWork;
    while (true) {
      if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (isHidden) {
          hideInstance(instance);
        } else {
          unhideInstance(node.stateNode, node.memoizedProps);
        }
      } else if (node.tag === HostText) {
        var _instance3 = node.stateNode;
        if (isHidden) {
          hideTextInstance(_instance3);
        } else {
          unhideTextInstance(_instance3, node.memoizedProps);
        }
      } else if (node.tag === SuspenseComponent && node.memoizedState !== null) {
        // Found a nested Suspense component that timed out. Skip over the
        var fallbackChildFragment = node.child.sibling;
        fallbackChildFragment.return = node;
        node = fallbackChildFragment;
        continue;
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === finishedWork) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === finishedWork) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
}

function commitAttachRef(finishedWork) {
  var ref = finishedWork.ref;
  if (ref !== null) {
    var instance = finishedWork.stateNode;
    var instanceToUse = void 0;
    switch (finishedWork.tag) {
      case HostComponent:
        instanceToUse = getPublicInstance(instance);
        break;
      default:
        instanceToUse = instance;
    }
    if (typeof ref === 'function') {
      ref(instanceToUse);
    } else {
      {
        if (!ref.hasOwnProperty('current')) {
          warningWithoutStack$1(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
        }
      }

      ref.current = instanceToUse;
    }
  }
}

function commitDetachRef(current$$1) {
  var currentRef = current$$1.ref;
  if (currentRef !== null) {
    if (typeof currentRef === 'function') {
      currentRef(null);
    } else {
      currentRef.current = null;
    }
  }
}

// User-originating errors (lifecycles and refs) should not interrupt
// deletion, so don't let them throw. Host-originating errors should
// interrupt deletion, so it's okay
function commitUnmount(current$$1, renderPriorityLevel) {
  onCommitUnmount(current$$1);

  switch (current$$1.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
      {
        var updateQueue = current$$1.updateQueue;
        if (updateQueue !== null) {
          var lastEffect = updateQueue.lastEffect;
          if (lastEffect !== null) {
            var firstEffect = lastEffect.next;

            // When the owner fiber is deleted, the destroy function of a passive
            // effect hook is called during the synchronous commit phase. This is
            // a concession to implementation complexity. Calling it in the
            // passive effect phase (like they usually are, when dependencies
            // change during an update) would require either traversing the
            // children of the deleted fiber again, or including unmount effects
            // as part of the fiber effect list.
            //
            // Because this is during the sync commit phase, we need to change
            // the priority.
            //
            // TODO: Reconsider this implementation trade off.
            var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
            runWithPriority$2(priorityLevel, function () {
              var effect = firstEffect;
              do {
                var destroy = effect.destroy;
                if (destroy !== undefined) {
                  safelyCallDestroy(current$$1, destroy);
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            });
          }
        }
        break;
      }
    case ClassComponent:
      {
        safelyDetachRef(current$$1);
        var instance = current$$1.stateNode;
        if (typeof instance.componentWillUnmount === 'function') {
          safelyCallComponentWillUnmount(current$$1, instance);
        }
        return;
      }
    case HostComponent:
      {
        if (enableFlareAPI) {
          var dependencies = current$$1.dependencies;

          if (dependencies !== null) {
            var respondersMap = dependencies.responders;
            if (respondersMap !== null) {
              var responderInstances = Array.from(respondersMap.values());
              for (var i = 0, length = responderInstances.length; i < length; i++) {
                var responderInstance = responderInstances[i];
                unmountResponderInstance(responderInstance);
              }
              dependencies.responders = null;
            }
          }
        }
        safelyDetachRef(current$$1);
        return;
      }
    case HostPortal:
      {
        // TODO: this is recursive.
        // We are also not using this parent because
        // the portal will get pushed immediately.
        if (supportsMutation) {
          unmountHostComponents(current$$1, renderPriorityLevel);
        } else if (supportsPersistence) {
          emptyPortalContainer(current$$1);
        }
        return;
      }
    case FundamentalComponent:
      {
        if (enableFundamentalAPI) {
          var fundamentalInstance = current$$1.stateNode;
          if (fundamentalInstance !== null) {
            unmountFundamentalComponent(fundamentalInstance);
            current$$1.stateNode = null;
          }
        }
      }
  }
}

function commitNestedUnmounts(root, renderPriorityLevel) {
  // While we're inside a removed host node we don't want to call
  // removeChild on the inner nodes because they're removed by the top
  // call anyway. We also want to call componentWillUnmount on all
  // composites before this host node is removed from the tree. Therefore
  var node = root;
  while (true) {
    commitUnmount(node, renderPriorityLevel);
    // Visit children because they may contain more composite or host nodes.
    // Skip portals because commitUnmount() currently visits them recursively.
    if (node.child !== null && (
    // If we use mutation we drill down into portals using commitUnmount above.
    // If we don't use mutation we drill down into portals here instead.
    !supportsMutation || node.tag !== HostPortal)) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === root) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === root) {
        return;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function detachFiber(current$$1) {
  // Cut off the return pointers to disconnect it from the tree. Ideally, we
  // should clear the child pointer of the parent alternate to let this
  // get GC:ed but we don't know which for sure which parent is the current
  // one so we'll settle for GC:ing the subtree of this child. This child
  // itself will be GC:ed when the parent updates the next time.
  current$$1.return = null;
  current$$1.child = null;
  current$$1.memoizedState = null;
  current$$1.updateQueue = null;
  current$$1.dependencies = null;
  var alternate = current$$1.alternate;
  if (alternate !== null) {
    alternate.return = null;
    alternate.child = null;
    alternate.memoizedState = null;
    alternate.updateQueue = null;
    alternate.dependencies = null;
  }
}

function emptyPortalContainer(current$$1) {
  if (!supportsPersistence) {
    return;
  }

  var portal = current$$1.stateNode;
  var containerInfo = portal.containerInfo;

  var emptyChildSet = createContainerChildSet(containerInfo);
  replaceContainerChildren(containerInfo, emptyChildSet);
}

function commitContainer(finishedWork) {
  if (!supportsPersistence) {
    return;
  }

  switch (finishedWork.tag) {
    case ClassComponent:
    case HostComponent:
    case HostText:
    case FundamentalComponent:
      {
        return;
      }
    case HostRoot:
    case HostPortal:
      {
        var portalOrRoot = finishedWork.stateNode;
        var containerInfo = portalOrRoot.containerInfo,
            _pendingChildren = portalOrRoot.pendingChildren;

        replaceContainerChildren(containerInfo, _pendingChildren);
        return;
      }
    default:
      {
        (function () {
          {
            {
              throw ReactError(Error('This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
      }
  }
}

function getHostParentFiber(fiber) {
  var parent = fiber.return;
  while (parent !== null) {
    if (isHostParent(parent)) {
      return parent;
    }
    parent = parent.return;
  }
  (function () {
    {
      {
        throw ReactError(Error('Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();
}

function isHostParent(fiber) {
  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
}

function getHostSibling(fiber) {
  // We're going to search forward into the tree until we find a sibling host
  // node. Unfortunately, if multiple insertions are done in a row we have to
  // search past them. This leads to exponential search for the next sibling.
  var node = fiber;
  siblings: while (true) {
    // If we didn't find anything, let's try the next sibling.
    while (node.sibling === null) {
      if (node.return === null || isHostParent(node.return)) {
        // If we pop out of the root or hit the parent the fiber we are the
        // last sibling.
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedSuspenseComponent) {
      // If it is not host node and, we might have a host node inside it.
      // Try to search down until we find one.
      if (node.effectTag & Placement) {
        // If we don't have a child, try the siblings instead.
        continue siblings;
      }
      // If we don't have a child, try the siblings instead.
      // We also skip portals because they are not part of this host tree.
      if (node.child === null || node.tag === HostPortal) {
        continue siblings;
      } else {
        node.child.return = node;
        node = node.child;
      }
    }
    // Check if this host node is stable or about to be placed.
    if (!(node.effectTag & Placement)) {
      // Found it!
      return node.stateNode;
    }
  }
}

function commitPlacement(finishedWork) {
  if (!supportsMutation) {
    return;
  }

  // Recursively insert all host nodes into the parent.
  var parentFiber = getHostParentFiber(finishedWork);

  // Note: these two variables *must* always be updated together.
  var parent = void 0;
  var isContainer = void 0;
  var parentStateNode = parentFiber.stateNode;
  switch (parentFiber.tag) {
    case HostComponent:
      parent = parentStateNode;
      isContainer = false;
      break;
    case HostRoot:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;
    case HostPortal:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;
    case FundamentalComponent:
      if (enableFundamentalAPI) {
        parent = parentStateNode.instance;
        isContainer = false;
      }
    // eslint-disable-next-line-no-fallthrough
    default:
      (function () {
        {
          {
            throw ReactError(Error('Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.'));
          }
        }
      })();
  }
  if (parentFiber.effectTag & ContentReset) {
    // Reset the text content of the parent before doing any insertions
    resetTextContent(parent);
    // Clear ContentReset from the effect tag
    parentFiber.effectTag &= ~ContentReset;
  }

  var before = getHostSibling(finishedWork);
  // We only have the top Fiber that was inserted but we need to recurse down its
  // children to find all the terminal nodes.
  var node = finishedWork;
  while (true) {
    var isHost = node.tag === HostComponent || node.tag === HostText;
    if (isHost || node.tag === FundamentalComponent) {
      var stateNode = isHost ? node.stateNode : node.stateNode.instance;
      if (before) {
        if (isContainer) {
          insertInContainerBefore(parent, stateNode, before);
        } else {
          insertBefore(parent, stateNode, before);
        }
      } else {
        if (isContainer) {
          appendChildToContainer(parent, stateNode);
        } else {
          appendChild(parent, stateNode);
        }
      }
    } else if (node.tag === HostPortal) {
      // If the insertion itself is a portal, then we don't want to traverse
      // down its children. Instead, we'll get insertions from each child in
      // the portal directly.
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === finishedWork) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === finishedWork) {
        return;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function unmountHostComponents(current$$1, renderPriorityLevel) {
  // We only have the top Fiber that was deleted but we need to recurse down its
  var node = current$$1;

  // Each iteration, currentParent is populated with node's host parent if not
  // currentParentIsValid.
  var currentParentIsValid = false;

  // Note: these two variables *must* always be updated together.
  var currentParent = void 0;
  var currentParentIsContainer = void 0;

  while (true) {
    if (!currentParentIsValid) {
      var parent = node.return;
      findParent: while (true) {
        (function () {
          if (!(parent !== null)) {
            {
              throw ReactError(Error('Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
        var parentStateNode = parent.stateNode;
        switch (parent.tag) {
          case HostComponent:
            currentParent = parentStateNode;
            currentParentIsContainer = false;
            break findParent;
          case HostRoot:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;
          case HostPortal:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;
          case FundamentalComponent:
            if (enableFundamentalAPI) {
              currentParent = parentStateNode.instance;
              currentParentIsContainer = false;
            }
        }
        parent = parent.return;
      }
      currentParentIsValid = true;
    }

    if (node.tag === HostComponent || node.tag === HostText) {
      commitNestedUnmounts(node, renderPriorityLevel);
      // After all the children have unmounted, it is now safe to remove the
      // node from the tree.
      if (currentParentIsContainer) {
        removeChildFromContainer(currentParent, node.stateNode);
      } else {
        removeChild(currentParent, node.stateNode);
      }
      // Don't visit children because we already visited them.
    } else if (node.tag === FundamentalComponent) {
      var fundamentalNode = node.stateNode.instance;
      commitNestedUnmounts(node, renderPriorityLevel);
      // After all the children have unmounted, it is now safe to remove the
      // node from the tree.
      if (currentParentIsContainer) {
        removeChildFromContainer(currentParent, fundamentalNode);
      } else {
        removeChild(currentParent, fundamentalNode);
      }
    } else if (enableSuspenseServerRenderer && node.tag === DehydratedSuspenseComponent) {
      // Delete the dehydrated suspense boundary and all of its content.
      if (currentParentIsContainer) {
        clearSuspenseBoundaryFromContainer(currentParent, node.stateNode);
      } else {
        clearSuspenseBoundary(currentParent, node.stateNode);
      }
    } else if (node.tag === HostPortal) {
      if (node.child !== null) {
        // When we go into a portal, it becomes the parent to remove from.
        // We will reassign it back when we pop the portal on the way up.
        currentParent = node.stateNode.containerInfo;
        currentParentIsContainer = true;
        // Visit children because portals might contain host components.
        node.child.return = node;
        node = node.child;
        continue;
      }
    } else {
      commitUnmount(node, renderPriorityLevel);
      // Visit children because we may find more host components below.
      if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
    }
    if (node === current$$1) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === current$$1) {
        return;
      }
      node = node.return;
      if (node.tag === HostPortal) {
        // When we go out of the portal, we need to restore the parent.
        // Since we don't keep a stack of them, we will search for it.
        currentParentIsValid = false;
      }
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function commitDeletion(current$$1, renderPriorityLevel) {
  if (supportsMutation) {
    // Recursively delete all host nodes from the parent.
    // Detach refs and call componentWillUnmount() on the whole subtree.
    unmountHostComponents(current$$1, renderPriorityLevel);
  } else {
    // Detach refs and call componentWillUnmount() on the whole subtree.
    commitNestedUnmounts(current$$1, renderPriorityLevel);
  }
  detachFiber(current$$1);
}

function commitWork(current$$1, finishedWork) {
  if (!supportsMutation) {
    switch (finishedWork.tag) {
      case FunctionComponent:
      case ForwardRef:
      case MemoComponent:
      case SimpleMemoComponent:
        {
          // Note: We currently never use MountMutation, but useLayout uses
          // UnmountMutation.
          commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
          return;
        }
      case Profiler:
        {
          return;
        }
      case SuspenseComponent:
        {
          commitSuspenseComponent(finishedWork);
          attachSuspenseRetryListeners(finishedWork);
          return;
        }
      case SuspenseListComponent:
        {
          attachSuspenseRetryListeners(finishedWork);
          return;
        }
    }

    commitContainer(finishedWork);
    return;
  }

  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
      {
        // Note: We currently never use MountMutation, but useLayout uses
        // UnmountMutation.
        commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
        return;
      }
    case ClassComponent:
      {
        return;
      }
    case HostComponent:
      {
        var instance = finishedWork.stateNode;
        if (instance != null) {
          // Commit the work prepared earlier.
          var newProps = finishedWork.memoizedProps;
          // For hydration we reuse the update path but we treat the oldProps
          // as the newProps. The updatePayload will contain the real change in
          // this case.
          var oldProps = current$$1 !== null ? current$$1.memoizedProps : newProps;
          var type = finishedWork.type;
          // TODO: Type the updateQueue to be specific to host components.
          var updatePayload = finishedWork.updateQueue;
          finishedWork.updateQueue = null;
          if (updatePayload !== null) {
            commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
          }
        }
        return;
      }
    case HostText:
      {
        (function () {
          if (!(finishedWork.stateNode !== null)) {
            {
              throw ReactError(Error('This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
        var textInstance = finishedWork.stateNode;
        var newText = finishedWork.memoizedProps;
        // For hydration we reuse the update path but we treat the oldProps
        // as the newProps. The updatePayload will contain the real change in
        // this case.
        var oldText = current$$1 !== null ? current$$1.memoizedProps : newText;
        commitTextUpdate(textInstance, oldText, newText);
        return;
      }
    case HostRoot:
      {
        return;
      }
    case Profiler:
      {
        return;
      }
    case SuspenseComponent:
      {
        commitSuspenseComponent(finishedWork);
        attachSuspenseRetryListeners(finishedWork);
        return;
      }
    case SuspenseListComponent:
      {
        attachSuspenseRetryListeners(finishedWork);
        return;
      }
    case IncompleteClassComponent:
      {
        return;
      }
    case FundamentalComponent:
      {
        if (enableFundamentalAPI) {
          var fundamentalInstance = finishedWork.stateNode;
          updateFundamentalComponent(fundamentalInstance);
        }
        return;
      }
    default:
      {
        (function () {
          {
            {
              throw ReactError(Error('This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'));
            }
          }
        })();
      }
  }
}

function commitSuspenseComponent(finishedWork) {
  var newState = finishedWork.memoizedState;

  var newDidTimeout = void 0;
  var primaryChildParent = finishedWork;
  if (newState === null) {
    newDidTimeout = false;
  } else {
    newDidTimeout = true;
    primaryChildParent = finishedWork.child;
    markCommitTimeOfFallback();
  }

  if (supportsMutation && primaryChildParent !== null) {
    hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
  }

  if (enableSuspenseCallback && newState !== null) {
    var suspenseCallback = finishedWork.memoizedProps.suspenseCallback;
    if (typeof suspenseCallback === 'function') {
      var thenables = finishedWork.updateQueue;
      if (thenables !== null) {
        suspenseCallback(new Set(thenables));
      }
    } else {
      if (suspenseCallback !== undefined) {
        warning$1(false, 'Unexpected type for suspenseCallback.');
      }
    }
  }
}

function attachSuspenseRetryListeners(finishedWork) {
  // If this boundary just timed out, then it will have a set of thenables.
  // For each thenable, attach a listener so that when it resolves, React
  var thenables = finishedWork.updateQueue;
  if (thenables !== null) {
    finishedWork.updateQueue = null;
    var retryCache = finishedWork.stateNode;
    if (retryCache === null) {
      retryCache = finishedWork.stateNode = new PossiblyWeakSet$1();
    }
    thenables.forEach(function (thenable) {
      // Memoize using the boundary fiber to prevent redundant listeners.
      var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
      if (!retryCache.has(thenable)) {
        if (enableSchedulerTracing) {
          retry = tracing.unstable_wrap(retry);
        }
        retryCache.add(thenable);
        thenable.then(retry, retry);
      }
    });
  }
}

function commitResetTextContent(current$$1) {
  if (!supportsMutation) {
    return;
  }
  resetTextContent(current$$1.stateNode);
}

var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;

function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  var update = createUpdate(expirationTime, null);
  // Unmount the root by rendering null.
  update.tag = CaptureUpdate;
  // Caution: React DevTools currently depends on this property
  // being called "element".
  update.payload = { element: null };
  var error = errorInfo.value;
  update.callback = function () {
    onUncaughtError(error);
    logError(fiber, errorInfo);
  };
  return update;
}

function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  var update = createUpdate(expirationTime, null);
  update.tag = CaptureUpdate;
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  if (typeof getDerivedStateFromError === 'function') {
    var error = errorInfo.value;
    update.payload = function () {
      logError(fiber, errorInfo);
      return getDerivedStateFromError(error);
    };
  }

  var inst = fiber.stateNode;
  if (inst !== null && typeof inst.componentDidCatch === 'function') {
    update.callback = function callback() {
      {
        markFailedErrorBoundaryForHotReloading(fiber);
      }
      if (typeof getDerivedStateFromError !== 'function') {
        // To preserve the preexisting retry behavior of error boundaries,
        // we keep track of which ones already failed during this batch.
        // This gets reset before we yield back to the browser.
        // TODO: Warn in strict mode if getDerivedStateFromError is
        // not defined.
        markLegacyErrorBoundaryAsFailed(this);

        // Only log here if componentDidCatch is the only error boundary method defined
        logError(fiber, errorInfo);
      }
      var error = errorInfo.value;
      var stack = errorInfo.stack;
      this.componentDidCatch(error, {
        componentStack: stack !== null ? stack : ''
      });
      {
        if (typeof getDerivedStateFromError !== 'function') {
          // If componentDidCatch is the only error boundary method defined,
          // then it needs to call setState to recover from errors.
          // If no state update is scheduled then the boundary will swallow the error.
          !(fiber.expirationTime === Sync) ? warningWithoutStack$1(false, '%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown') : void 0;
        }
      }
    };
  } else {
    update.callback = function () {
      markFailedErrorBoundaryForHotReloading(fiber);
    };
  }
  return update;
}

function attachPingListener(root, renderExpirationTime, thenable) {
  // Attach a listener to the promise to "ping" the root and retry. But
  // only if one does not already exist for the current render expiration
  // time (which acts like a "thread ID" here).
  var pingCache = root.pingCache;
  var threadIDs = void 0;
  if (pingCache === null) {
    pingCache = root.pingCache = new PossiblyWeakMap$1();
    threadIDs = new Set();
    pingCache.set(thenable, threadIDs);
  } else {
    threadIDs = pingCache.get(thenable);
    if (threadIDs === undefined) {
      threadIDs = new Set();
      pingCache.set(thenable, threadIDs);
    }
  }
  if (!threadIDs.has(renderExpirationTime)) {
    // Memoize using the thread ID to prevent redundant listeners.
    threadIDs.add(renderExpirationTime);
    var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
    if (enableSchedulerTracing) {
      ping = tracing.unstable_wrap(ping);
    }
    thenable.then(ping, ping);
  }
}

function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
  // The source fiber did not complete.
  sourceFiber.effectTag |= Incomplete;
  // Its effect list is no longer valid.
  sourceFiber.firstEffect = sourceFiber.lastEffect = null;

  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
    // This is a thenable.
    var thenable = value;

    checkForWrongSuspensePriorityInDEV(sourceFiber);

    var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);

    // Schedule the nearest Suspense to re-render the timed out view.
    var _workInProgress = returnFiber;
    do {
      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
        // Found the nearest boundary.

        // Stash the promise on the boundary fiber. If the boundary times out, we'll
        var thenables = _workInProgress.updateQueue;
        if (thenables === null) {
          var updateQueue = new Set();
          updateQueue.add(thenable);
          _workInProgress.updateQueue = updateQueue;
        } else {
          thenables.add(thenable);
        }

        // If the boundary is outside of batched mode, we should *not*
        // suspend the commit. Pretend as if the suspended component rendered
        // null and keep rendering. In the commit phase, we'll schedule a
        // subsequent synchronous update to re-render the Suspense.
        //
        // Note: It doesn't matter whether the component that suspended was
        // inside a batched mode tree. If the Suspense is outside of it, we
        // should *not* suspend the commit.
        if ((_workInProgress.mode & BatchedMode) === NoMode) {
          _workInProgress.effectTag |= DidCapture;

          // We're going to commit this fiber even though it didn't complete.
          // But we shouldn't call any lifecycle methods or callbacks. Remove
          // all lifecycle effect tags.
          sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);

          if (sourceFiber.tag === ClassComponent) {
            var currentSourceFiber = sourceFiber.alternate;
            if (currentSourceFiber === null) {
              // This is a new mount. Change the tag so it's not mistaken for a
              // completed class component. For example, we should not call
              // componentWillUnmount if it is deleted.
              sourceFiber.tag = IncompleteClassComponent;
            } else {
              // When we try rendering again, we should not reuse the current fiber,
              // since it's known to be in an inconsistent state. Use a force update to
              // prevent a bail out.
              var update = createUpdate(Sync, null);
              update.tag = ForceUpdate;
              enqueueUpdate(sourceFiber, update);
            }
          }

          // The source fiber did not complete. Mark it with Sync priority to
          // indicate that it still has pending work.
          sourceFiber.expirationTime = Sync;

          // Exit without suspending.
          return;
        }

        // Confirmed that the boundary is in a concurrent mode tree. Continue
        // with the normal suspend path.
        //
        // After this we'll use a set of heuristics to determine whether this
        // render pass will run to completion or restart or "suspend" the commit.
        // The actual logic for this is spread out in different places.
        //
        // This first principle is that if we're going to suspend when we complete
        // a root, then we should also restart if we get an update or ping that
        // might unsuspend it, and vice versa. The only reason to suspend is
        // because you think you might want to restart before committing. However,
        // it doesn't make sense to restart only while in the period we're suspended.
        //
        // Restarting too aggressively is also not good because it starves out any
        // intermediate loading state. So we use heuristics to determine when.

        // Suspense Heuristics
        //
        // If nothing threw a Promise or all the same fallbacks are already showing,
        // then don't suspend/restart.
        //
        // If this is an initial render of a new tree of Suspense boundaries and
        // those trigger a fallback, then don't suspend/restart. We want to ensure
        // that we can show the initial loading state as quickly as possible.
        //
        // If we hit a "Delayed" case, such as when we'd switch from content back into
        // a fallback, then we should always suspend/restart. SuspenseConfig applies to
        // this case. If none is defined, JND is used instead.
        //
        // If we're already showing a fallback and it gets "retried", allowing us to show
        // another level, but there's still an inner boundary that would show a fallback,
        // then we suspend/restart for 500ms since the last time we showed a fallback
        // anywhere in the tree. This effectively throttles progressive loading into a
        // consistent train of commits. This also gives us an opportunity to restart to
        // get to the completed state slightly earlier.
        //
        // If there's ambiguity due to batching it's resolved in preference of:
        // 1) "delayed", 2) "initial render", 3) "retry".
        //
        // We want to ensure that a "busy" state doesn't get force committed. We want to
        // ensure that new initial loading states can commit as soon as possible.

        attachPingListener(root, renderExpirationTime, thenable);

        _workInProgress.effectTag |= ShouldCapture;
        _workInProgress.expirationTime = renderExpirationTime;

        return;
      } else if (enableSuspenseServerRenderer && _workInProgress.tag === DehydratedSuspenseComponent) {
        attachPingListener(root, renderExpirationTime, thenable);

        // Since we already have a current fiber, we can eagerly add a retry listener.
        var retryCache = _workInProgress.memoizedState;
        if (retryCache === null) {
          retryCache = _workInProgress.memoizedState = new PossiblyWeakSet();
          var current$$1 = _workInProgress.alternate;
          (function () {
            if (!current$$1) {
              {
                throw ReactError(Error('A dehydrated suspense boundary must commit before trying to render. This is probably a bug in React.'));
              }
            }
          })();
          current$$1.memoizedState = retryCache;
        }
        // Memoize using the boundary fiber to prevent redundant listeners.
        if (!retryCache.has(thenable)) {
          retryCache.add(thenable);
          var retry = resolveRetryThenable.bind(null, _workInProgress, thenable);
          if (enableSchedulerTracing) {
            retry = tracing.unstable_wrap(retry);
          }
          thenable.then(retry, retry);
        }
        _workInProgress.effectTag |= ShouldCapture;
        _workInProgress.expirationTime = renderExpirationTime;
        return;
      }
      // This boundary already captured during this render. Continue to the next
      // boundary.
      _workInProgress = _workInProgress.return;
    } while (_workInProgress !== null);
    // No boundary was found. Fallthrough to error mode.
    // TODO: Use invariant so the message is stripped in prod?
    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
  }

  // We didn't find a boundary that could handle this type of exception. Start
  // over and traverse parent path again, this time treating the exception
  // as an error.
  renderDidError();
  value = createCapturedValue(value, sourceFiber);
  var workInProgress = returnFiber;
  do {
    switch (workInProgress.tag) {
      case HostRoot:
        {
          var _errorInfo = value;
          workInProgress.effectTag |= ShouldCapture;
          workInProgress.expirationTime = renderExpirationTime;
          var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
          enqueueCapturedUpdate(workInProgress, _update);
          return;
        }
      case ClassComponent:
        // Capture and retry
        var errorInfo = value;
        var ctor = workInProgress.type;
        var instance = workInProgress.stateNode;
        if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
          workInProgress.effectTag |= ShouldCapture;
          workInProgress.expirationTime = renderExpirationTime;
          // Schedule the error boundary to re-render using updated state
          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
          enqueueCapturedUpdate(workInProgress, _update2);
          return;
        }
        break;
      default:
        break;
    }
    workInProgress = workInProgress.return;
  } while (workInProgress !== null);
}

// The scheduler is imported here *only* to detect whether it's been mocked
// DEV stuff
var ceil = Math.ceil;

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;
var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;


var NoContext = /*                    */0;
var BatchedContext = /*               */1;
var EventContext = /*                 */2;
var DiscreteEventContext = /*         */4;
var LegacyUnbatchedContext = /*       */8;
var RenderContext = /*                */16;
var CommitContext = /*                */32;

var RootIncomplete = 0;
var RootErrored = 1;
var RootSuspended = 2;
var RootSuspendedWithDelay = 3;
var RootCompleted = 4;

// Describes where we are in the React execution stack
var executionContext = NoContext;
// The root we're working on
var workInProgressRoot = null;
// The fiber we're working on
var workInProgress = null;
// The expiration time we're rendering
var renderExpirationTime = NoWork;
// Whether to root completed, errored, suspended, etc.
var workInProgressRootExitStatus = RootIncomplete;
// Most recent event time among processed updates during this render.
// This is conceptually a time stamp but expressed in terms of an ExpirationTime
// because we deal mostly with expiration times in the hot path, so this avoids
// the conversion happening in the hot path.
var workInProgressRootLatestProcessedExpirationTime = Sync;
var workInProgressRootLatestSuspenseTimeout = Sync;
var workInProgressRootCanSuspendUsingConfig = null;
// If we're pinged while rendering we don't always restart immediately.
// This flag determines if it might be worthwhile to restart if an opportunity
// happens latere.
var workInProgressRootHasPendingPing = false;
// The most recent time we committed a fallback. This lets us ensure a train
// model where we don't commit new loading states in too quick succession.
var globalMostRecentFallbackTime = 0;
var FALLBACK_THROTTLE_MS = 500;

var nextEffect = null;
var hasUncaughtError = false;
var firstUncaughtError = null;
var legacyErrorBoundariesThatAlreadyFailed = null;

var rootDoesHavePassiveEffects = false;
var rootWithPendingPassiveEffects = null;
var pendingPassiveEffectsRenderPriority = NoPriority;
var pendingPassiveEffectsExpirationTime = NoWork;

var rootsWithPendingDiscreteUpdates = null;

// Use these to prevent an infinite loop of nested updates
var NESTED_UPDATE_LIMIT = 50;
var nestedUpdateCount = 0;
var rootWithNestedUpdates = null;

var NESTED_PASSIVE_UPDATE_LIMIT = 50;
var nestedPassiveUpdateCount = 0;

var interruptedBy = null;

// Marks the need to reschedule pending interactions at these expiration times
// during the commit phase. This enables them to be traced across components
// that spawn new work during render. E.g. hidden boundaries, suspended SSR
// hydration or SuspenseList.
var spawnedWorkDuringRender = null;

// Expiration times are computed by adding to the current time (the start
// time). However, if two updates are scheduled within the same event, we
// should treat their start times as simultaneous, even if the actual clock
// time has advanced between the first and second call.

// In other words, because expiration times determine how updates are batched,
// we want all updates of like priority that occur within the same event to
// receive the same expiration time. Otherwise we get tearing.
var currentEventTime = NoWork;

function requestCurrentTime() {
  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
    // We're inside React, so it's fine to read the actual time.
    return msToExpirationTime(now());
  }
  // We're not inside React, so we may be in the middle of a browser event.
  if (currentEventTime !== NoWork) {
    // Use the same start time for all updates until we enter React again.
    return currentEventTime;
  }
  // This is the first update since React yielded. Compute a new start time.
  currentEventTime = msToExpirationTime(now());
  return currentEventTime;
}

function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
  var mode = fiber.mode;
  if ((mode & BatchedMode) === NoMode) {
    return Sync;
  }

  var priorityLevel = getCurrentPriorityLevel();
  if ((mode & ConcurrentMode) === NoMode) {
    return priorityLevel === ImmediatePriority ? Sync : Batched;
  }

  if ((executionContext & RenderContext) !== NoContext) {
    // Use whatever time we're already rendering
    return renderExpirationTime;
  }

  var expirationTime = void 0;
  if (suspenseConfig !== null) {
    // Compute an expiration time based on the Suspense timeout.
    expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
  } else {
    // Compute an expiration time based on the Scheduler priority.
    switch (priorityLevel) {
      case ImmediatePriority:
        expirationTime = Sync;
        break;
      case UserBlockingPriority$2:
        // TODO: Rename this to computeUserBlockingExpiration
        expirationTime = computeInteractiveExpiration(currentTime);
        break;
      case NormalPriority:
      case LowPriority:
        // TODO: Handle LowPriority
        // TODO: Rename this to... something better.
        expirationTime = computeAsyncExpiration(currentTime);
        break;
      case IdlePriority:
        expirationTime = Never;
        break;
      default:
        (function () {
          {
            {
              throw ReactError(Error('Expected a valid priority level'));
            }
          }
        })();
    }
  }

  // If we're in the middle of rendering a tree, do not update at the same
  // expiration time that is already rendering.
  // TODO: We shouldn't have to do this if the update is on a different root.
  // Refactor computeExpirationForFiber + scheduleUpdate so we have access to
  // the root when we check for this condition.
  if (workInProgressRoot !== null && expirationTime === renderExpirationTime) {
    // This is a trick to move this update into a separate batch
    expirationTime -= 1;
  }

  return expirationTime;
}

var lastUniqueAsyncExpiration = NoWork;
function computeUniqueAsyncExpiration() {
  var currentTime = requestCurrentTime();
  var result = computeAsyncExpiration(currentTime);
  if (result <= lastUniqueAsyncExpiration) {
    // Since we assume the current time monotonically increases, we only hit
    // this branch when computeUniqueAsyncExpiration is fired multiple times
    // within a 200ms window (or whatever the async bucket size is).
    result -= 1;
  }
  lastUniqueAsyncExpiration = result;
  return result;
}

function scheduleUpdateOnFiber(fiber, expirationTime) {
  checkForNestedUpdates();
  warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber);

  var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
  if (root === null) {
    warnAboutUpdateOnUnmountedFiberInDEV(fiber);
    return;
  }

  root.pingTime = NoWork;

  checkForInterruption(fiber, expirationTime);
  recordScheduleUpdate();

  // TODO: computeExpirationForFiber also reads the priority. Pass the
  // priority as an argument to that function and this one.
  var priorityLevel = getCurrentPriorityLevel();

  if (expirationTime === Sync) {
    if (
    // Check if we're inside unbatchedUpdates
    (executionContext & LegacyUnbatchedContext) !== NoContext &&
    // Check if we're not already rendering
    (executionContext & (RenderContext | CommitContext)) === NoContext) {
      // Register pending interactions on the root to avoid losing traced interaction data.
      schedulePendingInteractions(root, expirationTime);

      // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
      // root inside of batchedUpdates should be synchronous, but layout updates
      // should be deferred until the end of the batch.
      var callback = renderRoot(root, Sync, true);
      while (callback !== null) {
        callback = callback(true);
      }
    } else {
      scheduleCallbackForRoot(root, ImmediatePriority, Sync);
      if (executionContext === NoContext) {
        // Flush the synchronous work now, wnless we're already working or inside
        // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
        // scheduleCallbackForFiber to preserve the ability to schedule a callback
        // without immediately flushing it. We only do this for user-initiated
        // updates, to preserve historical behavior of sync mode.
        flushSyncCallbackQueue();
      }
    }
  } else {
    scheduleCallbackForRoot(root, priorityLevel, expirationTime);
  }

  if ((executionContext & DiscreteEventContext) !== NoContext && (
  // Only updates at user-blocking priority or greater are considered
  // discrete, even inside a discrete event.
  priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority)) {
    // This is the result of a discrete event. Track the lowest priority
    // discrete update per root so we can flush them early, if needed.
    if (rootsWithPendingDiscreteUpdates === null) {
      rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);
    } else {
      var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);
      if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {
        rootsWithPendingDiscreteUpdates.set(root, expirationTime);
      }
    }
  }
}
var scheduleWork = scheduleUpdateOnFiber;

// This is split into a separate function so we can mark a fiber with pending
// work without treating it as a typical update that originates from an event;
// e.g. retrying a Suspense boundary isn't an update, but it does schedule work
// on a fiber.
function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
  // Update the source fiber's expiration time
  if (fiber.expirationTime < expirationTime) {
    fiber.expirationTime = expirationTime;
  }
  var alternate = fiber.alternate;
  if (alternate !== null && alternate.expirationTime < expirationTime) {
    alternate.expirationTime = expirationTime;
  }
  // Walk the parent path to the root and update the child expiration time.
  var node = fiber.return;
  var root = null;
  if (node === null && fiber.tag === HostRoot) {
    root = fiber.stateNode;
  } else {
    while (node !== null) {
      alternate = node.alternate;
      if (node.childExpirationTime < expirationTime) {
        node.childExpirationTime = expirationTime;
        if (alternate !== null && alternate.childExpirationTime < expirationTime) {
          alternate.childExpirationTime = expirationTime;
        }
      } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
        alternate.childExpirationTime = expirationTime;
      }
      if (node.return === null && node.tag === HostRoot) {
        root = node.stateNode;
        break;
      }
      node = node.return;
    }
  }

  if (root !== null) {
    // Update the first and last pending expiration times in this root
    var firstPendingTime = root.firstPendingTime;
    if (expirationTime > firstPendingTime) {
      root.firstPendingTime = expirationTime;
    }
    var lastPendingTime = root.lastPendingTime;
    if (lastPendingTime === NoWork || expirationTime < lastPendingTime) {
      root.lastPendingTime = expirationTime;
    }
  }

  return root;
}

// Use this function, along with runRootCallback, to ensure that only a single
// callback per root is scheduled. It's still possible to call renderRoot
// directly, but scheduling via this function helps avoid excessive callbacks.
// It works by storing the callback node and expiration time on the root. When a
// new callback comes in, it compares the expiration time to determine if it
// should cancel the previous one. It also relies on commitRoot scheduling a
// callback to render the next level, because that means we don't need a
// separate callback per expiration time.
function scheduleCallbackForRoot(root, priorityLevel, expirationTime) {
  var existingCallbackExpirationTime = root.callbackExpirationTime;
  if (existingCallbackExpirationTime < expirationTime) {
    // New callback has higher priority than the existing one.
    var existingCallbackNode = root.callbackNode;
    if (existingCallbackNode !== null) {
      cancelCallback(existingCallbackNode);
    }
    root.callbackExpirationTime = expirationTime;

    if (expirationTime === Sync) {
      // Sync React callbacks are scheduled on a special internal queue
      root.callbackNode = scheduleSyncCallback(runRootCallback.bind(null, root, renderRoot.bind(null, root, expirationTime)));
    } else {
      var options = null;
      if (!disableSchedulerTimeoutBasedOnReactExpirationTime && expirationTime !== Never) {
        var timeout = expirationTimeToMs(expirationTime) - now();
        options = { timeout: timeout };
      }

      root.callbackNode = scheduleCallback(priorityLevel, runRootCallback.bind(null, root, renderRoot.bind(null, root, expirationTime)), options);
      if (enableUserTimingAPI && expirationTime !== Sync && (executionContext & (RenderContext | CommitContext)) === NoContext) {
        // Scheduled an async callback, and we're not already working. Add an
        // entry to the flamegraph that shows we're waiting for a callback
        // to fire.
        startRequestCallbackTimer();
      }
    }
  }

  // Associate the current interactions with this new root+priority.
  schedulePendingInteractions(root, expirationTime);
}

function runRootCallback(root, callback, isSync) {
  var prevCallbackNode = root.callbackNode;
  var continuation = null;
  try {
    continuation = callback(isSync);
    if (continuation !== null) {
      return runRootCallback.bind(null, root, continuation);
    } else {
      return null;
    }
  } finally {
    // If the callback exits without returning a continuation, remove the
    // corresponding callback node from the root. Unless the callback node
    // has changed, which implies that it was already cancelled by a high
    // priority update.
    if (continuation === null && prevCallbackNode === root.callbackNode) {
      root.callbackNode = null;
      root.callbackExpirationTime = NoWork;
    }
  }
}

function flushRoot(root, expirationTime) {
  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
    (function () {
      {
        {
          throw ReactError(Error('work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.'));
        }
      }
    })();
  }
  scheduleSyncCallback(renderRoot.bind(null, root, expirationTime));
  flushSyncCallbackQueue();
}

function flushDiscreteUpdates() {
  // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
  // However, `act` uses `batchedUpdates`, so there's no way to distinguish
  // those two cases. Need to fix this before exposing flushDiscreteUpdates
  // as a public API.
  if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
    if ( true && (executionContext & RenderContext) !== NoContext) {
      warning$1(false, 'unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
    }
    // We're already rendering, so we can't synchronously flush pending work.
    // This is probably a nested event dispatch triggered by a lifecycle/effect,
    // like `el.focus()`. Exit.
    return;
  }
  flushPendingDiscreteUpdates();
  if (!revertPassiveEffectsChange) {
    // If the discrete updates scheduled passive effects, flush them now so that
    // they fire before the next serial event.
    flushPassiveEffects();
  }
}

function resolveLocksOnRoot(root, expirationTime) {
  var firstBatch = root.firstBatch;
  if (firstBatch !== null && firstBatch._defer && firstBatch._expirationTime >= expirationTime) {
    scheduleCallback(NormalPriority, function () {
      firstBatch._onComplete();
      return null;
    });
    return true;
  } else {
    return false;
  }
}





function flushPendingDiscreteUpdates() {
  if (rootsWithPendingDiscreteUpdates !== null) {
    // For each root with pending discrete updates, schedule a callback to
    // immediately flush them.
    var roots = rootsWithPendingDiscreteUpdates;
    rootsWithPendingDiscreteUpdates = null;
    roots.forEach(function (expirationTime, root) {
      scheduleSyncCallback(renderRoot.bind(null, root, expirationTime));
    });
    // Now flush the immediate queue.
    flushSyncCallbackQueue();
  }
}

function batchedUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= BatchedContext;
  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;
    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      flushSyncCallbackQueue();
    }
  }
}

function batchedEventUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= EventContext;
  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;
    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      flushSyncCallbackQueue();
    }
  }
}

function discreteUpdates$1(fn, a, b, c) {
  var prevExecutionContext = executionContext;
  executionContext |= DiscreteEventContext;
  try {
    // Should this
    return runWithPriority$2(UserBlockingPriority$2, fn.bind(null, a, b, c));
  } finally {
    executionContext = prevExecutionContext;
    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      flushSyncCallbackQueue();
    }
  }
}

function unbatchedUpdates(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext &= ~BatchedContext;
  executionContext |= LegacyUnbatchedContext;
  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;
    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      flushSyncCallbackQueue();
    }
  }
}

function flushSync(fn, a) {
  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
    (function () {
      {
        {
          throw ReactError(Error('flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.'));
        }
      }
    })();
  }
  var prevExecutionContext = executionContext;
  executionContext |= BatchedContext;
  try {
    return runWithPriority$2(ImmediatePriority, fn.bind(null, a));
  } finally {
    executionContext = prevExecutionContext;
    // Flush the immediate callbacks that were scheduled during this batch.
    // Note that this will happen even if batchedUpdates is higher up
    // the stack.
    flushSyncCallbackQueue();
  }
}

function flushControlled(fn) {
  var prevExecutionContext = executionContext;
  executionContext |= BatchedContext;
  try {
    runWithPriority$2(ImmediatePriority, fn);
  } finally {
    executionContext = prevExecutionContext;
    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      flushSyncCallbackQueue();
    }
  }
}

function prepareFreshStack(root, expirationTime) {
  root.finishedWork = null;
  root.finishedExpirationTime = NoWork;

  var timeoutHandle = root.timeoutHandle;
  if (timeoutHandle !== noTimeout) {
    // The root previous suspended and scheduled a timeout to commit a fallback
    // state. Now that we have additional work, cancel the timeout.
    root.timeoutHandle = noTimeout;
    // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
    cancelTimeout(timeoutHandle);
  }

  if (workInProgress !== null) {
    var interruptedWork = workInProgress.return;
    while (interruptedWork !== null) {
      unwindInterruptedWork(interruptedWork);
      interruptedWork = interruptedWork.return;
    }
  }
  workInProgressRoot = root;
  workInProgress = createWorkInProgress(root.current, null, expirationTime);
  renderExpirationTime = expirationTime;
  workInProgressRootExitStatus = RootIncomplete;
  workInProgressRootLatestProcessedExpirationTime = Sync;
  workInProgressRootLatestSuspenseTimeout = Sync;
  workInProgressRootCanSuspendUsingConfig = null;
  workInProgressRootHasPendingPing = false;

  if (enableSchedulerTracing) {
    spawnedWorkDuringRender = null;
  }

  {
    ReactStrictModeWarnings.discardPendingWarnings();
    componentsThatTriggeredHighPriSuspend = null;
  }
}

function renderRoot(root, expirationTime, isSync) {
  (function () {
    if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
      {
        throw ReactError(Error('Should not already be working.'));
      }
    }
  })();

  if (enableUserTimingAPI && expirationTime !== Sync) {
    var didExpire = isSync;
    stopRequestCallbackTimer(didExpire);
  }

  if (root.firstPendingTime < expirationTime) {
    // If there's no work left at this expiration time, exit immediately. This
    // happens when multiple callbacks are scheduled for a single root, but an
    // earlier callback flushes the work of a later one.
    return null;
  }

  if (isSync && root.finishedExpirationTime === expirationTime) {
    // There's already a pending commit at this expiration time.
    // TODO: This is poorly factored. This case only exists for the
    // batch.commit() API.
    return commitRoot.bind(null, root);
  }

  flushPassiveEffects();

  // If the root or expiration time have changed, throw out the existing stack
  // and prepare a fresh one. Otherwise we'll continue where we left off.
  if (root !== workInProgressRoot || expirationTime !== renderExpirationTime) {
    prepareFreshStack(root, expirationTime);
    startWorkOnPendingInteractions(root, expirationTime);
  } else if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
    // We could've received an update at a lower priority while we yielded.
    // We're suspended in a delayed state. Once we complete this render we're
    // just going to try to recover at the last pending time anyway so we might
    // as well start doing that eagerly.
    // Ideally we should be able to do this even for retries but we don't yet
    // know if we're going to process an update which wants to commit earlier,
    // and this path happens very early so it would happen too often. Instead,
    // for that case, we'll wait until we complete.
    if (workInProgressRootHasPendingPing) {
      // We have a ping at this expiration. Let's restart to see if we get unblocked.
      prepareFreshStack(root, expirationTime);
    } else {
      var lastPendingTime = root.lastPendingTime;
      if (lastPendingTime < expirationTime) {
        // There's lower priority work. It might be unsuspended. Try rendering
        // at that level immediately, while preserving the position in the queue.
        return renderRoot.bind(null, root, lastPendingTime);
      }
    }
  }

  // If we have a work-in-progress fiber, it means there's still work to do
  // in this root.
  if (workInProgress !== null) {
    var prevExecutionContext = executionContext;
    executionContext |= RenderContext;
    var prevDispatcher = ReactCurrentDispatcher.current;
    if (prevDispatcher === null) {
      // The React isomorphic package does not include a default dispatcher.
      // Instead the first renderer will lazily attach one, in order to give
      // nicer error messages.
      prevDispatcher = ContextOnlyDispatcher;
    }
    ReactCurrentDispatcher.current = ContextOnlyDispatcher;
    var prevInteractions = null;
    if (enableSchedulerTracing) {
      prevInteractions = tracing.__interactionsRef.current;
      tracing.__interactionsRef.current = root.memoizedInteractions;
    }

    startWorkLoopTimer(workInProgress);

    // TODO: Fork renderRoot into renderRootSync and renderRootAsync
    if (isSync) {
      if (expirationTime !== Sync) {
        // An async update expired. There may be other expired updates on
        // this root. We should render all the expired work in a
        // single batch.
        var currentTime = requestCurrentTime();
        if (currentTime < expirationTime) {
          // Restart at the current time.
          executionContext = prevExecutionContext;
          resetContextDependencies();
          ReactCurrentDispatcher.current = prevDispatcher;
          if (enableSchedulerTracing) {
            tracing.__interactionsRef.current = prevInteractions;
          }
          return renderRoot.bind(null, root, currentTime);
        }
      }
    } else {
      // Since we know we're in a React event, we can clear the current
      // event time. The next update will compute a new event time.
      currentEventTime = NoWork;
    }

    do {
      try {
        if (isSync) {
          workLoopSync();
        } else {
          workLoop();
        }
        break;
      } catch (thrownValue) {
        // Reset module-level state that was set during the render phase.
        resetContextDependencies();
        resetHooks();

        var sourceFiber = workInProgress;
        if (sourceFiber === null || sourceFiber.return === null) {
          // Expected to be working on a non-root fiber. This is a fatal error
          // because there's no ancestor that can handle it; the root is
          // supposed to capture all errors that weren't caught by an error
          // boundary.
          prepareFreshStack(root, expirationTime);
          executionContext = prevExecutionContext;
          throw thrownValue;
        }

        if (enableProfilerTimer && sourceFiber.mode & ProfileMode) {
          // Record the time spent rendering before an error was thrown. This
          // avoids inaccurate Profiler durations in the case of a
          // suspended render.
          stopProfilerTimerIfRunningAndRecordDelta(sourceFiber, true);
        }

        var returnFiber = sourceFiber.return;
        throwException(root, returnFiber, sourceFiber, thrownValue, renderExpirationTime);
        workInProgress = completeUnitOfWork(sourceFiber);
      }
    } while (true);

    executionContext = prevExecutionContext;
    resetContextDependencies();
    ReactCurrentDispatcher.current = prevDispatcher;
    if (enableSchedulerTracing) {
      tracing.__interactionsRef.current = prevInteractions;
    }

    if (workInProgress !== null) {
      // There's still work left over. Return a continuation.
      stopInterruptedWorkLoopTimer();
      if (expirationTime !== Sync) {
        startRequestCallbackTimer();
      }
      return renderRoot.bind(null, root, expirationTime);
    }
  }

  // We now have a consistent tree. The next step is either to commit it, or, if
  // something suspended, wait to commit it after a timeout.
  stopFinishedWorkLoopTimer();

  root.finishedWork = root.current.alternate;
  root.finishedExpirationTime = expirationTime;

  var isLocked = resolveLocksOnRoot(root, expirationTime);
  if (isLocked) {
    // This root has a lock that prevents it from committing. Exit. If we begin
    // work on the root again, without any intervening updates, it will finish
    // without doing additional work.
    return null;
  }

  // Set this to null to indicate there's no in-progress render.
  workInProgressRoot = null;

  switch (workInProgressRootExitStatus) {
    case RootIncomplete:
      {
        (function () {
          {
            {
              throw ReactError(Error('Should have a work-in-progress.'));
            }
          }
        })();
      }
    // Flow knows about invariant, so it complains if I add a break statement,
    // but eslint doesn't know about invariant, so it complains if I do.
    // eslint-disable-next-line no-fallthrough
    case RootErrored:
      {
        // An error was thrown. First check if there is lower priority work
        // scheduled on this root.
        var _lastPendingTime = root.lastPendingTime;
        if (_lastPendingTime < expirationTime) {
          // There's lower priority work. Before raising the error, try rendering
          // at the lower priority to see if it fixes it. Use a continuation to
          // maintain the existing priority and position in the queue.
          return renderRoot.bind(null, root, _lastPendingTime);
        }
        if (!isSync) {
          // If we're rendering asynchronously, it's possible the error was
          // caused by tearing due to a mutation during an event. Try rendering
          // one more time without yiedling to events.
          prepareFreshStack(root, expirationTime);
          scheduleSyncCallback(renderRoot.bind(null, root, expirationTime));
          return null;
        }
        // If we're already rendering synchronously, commit the root in its
        // errored state.
        return commitRoot.bind(null, root);
      }
    case RootSuspended:
      {
        flushSuspensePriorityWarningInDEV();

        // We have an acceptable loading state. We need to figure out if we should
        // immediately commit it or wait a bit.

        // If we have processed new updates during this render, we may now have a
        // new loading state ready. We want to ensure that we commit that as soon as
        // possible.
        var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
        if (hasNotProcessedNewUpdates && !isSync &&
        // do not delay if we're inside an act() scope
        !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
          // If we have not processed any new updates during this pass, then this is
          // either a retry of an existing fallback state or a hidden tree.
          // Hidden trees shouldn't be batched with other work and after that's
          // fixed it can only be a retry.
          // We're going to throttle committing retries so that we don't show too
          // many loading states too quickly.
          var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
          // Don't bother with a very short suspense time.
          if (msUntilTimeout > 10) {
            if (workInProgressRootHasPendingPing) {
              // This render was pinged but we didn't get to restart earlier so try
              // restarting now instead.
              prepareFreshStack(root, expirationTime);
              return renderRoot.bind(null, root, expirationTime);
            }
            var _lastPendingTime2 = root.lastPendingTime;
            if (_lastPendingTime2 < expirationTime) {
              // There's lower priority work. It might be unsuspended. Try rendering
              // at that level.
              return renderRoot.bind(null, root, _lastPendingTime2);
            }
            // The render is suspended, it hasn't timed out, and there's no lower
            // priority work to do. Instead of committing the fallback
            // immediately, wait for more data to arrive.
            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
            return null;
          }
        }
        // The work expired. Commit immediately.
        return commitRoot.bind(null, root);
      }
    case RootSuspendedWithDelay:
      {
        flushSuspensePriorityWarningInDEV();

        if (!isSync &&
        // do not delay if we're inside an act() scope
        !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
          // We're suspended in a state that should be avoided. We'll try to avoid committing
          // it for as long as the timeouts let us.
          if (workInProgressRootHasPendingPing) {
            // This render was pinged but we didn't get to restart earlier so try
            // restarting now instead.
            prepareFreshStack(root, expirationTime);
            return renderRoot.bind(null, root, expirationTime);
          }
          var _lastPendingTime3 = root.lastPendingTime;
          if (_lastPendingTime3 < expirationTime) {
            // There's lower priority work. It might be unsuspended. Try rendering
            // at that level immediately.
            return renderRoot.bind(null, root, _lastPendingTime3);
          }

          var _msUntilTimeout = void 0;
          if (workInProgressRootLatestSuspenseTimeout !== Sync) {
            // We have processed a suspense config whose expiration time we can use as
            // the timeout.
            _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
          } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
            // This should never normally happen because only new updates cause
            // delayed states, so we should have processed something. However,
            // this could also happen in an offscreen tree.
            _msUntilTimeout = 0;
          } else {
            // If we don't have a suspense config, we're going to use a heuristic to
            var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
            var currentTimeMs = now();
            var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
            var timeElapsed = currentTimeMs - eventTimeMs;
            if (timeElapsed < 0) {
              // We get this wrong some time since we estimate the time.
              timeElapsed = 0;
            }

            _msUntilTimeout = jnd(timeElapsed) - timeElapsed;

            // Clamp the timeout to the expiration time.
            // TODO: Once the event time is exact instead of inferred from expiration time
            // we don't need this.
            if (timeUntilExpirationMs < _msUntilTimeout) {
              _msUntilTimeout = timeUntilExpirationMs;
            }
          }

          // Don't bother with a very short suspense time.
          if (_msUntilTimeout > 10) {
            // The render is suspended, it hasn't timed out, and there's no lower
            // priority work to do. Instead of committing the fallback
            // immediately, wait for more data to arrive.
            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
            return null;
          }
        }
        // The work expired. Commit immediately.
        return commitRoot.bind(null, root);
      }
    case RootCompleted:
      {
        // The work completed. Ready to commit.
        if (!isSync &&
        // do not delay if we're inside an act() scope
        !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
          // If we have exceeded the minimum loading delay, which probably
          // means we have shown a spinner already, we might have to suspend
          // a bit longer to ensure that the spinner is shown for enough time.
          var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
          if (_msUntilTimeout2 > 10) {
            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);
            return null;
          }
        }
        return commitRoot.bind(null, root);
      }
    default:
      {
        (function () {
          {
            {
              throw ReactError(Error('Unknown root exit status.'));
            }
          }
        })();
      }
  }
}

function markCommitTimeOfFallback() {
  globalMostRecentFallbackTime = now();
}

function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
  if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Never) {
    workInProgressRootLatestProcessedExpirationTime = expirationTime;
  }
  if (suspenseConfig !== null) {
    if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Never) {
      workInProgressRootLatestSuspenseTimeout = expirationTime;
      // Most of the time we only have one config and getting wrong is not bad.
      workInProgressRootCanSuspendUsingConfig = suspenseConfig;
    }
  }
}

function renderDidSuspend() {
  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootSuspended;
  }
}

function renderDidSuspendDelayIfPossible() {
  if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
    workInProgressRootExitStatus = RootSuspendedWithDelay;
  }
}

function renderDidError() {
  if (workInProgressRootExitStatus !== RootCompleted) {
    workInProgressRootExitStatus = RootErrored;
  }
}

// Called during render to determine if anything has suspended.
// Returns false if we're not sure.
function renderHasNotSuspendedYet() {
  // If something errored or completed, we can't really be sure,
  // so those are false.
  return workInProgressRootExitStatus === RootIncomplete;
}

function inferTimeFromExpirationTime(expirationTime) {
  // We don't know exactly when the update was scheduled, but we can infer an
  // approximate start time from the expiration time.
  var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
}

function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
  // We don't know exactly when the update was scheduled, but we can infer an
  // approximate start time from the expiration time by subtracting the timeout
  // that was added to the event time.
  var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
}

function workLoopSync() {
  // Already timed out, so perform work without checking if we need to yield.
  while (workInProgress !== null) {
    workInProgress = performUnitOfWork(workInProgress);
  }
}

function workLoop() {
  // Perform work until Scheduler asks us to yield
  while (workInProgress !== null && !shouldYield()) {
    workInProgress = performUnitOfWork(workInProgress);
  }
}

function performUnitOfWork(unitOfWork) {
  // The current, flushed, state of this fiber is the alternate. Ideally
  // nothing should rely on this, but relying on it here means that we don't
  // need an additional field on the work in progress.
  var current$$1 = unitOfWork.alternate;

  startWorkTimer(unitOfWork);
  setCurrentFiber(unitOfWork);

  var next = void 0;
  if (enableProfilerTimer && (unitOfWork.mode & ProfileMode) !== NoMode) {
    startProfilerTimer(unitOfWork);
    next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
    stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
  } else {
    next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
  }

  resetCurrentFiber();
  unitOfWork.memoizedProps = unitOfWork.pendingProps;
  if (next === null) {
    // If this doesn't spawn new work, complete the current work.
    next = completeUnitOfWork(unitOfWork);
  }

  ReactCurrentOwner$2.current = null;
  return next;
}

function completeUnitOfWork(unitOfWork) {
  // Attempt to complete the current unit of work, then move to the next
  // sibling. If there are no more siblings, return to the parent fiber.
  workInProgress = unitOfWork;
  do {
    // The current, flushed, state of this fiber is the alternate. Ideally
    // nothing should rely on this, but relying on it here means that we don't
    // need an additional field on the work in progress.
    var current$$1 = workInProgress.alternate;
    var returnFiber = workInProgress.return;

    // Check if the work completed or if something threw.
    if ((workInProgress.effectTag & Incomplete) === NoEffect) {
      setCurrentFiber(workInProgress);
      var next = void 0;
      if (!enableProfilerTimer || (workInProgress.mode & ProfileMode) === NoMode) {
        next = completeWork(current$$1, workInProgress, renderExpirationTime);
      } else {
        startProfilerTimer(workInProgress);
        next = completeWork(current$$1, workInProgress, renderExpirationTime);
        // Update render duration assuming we didn't error.
        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
      }
      stopWorkTimer(workInProgress);
      resetCurrentFiber();
      resetChildExpirationTime(workInProgress);

      if (next !== null) {
        // Completing this fiber spawned new work. Work on that next.
        return next;
      }

      if (returnFiber !== null &&
      // Do not append effects to parents if a sibling failed to complete
      (returnFiber.effectTag & Incomplete) === NoEffect) {
        // Append all the effects of the subtree and this fiber onto the effect
        // list of the parent. The completion order of the children affects the
        // side-effect order.
        if (returnFiber.firstEffect === null) {
          returnFiber.firstEffect = workInProgress.firstEffect;
        }
        if (workInProgress.lastEffect !== null) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
          }
          returnFiber.lastEffect = workInProgress.lastEffect;
        }

        // If this fiber had side-effects, we append it AFTER the children's
        // side-effects. We can perform certain side-effects earlier if needed,
        // by doing multiple passes over the effect list. We don't want to
        // schedule our own side-effect on our own list because if end up
        // reusing children we'll schedule this effect onto itself since we're
        // at the end.
        var effectTag = workInProgress.effectTag;

        // Skip both NoWork and PerformedWork tags when creating the effect
        // list. PerformedWork effect is read by React DevTools but shouldn't be
        // committed.
        if (effectTag > PerformedWork) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = workInProgress;
          } else {
            returnFiber.firstEffect = workInProgress;
          }
          returnFiber.lastEffect = workInProgress;
        }
      }
    } else {
      // This fiber did not complete because something threw. Pop values off
      // the stack without entering the complete phase. If this is a boundary,
      // capture values if possible.
      var _next = unwindWork(workInProgress, renderExpirationTime);

      // Because this fiber did not complete, don't reset its expiration time.

      if (enableProfilerTimer && (workInProgress.mode & ProfileMode) !== NoMode) {
        // Record the render duration for the fiber that errored.
        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);

        // Include the time spent working on failed children before continuing.
        var actualDuration = workInProgress.actualDuration;
        var child = workInProgress.child;
        while (child !== null) {
          actualDuration += child.actualDuration;
          child = child.sibling;
        }
        workInProgress.actualDuration = actualDuration;
      }

      if (_next !== null) {
        // If completing this work spawned new work, do that next. We'll come
        // back here again.
        // Since we're restarting, remove anything that is not a host effect
        // from the effect tag.
        // TODO: The name stopFailedWorkTimer is misleading because Suspense
        // also captures and restarts.
        stopFailedWorkTimer(workInProgress);
        _next.effectTag &= HostEffectMask;
        return _next;
      }
      stopWorkTimer(workInProgress);

      if (returnFiber !== null) {
        // Mark the parent fiber as incomplete and clear its effect list.
        returnFiber.firstEffect = returnFiber.lastEffect = null;
        returnFiber.effectTag |= Incomplete;
      }
    }

    var siblingFiber = workInProgress.sibling;
    if (siblingFiber !== null) {
      // If there is more work to do in this returnFiber, do that next.
      return siblingFiber;
    }
    // Otherwise, return to the parent
    workInProgress = returnFiber;
  } while (workInProgress !== null);

  // We've reached the root.
  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootCompleted;
  }
  return null;
}

function resetChildExpirationTime(completedWork) {
  if (renderExpirationTime !== Never && completedWork.childExpirationTime === Never) {
    // The children of this component are hidden. Don't bubble their
    // expiration times.
    return;
  }

  var newChildExpirationTime = NoWork;

  // Bubble up the earliest expiration time.
  if (enableProfilerTimer && (completedWork.mode & ProfileMode) !== NoMode) {
    // In profiling mode, resetChildExpirationTime is also used to reset
    // profiler durations.
    var actualDuration = completedWork.actualDuration;
    var treeBaseDuration = completedWork.selfBaseDuration;

    // When a fiber is cloned, its actualDuration is reset to 0. This value will
    // only be updated if work is done on the fiber (i.e. it doesn't bailout).
    // When work is done, it should bubble to the parent's actualDuration. If
    // the fiber has not been cloned though, (meaning no work was done), then
    // this value will reflect the amount of time spent working on a previous
    // render. In that case it should not bubble. We determine whether it was
    // cloned by comparing the child pointer.
    var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;

    var child = completedWork.child;
    while (child !== null) {
      var childUpdateExpirationTime = child.expirationTime;
      var childChildExpirationTime = child.childExpirationTime;
      if (childUpdateExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = childUpdateExpirationTime;
      }
      if (childChildExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = childChildExpirationTime;
      }
      if (shouldBubbleActualDurations) {
        actualDuration += child.actualDuration;
      }
      treeBaseDuration += child.treeBaseDuration;
      child = child.sibling;
    }
    completedWork.actualDuration = actualDuration;
    completedWork.treeBaseDuration = treeBaseDuration;
  } else {
    var _child = completedWork.child;
    while (_child !== null) {
      var _childUpdateExpirationTime = _child.expirationTime;
      var _childChildExpirationTime = _child.childExpirationTime;
      if (_childUpdateExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = _childUpdateExpirationTime;
      }
      if (_childChildExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = _childChildExpirationTime;
      }
      _child = _child.sibling;
    }
  }

  completedWork.childExpirationTime = newChildExpirationTime;
}

function commitRoot(root) {
  var renderPriorityLevel = getCurrentPriorityLevel();
  runWithPriority$2(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));
  // If there are passive effects, schedule a callback to flush them. This goes
  // outside commitRootImpl so that it inherits the priority of the render.
  if (rootWithPendingPassiveEffects !== null) {
    scheduleCallback(NormalPriority, function () {
      flushPassiveEffects();
      return null;
    });
  }
  return null;
}

function commitRootImpl(root, renderPriorityLevel) {
  flushPassiveEffects();
  flushRenderPhaseStrictModeWarningsInDEV();

  (function () {
    if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
      {
        throw ReactError(Error('Should not already be working.'));
      }
    }
  })();

  var finishedWork = root.finishedWork;
  var expirationTime = root.finishedExpirationTime;
  if (finishedWork === null) {
    return null;
  }
  root.finishedWork = null;
  root.finishedExpirationTime = NoWork;

  (function () {
    if (!(finishedWork !== root.current)) {
      {
        throw ReactError(Error('Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.'));
      }
    }
  })();

  // commitRoot never returns a continuation; it always finishes synchronously.
  // So we can clear these now to allow a new callback to be scheduled.
  root.callbackNode = null;
  root.callbackExpirationTime = NoWork;

  startCommitTimer();

  // Update the first and last pending times on this root. The new first
  // pending time is whatever is left on the root fiber.
  var updateExpirationTimeBeforeCommit = finishedWork.expirationTime;
  var childExpirationTimeBeforeCommit = finishedWork.childExpirationTime;
  var firstPendingTimeBeforeCommit = childExpirationTimeBeforeCommit > updateExpirationTimeBeforeCommit ? childExpirationTimeBeforeCommit : updateExpirationTimeBeforeCommit;
  root.firstPendingTime = firstPendingTimeBeforeCommit;
  if (firstPendingTimeBeforeCommit < root.lastPendingTime) {
    // This usually means we've finished all the work, but it can also happen
    // when something gets downprioritized during render, like a hidden tree.
    root.lastPendingTime = firstPendingTimeBeforeCommit;
  }

  if (root === workInProgressRoot) {
    // We can reset these now that they are finished.
    workInProgressRoot = null;
    workInProgress = null;
    renderExpirationTime = NoWork;
  } else {}
  // This indicates that the last root we worked on is not the same one that
  // we're committing now. This most commonly happens when a suspended root
  // times out.


  // Get the list of effects.
  var firstEffect = void 0;
  if (finishedWork.effectTag > PerformedWork) {
    // A fiber's effect list consists only of its children, not itself. So if
    // the root has an effect, we need to add it to the end of the list. The
    // resulting list is the set that would belong to the root's parent, if it
    // had one; that is, all the effects in the tree including the root.
    if (finishedWork.lastEffect !== null) {
      finishedWork.lastEffect.nextEffect = finishedWork;
      firstEffect = finishedWork.firstEffect;
    } else {
      firstEffect = finishedWork;
    }
  } else {
    // There is no effect on the root.
    firstEffect = finishedWork.firstEffect;
  }

  if (firstEffect !== null) {
    var prevExecutionContext = executionContext;
    executionContext |= CommitContext;
    var prevInteractions = null;
    if (enableSchedulerTracing) {
      prevInteractions = tracing.__interactionsRef.current;
      tracing.__interactionsRef.current = root.memoizedInteractions;
    }

    // Reset this to null before calling lifecycles
    ReactCurrentOwner$2.current = null;

    // The commit phase is broken into several sub-phases. We do a separate pass
    // of the effect list for each phase: all mutation effects come before all
    // layout effects, and so on.

    // The first phase a "before mutation" phase. We use this phase to read the
    // state of the host tree right before we mutate it. This is where
    // getSnapshotBeforeUpdate is called.
    startCommitSnapshotEffectsTimer();
    prepareForCommit(root.containerInfo);
    nextEffect = firstEffect;
    do {
      {
        invokeGuardedCallback(null, commitBeforeMutationEffects, null);
        if (hasCaughtError()) {
          (function () {
            if (!(nextEffect !== null)) {
              {
                throw ReactError(Error('Should be working on an effect.'));
              }
            }
          })();
          var error = clearCaughtError();
          captureCommitPhaseError(nextEffect, error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);
    stopCommitSnapshotEffectsTimer();

    if (enableProfilerTimer) {
      // Mark the current commit time to be shared by all Profilers in this
      // batch. This enables them to be grouped later.
      recordCommitTime();
    }

    // The next phase is the mutation phase, where we mutate the host tree.
    startCommitHostEffectsTimer();
    nextEffect = firstEffect;
    do {
      {
        invokeGuardedCallback(null, commitMutationEffects, null, renderPriorityLevel);
        if (hasCaughtError()) {
          (function () {
            if (!(nextEffect !== null)) {
              {
                throw ReactError(Error('Should be working on an effect.'));
              }
            }
          })();
          var _error = clearCaughtError();
          captureCommitPhaseError(nextEffect, _error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);
    stopCommitHostEffectsTimer();
    resetAfterCommit(root.containerInfo);

    // The work-in-progress tree is now the current tree. This must come after
    // the mutation phase, so that the previous tree is still current during
    // componentWillUnmount, but before the layout phase, so that the finished
    // work is current during componentDidMount/Update.
    root.current = finishedWork;

    // The next phase is the layout phase, where we call effects that read
    // the host tree after it's been mutated. The idiomatic use case for this is
    // layout, but class component lifecycles also fire here for legacy reasons.
    startCommitLifeCyclesTimer();
    nextEffect = firstEffect;
    do {
      {
        invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);
        if (hasCaughtError()) {
          (function () {
            if (!(nextEffect !== null)) {
              {
                throw ReactError(Error('Should be working on an effect.'));
              }
            }
          })();
          var _error2 = clearCaughtError();
          captureCommitPhaseError(nextEffect, _error2);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);
    stopCommitLifeCyclesTimer();

    nextEffect = null;

    // Tell Scheduler to yield at the end of the frame, so the browser has an
    // opportunity to paint.
    requestPaint();

    if (enableSchedulerTracing) {
      tracing.__interactionsRef.current = prevInteractions;
    }
    executionContext = prevExecutionContext;
  } else {
    // No effects.
    root.current = finishedWork;
    // Measure these anyway so the flamegraph explicitly shows that there were
    // no effects.
    // TODO: Maybe there's a better way to report this.
    startCommitSnapshotEffectsTimer();
    stopCommitSnapshotEffectsTimer();
    if (enableProfilerTimer) {
      recordCommitTime();
    }
    startCommitHostEffectsTimer();
    stopCommitHostEffectsTimer();
    startCommitLifeCyclesTimer();
    stopCommitLifeCyclesTimer();
  }

  stopCommitTimer();

  var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;

  if (rootDoesHavePassiveEffects) {
    // This commit has passive effects. Stash a reference to them. But don't
    // schedule a callback until after flushing layout work.
    rootDoesHavePassiveEffects = false;
    rootWithPendingPassiveEffects = root;
    pendingPassiveEffectsExpirationTime = expirationTime;
    pendingPassiveEffectsRenderPriority = renderPriorityLevel;
  } else {
    // We are done with the effect chain at this point so let's clear the
    // nextEffect pointers to assist with GC. If we have passive effects, we'll
    // clear this in flushPassiveEffects.
    nextEffect = firstEffect;
    while (nextEffect !== null) {
      var nextNextEffect = nextEffect.nextEffect;
      nextEffect.nextEffect = null;
      nextEffect = nextNextEffect;
    }
  }

  // Check if there's remaining work on this root
  var remainingExpirationTime = root.firstPendingTime;
  if (remainingExpirationTime !== NoWork) {
    var currentTime = requestCurrentTime();
    var priorityLevel = inferPriorityFromExpirationTime(currentTime, remainingExpirationTime);

    if (enableSchedulerTracing) {
      if (spawnedWorkDuringRender !== null) {
        var expirationTimes = spawnedWorkDuringRender;
        spawnedWorkDuringRender = null;
        for (var i = 0; i < expirationTimes.length; i++) {
          scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
        }
      }
    }

    scheduleCallbackForRoot(root, priorityLevel, remainingExpirationTime);
  } else {
    // If there's no remaining work, we can clear the set of already failed
    // error boundaries.
    legacyErrorBoundariesThatAlreadyFailed = null;
  }

  if (enableSchedulerTracing) {
    if (!rootDidHavePassiveEffects) {
      // If there are no passive effects, then we can complete the pending interactions.
      // Otherwise, we'll wait until after the passive effects are flushed.
      // Wait to do this until after remaining work has been scheduled,
      // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
      finishPendingInteractions(root, expirationTime);
    }
  }

  onCommitRoot(finishedWork.stateNode, expirationTime);

  if (remainingExpirationTime === Sync) {
    // Count the number of times the root synchronously re-renders without
    // finishing. If there are too many, it indicates an infinite update loop.
    if (root === rootWithNestedUpdates) {
      nestedUpdateCount++;
    } else {
      nestedUpdateCount = 0;
      rootWithNestedUpdates = root;
    }
  } else {
    nestedUpdateCount = 0;
  }

  if (hasUncaughtError) {
    hasUncaughtError = false;
    var _error3 = firstUncaughtError;
    firstUncaughtError = null;
    throw _error3;
  }

  if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
    // This is a legacy edge case. We just committed the initial mount of
    // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
    // synchronously, but layout updates should be deferred until the end
    // of the batch.
    return null;
  }

  // If layout work was scheduled, flush it now.
  flushSyncCallbackQueue();
  return null;
}

function commitBeforeMutationEffects() {
  while (nextEffect !== null) {
    if ((nextEffect.effectTag & Snapshot) !== NoEffect) {
      setCurrentFiber(nextEffect);
      recordEffect();

      var current$$1 = nextEffect.alternate;
      commitBeforeMutationLifeCycles(current$$1, nextEffect);

      resetCurrentFiber();
    }
    nextEffect = nextEffect.nextEffect;
  }
}

function commitMutationEffects(renderPriorityLevel) {
  // TODO: Should probably move the bulk of this function to commitWork.
  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);

    var effectTag = nextEffect.effectTag;

    if (effectTag & ContentReset) {
      commitResetTextContent(nextEffect);
    }

    if (effectTag & Ref) {
      var current$$1 = nextEffect.alternate;
      if (current$$1 !== null) {
        commitDetachRef(current$$1);
      }
    }

    // The following switch statement is only concerned about placement,
    // updates, and deletions. To avoid needing to add a case for every possible
    // bitmap value, we remove the secondary effects from the effect tag and
    // switch on that value.
    var primaryEffectTag = effectTag & (Placement | Update | Deletion);
    switch (primaryEffectTag) {
      case Placement:
        {
          commitPlacement(nextEffect);
          // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.
          // TODO: findDOMNode doesn't rely on this any more but isMounted does
          // and isMounted is deprecated anyway so we should be able to kill this.
          nextEffect.effectTag &= ~Placement;
          break;
        }
      case PlacementAndUpdate:
        {
          // Placement
          commitPlacement(nextEffect);
          // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.
          nextEffect.effectTag &= ~Placement;

          // Update
          var _current = nextEffect.alternate;
          commitWork(_current, nextEffect);
          break;
        }
      case Update:
        {
          var _current2 = nextEffect.alternate;
          commitWork(_current2, nextEffect);
          break;
        }
      case Deletion:
        {
          commitDeletion(nextEffect, renderPriorityLevel);
          break;
        }
    }

    // TODO: Only record a mutation effect if primaryEffectTag is non-zero.
    recordEffect();

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function commitLayoutEffects(root, committedExpirationTime) {
  // TODO: Should probably move the bulk of this function to commitWork.
  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);

    var effectTag = nextEffect.effectTag;

    if (effectTag & (Update | Callback)) {
      recordEffect();
      var current$$1 = nextEffect.alternate;
      commitLifeCycles(root, current$$1, nextEffect, committedExpirationTime);
    }

    if (effectTag & Ref) {
      recordEffect();
      commitAttachRef(nextEffect);
    }

    if (effectTag & Passive) {
      rootDoesHavePassiveEffects = true;
    }

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function flushPassiveEffects() {
  if (rootWithPendingPassiveEffects === null) {
    return false;
  }
  var root = rootWithPendingPassiveEffects;
  var expirationTime = pendingPassiveEffectsExpirationTime;
  var renderPriorityLevel = pendingPassiveEffectsRenderPriority;
  rootWithPendingPassiveEffects = null;
  pendingPassiveEffectsExpirationTime = NoWork;
  pendingPassiveEffectsRenderPriority = NoPriority;
  var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
  return runWithPriority$2(priorityLevel, flushPassiveEffectsImpl.bind(null, root, expirationTime));
}

function flushPassiveEffectsImpl(root, expirationTime) {
  var prevInteractions = null;
  if (enableSchedulerTracing) {
    prevInteractions = tracing.__interactionsRef.current;
    tracing.__interactionsRef.current = root.memoizedInteractions;
  }

  (function () {
    if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
      {
        throw ReactError(Error('Cannot flush passive effects while already rendering.'));
      }
    }
  })();
  var prevExecutionContext = executionContext;
  executionContext |= CommitContext;

  // Note: This currently assumes there are no passive effects on the root
  // fiber, because the root is not part of its own effect list. This could
  // change in the future.
  var effect = root.current.firstEffect;
  while (effect !== null) {
    {
      setCurrentFiber(effect);
      invokeGuardedCallback(null, commitPassiveHookEffects, null, effect);
      if (hasCaughtError()) {
        (function () {
          if (!(effect !== null)) {
            {
              throw ReactError(Error('Should be working on an effect.'));
            }
          }
        })();
        var error = clearCaughtError();
        captureCommitPhaseError(effect, error);
      }
      resetCurrentFiber();
    }
    var nextNextEffect = effect.nextEffect;
    // Remove nextEffect pointer to assist GC
    effect.nextEffect = null;
    effect = nextNextEffect;
  }

  if (enableSchedulerTracing) {
    tracing.__interactionsRef.current = prevInteractions;
    finishPendingInteractions(root, expirationTime);
  }

  executionContext = prevExecutionContext;
  flushSyncCallbackQueue();

  // If additional passive effects were scheduled, increment a counter. If this
  // exceeds the limit, we'll fire a warning.
  nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;

  return true;
}

function isAlreadyFailedLegacyErrorBoundary(instance) {
  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
}

function markLegacyErrorBoundaryAsFailed(instance) {
  if (legacyErrorBoundariesThatAlreadyFailed === null) {
    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  } else {
    legacyErrorBoundariesThatAlreadyFailed.add(instance);
  }
}

function prepareToThrowUncaughtError(error) {
  if (!hasUncaughtError) {
    hasUncaughtError = true;
    firstUncaughtError = error;
  }
}
var onUncaughtError = prepareToThrowUncaughtError;

function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  var errorInfo = createCapturedValue(error, sourceFiber);
  var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
  enqueueUpdate(rootFiber, update);
  var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
  if (root !== null) {
    scheduleCallbackForRoot(root, ImmediatePriority, Sync);
  }
}

function captureCommitPhaseError(sourceFiber, error) {
  if (sourceFiber.tag === HostRoot) {
    // Error was thrown at the root. There is no parent, so the root
    // itself should capture it.
    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
    return;
  }

  var fiber = sourceFiber.return;
  while (fiber !== null) {
    if (fiber.tag === HostRoot) {
      captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
      return;
    } else if (fiber.tag === ClassComponent) {
      var ctor = fiber.type;
      var instance = fiber.stateNode;
      if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
        var errorInfo = createCapturedValue(error, sourceFiber);
        var update = createClassErrorUpdate(fiber, errorInfo,
        // TODO: This is always sync
        Sync);
        enqueueUpdate(fiber, update);
        var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
        if (root !== null) {
          scheduleCallbackForRoot(root, ImmediatePriority, Sync);
        }
        return;
      }
    }
    fiber = fiber.return;
  }
}

function pingSuspendedRoot(root, thenable, suspendedTime) {
  var pingCache = root.pingCache;
  if (pingCache !== null) {
    // The thenable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    pingCache.delete(thenable);
  }

  if (workInProgressRoot === root && renderExpirationTime === suspendedTime) {
    // Received a ping at the same priority level at which we're currently
    // rendering. We might want to restart this render. This should mirror
    // the logic of whether or not a root suspends once it completes.

    // TODO: If we're rendering sync either due to Sync, Batched or expired,
    // we should probably never restart.

    // If we're suspended with delay, we'll always suspend so we can always
    // restart. If we're suspended without any updates, it might be a retry.
    // If it's early in the retry we can restart. We can't know for sure
    // whether we'll eventually process an update during this render pass,
    // but it's somewhat unlikely that we get to a ping before that, since
    // getting to the root most update is usually very fast.
    if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
      // Restart from the root. Don't need to schedule a ping because
      // we're already working on this tree.
      prepareFreshStack(root, renderExpirationTime);
    } else {
      // Even though we can't restart right now, we might get an
      // opportunity later. So we mark this render as having a ping.
      workInProgressRootHasPendingPing = true;
    }
    return;
  }

  var lastPendingTime = root.lastPendingTime;
  if (lastPendingTime < suspendedTime) {
    // The root is no longer suspended at this time.
    return;
  }

  var pingTime = root.pingTime;
  if (pingTime !== NoWork && pingTime < suspendedTime) {
    // There's already a lower priority ping scheduled.
    return;
  }

  // Mark the time at which this ping was scheduled.
  root.pingTime = suspendedTime;

  if (root.finishedExpirationTime === suspendedTime) {
    // If there's a pending fallback waiting to commit, throw it away.
    root.finishedExpirationTime = NoWork;
    root.finishedWork = null;
  }

  var currentTime = requestCurrentTime();
  var priorityLevel = inferPriorityFromExpirationTime(currentTime, suspendedTime);
  scheduleCallbackForRoot(root, priorityLevel, suspendedTime);
}

function retryTimedOutBoundary(boundaryFiber) {
  // The boundary fiber (a Suspense component or SuspenseList component)
  // previously was rendered in its fallback state. One of the promises that
  // suspended it has resolved, which means at least part of the tree was
  // likely unblocked. Try rendering again, at a new expiration time.
  var currentTime = requestCurrentTime();
  var suspenseConfig = null; // Retries don't carry over the already committed update.
  var retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
  // TODO: Special case idle priority?
  var priorityLevel = inferPriorityFromExpirationTime(currentTime, retryTime);
  var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
  if (root !== null) {
    scheduleCallbackForRoot(root, priorityLevel, retryTime);
  }
}

function resolveRetryThenable(boundaryFiber, thenable) {
  var retryCache = void 0;
  if (enableSuspenseServerRenderer) {
    switch (boundaryFiber.tag) {
      case SuspenseComponent:
        retryCache = boundaryFiber.stateNode;
        break;
      case DehydratedSuspenseComponent:
        retryCache = boundaryFiber.memoizedState;
        break;
      default:
        (function () {
          {
            {
              throw ReactError(Error('Pinged unknown suspense boundary type. This is probably a bug in React.'));
            }
          }
        })();
    }
  } else {
    retryCache = boundaryFiber.stateNode;
  }

  if (retryCache !== null) {
    // The thenable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    retryCache.delete(thenable);
  }

  retryTimedOutBoundary(boundaryFiber);
}

// Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
}

function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
  var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
  if (busyMinDurationMs <= 0) {
    return 0;
  }
  var busyDelayMs = suspenseConfig.busyDelayMs | 0;

  // Compute the time until this render pass would expire.
  var currentTimeMs = now();
  var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
  var timeElapsed = currentTimeMs - eventTimeMs;
  if (timeElapsed <= busyDelayMs) {
    // If we haven't yet waited longer than the initial delay, we don't
    // have to wait any additional time.
    return 0;
  }
  var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed;
  // This is the value that is passed to `setTimeout`.
  return msUntilTimeout;
}

function checkForNestedUpdates() {
  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
    nestedUpdateCount = 0;
    rootWithNestedUpdates = null;
    (function () {
      {
        {
          throw ReactError(Error('Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.'));
        }
      }
    })();
  }

  {
    if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
      nestedPassiveUpdateCount = 0;
      warning$1(false, 'Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
    }
  }
}

function flushRenderPhaseStrictModeWarningsInDEV() {
  {
    ReactStrictModeWarnings.flushLegacyContextWarning();

    if (warnAboutDeprecatedLifecycles) {
      ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
    }
  }
}

function stopFinishedWorkLoopTimer() {
  var didCompleteRoot = true;
  stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  interruptedBy = null;
}

function stopInterruptedWorkLoopTimer() {
  // TODO: Track which fiber caused the interruption.
  var didCompleteRoot = false;
  stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  interruptedBy = null;
}

function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
  if (enableUserTimingAPI && workInProgressRoot !== null && updateExpirationTime > renderExpirationTime) {
    interruptedBy = fiberThatReceivedUpdate;
  }
}

var didWarnStateUpdateForUnmountedComponent = null;
function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
  {
    var tag = fiber.tag;
    if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
      // Only warn for user-defined components, not internal ones like Suspense.
      return;
    }
    // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.
    var componentName = getComponentName(fiber.type) || 'ReactComponent';
    if (didWarnStateUpdateForUnmountedComponent !== null) {
      if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
        return;
      }
      didWarnStateUpdateForUnmountedComponent.add(componentName);
    } else {
      didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
    }
    warningWithoutStack$1(false, "Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
  }
}

var beginWork$$1 = void 0;
if ( true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
  var dummyFiber = null;
  beginWork$$1 = function (current$$1, unitOfWork, expirationTime) {
    // If a component throws an error, we replay it again in a synchronously
    // dispatched event, so that the debugger will treat it as an uncaught
    // error See ReactErrorUtils for more information.

    // Before entering the begin phase, copy the work-in-progress onto a dummy
    // fiber. If beginWork throws, we'll use this to reset the state.
    var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
    try {
      return beginWork$1(current$$1, unitOfWork, expirationTime);
    } catch (originalError) {
      if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
        // Don't replay promises. Treat everything else like an error.
        throw originalError;
      }

      // Keep this code in sync with renderRoot; any changes here must have
      // corresponding changes there.
      resetContextDependencies();
      resetHooks();

      // Unwind the failed stack frame
      unwindInterruptedWork(unitOfWork);

      // Restore the original properties of the fiber.
      assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);

      if (enableProfilerTimer && unitOfWork.mode & ProfileMode) {
        // Reset the profiler timer.
        startProfilerTimer(unitOfWork);
      }

      // Run beginWork again.
      invokeGuardedCallback(null, beginWork$1, null, current$$1, unitOfWork, expirationTime);

      if (hasCaughtError()) {
        var replayError = clearCaughtError();
        // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
        // Rethrow this error instead of the original one.
        throw replayError;
      } else {
        // This branch is reachable if the render phase is impure.
        throw originalError;
      }
    }
  };
} else {
  beginWork$$1 = beginWork$1;
}

var didWarnAboutUpdateInRender = false;
var didWarnAboutUpdateInGetChildContext = false;
function warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber) {
  {
    if (fiber.tag === ClassComponent) {
      switch (phase) {
        case 'getChildContext':
          if (didWarnAboutUpdateInGetChildContext) {
            return;
          }
          warningWithoutStack$1(false, 'setState(...): Cannot call setState() inside getChildContext()');
          didWarnAboutUpdateInGetChildContext = true;
          break;
        case 'render':
          if (didWarnAboutUpdateInRender) {
            return;
          }
          warningWithoutStack$1(false, 'Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure function of ' + 'props and state.');
          didWarnAboutUpdateInRender = true;
          break;
      }
    }
  }
}

// a 'shared' variable that changes when act() opens/closes in tests.
var IsThisRendererActing = { current: false };

function warnIfNotScopedWithMatchingAct(fiber) {
  {
    if (warnsIfNotActing === true && IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
      warningWithoutStack$1(false, "It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '//...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '//...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));
    }
  }
}

function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
  {
    if (warnsIfNotActing === true && (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      warningWithoutStack$1(false, 'An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
    }
  }
}

function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
  {
    if (warnsIfNotActing === true && executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
    }
  }
}

var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;

// In tests, we want to enforce a mocked scheduler.
var didWarnAboutUnmockedScheduler = false;
// TODO Before we release concurrent mode, revisit this and decide whether a mocked
// scheduler is the actual recommendation. The alternative could be a testing build,
// a new lib, or whatever; we dunno just yet. This message is for early adopters
// to get their tests right.

function warnIfUnmockedScheduler(fiber) {
  {
    if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
      if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {
        didWarnAboutUnmockedScheduler = true;
        warningWithoutStack$1(false, 'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
      } else if (warnAboutUnmockedScheduler === true) {
        didWarnAboutUnmockedScheduler = true;
        warningWithoutStack$1(false, 'Starting from React v17, the "scheduler" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
      }
    }
  }
}

var componentsThatTriggeredHighPriSuspend = null;
function checkForWrongSuspensePriorityInDEV(sourceFiber) {
  {
    var currentPriorityLevel = getCurrentPriorityLevel();
    if ((sourceFiber.mode & ConcurrentMode) !== NoEffect && (currentPriorityLevel === UserBlockingPriority$2 || currentPriorityLevel === ImmediatePriority)) {
      var workInProgressNode = sourceFiber;
      while (workInProgressNode !== null) {
        // Add the component that triggered the suspense
        var current$$1 = workInProgressNode.alternate;
        if (current$$1 !== null) {
          // TODO: warn component that triggers the high priority
          // suspend is the HostRoot
          switch (workInProgressNode.tag) {
            case ClassComponent:
              // Loop through the component's update queue and see whether the component
              // has triggered any high priority updates
              var updateQueue = current$$1.updateQueue;
              if (updateQueue !== null) {
                var update = updateQueue.firstUpdate;
                while (update !== null) {
                  var priorityLevel = update.priority;
                  if (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority) {
                    if (componentsThatTriggeredHighPriSuspend === null) {
                      componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
                    } else {
                      componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
                    }
                    break;
                  }
                  update = update.next;
                }
              }
              break;
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent:
              if (workInProgressNode.memoizedState !== null && workInProgressNode.memoizedState.baseUpdate !== null) {
                var _update = workInProgressNode.memoizedState.baseUpdate;
                // Loop through the functional component's memoized state to see whether
                // the component has triggered any high pri updates
                while (_update !== null) {
                  var priority = _update.priority;
                  if (priority === UserBlockingPriority$2 || priority === ImmediatePriority) {
                    if (componentsThatTriggeredHighPriSuspend === null) {
                      componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
                    } else {
                      componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
                    }
                    break;
                  }
                  if (_update.next === workInProgressNode.memoizedState.baseUpdate) {
                    break;
                  }
                  _update = _update.next;
                }
              }
              break;
            default:
              break;
          }
        }
        workInProgressNode = workInProgressNode.return;
      }
    }
  }
}

function flushSuspensePriorityWarningInDEV() {
  {
    if (componentsThatTriggeredHighPriSuspend !== null) {
      var componentNames = [];
      componentsThatTriggeredHighPriSuspend.forEach(function (name) {
        return componentNames.push(name);
      });
      componentsThatTriggeredHighPriSuspend = null;

      if (componentNames.length > 0) {
        warningWithoutStack$1(false, '%s triggered a user-blocking update that suspended.' + '\n\n' + 'The fix is to split the update into multiple parts: a user-blocking ' + 'update to provide immediate feedback, and another update that ' + 'triggers the bulk of the changes.' + '\n\n' + 'Refer to the documentation for useSuspenseTransition to learn how ' + 'to implement this pattern.',
        // TODO: Add link to React docs with more information, once it exists
        componentNames.sort().join(', '));
      }
    }
  }
}

function computeThreadID(root, expirationTime) {
  // Interaction threads are unique per root and expiration time.
  return expirationTime * 1000 + root.interactionThreadID;
}

function markSpawnedWork(expirationTime) {
  if (!enableSchedulerTracing) {
    return;
  }
  if (spawnedWorkDuringRender === null) {
    spawnedWorkDuringRender = [expirationTime];
  } else {
    spawnedWorkDuringRender.push(expirationTime);
  }
}

function scheduleInteractions(root, expirationTime, interactions) {
  if (!enableSchedulerTracing) {
    return;
  }

  if (interactions.size > 0) {
    var pendingInteractionMap = root.pendingInteractionMap;
    var pendingInteractions = pendingInteractionMap.get(expirationTime);
    if (pendingInteractions != null) {
      interactions.forEach(function (interaction) {
        if (!pendingInteractions.has(interaction)) {
          // Update the pending async work count for previously unscheduled interaction.
          interaction.__count++;
        }

        pendingInteractions.add(interaction);
      });
    } else {
      pendingInteractionMap.set(expirationTime, new Set(interactions));

      // Update the pending async work count for the current interactions.
      interactions.forEach(function (interaction) {
        interaction.__count++;
      });
    }

    var subscriber = tracing.__subscriberRef.current;
    if (subscriber !== null) {
      var threadID = computeThreadID(root, expirationTime);
      subscriber.onWorkScheduled(interactions, threadID);
    }
  }
}

function schedulePendingInteractions(root, expirationTime) {
  // This is called when work is scheduled on a root.
  // It associates the current interactions with the newly-scheduled expiration.
  // They will be restored when that expiration is later committed.
  if (!enableSchedulerTracing) {
    return;
  }

  scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);
}

function startWorkOnPendingInteractions(root, expirationTime) {
  // This is called when new work is started on a root.
  if (!enableSchedulerTracing) {
    return;
  }

  // Determine which interactions this batch of work currently includes, So that
  // we can accurately attribute time spent working on it, And so that cascading
  // work triggered during the render phase will be associated with it.
  var interactions = new Set();
  root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
    if (scheduledExpirationTime >= expirationTime) {
      scheduledInteractions.forEach(function (interaction) {
        return interactions.add(interaction);
      });
    }
  });

  // Store the current set of interactions on the FiberRoot for a few reasons:
  // We can re-use it in hot functions like renderRoot() without having to
  // recalculate it. We will also use it in commitWork() to pass to any Profiler
  // onRender() hooks. This also provides DevTools with a way to access it when
  // the onCommitRoot() hook is called.
  root.memoizedInteractions = interactions;

  if (interactions.size > 0) {
    var subscriber = tracing.__subscriberRef.current;
    if (subscriber !== null) {
      var threadID = computeThreadID(root, expirationTime);
      try {
        subscriber.onWorkStarted(interactions, threadID);
      } catch (error) {
        // If the subscriber throws, rethrow it in a separate task
        scheduleCallback(ImmediatePriority, function () {
          throw error;
        });
      }
    }
  }
}

function finishPendingInteractions(root, committedExpirationTime) {
  if (!enableSchedulerTracing) {
    return;
  }

  var earliestRemainingTimeAfterCommit = root.firstPendingTime;

  var subscriber = void 0;

  try {
    subscriber = tracing.__subscriberRef.current;
    if (subscriber !== null && root.memoizedInteractions.size > 0) {
      var threadID = computeThreadID(root, committedExpirationTime);
      subscriber.onWorkStopped(root.memoizedInteractions, threadID);
    }
  } catch (error) {
    // If the subscriber throws, rethrow it in a separate task
    scheduleCallback(ImmediatePriority, function () {
      throw error;
    });
  } finally {
    // Clear completed interactions from the pending Map.
    // Unless the render was suspended or cascading work was scheduled,
    // In which case– leave pending interactions until the subsequent render.
    var pendingInteractionMap = root.pendingInteractionMap;
    pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
      // Only decrement the pending interaction count if we're done.
      // If there's still work at the current priority,
      // That indicates that we are waiting for suspense data.
      if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
        pendingInteractionMap.delete(scheduledExpirationTime);

        scheduledInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            try {
              subscriber.onInteractionScheduledWorkCompleted(interaction);
            } catch (error) {
              // If the subscriber throws, rethrow it in a separate task
              scheduleCallback(ImmediatePriority, function () {
                throw error;
              });
            }
          }
        });
      }
    });
  }
}

var onCommitFiberRoot = null;
var onCommitFiberUnmount = null;
var hasLoggedError = false;

var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';

function injectInternals(internals) {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
    // No DevTools
    return false;
  }
  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (hook.isDisabled) {
    // This isn't a real property on the hook, but it can be set to opt out
    // of DevTools integration and associated warnings and logs.
    // https://github.com/facebook/react/issues/3877
    return true;
  }
  if (!hook.supportsFiber) {
    {
      warningWithoutStack$1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
    }
    // DevTools exists, even though it doesn't support Fiber.
    return true;
  }
  try {
    var rendererID = hook.inject(internals);
    // We have successfully injected, so now it is safe to set up hooks.
    onCommitFiberRoot = function (root, expirationTime) {
      try {
        var didError = (root.current.effectTag & DidCapture) === DidCapture;
        if (enableProfilerTimer) {
          var currentTime = requestCurrentTime();
          var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
          hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
        } else {
          hook.onCommitFiberRoot(rendererID, root, undefined, didError);
        }
      } catch (err) {
        if ( true && !hasLoggedError) {
          hasLoggedError = true;
          warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
        }
      }
    };
    onCommitFiberUnmount = function (fiber) {
      try {
        hook.onCommitFiberUnmount(rendererID, fiber);
      } catch (err) {
        if ( true && !hasLoggedError) {
          hasLoggedError = true;
          warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
        }
      }
    };
  } catch (err) {
    // Catch all errors because it is unsafe to throw during initialization.
    {
      warningWithoutStack$1(false, 'React DevTools encountered an error: %s.', err);
    }
  }
  // DevTools exists
  return true;
}

function onCommitRoot(root, expirationTime) {
  if (typeof onCommitFiberRoot === 'function') {
    onCommitFiberRoot(root, expirationTime);
  }
}

function onCommitUnmount(fiber) {
  if (typeof onCommitFiberUnmount === 'function') {
    onCommitFiberUnmount(fiber);
  }
}

var hasBadMapPolyfill = void 0;

{
  hasBadMapPolyfill = false;
  try {
    var nonExtensibleObject = Object.preventExtensions({});
    var testMap = new Map([[nonExtensibleObject, null]]);
    var testSet = new Set([nonExtensibleObject]);
    // This is necessary for Rollup to not consider these unused.
    // https://github.com/rollup/rollup/issues/1771
    // TODO: we can remove these if Rollup fixes the bug.
    testMap.set(0, 0);
    testSet.add(0);
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

// A Fiber is work on a Component that needs to be done or was done. There can
// be more than one per component.


var debugCounter = void 0;

{
  debugCounter = 1;
}

function FiberNode(tag, pendingProps, key, mode) {
  // Instance
  this.tag = tag;
  this.key = key;
  this.elementType = null;
  this.type = null;
  this.stateNode = null;

  // Fiber
  this.return = null;
  this.child = null;
  this.sibling = null;
  this.index = 0;

  this.ref = null;

  this.pendingProps = pendingProps;
  this.memoizedProps = null;
  this.updateQueue = null;
  this.memoizedState = null;
  this.dependencies = null;

  this.mode = mode;

  // Effects
  this.effectTag = NoEffect;
  this.nextEffect = null;

  this.firstEffect = null;
  this.lastEffect = null;

  this.expirationTime = NoWork;
  this.childExpirationTime = NoWork;

  this.alternate = null;

  if (enableProfilerTimer) {
    // Note: The following is done to avoid a v8 performance cliff.
    //
    // Initializing the fields below to smis and later updating them with
    // double values will cause Fibers to end up having separate shapes.
    // This behavior/bug has something to do with Object.preventExtension().
    // Fortunately this only impacts DEV builds.
    // Unfortunately it makes React unusably slow for some applications.
    // To work around this, initialize the fields below with doubles.
    //
    // Learn more about this here:
    // https://github.com/facebook/react/issues/14365
    // https://bugs.chromium.org/p/v8/issues/detail?id=8538
    this.actualDuration = Number.NaN;
    this.actualStartTime = Number.NaN;
    this.selfBaseDuration = Number.NaN;
    this.treeBaseDuration = Number.NaN;

    // It's okay to replace the initial doubles with smis after initialization.
    // This won't trigger the performance cliff mentioned above,
    // and it simplifies other profiler code (including DevTools).
    this.actualDuration = 0;
    this.actualStartTime = -1;
    this.selfBaseDuration = 0;
    this.treeBaseDuration = 0;
  }

  {
    this._debugID = debugCounter++;
    this._debugSource = null;
    this._debugOwner = null;
    this._debugIsCurrentlyTiming = false;
    this._debugNeedsRemount = false;
    this._debugHookTypes = null;
    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
      Object.preventExtensions(this);
    }
  }
}

// This is a constructor function, rather than a POJO constructor, still
// please ensure we do the following:
// 1) Nobody should add any instance methods on this. Instance methods can be
//    more difficult to predict when they get optimized and they are almost
//    never inlined properly in static compilers.
// 2) Nobody should rely on `instanceof Fiber` for type testing. We should
//    always know when it is a fiber.
// 3) We might want to experiment with using numeric keys since they are easier
//    to optimize in a non-JIT environment.
// 4) We can easily go from a constructor to a createFiber object literal if that
//    is faster.
// 5) It should be easy to port this to a C struct and keep a C implementation
//    compatible.
var createFiber = function (tag, pendingProps, key, mode) {
  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  return new FiberNode(tag, pendingProps, key, mode);
};

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function isSimpleFunctionComponent(type) {
  return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
}

function resolveLazyComponentTag(Component) {
  if (typeof Component === 'function') {
    return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
  } else if (Component !== undefined && Component !== null) {
    var $$typeof = Component.$$typeof;
    if ($$typeof === REACT_FORWARD_REF_TYPE) {
      return ForwardRef;
    }
    if ($$typeof === REACT_MEMO_TYPE) {
      return MemoComponent;
    }
  }
  return IndeterminateComponent;
}

// This is used to create an alternate fiber to do work on.
function createWorkInProgress(current, pendingProps, expirationTime) {
  var workInProgress = current.alternate;
  if (workInProgress === null) {
    // We use a double buffering pooling technique because we know that we'll
    // only ever need at most two versions of a tree. We pool the "other" unused
    // node that we're free to reuse. This is lazily created to avoid allocating
    // extra objects for things that are never updated. It also allow us to
    // reclaim the extra memory if needed.
    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
    workInProgress.elementType = current.elementType;
    workInProgress.type = current.type;
    workInProgress.stateNode = current.stateNode;

    {
      // DEV-only fields
      workInProgress._debugID = current._debugID;
      workInProgress._debugSource = current._debugSource;
      workInProgress._debugOwner = current._debugOwner;
      workInProgress._debugHookTypes = current._debugHookTypes;
    }

    workInProgress.alternate = current;
    current.alternate = workInProgress;
  } else {
    workInProgress.pendingProps = pendingProps;

    // We already have an alternate.
    // Reset the effect tag.
    workInProgress.effectTag = NoEffect;

    // The effect list is no longer valid.
    workInProgress.nextEffect = null;
    workInProgress.firstEffect = null;
    workInProgress.lastEffect = null;

    if (enableProfilerTimer) {
      // We intentionally reset, rather than copy, actualDuration & actualStartTime.
      // This prevents time from endlessly accumulating in new commits.
      // This has the downside of resetting values for different priority renders,
      // But works for yielding (the common case) and should support resuming.
      workInProgress.actualDuration = 0;
      workInProgress.actualStartTime = -1;
    }
  }

  workInProgress.childExpirationTime = current.childExpirationTime;
  workInProgress.expirationTime = current.expirationTime;

  workInProgress.child = current.child;
  workInProgress.memoizedProps = current.memoizedProps;
  workInProgress.memoizedState = current.memoizedState;
  workInProgress.updateQueue = current.updateQueue;

  // Clone the dependencies object. This is mutated during the render phase, so
  // it cannot be shared with the current fiber.
  var currentDependencies = current.dependencies;
  workInProgress.dependencies = currentDependencies === null ? null : {
    expirationTime: currentDependencies.expirationTime,
    firstContext: currentDependencies.firstContext,
    responders: currentDependencies.responders
  };

  // These will be overridden during the parent's reconciliation
  workInProgress.sibling = current.sibling;
  workInProgress.index = current.index;
  workInProgress.ref = current.ref;

  if (enableProfilerTimer) {
    workInProgress.selfBaseDuration = current.selfBaseDuration;
    workInProgress.treeBaseDuration = current.treeBaseDuration;
  }

  {
    workInProgress._debugNeedsRemount = current._debugNeedsRemount;
    switch (workInProgress.tag) {
      case IndeterminateComponent:
      case FunctionComponent:
      case SimpleMemoComponent:
        workInProgress.type = resolveFunctionForHotReloading(current.type);
        break;
      case ClassComponent:
        workInProgress.type = resolveClassForHotReloading(current.type);
        break;
      case ForwardRef:
        workInProgress.type = resolveForwardRefForHotReloading(current.type);
        break;
      default:
        break;
    }
  }

  return workInProgress;
}

// Used to reuse a Fiber for a second pass.
function resetWorkInProgress(workInProgress, renderExpirationTime) {
  // This resets the Fiber to what createFiber or createWorkInProgress would
  // have set the values to before during the first pass. Ideally this wouldn't
  // be necessary but unfortunately many code paths reads from the workInProgress
  // when they should be reading from current and writing to workInProgress.

  // We assume pendingProps, index, key, ref, return are still untouched to
  // avoid doing another reconciliation.

  // Reset the effect tag but keep any Placement tags, since that's something
  // that child fiber is setting, not the reconciliation.
  workInProgress.effectTag &= Placement;

  // The effect list is no longer valid.
  workInProgress.nextEffect = null;
  workInProgress.firstEffect = null;
  workInProgress.lastEffect = null;

  var current = workInProgress.alternate;
  if (current === null) {
    // Reset to createFiber's initial values.
    workInProgress.childExpirationTime = NoWork;
    workInProgress.expirationTime = renderExpirationTime;

    workInProgress.child = null;
    workInProgress.memoizedProps = null;
    workInProgress.memoizedState = null;
    workInProgress.updateQueue = null;

    workInProgress.dependencies = null;

    if (enableProfilerTimer) {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = 0;
      workInProgress.treeBaseDuration = 0;
    }
  } else {
    // Reset to the cloned values that createWorkInProgress would've.
    workInProgress.childExpirationTime = current.childExpirationTime;
    workInProgress.expirationTime = current.expirationTime;

    workInProgress.child = current.child;
    workInProgress.memoizedProps = current.memoizedProps;
    workInProgress.memoizedState = current.memoizedState;
    workInProgress.updateQueue = current.updateQueue;

    // Clone the dependencies object. This is mutated during the render phase, so
    // it cannot be shared with the current fiber.
    var currentDependencies = current.dependencies;
    workInProgress.dependencies = currentDependencies === null ? null : {
      expirationTime: currentDependencies.expirationTime,
      firstContext: currentDependencies.firstContext,
      responders: currentDependencies.responders
    };

    if (enableProfilerTimer) {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = current.selfBaseDuration;
      workInProgress.treeBaseDuration = current.treeBaseDuration;
    }
  }

  return workInProgress;
}

function createHostRootFiber(tag) {
  var mode = void 0;
  if (tag === ConcurrentRoot) {
    mode = ConcurrentMode | BatchedMode | StrictMode;
  } else if (tag === BatchedRoot) {
    mode = BatchedMode | StrictMode;
  } else {
    mode = NoMode;
  }

  if (enableProfilerTimer && isDevToolsPresent) {
    // Always collect profile timings when DevTools are present.
    // This enables DevTools to start capturing timing at any point–
    // Without some nodes in the tree having empty base times.
    mode |= ProfileMode;
  }

  return createFiber(HostRoot, null, null, mode);
}

function createFiberFromTypeAndProps(type, // React$ElementType
key, pendingProps, owner, mode, expirationTime) {
  var fiber = void 0;

  var fiberTag = IndeterminateComponent;
  // The resolved type is set if we know what the final type will be. I.e. it's not lazy.
  var resolvedType = type;
  if (typeof type === 'function') {
    if (shouldConstruct(type)) {
      fiberTag = ClassComponent;
      {
        resolvedType = resolveClassForHotReloading(resolvedType);
      }
    } else {
      {
        resolvedType = resolveFunctionForHotReloading(resolvedType);
      }
    }
  } else if (typeof type === 'string') {
    fiberTag = HostComponent;
  } else {
    getTag: switch (type) {
      case REACT_FRAGMENT_TYPE:
        return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
      case REACT_CONCURRENT_MODE_TYPE:
        fiberTag = Mode;
        mode |= ConcurrentMode | BatchedMode | StrictMode;
        break;
      case REACT_STRICT_MODE_TYPE:
        fiberTag = Mode;
        mode |= StrictMode;
        break;
      case REACT_PROFILER_TYPE:
        return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
      case REACT_SUSPENSE_TYPE:
        return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
      case REACT_SUSPENSE_LIST_TYPE:
        return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
      default:
        {
          if (typeof type === 'object' && type !== null) {
            switch (type.$$typeof) {
              case REACT_PROVIDER_TYPE:
                fiberTag = ContextProvider;
                break getTag;
              case REACT_CONTEXT_TYPE:
                // This is a consumer
                fiberTag = ContextConsumer;
                break getTag;
              case REACT_FORWARD_REF_TYPE:
                fiberTag = ForwardRef;
                {
                  resolvedType = resolveForwardRefForHotReloading(resolvedType);
                }
                break getTag;
              case REACT_MEMO_TYPE:
                fiberTag = MemoComponent;
                break getTag;
              case REACT_LAZY_TYPE:
                fiberTag = LazyComponent;
                resolvedType = null;
                break getTag;
              case REACT_FUNDAMENTAL_TYPE:
                if (enableFundamentalAPI) {
                  return createFiberFromFundamental(type, pendingProps, mode, expirationTime, key);
                }
                break;
            }
          }
          var info = '';
          {
            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
              info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
            }
            var ownerName = owner ? getComponentName(owner.type) : null;
            if (ownerName) {
              info += '\n\nCheck the render method of `' + ownerName + '`.';
            }
          }
          (function () {
            {
              {
                throw ReactError(Error('Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ' + (type == null ? type : typeof type) + '.' + info));
              }
            }
          })();
        }
    }
  }

  fiber = createFiber(fiberTag, pendingProps, key, mode);
  fiber.elementType = type;
  fiber.type = resolvedType;
  fiber.expirationTime = expirationTime;

  return fiber;
}

function createFiberFromElement(element, mode, expirationTime) {
  var owner = null;
  {
    owner = element._owner;
  }
  var type = element.type;
  var key = element.key;
  var pendingProps = element.props;
  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
  {
    fiber._debugSource = element._source;
    fiber._debugOwner = element._owner;
  }
  return fiber;
}

function createFiberFromFragment(elements, mode, expirationTime, key) {
  var fiber = createFiber(Fragment, elements, key, mode);
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromFundamental(fundamentalComponent, pendingProps, mode, expirationTime, key) {
  var fiber = createFiber(FundamentalComponent, pendingProps, key, mode);
  fiber.elementType = fundamentalComponent;
  fiber.type = fundamentalComponent;
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
  {
    if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
      warningWithoutStack$1(false, 'Profiler must specify an "id" string and "onRender" function as props');
    }
  }

  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
  // TODO: The Profiler fiber shouldn't have a type. It has a tag.
  fiber.elementType = REACT_PROFILER_TYPE;
  fiber.type = REACT_PROFILER_TYPE;
  fiber.expirationTime = expirationTime;

  return fiber;
}

function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);

  // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.
  fiber.type = REACT_SUSPENSE_TYPE;
  fiber.elementType = REACT_SUSPENSE_TYPE;

  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
  var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
  {
    // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
    // This needs to be fixed in getComponentName so that it relies on the tag
    // instead.
    fiber.type = REACT_SUSPENSE_LIST_TYPE;
  }
  fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromText(content, mode, expirationTime) {
  var fiber = createFiber(HostText, content, null, mode);
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromHostInstanceForDeletion() {
  var fiber = createFiber(HostComponent, null, null, NoMode);
  // TODO: These should not need a type.
  fiber.elementType = 'DELETED';
  fiber.type = 'DELETED';
  return fiber;
}

function createFiberFromPortal(portal, mode, expirationTime) {
  var pendingProps = portal.children !== null ? portal.children : [];
  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  fiber.expirationTime = expirationTime;
  fiber.stateNode = {
    containerInfo: portal.containerInfo,
    pendingChildren: null, // Used by persistent updates
    implementation: portal.implementation
  };
  return fiber;
}

// Used for stashing WIP properties to replay failed work in DEV.
function assignFiberPropertiesInDEV(target, source) {
  if (target === null) {
    // This Fiber's initial properties will always be overwritten.
    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
    target = createFiber(IndeterminateComponent, null, null, NoMode);
  }

  // This is intentionally written as a list of all properties.
  // We tried to use Object.assign() instead but this is called in
  // the hottest path, and Object.assign() was too slow:
  // https://github.com/facebook/react/issues/12502
  // This code is DEV-only so size is not a concern.

  target.tag = source.tag;
  target.key = source.key;
  target.elementType = source.elementType;
  target.type = source.type;
  target.stateNode = source.stateNode;
  target.return = source.return;
  target.child = source.child;
  target.sibling = source.sibling;
  target.index = source.index;
  target.ref = source.ref;
  target.pendingProps = source.pendingProps;
  target.memoizedProps = source.memoizedProps;
  target.updateQueue = source.updateQueue;
  target.memoizedState = source.memoizedState;
  target.dependencies = source.dependencies;
  target.mode = source.mode;
  target.effectTag = source.effectTag;
  target.nextEffect = source.nextEffect;
  target.firstEffect = source.firstEffect;
  target.lastEffect = source.lastEffect;
  target.expirationTime = source.expirationTime;
  target.childExpirationTime = source.childExpirationTime;
  target.alternate = source.alternate;
  if (enableProfilerTimer) {
    target.actualDuration = source.actualDuration;
    target.actualStartTime = source.actualStartTime;
    target.selfBaseDuration = source.selfBaseDuration;
    target.treeBaseDuration = source.treeBaseDuration;
  }
  target._debugID = source._debugID;
  target._debugSource = source._debugSource;
  target._debugOwner = source._debugOwner;
  target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
  target._debugNeedsRemount = source._debugNeedsRemount;
  target._debugHookTypes = source._debugHookTypes;
  return target;
}

// TODO: This should be lifted into the renderer.


// The following attributes are only used by interaction tracing builds.
// They enable interactions to be associated with their async work,
// And expose interaction metadata to the React DevTools Profiler plugin.
// Note that these attributes are only defined when the enableSchedulerTracing flag is enabled.


// Exported FiberRoot type includes all properties,
// To avoid requiring potentially error-prone :any casts throughout the project.
// Profiling properties are only safe to access in profiling builds (when enableSchedulerTracing is true).
// The types are defined separately within this file to ensure they stay in sync.
// (We don't have to use an inline :any cast when enableSchedulerTracing is disabled.)


function FiberRootNode(containerInfo, tag, hydrate) {
  this.tag = tag;
  this.current = null;
  this.containerInfo = containerInfo;
  this.pendingChildren = null;
  this.pingCache = null;
  this.finishedExpirationTime = NoWork;
  this.finishedWork = null;
  this.timeoutHandle = noTimeout;
  this.context = null;
  this.pendingContext = null;
  this.hydrate = hydrate;
  this.firstBatch = null;
  this.callbackNode = null;
  this.callbackExpirationTime = NoWork;
  this.firstPendingTime = NoWork;
  this.lastPendingTime = NoWork;
  this.pingTime = NoWork;

  if (enableSchedulerTracing) {
    this.interactionThreadID = tracing.unstable_getThreadID();
    this.memoizedInteractions = new Set();
    this.pendingInteractionMap = new Map();
  }
}

function createFiberRoot(containerInfo, tag, hydrate) {
  var root = new FiberRootNode(containerInfo, tag, hydrate);

  // Cyclic construction. This cheats the type system right now because
  // stateNode is any.
  var uninitializedFiber = createHostRootFiber(tag);
  root.current = uninitializedFiber;
  uninitializedFiber.stateNode = root;

  return root;
}

// This lets us hook into Fiber to debug what it's doing.
// See https://github.com/facebook/react/pull/8033.
// This is not part of the public API, not even for React DevTools.
// You may only inject a debugTool if you work on React Fiber itself.
var ReactFiberInstrumentation = {
  debugTool: null
};

var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;

// 0 is PROD, 1 is DEV.
// Might add PROFILE later.


var didWarnAboutNestedUpdates = void 0;
var didWarnAboutFindNodeInStrictMode = void 0;

{
  didWarnAboutNestedUpdates = false;
  didWarnAboutFindNodeInStrictMode = {};
}

function getContextForSubtree(parentComponent) {
  if (!parentComponent) {
    return emptyContextObject;
  }

  var fiber = get(parentComponent);
  var parentContext = findCurrentUnmaskedContext(fiber);

  if (fiber.tag === ClassComponent) {
    var Component = fiber.type;
    if (isContextProvider(Component)) {
      return processChildContext(fiber, Component, parentContext);
    }
  }

  return parentContext;
}

function scheduleRootUpdate(current$$1, element, expirationTime, suspenseConfig, callback) {
  {
    if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
      didWarnAboutNestedUpdates = true;
      warningWithoutStack$1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
    }
  }

  var update = createUpdate(expirationTime, suspenseConfig);
  // Caution: React DevTools currently depends on this property
  // being called "element".
  update.payload = { element: element };

  callback = callback === undefined ? null : callback;
  if (callback !== null) {
    !(typeof callback === 'function') ? warningWithoutStack$1(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
    update.callback = callback;
  }

  if (revertPassiveEffectsChange) {
    flushPassiveEffects();
  }
  enqueueUpdate(current$$1, update);
  scheduleWork(current$$1, expirationTime);

  return expirationTime;
}

function updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, suspenseConfig, callback) {
  // TODO: If this is a nested container, this won't be the root.
  var current$$1 = container.current;

  {
    if (ReactFiberInstrumentation_1.debugTool) {
      if (current$$1.alternate === null) {
        ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
      } else if (element === null) {
        ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
      } else {
        ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
      }
    }
  }

  var context = getContextForSubtree(parentComponent);
  if (container.context === null) {
    container.context = context;
  } else {
    container.pendingContext = context;
  }

  return scheduleRootUpdate(current$$1, element, expirationTime, suspenseConfig, callback);
}

function findHostInstance(component) {
  var fiber = get(component);
  if (fiber === undefined) {
    if (typeof component.render === 'function') {
      (function () {
        {
          {
            throw ReactError(Error('Unable to find node on an unmounted component.'));
          }
        }
      })();
    } else {
      (function () {
        {
          {
            throw ReactError(Error('Argument appears to not be a ReactComponent. Keys: ' + Object.keys(component)));
          }
        }
      })();
    }
  }
  var hostFiber = findCurrentHostFiber(fiber);
  if (hostFiber === null) {
    return null;
  }
  return hostFiber.stateNode;
}

function findHostInstanceWithWarning(component, methodName) {
  {
    var fiber = get(component);
    if (fiber === undefined) {
      if (typeof component.render === 'function') {
        (function () {
          {
            {
              throw ReactError(Error('Unable to find node on an unmounted component.'));
            }
          }
        })();
      } else {
        (function () {
          {
            {
              throw ReactError(Error('Argument appears to not be a ReactComponent. Keys: ' + Object.keys(component)));
            }
          }
        })();
      }
    }
    var hostFiber = findCurrentHostFiber(fiber);
    if (hostFiber === null) {
      return null;
    }
    if (hostFiber.mode & StrictMode) {
      var componentName = getComponentName(fiber.type) || 'Component';
      if (!didWarnAboutFindNodeInStrictMode[componentName]) {
        didWarnAboutFindNodeInStrictMode[componentName] = true;
        if (fiber.mode & StrictMode) {
          warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
        } else {
          warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
        }
      }
    }
    return hostFiber.stateNode;
  }
  return findHostInstance(component);
}

function createContainer(containerInfo, tag, hydrate) {
  return createFiberRoot(containerInfo, tag, hydrate);
}

function updateContainer(element, container, parentComponent, callback) {
  var current$$1 = container.current;
  var currentTime = requestCurrentTime();
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfUnmockedScheduler(current$$1);
      warnIfNotScopedWithMatchingAct(current$$1);
    }
  }
  var suspenseConfig = requestCurrentSuspenseConfig();
  var expirationTime = computeExpirationForFiber(currentTime, current$$1, suspenseConfig);
  return updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, suspenseConfig, callback);
}

function getPublicRootInstance(container) {
  var containerFiber = container.current;
  if (!containerFiber.child) {
    return null;
  }
  switch (containerFiber.child.tag) {
    case HostComponent:
      return getPublicInstance(containerFiber.child.stateNode);
    default:
      return containerFiber.child.stateNode;
  }
}

function findHostInstanceWithNoPortals(fiber) {
  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
  if (hostFiber === null) {
    return null;
  }
  if (hostFiber.tag === FundamentalComponent) {
    return hostFiber.stateNode.instance;
  }
  return hostFiber.stateNode;
}

var shouldSuspendImpl = function (fiber) {
  return false;
};

function shouldSuspend(fiber) {
  return shouldSuspendImpl(fiber);
}

var overrideHookState = null;
var overrideProps = null;
var scheduleUpdate = null;
var setSuspenseHandler = null;

{
  var copyWithSetImpl = function (obj, path, idx, value) {
    if (idx >= path.length) {
      return value;
    }
    var key = path[idx];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
    // $FlowFixMe number or string is fine here
    updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
    return updated;
  };

  var copyWithSet = function (obj, path, value) {
    return copyWithSetImpl(obj, path, 0, value);
  };

  // Support DevTools editable values for useState and useReducer.
  overrideHookState = function (fiber, id, path, value) {
    // For now, the "id" of stateful hooks is just the stateful hook index.
    // This may change in the future with e.g. nested hooks.
    var currentHook = fiber.memoizedState;
    while (currentHook !== null && id > 0) {
      currentHook = currentHook.next;
      id--;
    }
    if (currentHook !== null) {
      if (revertPassiveEffectsChange) {
        flushPassiveEffects();
      }

      var newState = copyWithSet(currentHook.memoizedState, path, value);
      currentHook.memoizedState = newState;
      currentHook.baseState = newState;

      // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.
      fiber.memoizedProps = _assign({}, fiber.memoizedProps);

      scheduleWork(fiber, Sync);
    }
  };

  // Support DevTools props for function components, forwardRef, memo, host components, etc.
  overrideProps = function (fiber, path, value) {
    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }
    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }
    scheduleWork(fiber, Sync);
  };

  scheduleUpdate = function (fiber) {
    if (revertPassiveEffectsChange) {
      flushPassiveEffects();
    }
    scheduleWork(fiber, Sync);
  };

  setSuspenseHandler = function (newShouldSuspendImpl) {
    shouldSuspendImpl = newShouldSuspendImpl;
  };
}

function injectIntoDevTools(devToolsConfig) {
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;


  return injectInternals(_assign({}, devToolsConfig, {
    overrideHookState: overrideHookState,
    overrideProps: overrideProps,
    setSuspenseHandler: setSuspenseHandler,
    scheduleUpdate: scheduleUpdate,
    currentDispatcherRef: ReactCurrentDispatcher,
    findHostInstanceByFiber: function (fiber) {
      var hostFiber = findCurrentHostFiber(fiber);
      if (hostFiber === null) {
        return null;
      }
      return hostFiber.stateNode;
    },
    findFiberByHostInstance: function (instance) {
      if (!findFiberByHostInstance) {
        // Might not be implemented by the renderer.
        return null;
      }
      return findFiberByHostInstance(instance);
    },

    // React Refresh
    findHostInstancesForRefresh: findHostInstancesForRefresh,
    scheduleRefresh: scheduleRefresh,
    scheduleRoot: scheduleRoot,
    setRefreshHandler: setRefreshHandler,
    // Enables DevTools to append owner stacks to error messages in DEV mode.
    getCurrentFiber: function () {
      return current;
    }
  }));
}

// This file intentionally does *not* have the Flow annotation.
// Don't add it. See `./inline-typed.js` for an explanation.

function createPortal$1(children, containerInfo,
// TODO: figure out the API for cross-renderer implementation.
implementation) {
  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

  return {
    // This tag allow us to uniquely identify this as a React Portal
    $$typeof: REACT_PORTAL_TYPE,
    key: key == null ? null : '' + key,
    children: children,
    containerInfo: containerInfo,
    implementation: implementation
  };
}

// TODO: this is special because it gets imported during build.

var ReactVersion = '16.9.0';

// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

var topLevelUpdateWarnings = void 0;
var warnOnInvalidCallback = void 0;
var didWarnAboutUnstableCreatePortal = false;

{
  if (typeof Map !== 'function' ||
  // $FlowIssue Flow incorrectly thinks Map has no prototype
  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' ||
  // $FlowIssue Flow incorrectly thinks Set has no prototype
  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
    warningWithoutStack$1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  }

  topLevelUpdateWarnings = function (container) {
    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
      if (hostInstance) {
        !(hostInstance.parentNode === container) ? warningWithoutStack$1(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
      }
    }

    var isRootRenderedBySomeReact = !!container._reactRootContainer;
    var rootEl = getReactRootElementInContainer(container);
    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));

    !(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warningWithoutStack$1(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;

    !(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warningWithoutStack$1(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
  };

  warnOnInvalidCallback = function (callback, callerName) {
    !(callback === null || typeof callback === 'function') ? warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
  };
}

setRestoreImplementation(restoreControlledState$1);

function ReactBatch(root) {
  var expirationTime = computeUniqueAsyncExpiration();
  this._expirationTime = expirationTime;
  this._root = root;
  this._next = null;
  this._callbacks = null;
  this._didComplete = false;
  this._hasChildren = false;
  this._children = null;
  this._defer = true;
}
ReactBatch.prototype.render = function (children) {
  var _this = this;

  (function () {
    if (!_this._defer) {
      {
        throw ReactError(Error('batch.render: Cannot render a batch that already committed.'));
      }
    }
  })();
  this._hasChildren = true;
  this._children = children;
  var internalRoot = this._root._internalRoot;
  var expirationTime = this._expirationTime;
  var work = new ReactWork();
  updateContainerAtExpirationTime(children, internalRoot, null, expirationTime, null, work._onCommit);
  return work;
};
ReactBatch.prototype.then = function (onComplete) {
  if (this._didComplete) {
    onComplete();
    return;
  }
  var callbacks = this._callbacks;
  if (callbacks === null) {
    callbacks = this._callbacks = [];
  }
  callbacks.push(onComplete);
};
ReactBatch.prototype.commit = function () {
  var _this2 = this;

  var internalRoot = this._root._internalRoot;
  var firstBatch = internalRoot.firstBatch;
  (function () {
    if (!(_this2._defer && firstBatch !== null)) {
      {
        throw ReactError(Error('batch.commit: Cannot commit a batch multiple times.'));
      }
    }
  })();

  if (!this._hasChildren) {
    // This batch is empty. Return.
    this._next = null;
    this._defer = false;
    return;
  }

  var expirationTime = this._expirationTime;

  // Ensure this is the first batch in the list.
  if (firstBatch !== this) {
    // This batch is not the earliest batch. We need to move it to the front.
    // Update its expiration time to be the expiration time of the earliest
    // batch, so that we can flush it without flushing the other batches.
    if (this._hasChildren) {
      expirationTime = this._expirationTime = firstBatch._expirationTime;
      // Rendering this batch again ensures its children will be the final state
      // when we flush (updates are processed in insertion order: last
      // update wins).
      // TODO: This forces a restart. Should we print a warning?
      this.render(this._children);
    }

    // Remove the batch from the list.
    var previous = null;
    var batch = firstBatch;
    while (batch !== this) {
      previous = batch;
      batch = batch._next;
    }
    (function () {
      if (!(previous !== null)) {
        {
          throw ReactError(Error('batch.commit: Cannot commit a batch multiple times.'));
        }
      }
    })();
    previous._next = batch._next;

    // Add it to the front.
    this._next = firstBatch;
    firstBatch = internalRoot.firstBatch = this;
  }

  // Synchronously flush all the work up to this batch's expiration time.
  this._defer = false;
  flushRoot(internalRoot, expirationTime);

  // Pop the batch from the list.
  var next = this._next;
  this._next = null;
  firstBatch = internalRoot.firstBatch = next;

  // Append the next earliest batch's children to the update queue.
  if (firstBatch !== null && firstBatch._hasChildren) {
    firstBatch.render(firstBatch._children);
  }
};
ReactBatch.prototype._onComplete = function () {
  if (this._didComplete) {
    return;
  }
  this._didComplete = true;
  var callbacks = this._callbacks;
  if (callbacks === null) {
    return;
  }
  // TODO: Error handling.
  for (var i = 0; i < callbacks.length; i++) {
    var _callback = callbacks[i];
    _callback();
  }
};

function ReactWork() {
  this._callbacks = null;
  this._didCommit = false;
  // TODO: Avoid need to bind by replacing callbacks in the update queue with
  // list of Work objects.
  this._onCommit = this._onCommit.bind(this);
}
ReactWork.prototype.then = function (onCommit) {
  if (this._didCommit) {
    onCommit();
    return;
  }
  var callbacks = this._callbacks;
  if (callbacks === null) {
    callbacks = this._callbacks = [];
  }
  callbacks.push(onCommit);
};
ReactWork.prototype._onCommit = function () {
  if (this._didCommit) {
    return;
  }
  this._didCommit = true;
  var callbacks = this._callbacks;
  if (callbacks === null) {
    return;
  }
  // TODO: Error handling.
  for (var i = 0; i < callbacks.length; i++) {
    var _callback2 = callbacks[i];
    (function () {
      if (!(typeof _callback2 === 'function')) {
        {
          throw ReactError(Error('Invalid argument passed as callback. Expected a function. Instead received: ' + _callback2));
        }
      }
    })();
    _callback2();
  }
};

function ReactSyncRoot(container, tag, hydrate) {
  // Tag is either LegacyRoot or Concurrent Root
  var root = createContainer(container, tag, hydrate);
  this._internalRoot = root;
}

function ReactRoot(container, hydrate) {
  var root = createContainer(container, ConcurrentRoot, hydrate);
  this._internalRoot = root;
}

ReactRoot.prototype.render = ReactSyncRoot.prototype.render = function (children, callback) {
  var root = this._internalRoot;
  var work = new ReactWork();
  callback = callback === undefined ? null : callback;
  {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  updateContainer(children, root, null, work._onCommit);
  return work;
};

ReactRoot.prototype.unmount = ReactSyncRoot.prototype.unmount = function (callback) {
  var root = this._internalRoot;
  var work = new ReactWork();
  callback = callback === undefined ? null : callback;
  {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  updateContainer(null, root, null, work._onCommit);
  return work;
};

// Sync roots cannot create batches. Only concurrent ones.
ReactRoot.prototype.createBatch = function () {
  var batch = new ReactBatch(this);
  var expirationTime = batch._expirationTime;

  var internalRoot = this._internalRoot;
  var firstBatch = internalRoot.firstBatch;
  if (firstBatch === null) {
    internalRoot.firstBatch = batch;
    batch._next = null;
  } else {
    // Insert sorted by expiration time then insertion order
    var insertAfter = null;
    var insertBefore = firstBatch;
    while (insertBefore !== null && insertBefore._expirationTime >= expirationTime) {
      insertAfter = insertBefore;
      insertBefore = insertBefore._next;
    }
    batch._next = insertBefore;
    if (insertAfter !== null) {
      insertAfter._next = batch;
    }
  }

  return batch;
};

/**
 * True if the supplied DOM node is a valid node element.
 *
 * @param {?DOMElement} node The candidate DOM node.
 * @return {boolean} True if the DOM is a valid DOM node.
 * @internal
 */
function isValidContainer(node) {
  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
}

function getReactRootElementInContainer(container) {
  if (!container) {
    return null;
  }

  if (container.nodeType === DOCUMENT_NODE) {
    return container.documentElement;
  } else {
    return container.firstChild;
  }
}

function shouldHydrateDueToLegacyHeuristic(container) {
  var rootElement = getReactRootElementInContainer(container);
  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
}

setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);

var warnedAboutHydrateAPI = false;

function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
  // First clear any existing content.
  if (!shouldHydrate) {
    var warned = false;
    var rootSibling = void 0;
    while (rootSibling = container.lastChild) {
      {
        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
          warned = true;
          warningWithoutStack$1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
        }
      }
      container.removeChild(rootSibling);
    }
  }
  {
    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
      warnedAboutHydrateAPI = true;
      lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
    }
  }

  // Legacy roots are not batched.
  return new ReactSyncRoot(container, LegacyRoot, shouldHydrate);
}

function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  {
    topLevelUpdateWarnings(container);
    warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
  }

  // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  // member of intersection type." Whyyyyyy.
  var root = container._reactRootContainer;
  var fiberRoot = void 0;
  if (!root) {
    // Initial mount
    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
    fiberRoot = root._internalRoot;
    if (typeof callback === 'function') {
      var originalCallback = callback;
      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);
        originalCallback.call(instance);
      };
    }
    // Initial mount should not be batched.
    unbatchedUpdates(function () {
      updateContainer(children, fiberRoot, parentComponent, callback);
    });
  } else {
    fiberRoot = root._internalRoot;
    if (typeof callback === 'function') {
      var _originalCallback = callback;
      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);
        _originalCallback.call(instance);
      };
    }
    // Update
    updateContainer(children, fiberRoot, parentComponent, callback);
  }
  return getPublicRootInstance(fiberRoot);
}

function createPortal$$1(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  (function () {
    if (!isValidContainer(container)) {
      {
        throw ReactError(Error('Target container is not a DOM element.'));
      }
    }
  })();
  // TODO: pass ReactDOM portal implementation as third argument
  return createPortal$1(children, container, null, key);
}

var ReactDOM = {
  createPortal: createPortal$$1,

  findDOMNode: function (componentOrElement) {
    {
      var owner = ReactCurrentOwner.current;
      if (owner !== null && owner.stateNode !== null) {
        var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
        !warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component') : void 0;
        owner.stateNode._warnedAboutRefsInRender = true;
      }
    }
    if (componentOrElement == null) {
      return null;
    }
    if (componentOrElement.nodeType === ELEMENT_NODE) {
      return componentOrElement;
    }
    {
      return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
    }
    return findHostInstance(componentOrElement);
  },
  hydrate: function (element, container, callback) {
    (function () {
      if (!isValidContainer(container)) {
        {
          throw ReactError(Error('Target container is not a DOM element.'));
        }
      }
    })();
    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }
    // TODO: throw or warn if we couldn't hydrate?
    return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
  },
  render: function (element, container, callback) {
    (function () {
      if (!isValidContainer(container)) {
        {
          throw ReactError(Error('Target container is not a DOM element.'));
        }
      }
    })();
    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call root.render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }
    return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
  },
  unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {
    (function () {
      if (!isValidContainer(containerNode)) {
        {
          throw ReactError(Error('Target container is not a DOM element.'));
        }
      }
    })();
    (function () {
      if (!(parentComponent != null && has(parentComponent))) {
        {
          throw ReactError(Error('parentComponent must be a valid React Component'));
        }
      }
    })();
    return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
  },
  unmountComponentAtNode: function (container) {
    (function () {
      if (!isValidContainer(container)) {
        {
          throw ReactError(Error('unmountComponentAtNode(...): Target container is not a DOM element.'));
        }
      }
    })();

    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. Did you mean to call root.unmount()?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }

    if (container._reactRootContainer) {
      {
        var rootEl = getReactRootElementInContainer(container);
        var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
        !!renderedByDifferentReact ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
      }

      // Unmount should not be batched.
      unbatchedUpdates(function () {
        legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
          container._reactRootContainer = null;
        });
      });
      // If you call unmountComponentAtNode twice in quick succession, you'll
      // get `true` twice. That's probably fine?
      return true;
    } else {
      {
        var _rootEl = getReactRootElementInContainer(container);
        var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));

        // Check if the container itself is a React root node.
        var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;

        !!hasNonRootReactChild ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
      }

      return false;
    }
  },


  // Temporary alias since we already shipped React 16 RC with it.
  // TODO: remove in React 17.
  unstable_createPortal: function () {
    if (!didWarnAboutUnstableCreatePortal) {
      didWarnAboutUnstableCreatePortal = true;
      lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
    }
    return createPortal$$1.apply(undefined, arguments);
  },


  unstable_batchedUpdates: batchedUpdates$1,

  // TODO remove this legacy method, unstable_discreteUpdates replaces it
  unstable_interactiveUpdates: function (fn, a, b, c) {
    flushDiscreteUpdates();
    return discreteUpdates$1(fn, a, b, c);
  },

  unstable_discreteUpdates: discreteUpdates$1,
  unstable_flushDiscreteUpdates: flushDiscreteUpdates,

  flushSync: flushSync,

  unstable_createRoot: createRoot,
  unstable_createSyncRoot: createSyncRoot,
  unstable_flushControlled: flushControlled,

  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
    // Keep in sync with ReactDOMUnstableNativeDependencies.js
    // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.
    Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injection.injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
  }
};

function createRoot(container, options) {
  var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
  (function () {
    if (!isValidContainer(container)) {
      {
        throw ReactError(Error(functionName + '(...): Target container is not a DOM element.'));
      }
    }
  })();
  warnIfReactDOMContainerInDEV(container);
  var hydrate = options != null && options.hydrate === true;
  return new ReactRoot(container, hydrate);
}

function createSyncRoot(container, options) {
  var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
  (function () {
    if (!isValidContainer(container)) {
      {
        throw ReactError(Error(functionName + '(...): Target container is not a DOM element.'));
      }
    }
  })();
  warnIfReactDOMContainerInDEV(container);
  var hydrate = options != null && options.hydrate === true;
  return new ReactSyncRoot(container, BatchedRoot, hydrate);
}

function warnIfReactDOMContainerInDEV(container) {
  {
    !!container._reactRootContainer ? warningWithoutStack$1(false, 'You are calling ReactDOM.%s() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    container._reactHasBeenPassedToCreateRootDEV = true;
  }
}

if (enableStableConcurrentModeAPIs) {
  ReactDOM.createRoot = createRoot;
  ReactDOM.createSyncRoot = createSyncRoot;
}

var foundDevTools = injectIntoDevTools({
  findFiberByHostInstance: getClosestInstanceFromNode,
  bundleType: 1,
  version: ReactVersion,
  rendererPackageName: 'react-dom'
});

{
  if (!foundDevTools && canUseDOM && window.top === window.self) {
    // If we're in Chrome or Firefox, provide a download link if not installed.
    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
      var protocol = window.location.protocol;
      // Don't warn in exotic cases like chrome-extension://.
      if (/^(https?|file):$/.test(protocol)) {
        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
      }
    }
  }
}



var ReactDOM$2 = Object.freeze({
	default: ReactDOM
});

var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest.
var reactDom = ReactDOM$3.default || ReactDOM$3;

module.exports = reactDom;
  })();
}


/***/ }),

/***/ "./node_modules/react-dom/index.js":
/*!*****************************************!*\
  !*** ./node_modules/react-dom/index.js ***!
  \*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  ) {
    return;
  }
  if (true) {
    // This branch is unreachable because this function is only called
    // in production, but the condition is true only in development.
    // Therefore if the branch is still here, dead code elimination wasn't
    // properly applied.
    // Don't change the message. React DevTools relies on it. Also make sure
    // this message doesn't occur elsewhere in this function, or it will cause
    // a false positive.
    throw new Error('^_^');
  }
  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (false) {} else {
  module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ "./node_modules/react-dom/cjs/react-dom.development.js");
}


/***/ }),

/***/ "./node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js":
/*!********************************************************************************************!*\
  !*** ./node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
  \********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v0.15.0
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:


// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:


// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.


// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:


// Gather advanced timing metrics for Profiler subtrees.


// Trace which interactions trigger each commit.
var enableSchedulerTracing = true;

// Only used in www builds.
 // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// Disable javascript: URL strings in href for XSS protection.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties


// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.




// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
// This is a flag so we can fix warnings in RN core before turning it on


// Experimental React Flare event system and event components support.


// Experimental Host Component support.


// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107


// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version

// Temporary flag to revert the fix in #15650


// For tests, we flush suspense fallbacks in an act scope;
// *except* in some of our own tests, where we test incremental loading states.


// Changes priority of some events like mousemove to user-blocking priority,
// but without making them discrete. The flag exists in case it causes
// starvation problems.


// Add a callback property to suspense to notify which promises are currently
// in the update queue. This allows reporting and tracing of what is causing
// the user to see a loading state.


// Part of the simplification of React.createElement so we can eventually move
// from React.createElement to React.jsx
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md

var DEFAULT_THREAD_ID = 0;

// Counters used to generate unique IDs.
var interactionIDCounter = 0;
var threadIDCounter = 0;

// Set of currently traced interactions.
// Interactions "stack"–
// Meaning that newly traced interactions are appended to the previously active set.
// When an interaction goes out of scope, the previous set (if any) is restored.
exports.__interactionsRef = null;

// Listener(s) to notify when interactions begin and end.
exports.__subscriberRef = null;

if (enableSchedulerTracing) {
  exports.__interactionsRef = {
    current: new Set()
  };
  exports.__subscriberRef = {
    current: null
  };
}

function unstable_clear(callback) {
  if (!enableSchedulerTracing) {
    return callback();
  }

  var prevInteractions = exports.__interactionsRef.current;
  exports.__interactionsRef.current = new Set();

  try {
    return callback();
  } finally {
    exports.__interactionsRef.current = prevInteractions;
  }
}

function unstable_getCurrent() {
  if (!enableSchedulerTracing) {
    return null;
  } else {
    return exports.__interactionsRef.current;
  }
}

function unstable_getThreadID() {
  return ++threadIDCounter;
}

function unstable_trace(name, timestamp, callback) {
  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;

  if (!enableSchedulerTracing) {
    return callback();
  }

  var interaction = {
    __count: 1,
    id: interactionIDCounter++,
    name: name,
    timestamp: timestamp
  };

  var prevInteractions = exports.__interactionsRef.current;

  // Traced interactions should stack/accumulate.
  // To do that, clone the current interactions.
  // The previous set will be restored upon completion.
  var interactions = new Set(prevInteractions);
  interactions.add(interaction);
  exports.__interactionsRef.current = interactions;

  var subscriber = exports.__subscriberRef.current;
  var returnValue = void 0;

  try {
    if (subscriber !== null) {
      subscriber.onInteractionTraced(interaction);
    }
  } finally {
    try {
      if (subscriber !== null) {
        subscriber.onWorkStarted(interactions, threadID);
      }
    } finally {
      try {
        returnValue = callback();
      } finally {
        exports.__interactionsRef.current = prevInteractions;

        try {
          if (subscriber !== null) {
            subscriber.onWorkStopped(interactions, threadID);
          }
        } finally {
          interaction.__count--;

          // If no async work was scheduled for this interaction,
          // Notify subscribers that it's completed.
          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        }
      }
    }
  }

  return returnValue;
}

function unstable_wrap(callback) {
  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;

  if (!enableSchedulerTracing) {
    return callback;
  }

  var wrappedInteractions = exports.__interactionsRef.current;

  var subscriber = exports.__subscriberRef.current;
  if (subscriber !== null) {
    subscriber.onWorkScheduled(wrappedInteractions, threadID);
  }

  // Update the pending async work count for the current interactions.
  // Update after calling subscribers in case of error.
  wrappedInteractions.forEach(function (interaction) {
    interaction.__count++;
  });

  var hasRun = false;

  function wrapped() {
    var prevInteractions = exports.__interactionsRef.current;
    exports.__interactionsRef.current = wrappedInteractions;

    subscriber = exports.__subscriberRef.current;

    try {
      var returnValue = void 0;

      try {
        if (subscriber !== null) {
          subscriber.onWorkStarted(wrappedInteractions, threadID);
        }
      } finally {
        try {
          returnValue = callback.apply(undefined, arguments);
        } finally {
          exports.__interactionsRef.current = prevInteractions;

          if (subscriber !== null) {
            subscriber.onWorkStopped(wrappedInteractions, threadID);
          }
        }
      }

      return returnValue;
    } finally {
      if (!hasRun) {
        // We only expect a wrapped function to be executed once,
        // But in the event that it's executed more than once–
        // Only decrement the outstanding interaction counts once.
        hasRun = true;

        // Update pending async counts for all wrapped interactions.
        // If this was the last scheduled async work for any of them,
        // Mark them as completed.
        wrappedInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        });
      }
    }
  }

  wrapped.cancel = function cancel() {
    subscriber = exports.__subscriberRef.current;

    try {
      if (subscriber !== null) {
        subscriber.onWorkCanceled(wrappedInteractions, threadID);
      }
    } finally {
      // Update pending async counts for all wrapped interactions.
      // If this was the last scheduled async work for any of them,
      // Mark them as completed.
      wrappedInteractions.forEach(function (interaction) {
        interaction.__count--;

        if (subscriber && interaction.__count === 0) {
          subscriber.onInteractionScheduledWorkCompleted(interaction);
        }
      });
    }
  };

  return wrapped;
}

var subscribers = null;
if (enableSchedulerTracing) {
  subscribers = new Set();
}

function unstable_subscribe(subscriber) {
  if (enableSchedulerTracing) {
    subscribers.add(subscriber);

    if (subscribers.size === 1) {
      exports.__subscriberRef.current = {
        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
        onInteractionTraced: onInteractionTraced,
        onWorkCanceled: onWorkCanceled,
        onWorkScheduled: onWorkScheduled,
        onWorkStarted: onWorkStarted,
        onWorkStopped: onWorkStopped
      };
    }
  }
}

function unstable_unsubscribe(subscriber) {
  if (enableSchedulerTracing) {
    subscribers.delete(subscriber);

    if (subscribers.size === 0) {
      exports.__subscriberRef.current = null;
    }
  }
}

function onInteractionTraced(interaction) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionTraced(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onInteractionScheduledWorkCompleted(interaction) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionScheduledWorkCompleted(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkScheduled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkScheduled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStarted(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStarted(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStopped(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStopped(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkCanceled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkCanceled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

exports.unstable_clear = unstable_clear;
exports.unstable_getCurrent = unstable_getCurrent;
exports.unstable_getThreadID = unstable_getThreadID;
exports.unstable_trace = unstable_trace;
exports.unstable_wrap = unstable_wrap;
exports.unstable_subscribe = unstable_subscribe;
exports.unstable_unsubscribe = unstable_unsubscribe;
  })();
}


/***/ }),

/***/ "./node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js":
/*!************************************************************************************!*\
  !*** ./node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js ***!
  \************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v0.15.0
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var enableSchedulerDebugging = false;
var enableIsInputPending = false;
var requestIdleCallbackBeforeFirstFrame = false;
var requestTimerEventBeforeFirstFrame = false;
var enableMessageLoopImplementation = false;

// The DOM Scheduler implementation is similar to requestIdleCallback. It
// works by scheduling a requestAnimationFrame, storing the time for the start
// of the frame, then scheduling a postMessage which gets scheduled after paint.
// Within the postMessage handler do as much work as possible until time + frame
// rate. By separating the idle call into a separate event tick we ensure that
// layout, paint and other browser work is counted against the available time.
// The frame rate is dynamically adjusted.

var requestHostCallback = void 0;

var requestHostTimeout = void 0;
var cancelHostTimeout = void 0;
var shouldYieldToHost = void 0;
var requestPaint = void 0;
exports.unstable_now = void 0;
exports.unstable_forceFrameRate = void 0;

if (
// If Scheduler runs in a non-DOM environment, it falls back to a naive
// implementation using setTimeout.
typeof window === 'undefined' ||
// Check if MessageChannel is supported, too.
typeof MessageChannel !== 'function') {
  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  // fallback to a naive implementation.
  var _callback = null;
  var _timeoutID = null;
  var _flushCallback = function () {
    if (_callback !== null) {
      try {
        var currentTime = exports.unstable_now();
        var hasRemainingTime = true;
        _callback(hasRemainingTime, currentTime);
        _callback = null;
      } catch (e) {
        setTimeout(_flushCallback, 0);
        throw e;
      }
    }
  };
  exports.unstable_now = function () {
    return Date.now();
  };
  requestHostCallback = function (cb) {
    if (_callback !== null) {
      // Protect against re-entrancy.
      setTimeout(requestHostCallback, 0, cb);
    } else {
      _callback = cb;
      setTimeout(_flushCallback, 0);
    }
  };
  requestHostTimeout = function (cb, ms) {
    _timeoutID = setTimeout(cb, ms);
  };
  cancelHostTimeout = function () {
    clearTimeout(_timeoutID);
  };
  shouldYieldToHost = function () {
    return false;
  };
  requestPaint = exports.unstable_forceFrameRate = function () {};
} else {
  // Capture local references to native APIs, in case a polyfill overrides them.
  var performance = window.performance;
  var _Date = window.Date;
  var _setTimeout = window.setTimeout;
  var _clearTimeout = window.clearTimeout;
  var requestAnimationFrame = window.requestAnimationFrame;
  var cancelAnimationFrame = window.cancelAnimationFrame;
  var requestIdleCallback = window.requestIdleCallback;

  if (typeof console !== 'undefined') {
    // TODO: Remove fb.me link
    if (typeof requestAnimationFrame !== 'function') {
      console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
    }
    if (typeof cancelAnimationFrame !== 'function') {
      console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
    }
  }

  var requestIdleCallbackBeforeFirstFrame$1 = requestIdleCallbackBeforeFirstFrame && typeof requestIdleCallback === 'function' && typeof cancelIdleCallback === 'function';

  exports.unstable_now = typeof performance === 'object' && typeof performance.now === 'function' ? function () {
    return performance.now();
  } : function () {
    return _Date.now();
  };

  var isRAFLoopRunning = false;
  var isMessageLoopRunning = false;
  var scheduledHostCallback = null;
  var rAFTimeoutID = -1;
  var taskTimeoutID = -1;

  var frameLength = enableMessageLoopImplementation ? // We won't attempt to align with the vsync. Instead we'll yield multiple
  // times per frame, often enough to keep it responsive even at really
  // high frame rates > 120.
  5 : // Use a heuristic to measure the frame rate and yield at the end of the
  // frame. We start out assuming that we run at 30fps but then the
  // heuristic tracking will adjust this value to a faster fps if we get
  // more frequent animation frames.
  33.33;

  var prevRAFTime = -1;
  var prevRAFInterval = -1;
  var frameDeadline = 0;

  var fpsLocked = false;

  // TODO: Make this configurable
  // TODO: Adjust this based on priority?
  var maxFrameLength = 300;
  var needsPaint = false;

  if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) {
    var scheduling = navigator.scheduling;
    shouldYieldToHost = function () {
      var currentTime = exports.unstable_now();
      if (currentTime >= frameDeadline) {
        // There's no time left in the frame. We may want to yield control of
        // the main thread, so the browser can perform high priority tasks. The
        // main ones are painting and user input. If there's a pending paint or
        // a pending input, then we should yield. But if there's neither, then
        // we can yield less often while remaining responsive. We'll eventually
        // yield regardless, since there could be a pending paint that wasn't
        // accompanied by a call to `requestPaint`, or other main thread tasks
        // like network events.
        if (needsPaint || scheduling.isInputPending()) {
          // There is either a pending paint or a pending input.
          return true;
        }
        // There's no pending input. Only yield if we've reached the max
        // frame length.
        return currentTime >= frameDeadline + maxFrameLength;
      } else {
        // There's still time left in the frame.
        return false;
      }
    };

    requestPaint = function () {
      needsPaint = true;
    };
  } else {
    // `isInputPending` is not available. Since we have no way of knowing if
    // there's pending input, always yield at the end of the frame.
    shouldYieldToHost = function () {
      return exports.unstable_now() >= frameDeadline;
    };

    // Since we yield every frame regardless, `requestPaint` has no effect.
    requestPaint = function () {};
  }

  exports.unstable_forceFrameRate = function (fps) {
    if (fps < 0 || fps > 125) {
      console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');
      return;
    }
    if (fps > 0) {
      frameLength = Math.floor(1000 / fps);
      fpsLocked = true;
    } else {
      // reset the framerate
      frameLength = 33.33;
      fpsLocked = false;
    }
  };

  var performWorkUntilDeadline = function () {
    if (enableMessageLoopImplementation) {
      if (scheduledHostCallback !== null) {
        var currentTime = exports.unstable_now();
        // Yield after `frameLength` ms, regardless of where we are in the vsync
        // cycle. This means there's always time remaining at the beginning of
        // the message event.
        frameDeadline = currentTime + frameLength;
        var hasTimeRemaining = true;
        try {
          var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
          if (!hasMoreWork) {
            isMessageLoopRunning = false;
            scheduledHostCallback = null;
          } else {
            // If there's more work, schedule the next message event at the end
            // of the preceding one.
            port.postMessage(null);
          }
        } catch (error) {
          // If a scheduler task throws, exit the current browser task so the
          // error can be observed.
          port.postMessage(null);
          throw error;
        }
      }
      // Yielding to the browser will give it a chance to paint, so we can
      // reset this.
      needsPaint = false;
    } else {
      if (scheduledHostCallback !== null) {
        var _currentTime = exports.unstable_now();
        var _hasTimeRemaining = frameDeadline - _currentTime > 0;
        try {
          var _hasMoreWork = scheduledHostCallback(_hasTimeRemaining, _currentTime);
          if (!_hasMoreWork) {
            scheduledHostCallback = null;
          }
        } catch (error) {
          // If a scheduler task throws, exit the current browser task so the
          // error can be observed, and post a new task as soon as possible
          // so we can continue where we left off.
          port.postMessage(null);
          throw error;
        }
      }
      // Yielding to the browser will give it a chance to paint, so we can
      // reset this.
      needsPaint = false;
    }
  };

  var channel = new MessageChannel();
  var port = channel.port2;
  channel.port1.onmessage = performWorkUntilDeadline;

  var onAnimationFrame = function (rAFTime) {
    if (scheduledHostCallback === null) {
      // No scheduled work. Exit.
      prevRAFTime = -1;
      prevRAFInterval = -1;
      isRAFLoopRunning = false;
      return;
    }

    // Eagerly schedule the next animation callback at the beginning of the
    // frame. If the scheduler queue is not empty at the end of the frame, it
    // will continue flushing inside that callback. If the queue *is* empty,
    // then it will exit immediately. Posting the callback at the start of the
    // frame ensures it's fired within the earliest possible frame. If we
    // waited until the end of the frame to post the callback, we risk the
    // browser skipping a frame and not firing the callback until the frame
    // after that.
    isRAFLoopRunning = true;
    requestAnimationFrame(function (nextRAFTime) {
      _clearTimeout(rAFTimeoutID);
      onAnimationFrame(nextRAFTime);
    });

    // requestAnimationFrame is throttled when the tab is backgrounded. We
    // don't want to stop working entirely. So we'll fallback to a timeout loop.
    // TODO: Need a better heuristic for backgrounded work.
    var onTimeout = function () {
      frameDeadline = exports.unstable_now() + frameLength / 2;
      performWorkUntilDeadline();
      rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3);
    };
    rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3);

    if (prevRAFTime !== -1 &&
    // Make sure this rAF time is different from the previous one. This check
    // could fail if two rAFs fire in the same frame.
    rAFTime - prevRAFTime > 0.1) {
      var rAFInterval = rAFTime - prevRAFTime;
      if (!fpsLocked && prevRAFInterval !== -1) {
        // We've observed two consecutive frame intervals. We'll use this to
        // dynamically adjust the frame rate.
        //
        // If one frame goes long, then the next one can be short to catch up.
        // If two frames are short in a row, then that's an indication that we
        // actually have a higher frame rate than what we're currently
        // optimizing. For example, if we're running on 120hz display or 90hz VR
        // display. Take the max of the two in case one of them was an anomaly
        // due to missed frame deadlines.
        if (rAFInterval < frameLength && prevRAFInterval < frameLength) {
          frameLength = rAFInterval < prevRAFInterval ? prevRAFInterval : rAFInterval;
          if (frameLength < 8.33) {
            // Defensive coding. We don't support higher frame rates than 120hz.
            // If the calculated frame length gets lower than 8, it is probably
            // a bug.
            frameLength = 8.33;
          }
        }
      }
      prevRAFInterval = rAFInterval;
    }
    prevRAFTime = rAFTime;
    frameDeadline = rAFTime + frameLength;

    // We use the postMessage trick to defer idle work until after the repaint.
    port.postMessage(null);
  };

  requestHostCallback = function (callback) {
    scheduledHostCallback = callback;
    if (enableMessageLoopImplementation) {
      if (!isMessageLoopRunning) {
        isMessageLoopRunning = true;
        port.postMessage(null);
      }
    } else {
      if (!isRAFLoopRunning) {
        // Start a rAF loop.
        isRAFLoopRunning = true;
        requestAnimationFrame(function (rAFTime) {
          if (requestIdleCallbackBeforeFirstFrame$1) {
            cancelIdleCallback(idleCallbackID);
          }
          if (requestTimerEventBeforeFirstFrame) {
            _clearTimeout(idleTimeoutID);
          }
          onAnimationFrame(rAFTime);
        });

        // If we just missed the last vsync, the next rAF might not happen for
        // another frame. To claim as much idle time as possible, post a
        // callback with `requestIdleCallback`, which should fire if there's
        // idle time left in the frame.
        //
        // This should only be an issue for the first rAF in the loop;
        // subsequent rAFs are scheduled at the beginning of the
        // preceding frame.
        var idleCallbackID = void 0;
        if (requestIdleCallbackBeforeFirstFrame$1) {
          idleCallbackID = requestIdleCallback(function onIdleCallbackBeforeFirstFrame() {
            if (requestTimerEventBeforeFirstFrame) {
              _clearTimeout(idleTimeoutID);
            }
            frameDeadline = exports.unstable_now() + frameLength;
            performWorkUntilDeadline();
          });
        }
        // Alternate strategy to address the same problem. Scheduler a timer
        // with no delay. If this fires before the rAF, that likely indicates
        // that there's idle time before the next vsync. This isn't always the
        // case, but we'll be aggressive and assume it is, as a trade off to
        // prevent idle periods.
        var idleTimeoutID = void 0;
        if (requestTimerEventBeforeFirstFrame) {
          idleTimeoutID = _setTimeout(function onTimerEventBeforeFirstFrame() {
            if (requestIdleCallbackBeforeFirstFrame$1) {
              cancelIdleCallback(idleCallbackID);
            }
            frameDeadline = exports.unstable_now() + frameLength;
            performWorkUntilDeadline();
          }, 0);
        }
      }
    }
  };

  requestHostTimeout = function (callback, ms) {
    taskTimeoutID = _setTimeout(function () {
      callback(exports.unstable_now());
    }, ms);
  };

  cancelHostTimeout = function () {
    _clearTimeout(taskTimeoutID);
    taskTimeoutID = -1;
  };
}

/* eslint-disable no-var */

// TODO: Use symbols?
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var maxSigned31BitInt = 1073741823;

// Times out immediately
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
// Eventually times out
var USER_BLOCKING_PRIORITY = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000;
// Never times out
var IDLE_PRIORITY = maxSigned31BitInt;

// Tasks are stored as a circular, doubly linked list.
var firstTask = null;
var firstDelayedTask = null;

// Pausing the scheduler is useful for debugging.
var isSchedulerPaused = false;

var currentTask = null;
var currentPriorityLevel = NormalPriority;

// This is set while performing work, to prevent re-entrancy.
var isPerformingWork = false;

var isHostCallbackScheduled = false;
var isHostTimeoutScheduled = false;

function scheduler_flushTaskAtPriority_Immediate(callback, didTimeout) {
  return callback(didTimeout);
}
function scheduler_flushTaskAtPriority_UserBlocking(callback, didTimeout) {
  return callback(didTimeout);
}
function scheduler_flushTaskAtPriority_Normal(callback, didTimeout) {
  return callback(didTimeout);
}
function scheduler_flushTaskAtPriority_Low(callback, didTimeout) {
  return callback(didTimeout);
}
function scheduler_flushTaskAtPriority_Idle(callback, didTimeout) {
  return callback(didTimeout);
}

function flushTask(task, currentTime) {
  // Remove the task from the list before calling the callback. That way the
  // list is in a consistent state even if the callback throws.
  var next = task.next;
  if (next === task) {
    // This is the only scheduled task. Clear the list.
    firstTask = null;
  } else {
    // Remove the task from its position in the list.
    if (task === firstTask) {
      firstTask = next;
    }
    var previous = task.previous;
    previous.next = next;
    next.previous = previous;
  }
  task.next = task.previous = null;

  // Now it's safe to execute the task.
  var callback = task.callback;
  var previousPriorityLevel = currentPriorityLevel;
  var previousTask = currentTask;
  currentPriorityLevel = task.priorityLevel;
  currentTask = task;
  var continuationCallback;
  try {
    var didUserCallbackTimeout = task.expirationTime <= currentTime;
    // Add an extra function to the callstack. Profiling tools can use this
    // to infer the priority of work that appears higher in the stack.
    switch (currentPriorityLevel) {
      case ImmediatePriority:
        continuationCallback = scheduler_flushTaskAtPriority_Immediate(callback, didUserCallbackTimeout);
        break;
      case UserBlockingPriority:
        continuationCallback = scheduler_flushTaskAtPriority_UserBlocking(callback, didUserCallbackTimeout);
        break;
      case NormalPriority:
        continuationCallback = scheduler_flushTaskAtPriority_Normal(callback, didUserCallbackTimeout);
        break;
      case LowPriority:
        continuationCallback = scheduler_flushTaskAtPriority_Low(callback, didUserCallbackTimeout);
        break;
      case IdlePriority:
        continuationCallback = scheduler_flushTaskAtPriority_Idle(callback, didUserCallbackTimeout);
        break;
    }
  } catch (error) {
    throw error;
  } finally {
    currentPriorityLevel = previousPriorityLevel;
    currentTask = previousTask;
  }

  // A callback may return a continuation. The continuation should be scheduled
  // with the same priority and expiration as the just-finished callback.
  if (typeof continuationCallback === 'function') {
    var expirationTime = task.expirationTime;
    var continuationTask = task;
    continuationTask.callback = continuationCallback;

    // Insert the new callback into the list, sorted by its timeout. This is
    // almost the same as the code in `scheduleCallback`, except the callback
    // is inserted into the list *before* callbacks of equal timeout instead
    // of after.
    if (firstTask === null) {
      // This is the first callback in the list.
      firstTask = continuationTask.next = continuationTask.previous = continuationTask;
    } else {
      var nextAfterContinuation = null;
      var t = firstTask;
      do {
        if (expirationTime <= t.expirationTime) {
          // This task times out at or after the continuation. We will insert
          // the continuation *before* this task.
          nextAfterContinuation = t;
          break;
        }
        t = t.next;
      } while (t !== firstTask);
      if (nextAfterContinuation === null) {
        // No equal or lower priority task was found, which means the new task
        // is the lowest priority task in the list.
        nextAfterContinuation = firstTask;
      } else if (nextAfterContinuation === firstTask) {
        // The new task is the highest priority task in the list.
        firstTask = continuationTask;
      }

      var _previous = nextAfterContinuation.previous;
      _previous.next = nextAfterContinuation.previous = continuationTask;
      continuationTask.next = nextAfterContinuation;
      continuationTask.previous = _previous;
    }
  }
}

function advanceTimers(currentTime) {
  // Check for tasks that are no longer delayed and add them to the queue.
  if (firstDelayedTask !== null && firstDelayedTask.startTime <= currentTime) {
    do {
      var task = firstDelayedTask;
      var next = task.next;
      if (task === next) {
        firstDelayedTask = null;
      } else {
        firstDelayedTask = next;
        var previous = task.previous;
        previous.next = next;
        next.previous = previous;
      }
      task.next = task.previous = null;
      insertScheduledTask(task, task.expirationTime);
    } while (firstDelayedTask !== null && firstDelayedTask.startTime <= currentTime);
  }
}

function handleTimeout(currentTime) {
  isHostTimeoutScheduled = false;
  advanceTimers(currentTime);

  if (!isHostCallbackScheduled) {
    if (firstTask !== null) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    } else if (firstDelayedTask !== null) {
      requestHostTimeout(handleTimeout, firstDelayedTask.startTime - currentTime);
    }
  }
}

function flushWork(hasTimeRemaining, initialTime) {
  // Exit right away if we're currently paused
  if (enableSchedulerDebugging && isSchedulerPaused) {
    return;
  }

  // We'll need a host callback the next time work is scheduled.
  isHostCallbackScheduled = false;
  if (isHostTimeoutScheduled) {
    // We scheduled a timeout but it's no longer needed. Cancel it.
    isHostTimeoutScheduled = false;
    cancelHostTimeout();
  }

  var currentTime = initialTime;
  advanceTimers(currentTime);

  isPerformingWork = true;
  try {
    if (!hasTimeRemaining) {
      // Flush all the expired callbacks without yielding.
      // TODO: Split flushWork into two separate functions instead of using
      // a boolean argument?
      while (firstTask !== null && firstTask.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused)) {
        flushTask(firstTask, currentTime);
        currentTime = exports.unstable_now();
        advanceTimers(currentTime);
      }
    } else {
      // Keep flushing callbacks until we run out of time in the frame.
      if (firstTask !== null) {
        do {
          flushTask(firstTask, currentTime);
          currentTime = exports.unstable_now();
          advanceTimers(currentTime);
        } while (firstTask !== null && !shouldYieldToHost() && !(enableSchedulerDebugging && isSchedulerPaused));
      }
    }
    // Return whether there's additional work
    if (firstTask !== null) {
      return true;
    } else {
      if (firstDelayedTask !== null) {
        requestHostTimeout(handleTimeout, firstDelayedTask.startTime - currentTime);
      }
      return false;
    }
  } finally {
    isPerformingWork = false;
  }
}

function unstable_runWithPriority(priorityLevel, eventHandler) {
  switch (priorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
    case LowPriority:
    case IdlePriority:
      break;
    default:
      priorityLevel = NormalPriority;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_next(eventHandler) {
  var priorityLevel;
  switch (currentPriorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
      // Shift down to normal priority
      priorityLevel = NormalPriority;
      break;
    default:
      // Anything lower than normal priority should remain at the current level.
      priorityLevel = currentPriorityLevel;
      break;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_wrapCallback(callback) {
  var parentPriorityLevel = currentPriorityLevel;
  return function () {
    // This is a fork of runWithPriority, inlined for performance.
    var previousPriorityLevel = currentPriorityLevel;
    currentPriorityLevel = parentPriorityLevel;

    try {
      return callback.apply(this, arguments);
    } finally {
      currentPriorityLevel = previousPriorityLevel;
    }
  };
}

function timeoutForPriorityLevel(priorityLevel) {
  switch (priorityLevel) {
    case ImmediatePriority:
      return IMMEDIATE_PRIORITY_TIMEOUT;
    case UserBlockingPriority:
      return USER_BLOCKING_PRIORITY;
    case IdlePriority:
      return IDLE_PRIORITY;
    case LowPriority:
      return LOW_PRIORITY_TIMEOUT;
    case NormalPriority:
    default:
      return NORMAL_PRIORITY_TIMEOUT;
  }
}

function unstable_scheduleCallback(priorityLevel, callback, options) {
  var currentTime = exports.unstable_now();

  var startTime;
  var timeout;
  if (typeof options === 'object' && options !== null) {
    var delay = options.delay;
    if (typeof delay === 'number' && delay > 0) {
      startTime = currentTime + delay;
    } else {
      startTime = currentTime;
    }
    timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
  } else {
    timeout = timeoutForPriorityLevel(priorityLevel);
    startTime = currentTime;
  }

  var expirationTime = startTime + timeout;

  var newTask = {
    callback: callback,
    priorityLevel: priorityLevel,
    startTime: startTime,
    expirationTime: expirationTime,
    next: null,
    previous: null
  };

  if (startTime > currentTime) {
    // This is a delayed task.
    insertDelayedTask(newTask, startTime);
    if (firstTask === null && firstDelayedTask === newTask) {
      // All tasks are delayed, and this is the task with the earliest delay.
      if (isHostTimeoutScheduled) {
        // Cancel an existing timeout.
        cancelHostTimeout();
      } else {
        isHostTimeoutScheduled = true;
      }
      // Schedule a timeout.
      requestHostTimeout(handleTimeout, startTime - currentTime);
    }
  } else {
    insertScheduledTask(newTask, expirationTime);
    // Schedule a host callback, if needed. If we're already performing work,
    // wait until the next time we yield.
    if (!isHostCallbackScheduled && !isPerformingWork) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    }
  }

  return newTask;
}

function insertScheduledTask(newTask, expirationTime) {
  // Insert the new task into the list, ordered first by its timeout, then by
  // insertion. So the new task is inserted after any other task the
  // same timeout
  if (firstTask === null) {
    // This is the first task in the list.
    firstTask = newTask.next = newTask.previous = newTask;
  } else {
    var next = null;
    var task = firstTask;
    do {
      if (expirationTime < task.expirationTime) {
        // The new task times out before this one.
        next = task;
        break;
      }
      task = task.next;
    } while (task !== firstTask);

    if (next === null) {
      // No task with a later timeout was found, which means the new task has
      // the latest timeout in the list.
      next = firstTask;
    } else if (next === firstTask) {
      // The new task has the earliest expiration in the entire list.
      firstTask = newTask;
    }

    var previous = next.previous;
    previous.next = next.previous = newTask;
    newTask.next = next;
    newTask.previous = previous;
  }
}

function insertDelayedTask(newTask, startTime) {
  // Insert the new task into the list, ordered by its start time.
  if (firstDelayedTask === null) {
    // This is the first task in the list.
    firstDelayedTask = newTask.next = newTask.previous = newTask;
  } else {
    var next = null;
    var task = firstDelayedTask;
    do {
      if (startTime < task.startTime) {
        // The new task times out before this one.
        next = task;
        break;
      }
      task = task.next;
    } while (task !== firstDelayedTask);

    if (next === null) {
      // No task with a later timeout was found, which means the new task has
      // the latest timeout in the list.
      next = firstDelayedTask;
    } else if (next === firstDelayedTask) {
      // The new task has the earliest expiration in the entire list.
      firstDelayedTask = newTask;
    }

    var previous = next.previous;
    previous.next = next.previous = newTask;
    newTask.next = next;
    newTask.previous = previous;
  }
}

function unstable_pauseExecution() {
  isSchedulerPaused = true;
}

function unstable_continueExecution() {
  isSchedulerPaused = false;
  if (!isHostCallbackScheduled && !isPerformingWork) {
    isHostCallbackScheduled = true;
    requestHostCallback(flushWork);
  }
}

function unstable_getFirstCallbackNode() {
  return firstTask;
}

function unstable_cancelCallback(task) {
  var next = task.next;
  if (next === null) {
    // Already cancelled.
    return;
  }

  if (task === next) {
    if (task === firstTask) {
      firstTask = null;
    } else if (task === firstDelayedTask) {
      firstDelayedTask = null;
    }
  } else {
    if (task === firstTask) {
      firstTask = next;
    } else if (task === firstDelayedTask) {
      firstDelayedTask = next;
    }
    var previous = task.previous;
    previous.next = next;
    next.previous = previous;
  }

  task.next = task.previous = null;
}

function unstable_getCurrentPriorityLevel() {
  return currentPriorityLevel;
}

function unstable_shouldYield() {
  var currentTime = exports.unstable_now();
  advanceTimers(currentTime);
  return currentTask !== null && firstTask !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
}

var unstable_requestPaint = requestPaint;

exports.unstable_ImmediatePriority = ImmediatePriority;
exports.unstable_UserBlockingPriority = UserBlockingPriority;
exports.unstable_NormalPriority = NormalPriority;
exports.unstable_IdlePriority = IdlePriority;
exports.unstable_LowPriority = LowPriority;
exports.unstable_runWithPriority = unstable_runWithPriority;
exports.unstable_next = unstable_next;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_wrapCallback = unstable_wrapCallback;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_shouldYield = unstable_shouldYield;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_continueExecution = unstable_continueExecution;
exports.unstable_pauseExecution = unstable_pauseExecution;
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
  })();
}


/***/ }),

/***/ "./node_modules/react-dom/node_modules/scheduler/index.js":
/*!****************************************************************!*\
  !*** ./node_modules/react-dom/node_modules/scheduler/index.js ***!
  \****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {} else {
  module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ "./node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js");
}


/***/ }),

/***/ "./node_modules/react-dom/node_modules/scheduler/tracing.js":
/*!******************************************************************!*\
  !*** ./node_modules/react-dom/node_modules/scheduler/tracing.js ***!
  \******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {} else {
  module.exports = __webpack_require__(/*! ./cjs/scheduler-tracing.development.js */ "./node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js");
}


/***/ }),

/***/ "./node_modules/react/cjs/react.development.js":
/*!*****************************************************!*\
  !*** ./node_modules/react/cjs/react.development.js ***!
  \*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.9.0
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");

// TODO: this is special because it gets imported during build.

var ReactVersion = '16.9.0';

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;

var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?

var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';

function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }
  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }
  return null;
}

// Do not require this module directly! Use normal `invariant` calls with
// template literal strings. The messages will be converted to ReactError during
// build, and in production they will be minified.

// Do not require this module directly! Use normal `invariant` calls with
// template literal strings. The messages will be converted to ReactError during
// build, and in production they will be minified.

function ReactError(error) {
  error.name = 'Invariant Violation';
  return error;
}

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warningWithoutStack = function () {};

{
  warningWithoutStack = function (condition, format) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    if (format === undefined) {
      throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      var argsWithFormat = args.map(function (item) {
        return '' + item;
      });
      argsWithFormat.unshift('Warning: ' + format);

      // We intentionally don't use spread (or .apply) directly because it
      // breaks IE9: https://github.com/facebook/react/issues/13610
      Function.prototype.apply.call(console.error, console, argsWithFormat);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      var argIndex = 0;
      var message = 'Warning: ' + format.replace(/%s/g, function () {
        return args[argIndex++];
      });
      throw new Error(message);
    } catch (x) {}
  };
}

var warningWithoutStack$1 = warningWithoutStack;

var didWarnStateUpdateForUnmountedComponent = {};

function warnNoop(publicInstance, callerName) {
  {
    var _constructor = publicInstance.constructor;
    var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
    var warningKey = componentName + '.' + callerName;
    if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
      return;
    }
    warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
    didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  }
}

/**
 * This is the abstract API for an update queue.
 */
var ReactNoopUpdateQueue = {
  /**
   * Checks whether or not this composite component is mounted.
   * @param {ReactClass} publicInstance The instance we want to test.
   * @return {boolean} True if mounted, false otherwise.
   * @protected
   * @final
   */
  isMounted: function (publicInstance) {
    return false;
  },

  /**
   * Forces an update. This should only be invoked when it is known with
   * certainty that we are **not** in a DOM transaction.
   *
   * You may want to call this when you know that some deeper aspect of the
   * component's state has changed but `setState` was not called.
   *
   * This will not invoke `shouldComponentUpdate`, but it will invoke
   * `componentWillUpdate` and `componentDidUpdate`.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueForceUpdate: function (publicInstance, callback, callerName) {
    warnNoop(publicInstance, 'forceUpdate');
  },

  /**
   * Replaces all of the state. Always use this or `setState` to mutate state.
   * You should treat `this.state` as immutable.
   *
   * There is no guarantee that `this.state` will be immediately updated, so
   * accessing `this.state` after calling this method may return the old value.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} completeState Next state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
    warnNoop(publicInstance, 'replaceState');
  },

  /**
   * Sets a subset of the state. This only exists because _pendingState is
   * internal. This provides a merging strategy that is not available to deep
   * properties which is confusing. TODO: Expose pendingState or don't use it
   * during the merge.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} partialState Next partial state to be merged with state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} Name of the calling function in the public API.
   * @internal
   */
  enqueueSetState: function (publicInstance, partialState, callback, callerName) {
    warnNoop(publicInstance, 'setState');
  }
};

var emptyObject = {};
{
  Object.freeze(emptyObject);
}

/**
 * Base class helpers for the updating state of a component.
 */
function Component(props, context, updater) {
  this.props = props;
  this.context = context;
  // If a component has string refs, we will assign a different object later.
  this.refs = emptyObject;
  // We initialize the default updater but the real one gets injected by the
  // renderer.
  this.updater = updater || ReactNoopUpdateQueue;
}

Component.prototype.isReactComponent = {};

/**
 * Sets a subset of the state. Always use this to mutate
 * state. You should treat `this.state` as immutable.
 *
 * There is no guarantee that `this.state` will be immediately updated, so
 * accessing `this.state` after calling this method may return the old value.
 *
 * There is no guarantee that calls to `setState` will run synchronously,
 * as they may eventually be batched together.  You can provide an optional
 * callback that will be executed when the call to setState is actually
 * completed.
 *
 * When a function is provided to setState, it will be called at some point in
 * the future (not synchronously). It will be called with the up to date
 * component arguments (state, props, context). These values can be different
 * from this.* because your function may be called after receiveProps but before
 * shouldComponentUpdate, and this new state, props, and context will not yet be
 * assigned to this.
 *
 * @param {object|function} partialState Next partial state or function to
 *        produce next partial state to be merged with current state.
 * @param {?function} callback Called after state is updated.
 * @final
 * @protected
 */
Component.prototype.setState = function (partialState, callback) {
  (function () {
    if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
      {
        throw ReactError(Error('setState(...): takes an object of state variables to update or a function which returns an object of state variables.'));
      }
    }
  })();
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
};

/**
 * Forces an update. This should only be invoked when it is known with
 * certainty that we are **not** in a DOM transaction.
 *
 * You may want to call this when you know that some deeper aspect of the
 * component's state has changed but `setState` was not called.
 *
 * This will not invoke `shouldComponentUpdate`, but it will invoke
 * `componentWillUpdate` and `componentDidUpdate`.
 *
 * @param {?function} callback Called after update is complete.
 * @final
 * @protected
 */
Component.prototype.forceUpdate = function (callback) {
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
};

/**
 * Deprecated APIs. These APIs used to exist on classic React classes but since
 * we would like to deprecate them, we're not going to move them over to this
 * modern base class. Instead, we define a getter that warns if it's accessed.
 */
{
  var deprecatedAPIs = {
    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  };
  var defineDeprecationWarning = function (methodName, info) {
    Object.defineProperty(Component.prototype, methodName, {
      get: function () {
        lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
        return undefined;
      }
    });
  };
  for (var fnName in deprecatedAPIs) {
    if (deprecatedAPIs.hasOwnProperty(fnName)) {
      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
    }
  }
}

function ComponentDummy() {}
ComponentDummy.prototype = Component.prototype;

/**
 * Convenience component with default shallow equality check for sCU.
 */
function PureComponent(props, context, updater) {
  this.props = props;
  this.context = context;
  // If a component has string refs, we will assign a different object later.
  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}

var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
// Avoid an extra prototype jump for these methods.
_assign(pureComponentPrototype, Component.prototype);
pureComponentPrototype.isPureReactComponent = true;

// an immutable object with a single mutable value
function createRef() {
  var refObject = {
    current: null
  };
  {
    Object.seal(refObject);
  }
  return refObject;
}

/**
 * Keeps track of the current dispatcher.
 */
var ReactCurrentDispatcher = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

/**
 * Keeps track of the current batch's configuration such as how long an update
 * should suspend for if it needs to.
 */
var ReactCurrentBatchConfig = {
  suspense: null
};

/**
 * Keeps track of the current owner.
 *
 * The current owner is the component who should own any components that are
 * currently being constructed.
 */
var ReactCurrentOwner = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

var BEFORE_SLASH_RE = /^(.*)[\\\/]/;

var describeComponentFrame = function (name, source, ownerName) {
  var sourceInfo = '';
  if (source) {
    var path = source.fileName;
    var fileName = path.replace(BEFORE_SLASH_RE, '');
    {
      // In DEV, include code for a common special case:
      // prefer "folder/index.js" instead of just "index.js".
      if (/^index\./.test(fileName)) {
        var match = path.match(BEFORE_SLASH_RE);
        if (match) {
          var pathBeforeSlash = match[1];
          if (pathBeforeSlash) {
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
            fileName = folderName + '/' + fileName;
          }
        }
      }
    }
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  } else if (ownerName) {
    sourceInfo = ' (created by ' + ownerName + ')';
  }
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
};

var Resolved = 1;


function refineResolvedLazyComponent(lazyComponent) {
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }
  {
    if (typeof type.tag === 'number') {
      warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }
  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }
  if (typeof type === 'string') {
    return type;
  }
  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';
    case REACT_PORTAL_TYPE:
      return 'Portal';
    case REACT_PROFILER_TYPE:
      return 'Profiler';
    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';
    case REACT_SUSPENSE_TYPE:
      return 'Suspense';
    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }
  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        return 'Context.Consumer';
      case REACT_PROVIDER_TYPE:
        return 'Context.Provider';
      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');
      case REACT_MEMO_TYPE:
        return getComponentName(type.type);
      case REACT_LAZY_TYPE:
        {
          var thenable = type;
          var resolvedThenable = refineResolvedLazyComponent(thenable);
          if (resolvedThenable) {
            return getComponentName(resolvedThenable);
          }
          break;
        }
    }
  }
  return null;
}

var ReactDebugCurrentFrame = {};

var currentlyValidatingElement = null;

function setCurrentlyValidatingElement(element) {
  {
    currentlyValidatingElement = element;
  }
}

{
  // Stack implementation injected by the current renderer.
  ReactDebugCurrentFrame.getCurrentStack = null;

  ReactDebugCurrentFrame.getStackAddendum = function () {
    var stack = '';

    // Add an extra top frame while an element is being validated
    if (currentlyValidatingElement) {
      var name = getComponentName(currentlyValidatingElement.type);
      var owner = currentlyValidatingElement._owner;
      stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
    }

    // Delegate to the injected renderer-specific implementation
    var impl = ReactDebugCurrentFrame.getCurrentStack;
    if (impl) {
      stack += impl() || '';
    }

    return stack;
  };
}

/**
 * Used by act() to track whether you're inside an act() scope.
 */

var IsSomeRendererActing = {
  current: false
};

var ReactSharedInternals = {
  ReactCurrentDispatcher: ReactCurrentDispatcher,
  ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  ReactCurrentOwner: ReactCurrentOwner,
  IsSomeRendererActing: IsSomeRendererActing,
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  assign: _assign
};

{
  _assign(ReactSharedInternals, {
    // These should not be included in production.
    ReactDebugCurrentFrame: ReactDebugCurrentFrame,
    // Shim for React DOM 16.0.0 which still destructured (but not used) this.
    // TODO: remove in React 17.0.
    ReactComponentTreeHook: {}
  });
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = warningWithoutStack$1;

{
  warning = function (condition, format) {
    if (condition) {
      return;
    }
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();
    // eslint-disable-next-line react-internal/warning-and-invariant-args

    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
  };
}

var warning$1 = warning;

var hasOwnProperty = Object.prototype.hasOwnProperty;

var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};

var specialPropKeyWarningShown = void 0;
var specialPropRefWarningShown = void 0;

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }
  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }
  return config.key !== undefined;
}

function defineKeyPropWarningGetter(props, displayName) {
  var warnAboutAccessingKey = function () {
    if (!specialPropKeyWarningShown) {
      specialPropKeyWarningShown = true;
      warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
    }
  };
  warnAboutAccessingKey.isReactWarning = true;
  Object.defineProperty(props, 'key', {
    get: warnAboutAccessingKey,
    configurable: true
  });
}

function defineRefPropWarningGetter(props, displayName) {
  var warnAboutAccessingRef = function () {
    if (!specialPropRefWarningShown) {
      specialPropRefWarningShown = true;
      warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
    }
  };
  warnAboutAccessingRef.isReactWarning = true;
  Object.defineProperty(props, 'ref', {
    get: warnAboutAccessingRef,
    configurable: true
  });
}

/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, no instanceof check
 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */
var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,

    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,

    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {};

    // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.
    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    });
    // self and source are DEV only properties.
    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    });
    // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.
    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });
    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};

/**
 * https://github.com/reactjs/rfcs/pull/107
 * @param {*} type
 * @param {object} props
 * @param {string} key
 */


/**
 * https://github.com/reactjs/rfcs/pull/107
 * @param {*} type
 * @param {object} props
 * @param {string} key
 */
function jsxDEV(type, config, maybeKey, source, self) {
  var propName = void 0;

  // Reserved names are extracted
  var props = {};

  var key = null;
  var ref = null;

  if (hasValidRef(config)) {
    ref = config.ref;
  }

  if (hasValidKey(config)) {
    key = '' + config.key;
  }

  // Remaining properties are added to a new props object
  for (propName in config) {
    if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
      props[propName] = config[propName];
    }
  }

  // intentionally not checking if key was set above
  // this key is higher priority as it's static
  if (maybeKey !== undefined) {
    key = '' + maybeKey;
  }

  // Resolve default props
  if (type && type.defaultProps) {
    var defaultProps = type.defaultProps;
    for (propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
  }

  if (key || ref) {
    var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
    if (key) {
      defineKeyPropWarningGetter(props, displayName);
    }
    if (ref) {
      defineRefPropWarningGetter(props, displayName);
    }
  }

  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
}

/**
 * Create and return a new ReactElement of the given type.
 * See https://reactjs.org/docs/react-api.html#createelement
 */
function createElement(type, config, children) {
  var propName = void 0;

  // Reserved names are extracted
  var props = {};

  var key = null;
  var ref = null;
  var self = null;
  var source = null;

  if (config != null) {
    if (hasValidRef(config)) {
      ref = config.ref;
    }
    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    self = config.__self === undefined ? null : config.__self;
    source = config.__source === undefined ? null : config.__source;
    // Remaining properties are added to a new props object
    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    }
  }

  // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.
  var childrenLength = arguments.length - 2;
  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);
    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }
    {
      if (Object.freeze) {
        Object.freeze(childArray);
      }
    }
    props.children = childArray;
  }

  // Resolve default props
  if (type && type.defaultProps) {
    var defaultProps = type.defaultProps;
    for (propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
  }
  {
    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }
      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }
  }
  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
}

/**
 * Return a function that produces ReactElements of a given type.
 * See https://reactjs.org/docs/react-api.html#createfactory
 */


function cloneAndReplaceKey(oldElement, newKey) {
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);

  return newElement;
}

/**
 * Clone and return a new ReactElement using element as the starting point.
 * See https://reactjs.org/docs/react-api.html#cloneelement
 */
function cloneElement(element, config, children) {
  (function () {
    if (!!(element === null || element === undefined)) {
      {
        throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));
      }
    }
  })();

  var propName = void 0;

  // Original props are copied
  var props = _assign({}, element.props);

  // Reserved names are extracted
  var key = element.key;
  var ref = element.ref;
  // Self is preserved since the owner is preserved.
  var self = element._self;
  // Source is preserved since cloneElement is unlikely to be targeted by a
  // transpiler, and the original source is probably a better indicator of the
  // true owner.
  var source = element._source;

  // Owner will be preserved, unless ref is overridden
  var owner = element._owner;

  if (config != null) {
    if (hasValidRef(config)) {
      // Silently steal the ref from the parent.
      ref = config.ref;
      owner = ReactCurrentOwner.current;
    }
    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    // Remaining properties override existing props
    var defaultProps = void 0;
    if (element.type && element.type.defaultProps) {
      defaultProps = element.type.defaultProps;
    }
    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        if (config[propName] === undefined && defaultProps !== undefined) {
          // Resolve default props
          props[propName] = defaultProps[propName];
        } else {
          props[propName] = config[propName];
        }
      }
    }
  }

  // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.
  var childrenLength = arguments.length - 2;
  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);
    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }
    props.children = childArray;
  }

  return ReactElement(element.type, key, ref, self, source, owner, props);
}

/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */
function isValidElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}

var SEPARATOR = '.';
var SUBSEPARATOR = ':';

/**
 * Escape and wrap key so it is safe to use as a reactid
 *
 * @param {string} key to be escaped.
 * @return {string} the escaped key.
 */
function escape(key) {
  var escapeRegex = /[=:]/g;
  var escaperLookup = {
    '=': '=0',
    ':': '=2'
  };
  var escapedString = ('' + key).replace(escapeRegex, function (match) {
    return escaperLookup[match];
  });

  return '$' + escapedString;
}

/**
 * TODO: Test that a single child and an array with one item have the same key
 * pattern.
 */

var didWarnAboutMaps = false;

var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text) {
  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
}

var POOL_SIZE = 10;
var traverseContextPool = [];
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
  if (traverseContextPool.length) {
    var traverseContext = traverseContextPool.pop();
    traverseContext.result = mapResult;
    traverseContext.keyPrefix = keyPrefix;
    traverseContext.func = mapFunction;
    traverseContext.context = mapContext;
    traverseContext.count = 0;
    return traverseContext;
  } else {
    return {
      result: mapResult,
      keyPrefix: keyPrefix,
      func: mapFunction,
      context: mapContext,
      count: 0
    };
  }
}

function releaseTraverseContext(traverseContext) {
  traverseContext.result = null;
  traverseContext.keyPrefix = null;
  traverseContext.func = null;
  traverseContext.context = null;
  traverseContext.count = 0;
  if (traverseContextPool.length < POOL_SIZE) {
    traverseContextPool.push(traverseContext);
  }
}

/**
 * @param {?*} children Children tree container.
 * @param {!string} nameSoFar Name of the key path so far.
 * @param {!function} callback Callback to invoke with each child found.
 * @param {?*} traverseContext Used to pass information throughout the traversal
 * process.
 * @return {!number} The number of children in this subtree.
 */
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  var type = typeof children;

  if (type === 'undefined' || type === 'boolean') {
    // All of the above are perceived as null.
    children = null;
  }

  var invokeCallback = false;

  if (children === null) {
    invokeCallback = true;
  } else {
    switch (type) {
      case 'string':
      case 'number':
        invokeCallback = true;
        break;
      case 'object':
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE:
          case REACT_PORTAL_TYPE:
            invokeCallback = true;
        }
    }
  }

  if (invokeCallback) {
    callback(traverseContext, children,
    // If it's the only child, treat the name as if it was wrapped in an array
    // so that it's consistent if the number of children grows.
    nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
    return 1;
  }

  var child = void 0;
  var nextName = void 0;
  var subtreeCount = 0; // Count of children found in the current subtree.
  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;

  if (Array.isArray(children)) {
    for (var i = 0; i < children.length; i++) {
      child = children[i];
      nextName = nextNamePrefix + getComponentKey(child, i);
      subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
    }
  } else {
    var iteratorFn = getIteratorFn(children);
    if (typeof iteratorFn === 'function') {
      {
        // Warn about using Maps as children
        if (iteratorFn === children.entries) {
          !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
          didWarnAboutMaps = true;
        }
      }

      var iterator = iteratorFn.call(children);
      var step = void 0;
      var ii = 0;
      while (!(step = iterator.next()).done) {
        child = step.value;
        nextName = nextNamePrefix + getComponentKey(child, ii++);
        subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
      }
    } else if (type === 'object') {
      var addendum = '';
      {
        addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
      }
      var childrenString = '' + children;
      (function () {
        {
          {
            throw ReactError(Error('Objects are not valid as a React child (found: ' + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ').' + addendum));
          }
        }
      })();
    }
  }

  return subtreeCount;
}

/**
 * Traverses children that are typically specified as `props.children`, but
 * might also be specified through attributes:
 *
 * - `traverseAllChildren(this.props.children, ...)`
 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
 *
 * The `traverseContext` is an optional argument that is passed through the
 * entire traversal. It can be used to store accumulations or anything else that
 * the callback might find relevant.
 *
 * @param {?*} children Children tree object.
 * @param {!function} callback To invoke upon traversing each child.
 * @param {?*} traverseContext Context for traversal.
 * @return {!number} The number of children in this subtree.
 */
function traverseAllChildren(children, callback, traverseContext) {
  if (children == null) {
    return 0;
  }

  return traverseAllChildrenImpl(children, '', callback, traverseContext);
}

/**
 * Generate a key string that identifies a component within a set.
 *
 * @param {*} component A component that could contain a manual key.
 * @param {number} index Index that is used if a manual key is not provided.
 * @return {string}
 */
function getComponentKey(component, index) {
  // Do some typechecking here since we call this blindly. We want to ensure
  // that we don't block potential future ES APIs.
  if (typeof component === 'object' && component !== null && component.key != null) {
    // Explicit key
    return escape(component.key);
  }
  // Implicit key determined by the index in the set
  return index.toString(36);
}

function forEachSingleChild(bookKeeping, child, name) {
  var func = bookKeeping.func,
      context = bookKeeping.context;

  func.call(context, child, bookKeeping.count++);
}

/**
 * Iterates through children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} forEachFunc
 * @param {*} forEachContext Context for forEachContext.
 */
function forEachChildren(children, forEachFunc, forEachContext) {
  if (children == null) {
    return children;
  }
  var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
  traverseAllChildren(children, forEachSingleChild, traverseContext);
  releaseTraverseContext(traverseContext);
}

function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  var result = bookKeeping.result,
      keyPrefix = bookKeeping.keyPrefix,
      func = bookKeeping.func,
      context = bookKeeping.context;


  var mappedChild = func.call(context, child, bookKeeping.count++);
  if (Array.isArray(mappedChild)) {
    mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
      return c;
    });
  } else if (mappedChild != null) {
    if (isValidElement(mappedChild)) {
      mappedChild = cloneAndReplaceKey(mappedChild,
      // Keep both the (mapped) and old keys if they differ, just as
      // traverseAllChildren used to do for objects as children
      keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
    }
    result.push(mappedChild);
  }
}

function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  var escapedPrefix = '';
  if (prefix != null) {
    escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  }
  var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  releaseTraverseContext(traverseContext);
}

/**
 * Maps children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
 *
 * The provided mapFunction(child, key, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} func The map function.
 * @param {*} context Context for mapFunction.
 * @return {object} Object containing the ordered map of results.
 */
function mapChildren(children, func, context) {
  if (children == null) {
    return children;
  }
  var result = [];
  mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  return result;
}

/**
 * Count the number of children that are typically specified as
 * `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrencount
 *
 * @param {?*} children Children tree container.
 * @return {number} The number of children.
 */
function countChildren(children) {
  return traverseAllChildren(children, function () {
    return null;
  }, null);
}

/**
 * Flatten a children object (typically specified as `props.children`) and
 * return an array with appropriately re-keyed children.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
 */
function toArray(children) {
  var result = [];
  mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
    return child;
  });
  return result;
}

/**
 * Returns the first child in a collection of children and verifies that there
 * is only one child in the collection.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
 *
 * The current implementation of this function assumes that a single child gets
 * passed without a wrapper, but the purpose of this helper function is to
 * abstract away the particular structure of children.
 *
 * @param {?object} children Child collection structure.
 * @return {ReactElement} The first and only `ReactElement` contained in the
 * structure.
 */
function onlyChild(children) {
  (function () {
    if (!isValidElement(children)) {
      {
        throw ReactError(Error('React.Children.only expected to receive a single React element child.'));
      }
    }
  })();
  return children;
}

function createContext(defaultValue, calculateChangedBits) {
  if (calculateChangedBits === undefined) {
    calculateChangedBits = null;
  } else {
    {
      !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
    }
  }

  var context = {
    $$typeof: REACT_CONTEXT_TYPE,
    _calculateChangedBits: calculateChangedBits,
    // As a workaround to support multiple concurrent renderers, we categorize
    // some renderers as primary and others as secondary. We only expect
    // there to be two concurrent renderers at most: React Native (primary) and
    // Fabric (secondary); React DOM (primary) and React ART (secondary).
    // Secondary renderers store their context values on separate fields.
    _currentValue: defaultValue,
    _currentValue2: defaultValue,
    // Used to track how many concurrent renderers this context currently
    // supports within in a single renderer. Such as parallel server rendering.
    _threadCount: 0,
    // These are circular
    Provider: null,
    Consumer: null
  };

  context.Provider = {
    $$typeof: REACT_PROVIDER_TYPE,
    _context: context
  };

  var hasWarnedAboutUsingNestedContextConsumers = false;
  var hasWarnedAboutUsingConsumerProvider = false;

  {
    // A separate object, but proxies back to the original context object for
    // backwards compatibility. It has a different $$typeof, so we can properly
    // warn for the incorrect usage of Context as a Consumer.
    var Consumer = {
      $$typeof: REACT_CONTEXT_TYPE,
      _context: context,
      _calculateChangedBits: context._calculateChangedBits
    };
    // $FlowFixMe: Flow complains about not setting a value, which is intentional here
    Object.defineProperties(Consumer, {
      Provider: {
        get: function () {
          if (!hasWarnedAboutUsingConsumerProvider) {
            hasWarnedAboutUsingConsumerProvider = true;
            warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
          }
          return context.Provider;
        },
        set: function (_Provider) {
          context.Provider = _Provider;
        }
      },
      _currentValue: {
        get: function () {
          return context._currentValue;
        },
        set: function (_currentValue) {
          context._currentValue = _currentValue;
        }
      },
      _currentValue2: {
        get: function () {
          return context._currentValue2;
        },
        set: function (_currentValue2) {
          context._currentValue2 = _currentValue2;
        }
      },
      _threadCount: {
        get: function () {
          return context._threadCount;
        },
        set: function (_threadCount) {
          context._threadCount = _threadCount;
        }
      },
      Consumer: {
        get: function () {
          if (!hasWarnedAboutUsingNestedContextConsumers) {
            hasWarnedAboutUsingNestedContextConsumers = true;
            warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
          }
          return context.Consumer;
        }
      }
    });
    // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
    context.Consumer = Consumer;
  }

  {
    context._currentRenderer = null;
    context._currentRenderer2 = null;
  }

  return context;
}

function lazy(ctor) {
  var lazyType = {
    $$typeof: REACT_LAZY_TYPE,
    _ctor: ctor,
    // React uses these fields to store the result.
    _status: -1,
    _result: null
  };

  {
    // In production, this would just set it on the object.
    var defaultProps = void 0;
    var propTypes = void 0;
    Object.defineProperties(lazyType, {
      defaultProps: {
        configurable: true,
        get: function () {
          return defaultProps;
        },
        set: function (newDefaultProps) {
          warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
          defaultProps = newDefaultProps;
          // Match production behavior more closely:
          Object.defineProperty(lazyType, 'defaultProps', {
            enumerable: true
          });
        }
      },
      propTypes: {
        configurable: true,
        get: function () {
          return propTypes;
        },
        set: function (newPropTypes) {
          warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
          propTypes = newPropTypes;
          // Match production behavior more closely:
          Object.defineProperty(lazyType, 'propTypes', {
            enumerable: true
          });
        }
      }
    });
  }

  return lazyType;
}

function forwardRef(render) {
  {
    if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
      warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
    } else if (typeof render !== 'function') {
      warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
    } else {
      !(
      // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
      render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
    }

    if (render != null) {
      !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
    }
  }

  return {
    $$typeof: REACT_FORWARD_REF_TYPE,
    render: render
  };
}

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' ||
  // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE);
}

function memo(type, compare) {
  {
    if (!isValidElementType(type)) {
      warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
    }
  }
  return {
    $$typeof: REACT_MEMO_TYPE,
    type: type,
    compare: compare === undefined ? null : compare
  };
}

function resolveDispatcher() {
  var dispatcher = ReactCurrentDispatcher.current;
  (function () {
    if (!(dispatcher !== null)) {
      {
        throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.'));
      }
    }
  })();
  return dispatcher;
}

function useContext(Context, unstable_observedBits) {
  var dispatcher = resolveDispatcher();
  {
    !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;

    // TODO: add a more generic warning for invalid values.
    if (Context._context !== undefined) {
      var realContext = Context._context;
      // Don't deduplicate because this legitimately causes bugs
      // and nobody should be using this in existing code.
      if (realContext.Consumer === Context) {
        warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
      } else if (realContext.Provider === Context) {
        warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
      }
    }
  }
  return dispatcher.useContext(Context, unstable_observedBits);
}

function useState(initialState) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useState(initialState);
}

function useReducer(reducer, initialArg, init) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useReducer(reducer, initialArg, init);
}

function useRef(initialValue) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useRef(initialValue);
}

function useEffect(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useEffect(create, inputs);
}

function useLayoutEffect(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useLayoutEffect(create, inputs);
}

function useCallback(callback, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useCallback(callback, inputs);
}

function useMemo(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useMemo(create, inputs);
}

function useImperativeHandle(ref, create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useImperativeHandle(ref, create, inputs);
}

function useDebugValue(value, formatterFn) {
  {
    var dispatcher = resolveDispatcher();
    return dispatcher.useDebugValue(value, formatterFn);
  }
}

var emptyObject$1 = {};

function useResponder(responder, listenerProps) {
  var dispatcher = resolveDispatcher();
  {
    if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
      warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
      return;
    }
  }
  return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
}

// Within the scope of the callback, mark all updates as being allowed to suspend.
function withSuspenseConfig(scope, config) {
  var previousConfig = ReactCurrentBatchConfig.suspense;
  ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
  try {
    scope();
  } finally {
    ReactCurrentBatchConfig.suspense = previousConfig;
  }
}

/**
 * ReactElementValidator provides a wrapper around a element factory
 * which validates the props passed to the element. This is intended to be
 * used only in DEV and could be replaced by a static type checker for languages
 * that support it.
 */

var propTypesMisspellWarningShown = void 0;

{
  propTypesMisspellWarningShown = false;
}

function getDeclarationErrorAddendum() {
  if (ReactCurrentOwner.current) {
    var name = getComponentName(ReactCurrentOwner.current.type);
    if (name) {
      return '\n\nCheck the render method of `' + name + '`.';
    }
  }
  return '';
}

function getSourceInfoErrorAddendum(source) {
  if (source !== undefined) {
    var fileName = source.fileName.replace(/^.*[\\\/]/, '');
    var lineNumber = source.lineNumber;
    return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  }
  return '';
}

function getSourceInfoErrorAddendumForProps(elementProps) {
  if (elementProps !== null && elementProps !== undefined) {
    return getSourceInfoErrorAddendum(elementProps.__source);
  }
  return '';
}

/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */
var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  var info = getDeclarationErrorAddendum();

  if (!info) {
    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
    if (parentName) {
      info = '\n\nCheck the top-level render call using <' + parentName + '>.';
    }
  }
  return info;
}

/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */
function validateExplicitKey(element, parentType) {
  if (!element._store || element._store.validated || element.key != null) {
    return;
  }
  element._store.validated = true;

  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
    return;
  }
  ownerHasKeyUseWarning[currentComponentErrorInfo] = true;

  // Usually the current owner is the offender, but if it accepts children as a
  // property, it may be the creator of the child that's responsible for
  // assigning it a key.
  var childOwner = '';
  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
    // Give the component that originally created this child.
    childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
  }

  setCurrentlyValidatingElement(element);
  {
    warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
  }
  setCurrentlyValidatingElement(null);
}

/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */
function validateChildKeys(node, parentType) {
  if (typeof node !== 'object') {
    return;
  }
  if (Array.isArray(node)) {
    for (var i = 0; i < node.length; i++) {
      var child = node[i];
      if (isValidElement(child)) {
        validateExplicitKey(child, parentType);
      }
    }
  } else if (isValidElement(node)) {
    // This element was passed in a valid location.
    if (node._store) {
      node._store.validated = true;
    }
  } else if (node) {
    var iteratorFn = getIteratorFn(node);
    if (typeof iteratorFn === 'function') {
      // Entry iterators used to provide implicit keys,
      // but now we print a separate warning for them later.
      if (iteratorFn !== node.entries) {
        var iterator = iteratorFn.call(node);
        var step = void 0;
        while (!(step = iterator.next()).done) {
          if (isValidElement(step.value)) {
            validateExplicitKey(step.value, parentType);
          }
        }
      }
    }
  }
}

/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */
function validatePropTypes(element) {
  var type = element.type;
  if (type === null || type === undefined || typeof type === 'string') {
    return;
  }
  var name = getComponentName(type);
  var propTypes = void 0;
  if (typeof type === 'function') {
    propTypes = type.propTypes;
  } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
  // Note: Memo only checks outer props here.
  // Inner props are checked in the reconciler.
  type.$$typeof === REACT_MEMO_TYPE)) {
    propTypes = type.propTypes;
  } else {
    return;
  }
  if (propTypes) {
    setCurrentlyValidatingElement(element);
    checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
    setCurrentlyValidatingElement(null);
  } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
    propTypesMisspellWarningShown = true;
    warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
  }
  if (typeof type.getDefaultProps === 'function') {
    !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
  }
}

/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */
function validateFragmentProps(fragment) {
  setCurrentlyValidatingElement(fragment);

  var keys = Object.keys(fragment.props);
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (key !== 'children' && key !== 'key') {
      warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
      break;
    }
  }

  if (fragment.ref !== null) {
    warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
  }

  setCurrentlyValidatingElement(null);
}

function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
  var validType = isValidElementType(type);

  // We warn in this case but don't throw. We expect the element creation to
  // succeed and there will likely be errors in render.
  if (!validType) {
    var info = '';
    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
      info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
    }

    var sourceInfo = getSourceInfoErrorAddendum(source);
    if (sourceInfo) {
      info += sourceInfo;
    } else {
      info += getDeclarationErrorAddendum();
    }

    var typeString = void 0;
    if (type === null) {
      typeString = 'null';
    } else if (Array.isArray(type)) {
      typeString = 'array';
    } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
      typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
      info = ' Did you accidentally export a JSX literal instead of a component?';
    } else {
      typeString = typeof type;
    }

    warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  }

  var element = jsxDEV(type, props, key, source, self);

  // The result can be nullish if a mock or a custom function is used.
  // TODO: Drop this when these are no longer allowed as the type argument.
  if (element == null) {
    return element;
  }

  // Skip key warning if the type isn't valid since our key validation logic
  // doesn't expect a non-string/function type and can throw confusing errors.
  // We don't want exception behavior to differ between dev and prod.
  // (Rendering will throw with a helpful message and as soon as the type is
  // fixed, the key warnings will appear.)
  if (validType) {
    var children = props.children;
    if (children !== undefined) {
      if (isStaticChildren) {
        for (var i = 0; i < children.length; i++) {
          validateChildKeys(children[i], type);
        }
      } else {
        validateChildKeys(children, type);
      }
    }
  }

  if (props.key !== undefined) {
    warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
  }

  if (type === REACT_FRAGMENT_TYPE) {
    validateFragmentProps(element);
  } else {
    validatePropTypes(element);
  }

  return element;
}

// These two functions exist to still get child warnings in dev
// even with the prod transform. This means that jsxDEV is purely
// opt-in behavior for better messages but that we won't stop
// giving you warnings if you use production apis.
function jsxWithValidationStatic(type, props, key) {
  return jsxWithValidation(type, props, key, true);
}

function jsxWithValidationDynamic(type, props, key) {
  return jsxWithValidation(type, props, key, false);
}

function createElementWithValidation(type, props, children) {
  var validType = isValidElementType(type);

  // We warn in this case but don't throw. We expect the element creation to
  // succeed and there will likely be errors in render.
  if (!validType) {
    var info = '';
    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
      info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
    }

    var sourceInfo = getSourceInfoErrorAddendumForProps(props);
    if (sourceInfo) {
      info += sourceInfo;
    } else {
      info += getDeclarationErrorAddendum();
    }

    var typeString = void 0;
    if (type === null) {
      typeString = 'null';
    } else if (Array.isArray(type)) {
      typeString = 'array';
    } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
      typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
      info = ' Did you accidentally export a JSX literal instead of a component?';
    } else {
      typeString = typeof type;
    }

    warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  }

  var element = createElement.apply(this, arguments);

  // The result can be nullish if a mock or a custom function is used.
  // TODO: Drop this when these are no longer allowed as the type argument.
  if (element == null) {
    return element;
  }

  // Skip key warning if the type isn't valid since our key validation logic
  // doesn't expect a non-string/function type and can throw confusing errors.
  // We don't want exception behavior to differ between dev and prod.
  // (Rendering will throw with a helpful message and as soon as the type is
  // fixed, the key warnings will appear.)
  if (validType) {
    for (var i = 2; i < arguments.length; i++) {
      validateChildKeys(arguments[i], type);
    }
  }

  if (type === REACT_FRAGMENT_TYPE) {
    validateFragmentProps(element);
  } else {
    validatePropTypes(element);
  }

  return element;
}

function createFactoryWithValidation(type) {
  var validatedFactory = createElementWithValidation.bind(null, type);
  validatedFactory.type = type;
  // Legacy hook: remove it
  {
    Object.defineProperty(validatedFactory, 'type', {
      enumerable: false,
      get: function () {
        lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
        Object.defineProperty(this, 'type', {
          value: type
        });
        return type;
      }
    });
  }

  return validatedFactory;
}

function cloneElementWithValidation(element, props, children) {
  var newElement = cloneElement.apply(this, arguments);
  for (var i = 2; i < arguments.length; i++) {
    validateChildKeys(arguments[i], newElement.type);
  }
  validatePropTypes(newElement);
  return newElement;
}

var hasBadMapPolyfill = void 0;

{
  hasBadMapPolyfill = false;
  try {
    var frozenObject = Object.freeze({});
    var testMap = new Map([[frozenObject, null]]);
    var testSet = new Set([frozenObject]);
    // This is necessary for Rollup to not consider these unused.
    // https://github.com/rollup/rollup/issues/1771
    // TODO: we can remove these if Rollup fixes the bug.
    testMap.set(0, 0);
    testSet.add(0);
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

function createFundamentalComponent(impl) {
  // We use responder as a Map key later on. When we have a bad
  // polyfill, then we can't use it as a key as the polyfill tries
  // to add a property to the object.
  if ( true && !hasBadMapPolyfill) {
    Object.freeze(impl);
  }
  var fundamantalComponent = {
    $$typeof: REACT_FUNDAMENTAL_TYPE,
    impl: impl
  };
  {
    Object.freeze(fundamantalComponent);
  }
  return fundamantalComponent;
}

function createEventResponder(displayName, responderConfig) {
  var getInitialState = responderConfig.getInitialState,
      onEvent = responderConfig.onEvent,
      onMount = responderConfig.onMount,
      onUnmount = responderConfig.onUnmount,
      onOwnershipChange = responderConfig.onOwnershipChange,
      onRootEvent = responderConfig.onRootEvent,
      rootEventTypes = responderConfig.rootEventTypes,
      targetEventTypes = responderConfig.targetEventTypes;

  var eventResponder = {
    $$typeof: REACT_RESPONDER_TYPE,
    displayName: displayName,
    getInitialState: getInitialState || null,
    onEvent: onEvent || null,
    onMount: onMount || null,
    onOwnershipChange: onOwnershipChange || null,
    onRootEvent: onRootEvent || null,
    onUnmount: onUnmount || null,
    rootEventTypes: rootEventTypes || null,
    targetEventTypes: targetEventTypes || null
  };
  // We use responder as a Map key later on. When we have a bad
  // polyfill, then we can't use it as a key as the polyfill tries
  // to add a property to the object.
  if ( true && !hasBadMapPolyfill) {
    Object.freeze(eventResponder);
  }
  return eventResponder;
}

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:


// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:


// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.


// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:


// Gather advanced timing metrics for Profiler subtrees.


// Trace which interactions trigger each commit.


// Only used in www builds.
 // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// Disable javascript: URL strings in href for XSS protection.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties


// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.




// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
// This is a flag so we can fix warnings in RN core before turning it on


// Experimental React Flare event system and event components support.
var enableFlareAPI = false;

// Experimental Host Component support.
var enableFundamentalAPI = false;

// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
var enableJSXTransformAPI = false;

// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version

// Temporary flag to revert the fix in #15650


// For tests, we flush suspense fallbacks in an act scope;
// *except* in some of our own tests, where we test incremental loading states.


// Changes priority of some events like mousemove to user-blocking priority,
// but without making them discrete. The flag exists in case it causes
// starvation problems.


// Add a callback property to suspense to notify which promises are currently
// in the update queue. This allows reporting and tracing of what is causing
// the user to see a loading state.


// Part of the simplification of React.createElement so we can eventually move
// from React.createElement to React.jsx
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md

var React = {
  Children: {
    map: mapChildren,
    forEach: forEachChildren,
    count: countChildren,
    toArray: toArray,
    only: onlyChild
  },

  createRef: createRef,
  Component: Component,
  PureComponent: PureComponent,

  createContext: createContext,
  forwardRef: forwardRef,
  lazy: lazy,
  memo: memo,

  useCallback: useCallback,
  useContext: useContext,
  useEffect: useEffect,
  useImperativeHandle: useImperativeHandle,
  useDebugValue: useDebugValue,
  useLayoutEffect: useLayoutEffect,
  useMemo: useMemo,
  useReducer: useReducer,
  useRef: useRef,
  useState: useState,

  Fragment: REACT_FRAGMENT_TYPE,
  Profiler: REACT_PROFILER_TYPE,
  StrictMode: REACT_STRICT_MODE_TYPE,
  Suspense: REACT_SUSPENSE_TYPE,
  unstable_SuspenseList: REACT_SUSPENSE_LIST_TYPE,

  createElement: createElementWithValidation,
  cloneElement: cloneElementWithValidation,
  createFactory: createFactoryWithValidation,
  isValidElement: isValidElement,

  version: ReactVersion,

  unstable_withSuspenseConfig: withSuspenseConfig,

  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
};

if (enableFlareAPI) {
  React.unstable_useResponder = useResponder;
  React.unstable_createResponder = createEventResponder;
}

if (enableFundamentalAPI) {
  React.unstable_createFundamental = createFundamentalComponent;
}

// Note: some APIs are added with feature flags.
// Make sure that stable builds for open source
// don't modify the React object to avoid deopts.
// Also let's not expose their names in stable builds.

if (enableJSXTransformAPI) {
  {
    React.jsxDEV = jsxWithValidation;
    React.jsx = jsxWithValidationDynamic;
    React.jsxs = jsxWithValidationStatic;
  }
}



var React$2 = Object.freeze({
	default: React
});

var React$3 = ( React$2 && React ) || React$2;

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest.
var react = React$3.default || React$3;

module.exports = react;
  })();
}


/***/ }),

/***/ "./node_modules/react/index.js":
/*!*************************************!*\
  !*** ./node_modules/react/index.js ***!
  \*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {} else {
  module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "./node_modules/react/cjs/react.development.js");
}


/***/ }),

/***/ "./node_modules/style-loader/lib/addStyles.js":
/*!****************************************************!*\
  !*** ./node_modules/style-loader/lib/addStyles.js ***!
  \****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/

var stylesInDom = {};

var	memoize = function (fn) {
	var memo;

	return function () {
		if (typeof memo === "undefined") memo = fn.apply(this, arguments);
		return memo;
	};
};

var isOldIE = memoize(function () {
	// Test for IE <= 9 as proposed by Browserhacks
	// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
	// Tests for existence of standard globals is to allow style-loader
	// to operate correctly into non-standard environments
	// @see https://github.com/webpack-contrib/style-loader/issues/177
	return window && document && document.all && !window.atob;
});

var getTarget = function (target, parent) {
  if (parent){
    return parent.querySelector(target);
  }
  return document.querySelector(target);
};

var getElement = (function (fn) {
	var memo = {};

	return function(target, parent) {
                // If passing function in options, then use it for resolve "head" element.
                // Useful for Shadow Root style i.e
                // {
                //   insertInto: function () { return document.querySelector("#foo").shadowRoot }
                // }
                if (typeof target === 'function') {
                        return target();
                }
                if (typeof memo[target] === "undefined") {
			var styleTarget = getTarget.call(this, target, parent);
			// Special case to return head of iframe instead of iframe itself
			if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
				try {
					// This will throw an exception if access to iframe is blocked
					// due to cross-origin restrictions
					styleTarget = styleTarget.contentDocument.head;
				} catch(e) {
					styleTarget = null;
				}
			}
			memo[target] = styleTarget;
		}
		return memo[target]
	};
})();

var singleton = null;
var	singletonCounter = 0;
var	stylesInsertedAtTop = [];

var	fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");

module.exports = function(list, options) {
	if (typeof DEBUG !== "undefined" && DEBUG) {
		if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
	}

	options = options || {};

	options.attrs = typeof options.attrs === "object" ? options.attrs : {};

	// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
	// tags it will allow on a page
	if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();

	// By default, add <style> tags to the <head> element
        if (!options.insertInto) options.insertInto = "head";

	// By default, add <style> tags to the bottom of the target
	if (!options.insertAt) options.insertAt = "bottom";

	var styles = listToStyles(list, options);

	addStylesToDom(styles, options);

	return function update (newList) {
		var mayRemove = [];

		for (var i = 0; i < styles.length; i++) {
			var item = styles[i];
			var domStyle = stylesInDom[item.id];

			domStyle.refs--;
			mayRemove.push(domStyle);
		}

		if(newList) {
			var newStyles = listToStyles(newList, options);
			addStylesToDom(newStyles, options);
		}

		for (var i = 0; i < mayRemove.length; i++) {
			var domStyle = mayRemove[i];

			if(domStyle.refs === 0) {
				for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();

				delete stylesInDom[domStyle.id];
			}
		}
	};
};

function addStylesToDom (styles, options) {
	for (var i = 0; i < styles.length; i++) {
		var item = styles[i];
		var domStyle = stylesInDom[item.id];

		if(domStyle) {
			domStyle.refs++;

			for(var j = 0; j < domStyle.parts.length; j++) {
				domStyle.parts[j](item.parts[j]);
			}

			for(; j < item.parts.length; j++) {
				domStyle.parts.push(addStyle(item.parts[j], options));
			}
		} else {
			var parts = [];

			for(var j = 0; j < item.parts.length; j++) {
				parts.push(addStyle(item.parts[j], options));
			}

			stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
		}
	}
}

function listToStyles (list, options) {
	var styles = [];
	var newStyles = {};

	for (var i = 0; i < list.length; i++) {
		var item = list[i];
		var id = options.base ? item[0] + options.base : item[0];
		var css = item[1];
		var media = item[2];
		var sourceMap = item[3];
		var part = {css: css, media: media, sourceMap: sourceMap};

		if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
		else newStyles[id].parts.push(part);
	}

	return styles;
}

function insertStyleElement (options, style) {
	var target = getElement(options.insertInto)

	if (!target) {
		throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
	}

	var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];

	if (options.insertAt === "top") {
		if (!lastStyleElementInsertedAtTop) {
			target.insertBefore(style, target.firstChild);
		} else if (lastStyleElementInsertedAtTop.nextSibling) {
			target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
		} else {
			target.appendChild(style);
		}
		stylesInsertedAtTop.push(style);
	} else if (options.insertAt === "bottom") {
		target.appendChild(style);
	} else if (typeof options.insertAt === "object" && options.insertAt.before) {
		var nextSibling = getElement(options.insertAt.before, target);
		target.insertBefore(style, nextSibling);
	} else {
		throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
	}
}

function removeStyleElement (style) {
	if (style.parentNode === null) return false;
	style.parentNode.removeChild(style);

	var idx = stylesInsertedAtTop.indexOf(style);
	if(idx >= 0) {
		stylesInsertedAtTop.splice(idx, 1);
	}
}

function createStyleElement (options) {
	var style = document.createElement("style");

	if(options.attrs.type === undefined) {
		options.attrs.type = "text/css";
	}

	if(options.attrs.nonce === undefined) {
		var nonce = getNonce();
		if (nonce) {
			options.attrs.nonce = nonce;
		}
	}

	addAttrs(style, options.attrs);
	insertStyleElement(options, style);

	return style;
}

function createLinkElement (options) {
	var link = document.createElement("link");

	if(options.attrs.type === undefined) {
		options.attrs.type = "text/css";
	}
	options.attrs.rel = "stylesheet";

	addAttrs(link, options.attrs);
	insertStyleElement(options, link);

	return link;
}

function addAttrs (el, attrs) {
	Object.keys(attrs).forEach(function (key) {
		el.setAttribute(key, attrs[key]);
	});
}

function getNonce() {
	if (false) {}

	return __webpack_require__.nc;
}

function addStyle (obj, options) {
	var style, update, remove, result;

	// If a transform function was defined, run it on the css
	if (options.transform && obj.css) {
	    result = typeof options.transform === 'function'
		 ? options.transform(obj.css) 
		 : options.transform.default(obj.css);

	    if (result) {
	    	// If transform returns a value, use that instead of the original css.
	    	// This allows running runtime transformations on the css.
	    	obj.css = result;
	    } else {
	    	// If the transform function returns a falsy value, don't add this css.
	    	// This allows conditional loading of css
	    	return function() {
	    		// noop
	    	};
	    }
	}

	if (options.singleton) {
		var styleIndex = singletonCounter++;

		style = singleton || (singleton = createStyleElement(options));

		update = applyToSingletonTag.bind(null, style, styleIndex, false);
		remove = applyToSingletonTag.bind(null, style, styleIndex, true);

	} else if (
		obj.sourceMap &&
		typeof URL === "function" &&
		typeof URL.createObjectURL === "function" &&
		typeof URL.revokeObjectURL === "function" &&
		typeof Blob === "function" &&
		typeof btoa === "function"
	) {
		style = createLinkElement(options);
		update = updateLink.bind(null, style, options);
		remove = function () {
			removeStyleElement(style);

			if(style.href) URL.revokeObjectURL(style.href);
		};
	} else {
		style = createStyleElement(options);
		update = applyToTag.bind(null, style);
		remove = function () {
			removeStyleElement(style);
		};
	}

	update(obj);

	return function updateStyle (newObj) {
		if (newObj) {
			if (
				newObj.css === obj.css &&
				newObj.media === obj.media &&
				newObj.sourceMap === obj.sourceMap
			) {
				return;
			}

			update(obj = newObj);
		} else {
			remove();
		}
	};
}

var replaceText = (function () {
	var textStore = [];

	return function (index, replacement) {
		textStore[index] = replacement;

		return textStore.filter(Boolean).join('\n');
	};
})();

function applyToSingletonTag (style, index, remove, obj) {
	var css = remove ? "" : obj.css;

	if (style.styleSheet) {
		style.styleSheet.cssText = replaceText(index, css);
	} else {
		var cssNode = document.createTextNode(css);
		var childNodes = style.childNodes;

		if (childNodes[index]) style.removeChild(childNodes[index]);

		if (childNodes.length) {
			style.insertBefore(cssNode, childNodes[index]);
		} else {
			style.appendChild(cssNode);
		}
	}
}

function applyToTag (style, obj) {
	var css = obj.css;
	var media = obj.media;

	if(media) {
		style.setAttribute("media", media)
	}

	if(style.styleSheet) {
		style.styleSheet.cssText = css;
	} else {
		while(style.firstChild) {
			style.removeChild(style.firstChild);
		}

		style.appendChild(document.createTextNode(css));
	}
}

function updateLink (link, options, obj) {
	var css = obj.css;
	var sourceMap = obj.sourceMap;

	/*
		If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
		and there is no publicPath defined then lets turn convertToAbsoluteUrls
		on by default.  Otherwise default to the convertToAbsoluteUrls option
		directly
	*/
	var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;

	if (options.convertToAbsoluteUrls || autoFixUrls) {
		css = fixUrls(css);
	}

	if (sourceMap) {
		// http://stackoverflow.com/a/26603875
		css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
	}

	var blob = new Blob([css], { type: "text/css" });

	var oldSrc = link.href;

	link.href = URL.createObjectURL(blob);

	if(oldSrc) URL.revokeObjectURL(oldSrc);
}


/***/ }),

/***/ "./node_modules/style-loader/lib/urls.js":
/*!***********************************************!*\
  !*** ./node_modules/style-loader/lib/urls.js ***!
  \***********************************************/
/*! no static exports found */
/***/ (function(module, exports) {


/**
 * When source maps are enabled, `style-loader` uses a link element with a data-uri to
 * embed the css on the page. This breaks all relative urls because now they are relative to a
 * bundle instead of the current page.
 *
 * One solution is to only use full urls, but that may be impossible.
 *
 * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
 *
 * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
 *
 */

module.exports = function (css) {
  // get current location
  var location = typeof window !== "undefined" && window.location;

  if (!location) {
    throw new Error("fixUrls requires window.location");
  }

	// blank or null?
	if (!css || typeof css !== "string") {
	  return css;
  }

  var baseUrl = location.protocol + "//" + location.host;
  var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");

	// convert each url(...)
	/*
	This regular expression is just a way to recursively match brackets within
	a string.

	 /url\s*\(  = Match on the word "url" with any whitespace after it and then a parens
	   (  = Start a capturing group
	     (?:  = Start a non-capturing group
	         [^)(]  = Match anything that isn't a parentheses
	         |  = OR
	         \(  = Match a start parentheses
	             (?:  = Start another non-capturing groups
	                 [^)(]+  = Match anything that isn't a parentheses
	                 |  = OR
	                 \(  = Match a start parentheses
	                     [^)(]*  = Match anything that isn't a parentheses
	                 \)  = Match a end parentheses
	             )  = End Group
              *\) = Match anything and then a close parens
          )  = Close non-capturing group
          *  = Match anything
       )  = Close capturing group
	 \)  = Match a close parens

	 /gi  = Get all matches, not the first.  Be case insensitive.
	 */
	var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
		// strip quotes (if they exist)
		var unquotedOrigUrl = origUrl
			.trim()
			.replace(/^"(.*)"$/, function(o, $1){ return $1; })
			.replace(/^'(.*)'$/, function(o, $1){ return $1; });

		// already a full url? no change
		if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
		  return fullMatch;
		}

		// convert the url to a full url
		var newUrl;

		if (unquotedOrigUrl.indexOf("//") === 0) {
		  	//TODO: should we add protocol?
			newUrl = unquotedOrigUrl;
		} else if (unquotedOrigUrl.indexOf("/") === 0) {
			// path should be relative to the base url
			newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
		} else {
			// path should be relative to current directory
			newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
		}

		// send back the fixed url(...)
		return "url(" + JSON.stringify(newUrl) + ")";
	});

	// send back the fixed css
	return fixedCss;
};


/***/ }),

/***/ "./node_modules/vitessce/dist/es/production/static/css/index.css":
/*!***********************************************************************!*\
  !*** ./node_modules/vitessce/dist/es/production/static/css/index.css ***!
  \***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {


var content = __webpack_require__(/*! !../../../../../../css-loader!./index.css */ "./node_modules/css-loader/index.js!./node_modules/vitessce/dist/es/production/static/css/index.css");

if(typeof content === 'string') content = [[module.i, content, '']];

var transform;
var insertInto;



var options = {"hmr":true}

options.transform = transform
options.insertInto = undefined;

var update = __webpack_require__(/*! ../../../../../../style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);

if(content.locals) module.exports = content.locals;

if(false) {}

/***/ }),

/***/ "./node_modules/vitessce/dist/umd/production/index.min.js":
/*!****************************************************************!*\
  !*** ./node_modules/vitessce/dist/umd/production/index.min.js ***!
  \****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

/*! For license information please see index.min.js.LICENSE.txt */
!function(t,e){ true?module.exports=e(__webpack_require__(/*! react */ "./node_modules/react/index.js"),__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js")):undefined}(this,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=1437)}([function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=function(t,e,n){return t.fields=e||[],t.fname=n,t};function i(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}var a=function(t){return 1===t.length?A(t[0]):s(t)},A=function(t){return function(e){return e[t]}},s=function(t){var e=t.length;return function(n){for(var r=0;r<e;++r)n=n[t[r]];return n}},c=function(t){throw Error(t)},u=function(t){var e,n,r,i=[],o=null,a=0,A=t.length,s="";function u(){i.push(s+t.substring(e,n)),s="",e=n+1}for(t+="",e=n=0;n<A;++n)if("\\"===(r=t[n]))s+=t.substring(e,n),s+=t.substring(++n,++n),e=n;else if(r===o)u(),o=null,a=-1;else{if(o)continue;e===a&&'"'===r||e===a&&"'"===r?(e=n+1,o=r):"."!==r||a?"["===r?(n>e&&u(),a=e=n+1):"]"===r&&(a||c("Access path missing open bracket: "+t),a>0&&u(),a=0,e=n+1):n>e?u():e=n+1}return a&&c("Access path missing closing bracket: "+t),o&&c("Access path missing closing quote: "+t),n>e&&(n++,u()),i},l=function(t,e,n){var i=u(t);return t=1===i.length?i[0]:t,r((n&&n.get||a)(i),[t],e||t)},g=[],f=l("id"),h=r((function(t){return t}),g,"identity"),d=r((function(){return 0}),g,"zero"),I=r((function(){return 1}),g,"one"),p=r((function(){return!0}),g,"true"),C=r((function(){return!1}),g,"false");function y(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}var v=function(t,e){var n=t||0;return{level:function(t){return arguments.length?(n=+t,this):n},error:function(){return n>=1&&y(e||"error","ERROR",arguments),this},warn:function(){return n>=2&&y(e||"warn","WARN",arguments),this},info:function(){return n>=3&&y(e||"log","INFO",arguments),this},debug:function(){return n>=4&&y(e||"log","DEBUG",arguments),this}}},B=Array.isArray,m=function(t){return t===Object(t)},b=function(t){return"__proto__"!==t};function E(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((function(t,e){for(var n in e)if("signals"===n)t.signals=F(t.signals,e.signals);else{var r="legend"===n?{layout:1}:"style"===n||null;Q(t,n,e[n],r)}return t}),{})}function Q(t,e,n,r){var i,o;if(b(e))if(m(n)&&!B(n))for(i in o=m(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?Q(o,i,n[i]):b(i)&&(o[i]=n[i]);else t[e]=n}function F(t,e){if(null==t)return e;var n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}var w=function(t){return t[t.length-1]},S=function(t){return null==t||""===t?null:+t};function R(t){return function(e){return t*Math.exp(e)}}function U(t){return function(e){return Math.log(t*e)}}function x(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function k(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function O(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function N(t,e,n,r){var i=n(t[0]),o=n(w(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function D(t,e){return N(t,e,S,h)}function G(t,e){var n=Math.sign(t[0]);return N(t,e,U(n),R(n))}function _(t,e,n){return N(t,e,O(n),O(1/n))}function M(t,e,n){return N(t,e,x(n),k(n))}function T(t,e,n,r,i){var o=r(t[0]),a=r(w(t)),A=null!=e?r(e):(o+a)/2;return[i(A+(o-A)*n),i(A+(a-A)*n)]}function j(t,e,n){return T(t,e,n,S,h)}function L(t,e,n){var r=Math.sign(t[0]);return T(t,e,n,U(r),R(r))}function V(t,e,n,r){return T(t,e,n,O(r),O(1/r))}function Z(t,e,n,r){return T(t,e,n,x(r),k(r))}function P(t){return 1+~~(new Date(t).getMonth()/3)}function W(t){return 1+~~(new Date(t).getUTCMonth()/3)}var J=function(t){return null!=t?B(t)?t:[t]:[]},H=function(t,e,n){var r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),(r=o-i)>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]},Y=function(t){return"function"===typeof t},X=function(t,e,n){n=n||{},e=J(e)||[];var i=[],a=[],A={},s=n.comparator||K;return J(t).forEach((function(t,r){null!=t&&(i.push("descending"===e[r]?-1:1),a.push(t=Y(t)?t:l(t,null,n)),(o(t)||[]).forEach((function(t){return A[t]=1})))})),0===a.length?null:r(s(a,i),Object.keys(A))},z=function(t,e){return(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0)},K=function(t,e){return 1===t.length?q(t[0],e[0]):$(t,e,t.length)},q=function(t,e){return function(n,r){return z(t(n),t(r))*e}},$=function(t,e,n){return e.push(0),function(r,i){for(var o,a=0,A=-1;0===a&&++A<n;)o=t[A],a=z(o(r),o(i));return a*e[A]}},tt=function(t){return Y(t)?t:function(){return t}},et=function(t,e){var n,r;function i(){e(r),n=r=null}return function(e){r=e,n&&clearTimeout(n),n=setTimeout(i,t)}},nt=function(t){for(var e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r])t[n]=e[n];return t},rt=function(t,e){var n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)null!=(r=t[a])&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)null!=(r=e(t[a]))&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]},it=function(t,e){var n,r,i,o,a,A=-1,s=t.length;if(null==e){for(;++A<s;)if(null!=(r=t[A])&&r>=r){n=i=r;break}if(A===s)return[-1,-1];for(o=a=A;++A<s;)null!=(r=t[A])&&(n>r&&(n=r,o=A),i<r&&(i=r,a=A))}else{for(;++A<s;)if(null!=(r=e(t[A],A,t))&&r>=r){n=i=r;break}if(A===s)return[-1,-1];for(o=a=A;++A<s;)null!=(r=e(t[A],A,t))&&(n>r&&(n=r,o=A),i<r&&(i=r,a=A))}return[o,a]},ot=Object.prototype.hasOwnProperty,at=function(t,e){return ot.call(t,e)},At={},st=function(t){var e,n,r={};function i(t){return at(r,t)&&r[t]!==At}return e={size:0,empty:0,object:r,has:i,get:function(t){return i(t)?r[t]:void 0},set:function(t,n){return i(t)||(++e.size,r[t]===At&&--e.empty),r[t]=n,this},delete:function(t){return i(t)&&(--e.size,++e.empty,r[t]=At),this},clear:function(){e.size=e.empty=0,e.object=r={}},test:function(t){return arguments.length?(n=t,e):n},clean:function(){var t,i,o={},a=0;for(t in r)(i=r[t])===At||n&&n(i)||(o[t]=i,++a);e.size=a,e.empty=0,e.object=r=o}},t&&Object.keys(t).forEach((function(n){e.set(n,t[n])})),e},ct=function(t,e,n,r,i,o){if(!n&&0!==n)return o;var a,A,s=t[0],c=w(t),u=+n;return c<s&&(a=s,s=c,c=a),(a=Math.abs(e-s))<(A=Math.abs(c-e))&&a<=u?r:A<=u?i:o},ut=function(t,e){var n=t.prototype=Object.create(e.prototype);return n.constructor=t,n},lt=function(t,e,n,r){var i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)},gt=function(t){return"boolean"===typeof t},ft=function(t){return"[object Date]"===Object.prototype.toString.call(t)},ht=function(t){return"number"===typeof t},dt=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},It=function(t){return"string"===typeof t},pt=function(t,e,n){t&&(t=e?J(t).map((function(t){return t.replace(/\\(.)/g,"$1")})):J(t));var i,o=t&&t.length,A=n&&n.get||a,s=function(t){return A(e?[t]:u(t))};if(o)if(1===o){var c=s(t[0]);i=function(t){return""+c(t)}}else{var l=t.map(s);i=function(t){for(var e=""+l[0](t),n=0;++n<o;)e+="|"+l[n](t);return e}}else i=function(){return""};return r(i,t,"key")},Ct=function(t,e){var n=t[0],r=w(t),i=+e;return i?1===i?r:n+i*(r-n):n},yt=function(t){var e,n,r;t=+t||1e4;var i=function(){e={},n={},r=0},o=function(i,o){return++r>t&&(n=e,e={},r=1),e[i]=o};return i(),{clear:i,has:function(t){return at(e,t)||at(n,t)},get:function(t){return at(e,t)?e[t]:at(n,t)?o(t,n[t]):void 0},set:function(t,n){return at(e,t)?e[t]=n:o(t,n)}}},vt=function(t,e,n,r){var i=e.length,o=n.length;if(!o)return e;if(!i)return n;for(var a=r||new e.constructor(i+o),A=0,s=0,c=0;A<i&&s<o;++c)a[c]=t(e[A],n[s])>0?n[s++]:e[A++];for(;A<i;++A,++c)a[c]=e[A];for(;s<o;++s,++c)a[c]=n[s];return a},Bt=function(t,e){for(var n="";--e>=0;)n+=t;return n},mt=function(t,e,n,r){var i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?Bt(i,a)+o:"center"===r?Bt(i,~~(a/2))+o+Bt(i,Math.ceil(a/2)):o+Bt(i,a)},bt=function(t){return t&&w(t)-t[0]||0};function Et(t){return B(t)?"["+t.map(Et)+"]":m(t)||It(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}var Qt=function(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t};function Ft(t){return ht(t)||ft(t)?t:Date.parse(t)}var wt=function(t,e){return e=e||Ft,null==t||""===t?null:e(t)},St=function(t){return null==t||""===t?null:t+""},Rt=function(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=!0;return e},Ut=function(t,e,n,r){var i=null!=r?r:"\u2026",o=t+"",a=o.length,A=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-A):"center"===n?o.slice(0,Math.ceil(A/2))+i+o.slice(a-~~(A/2)):o.slice(0,A)+i},xt=function(t,e,n){if(t)if(e)for(var r,i=0,o=t.length;i<o;++i)(r=e(t[i]))&&n(r,i,t);else t.forEach(n)};n.d(e,"f",(function(){return r})),n.d(e,"h",(function(){return i})),n.d(e,"g",(function(){return o})),n.d(e,"w",(function(){return f})),n.d(e,"x",(function(){return h})),n.d(e,"kb",(function(){return d})),n.d(e,"O",(function(){return I})),n.d(e,"gb",(function(){return p})),n.d(e,"r",(function(){return C})),n.d(e,"K",(function(){return v})),n.d(e,"d",(function(){return 0})),n.d(e,"b",(function(){return 1})),n.d(e,"e",(function(){return 2})),n.d(e,"c",(function(){return 3})),n.d(e,"a",(function(){return 4})),n.d(e,"N",(function(){return E})),n.d(e,"jb",(function(){return Q})),n.d(e,"Q",(function(){return D})),n.d(e,"R",(function(){return G})),n.d(e,"S",(function(){return _})),n.d(e,"T",(function(){return M})),n.d(e,"lb",(function(){return j})),n.d(e,"mb",(function(){return L})),n.d(e,"nb",(function(){return V})),n.d(e,"ob",(function(){return Z})),n.d(e,"V",(function(){return P})),n.d(e,"hb",(function(){return W})),n.d(e,"i",(function(){return J})),n.d(e,"j",(function(){return H})),n.d(e,"k",(function(){return X})),n.d(e,"l",(function(){return tt})),n.d(e,"m",(function(){return et})),n.d(e,"n",(function(){return c})),n.d(e,"o",(function(){return nt})),n.d(e,"p",(function(){return rt})),n.d(e,"q",(function(){return it})),n.d(e,"s",(function(){return st})),n.d(e,"t",(function(){return l})),n.d(e,"u",(function(){return ct})),n.d(e,"v",(function(){return at})),n.d(e,"y",(function(){return ut})),n.d(e,"z",(function(){return lt})),n.d(e,"A",(function(){return B})),n.d(e,"B",(function(){return gt})),n.d(e,"C",(function(){return ft})),n.d(e,"D",(function(){return Y})),n.d(e,"E",(function(){return ht})),n.d(e,"F",(function(){return m})),n.d(e,"G",(function(){return dt})),n.d(e,"H",(function(){return It})),n.d(e,"I",(function(){return pt})),n.d(e,"J",(function(){return Ct})),n.d(e,"L",(function(){return yt})),n.d(e,"M",(function(){return vt})),n.d(e,"P",(function(){return mt})),n.d(e,"U",(function(){return w})),n.d(e,"W",(function(){return Bt})),n.d(e,"X",(function(){return bt})),n.d(e,"Y",(function(){return u})),n.d(e,"Z",(function(){return Et})),n.d(e,"ab",(function(){return Qt})),n.d(e,"bb",(function(){return wt})),n.d(e,"cb",(function(){return S})),n.d(e,"eb",(function(){return St})),n.d(e,"db",(function(){return Rt})),n.d(e,"fb",(function(){return Ut})),n.d(e,"ib",(function(){return xt}))},function(t,e,n){t.exports=n(405)},function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(210);function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Object(r.a)(t,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(27),i=n(54);function o(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!==typeof e?Object(i.a)(t):e}},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"h",(function(){return A})),n.d(e,"p",(function(){return s})),n.d(e,"o",(function(){return c})),n.d(e,"k",(function(){return u})),n.d(e,"l",(function(){return l})),n.d(e,"m",(function(){return g})),n.d(e,"n",(function(){return f})),n.d(e,"e",(function(){return h})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return I})),n.d(e,"j",(function(){return p})),n.d(e,"i",(function(){return C})),n.d(e,"g",(function(){return y})),n.d(e,"b",(function(){return v}));var r=n(29);function i(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],A=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=A}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],A=e[5],s=e[6],c=e[7],u=e[8],l=e[9],g=e[10],f=e[11],h=e[12],d=e[13],I=e[14],p=e[15],C=n*A-r*a,y=n*s-i*a,v=n*c-o*a,B=r*s-i*A,m=r*c-o*A,b=i*c-o*s,E=u*d-l*h,Q=u*I-g*h,F=u*p-f*h,w=l*I-g*d,S=l*p-f*d,R=g*p-f*I,U=C*R-y*S+v*w+B*F-m*Q+b*E;return U?(U=1/U,t[0]=(A*R-s*S+c*w)*U,t[1]=(i*S-r*R-o*w)*U,t[2]=(d*b-I*m+p*B)*U,t[3]=(g*m-l*b-f*B)*U,t[4]=(s*F-a*R-c*Q)*U,t[5]=(n*R-i*F+o*Q)*U,t[6]=(I*v-h*b-p*y)*U,t[7]=(u*b-g*v+f*y)*U,t[8]=(a*S-A*F+c*E)*U,t[9]=(r*F-n*S-o*E)*U,t[10]=(h*m-d*v+p*C)*U,t[11]=(l*v-u*m-f*C)*U,t[12]=(A*Q-a*w-s*E)*U,t[13]=(n*w-r*Q+i*E)*U,t[14]=(d*y-h*B-I*C)*U,t[15]=(u*B-l*y+g*C)*U,t):null}function a(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],A=t[6],s=t[7],c=t[8],u=t[9],l=t[10],g=t[11],f=t[12],h=t[13],d=t[14],I=t[15];return(e*a-n*o)*(l*I-g*d)-(e*A-r*o)*(u*I-g*h)+(e*s-i*o)*(u*d-l*h)+(n*A-r*a)*(c*I-g*f)-(n*s-i*a)*(c*d-l*f)+(r*s-i*A)*(c*h-u*f)}function A(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=e[4],s=e[5],c=e[6],u=e[7],l=e[8],g=e[9],f=e[10],h=e[11],d=e[12],I=e[13],p=e[14],C=e[15],y=n[0],v=n[1],B=n[2],m=n[3];return t[0]=y*r+v*A+B*l+m*d,t[1]=y*i+v*s+B*g+m*I,t[2]=y*o+v*c+B*f+m*p,t[3]=y*a+v*u+B*h+m*C,y=n[4],v=n[5],B=n[6],m=n[7],t[4]=y*r+v*A+B*l+m*d,t[5]=y*i+v*s+B*g+m*I,t[6]=y*o+v*c+B*f+m*p,t[7]=y*a+v*u+B*h+m*C,y=n[8],v=n[9],B=n[10],m=n[11],t[8]=y*r+v*A+B*l+m*d,t[9]=y*i+v*s+B*g+m*I,t[10]=y*o+v*c+B*f+m*p,t[11]=y*a+v*u+B*h+m*C,y=n[12],v=n[13],B=n[14],m=n[15],t[12]=y*r+v*A+B*l+m*d,t[13]=y*i+v*s+B*g+m*I,t[14]=y*o+v*c+B*f+m*p,t[15]=y*a+v*u+B*h+m*C,t}function s(t,e,n){var r,i,o,a,A,s,c,u,l,g,f,h,d=n[0],I=n[1],p=n[2];return e===t?(t[12]=e[0]*d+e[4]*I+e[8]*p+e[12],t[13]=e[1]*d+e[5]*I+e[9]*p+e[13],t[14]=e[2]*d+e[6]*I+e[10]*p+e[14],t[15]=e[3]*d+e[7]*I+e[11]*p+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],A=e[4],s=e[5],c=e[6],u=e[7],l=e[8],g=e[9],f=e[10],h=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=A,t[5]=s,t[6]=c,t[7]=u,t[8]=l,t[9]=g,t[10]=f,t[11]=h,t[12]=r*d+A*I+l*p+e[12],t[13]=i*d+s*I+g*p+e[13],t[14]=o*d+c*I+f*p+e[14],t[15]=a*d+u*I+h*p+e[15]),t}function c(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(t,e,n,i){var o,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F,w,S,R=i[0],U=i[1],x=i[2],k=Math.hypot(R,U,x);return k<r.b?null:(R*=k=1/k,U*=k,x*=k,o=Math.sin(n),A=1-(a=Math.cos(n)),s=e[0],c=e[1],u=e[2],l=e[3],g=e[4],f=e[5],h=e[6],d=e[7],I=e[8],p=e[9],C=e[10],y=e[11],v=R*R*A+a,B=U*R*A+x*o,m=x*R*A-U*o,b=R*U*A-x*o,E=U*U*A+a,Q=x*U*A+R*o,F=R*x*A+U*o,w=U*x*A-R*o,S=x*x*A+a,t[0]=s*v+g*B+I*m,t[1]=c*v+f*B+p*m,t[2]=u*v+h*B+C*m,t[3]=l*v+d*B+y*m,t[4]=s*b+g*E+I*Q,t[5]=c*b+f*E+p*Q,t[6]=u*b+h*E+C*Q,t[7]=l*b+d*E+y*Q,t[8]=s*F+g*w+I*S,t[9]=c*F+f*w+p*S,t[10]=u*F+h*w+C*S,t[11]=l*F+d*w+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function l(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],A=e[6],s=e[7],c=e[8],u=e[9],l=e[10],g=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+u*r,t[6]=A*i+l*r,t[7]=s*i+g*r,t[8]=c*i-o*r,t[9]=u*i-a*r,t[10]=l*i-A*r,t[11]=g*i-s*r,t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],A=e[2],s=e[3],c=e[8],u=e[9],l=e[10],g=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-u*r,t[2]=A*i-l*r,t[3]=s*i-g*r,t[8]=o*r+c*i,t[9]=a*r+u*i,t[10]=A*r+l*i,t[11]=s*r+g*i,t}function f(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],A=e[2],s=e[3],c=e[4],u=e[5],l=e[6],g=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+u*r,t[2]=A*i+l*r,t[3]=s*i+g*r,t[4]=c*i-o*r,t[5]=u*i-a*r,t[6]=l*i-A*r,t[7]=g*i-s*r,t}function h(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],A=e[6],s=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,A),t[2]=Math.hypot(s,c,u),t}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,A=r+r,s=i+i,c=n*a,u=r*a,l=r*A,g=i*a,f=i*A,h=i*s,d=o*a,I=o*A,p=o*s;return t[0]=1-l-h,t[1]=u+p,t[2]=g-I,t[3]=0,t[4]=u-p,t[5]=1-c-h,t[6]=f+d,t[7]=0,t[8]=g+I,t[9]=f-d,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function I(t,e,n,r,i,o,a){var A=1/(n-e),s=1/(i-r),c=1/(o-a);return t[0]=2*o*A,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*s,t[6]=0,t[7]=0,t[8]=(n+e)*A,t[9]=(i+r)*s,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function p(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function C(t,e,n,r,i,o,a){var A=1/(e-n),s=1/(r-i),c=1/(o-a);return t[0]=-2*A,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*A,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1,t}function y(t,e,n,i){var o,a,A,s,c,u,l,g,f,h,d=e[0],I=e[1],p=e[2],C=i[0],y=i[1],v=i[2],B=n[0],m=n[1],b=n[2];return Math.abs(d-B)<r.b&&Math.abs(I-m)<r.b&&Math.abs(p-b)<r.b?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(l=d-B,g=I-m,f=p-b,o=y*(f*=h=1/Math.hypot(l,g,f))-v*(g*=h),a=v*(l*=h)-C*f,A=C*g-y*l,(h=Math.hypot(o,a,A))?(o*=h=1/h,a*=h,A*=h):(o=0,a=0,A=0),s=g*A-f*a,c=f*o-l*A,u=l*a-g*o,(h=Math.hypot(s,c,u))?(s*=h=1/h,c*=h,u*=h):(s=0,c=0,u=0),t[0]=o,t[1]=s,t[2]=l,t[3]=0,t[4]=a,t[5]=c,t[6]=g,t[7]=0,t[8]=A,t[9]=u,t[10]=f,t[11]=0,t[12]=-(o*d+a*I+A*p),t[13]=-(s*d+c*I+u*p),t[14]=-(l*d+g*I+f*p),t[15]=1,t)}function v(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],A=t[4],s=t[5],c=t[6],u=t[7],l=t[8],g=t[9],f=t[10],h=t[11],d=t[12],I=t[13],p=t[14],C=t[15],y=e[0],v=e[1],B=e[2],m=e[3],b=e[4],E=e[5],Q=e[6],F=e[7],w=e[8],S=e[9],R=e[10],U=e[11],x=e[12],k=e[13],O=e[14],N=e[15];return Math.abs(n-y)<=r.b*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=r.b*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(o-B)<=r.b*Math.max(1,Math.abs(o),Math.abs(B))&&Math.abs(a-m)<=r.b*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(A-b)<=r.b*Math.max(1,Math.abs(A),Math.abs(b))&&Math.abs(s-E)<=r.b*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-Q)<=r.b*Math.max(1,Math.abs(c),Math.abs(Q))&&Math.abs(u-F)<=r.b*Math.max(1,Math.abs(u),Math.abs(F))&&Math.abs(l-w)<=r.b*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(g-S)<=r.b*Math.max(1,Math.abs(g),Math.abs(S))&&Math.abs(f-R)<=r.b*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(h-U)<=r.b*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(d-x)<=r.b*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(I-k)<=r.b*Math.max(1,Math.abs(I),Math.abs(k))&&Math.abs(p-O)<=r.b*Math.max(1,Math.abs(p),Math.abs(O))&&Math.abs(C-N)<=r.b*Math.max(1,Math.abs(C),Math.abs(N))}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(254);var i=n(146),o=n(255);function a(t,e){return Object(r.a)(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}(t,e)||Object(i.a)(t,e)||Object(o.a)()}n.d(e,"a",(function(){return a}))},function(t,e,n){t.exports=n(405)},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(146);function i(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=Object(r.a)(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o,a=!0,A=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(A)throw o}}}}},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(349);var i=n(350);function o(t,e){return Object(r.a)(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}(t,e)||Object(i.a)()}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";var r=n(195);var i=n(263),o=n(146);function a(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||Object(i.a)(t)||Object(o.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n(432);var r=n(160),i=n(132),o=n(58),a=n(41),A=Object(o.isBrowser)(),s=A&&"undefined"!==typeof document,c={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(a.a)(A,"createGLContext on available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");var e,n=t=Object.assign({},c,t),r=n.width,i=n.height;function o(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}t.onError=o;var s=t,u=s.canvas,g=h({canvas:u,width:r,height:i,onError:o});return(e=f(g,t))?(d(e=l(e,t)),e):null}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||I(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};var n=e=Object.assign({},c,e),r=n.manageState,s=n.debug;return r&&Object(i.a)(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return a.i.log.apply(a.i,[1].concat(e))()}}),A&&s&&(o.global.makeDebugContext?(t=o.global.makeDebugContext(t,e),a.i.level=Math.max(a.i.level,1)):a.i.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){var n=Object(a.e)(e.useDevicePixels);p(t,n,e)}else{var r=t.getExtension("STACKGL_resize_drawingbuffer");r&&"width"in e&&"height"in e&&r.resize(e.width,e.height)}}function f(t,e){var n=e.onError,r=function(t){return n("WebGL context: ".concat(t.statusMessage||"error"))};t.addEventListener("webglcontextcreationerror",r,!1);var i=e.webgl1,o=void 0===i||i,a=e.webgl2,A=void 0===a||a,s=null;return A&&(s=(s=s||t.getContext("webgl2",e))||t.getContext("experimental-webgl2",e)),o&&(s=(s=s||t.getContext("webgl",e))||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",r,!1),s||n("Failed to create ".concat(A&&!o?"WebGL2":"WebGL"," context"))}function h(t){var e,n=t.canvas,r=t.width,i=void 0===r?800:r,o=t.height,a=void 0===o?600:o,A=t.onError;"string"===typeof n?(s&&"complete"===document.readyState||A("createGLContext called on canvas '".concat(n,"' before page was loaded")),e=document.getElementById(n)):n?e=n:((e=document.createElement("canvas")).id="lumagl-canvas",e.style.width=Number.isFinite(i)?"".concat(i,"px"):"100%",e.style.height=Number.isFinite(a)?"".concat(a,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}function d(t){var e=Object(a.h)(t)?"WebGL2":"WebGL1",n=function(t){var e=t.getParameter(7936),n=t.getParameter(7937),r=t.getExtension("WEBGL_debug_renderer_info");return{vendor:r&&t.getParameter(r.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:r&&t.getParameter(r.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),r=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",i=t.debug?" debug":"";a.i.info(1,"".concat(e).concat(i," context ").concat(r))()}function I(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}function p(t,e,n){var r="width"in n?n.width:t.canvas.clientWidth,i="height"in n?n.height:t.canvas.clientHeight;r&&i||(a.i.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=t.canvas.width||1,i=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};var o=t.luma.canvasSizeInfo;if(o.clientWidth!==r||o.clientHeight!==i||o.devicePixelRatio!==e){var A=e,s=Math.floor(r*A),c=Math.floor(i*A);t.canvas.width=s,t.canvas.height=c,t.drawingBufferWidth===s&&t.drawingBufferHeight===c||(a.i.warn("Device pixel ratio clamped")(),A=Math.min(t.drawingBufferWidth/r,t.drawingBufferHeight/i),t.canvas.width=Math.floor(r*A),t.canvas.height=Math.floor(i*A)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:r,clientHeight:i,devicePixelRatio:e})}}n.d(e,"d",(function(){return r.a})),n.d(e,"k",(function(){return r.c})),n.d(e,"i",(function(){return r.b})),n.d(e,"l",(function(){return r.d})),n.d(e,"a",(function(){return u})),n.d(e,"j",(function(){return g})),n.d(e,"e",(function(){return l})),n.d(e,"h",(function(){return a.i})),n.d(e,"c",(function(){return a.c})),n.d(e,"b",(function(){return a.b})),n.d(e,"f",(function(){return a.g})),n.d(e,"g",(function(){return a.h}))},function(t,e,n){t.exports=n(525)()},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){try{var A=t[o](a),s=A.value}catch(c){return void n(c)}A.done?e(s):Promise.resolve(s).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function A(t){r(a,i,o,A,s,"next",t)}function s(t){r(a,i,o,A,s,"throw",t)}A(void 0)}))}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"g",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"i",(function(){return A})),n.d(e,"j",(function(){return s})),n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"h",(function(){return l})),n.d(e,"q",(function(){return g})),n.d(e,"p",(function(){return f})),n.d(e,"r",(function(){return h})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return I})),n.d(e,"m",(function(){return p})),n.d(e,"a",(function(){return C})),n.d(e,"o",(function(){return y})),n.d(e,"f",(function(){return v})),n.d(e,"n",(function(){return B}));var r=n(29);function i(){var t=new r.a(3);return r.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function a(t,e,n){var i=new r.a(3);return i[0]=t,i[1]=e,i[2]=n,i}function A(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function s(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],A=n[1],s=n[2];return t[0]=i*s-o*A,t[1]=o*a-r*s,t[2]=r*A-i*a,t}function l(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function g(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function f(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function h(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],A=e[0],s=e[1],c=e[2],u=i*c-o*s,l=o*A-r*c,g=r*s-i*A,f=i*g-o*l,h=o*u-r*g,d=r*l-i*u,I=2*a;return u*=I,l*=I,g*=I,f*=2,h*=2,d*=2,t[0]=A+u+f,t[1]=s+l+h,t[2]=c+g+d,t}function d(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function I(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function p(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function C(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],A=e[2],s=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+A*A),u=s&&c(t,e)/s;return Math.acos(Math.min(Math.max(u,-1),1))}var y=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},v=o,B=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r};!function(){var t=i()}()},function(t,e,n){"use strict";var r=n(348);function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||Object(r.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(208);function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Object(r.a)(t,e)}},function(t,e,n){"use strict";var r=n(74),i=n(288);function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=n(61);function A(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?Object(a.a)(t):e}function s(t){return function(){var e,n=Object(r.a)(t);if(Object(i.a)()){var o=Object(r.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return A(this,e)}}n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(16);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(157);function i(t,e){if(null==t)return{};var n,i,o=Object(r.a)(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!==typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){try{var A=t[o](a),s=A.value}catch(c){return void n(c)}A.done?e(s):Promise.resolve(s).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function A(t){r(a,i,o,A,s,"next",t)}function s(t){r(a,i,o,A,s,"throw",t)}A(void 0)}))}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"l",(function(){return g})),n.d(e,"m",(function(){return f})),n.d(e,"e",(function(){return h})),n.d(e,"s",(function(){return I})),n.d(e,"r",(function(){return p})),n.d(e,"o",(function(){return C})),n.d(e,"i",(function(){return y})),n.d(e,"p",(function(){return v})),n.d(e,"h",(function(){return B})),n.d(e,"q",(function(){return m})),n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return E})),n.d(e,"c",(function(){return Q})),n.d(e,"d",(function(){return F})),n.d(e,"n",(function(){return w})),n.d(e,"j",(function(){return S})),n.d(e,"k",(function(){return R})),n.d(e,"t",(function(){return U}));var r=n(27),i=n(79),o=n(23),a=n(135),A=1/Math.PI*180,s=1/180*Math.PI,c={};function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)Object(a.a)(e in c),c[e]=t[e];return c}function l(t){return Math.round(t/c.EPSILON)*c.EPSILON}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?c.precision||4:n;return t=l(t),"".concat(parseFloat(t.toPrecision(r)))}function f(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&void 0!==t.length}function h(t){return t.clone?t.clone():Object(i.a)(Array,Object(o.a)(t))}function d(t,e,n){if(f(t)){n=n||((i=t).clone?i.clone():new Array(i.length));for(var r=0;r<n.length&&r<t.length;++r)n[r]=e(t[r],r,n);return n}var i;return e(t)}function I(t){return C(t)}function p(t){return y(t)}function C(t,e){return d(t,(function(t){return t*s}),e)}function y(t,e){return d(t,(function(t){return t*A}),e)}function v(t){return d(t,(function(t){return Math.sin(t)}))}function B(t){return d(t,(function(t){return Math.cos(t)}))}function m(t){return d(t,(function(t){return Math.tan(t)}))}function b(t){return d(t,(function(t){return Math.asin(t)}))}function E(t){return d(t,(function(t){return Math.acos(t)}))}function Q(t){return d(t,(function(t){return Math.atan(t)}))}function F(t,e,n){return d(t,(function(t){return Math.max(e,Math.min(n,t))}))}function w(t,e,n){return f(t)?t.map((function(t,r){return w(t,e[r],n)})):n*e+(1-n)*t}function S(t,e,n){var r=c.EPSILON;n&&(c.EPSILON=n);try{if(t===e)return!0;if(f(t)&&f(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!S(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=c.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{c.EPSILON=r}}function R(t,e){if(t===e)return!0;if(t&&"object"===Object(r.a)(t)&&e&&"object"===Object(r.a)(e)){if(t.constructor!==e.constructor)return!1;if(t.exactEquals)return t.exactEquals(e)}if(f(t)&&f(e)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!R(t[n],e[n]))return!1;return!0}return!1}function U(t,e){var n,r=c.EPSILON;c.EPSILON=t;try{n=e()}finally{c.EPSILON=r}return n}c.EPSILON=1e-12,c.debug=!1,c.precision=4,c.printTypes=!1,c.printDegrees=!1,c.printRowMajor=!0},function(t,e,n){"use strict";function r(t){var e,n,i="";if("string"===typeof t||"number"===typeof t)i+=t;else if("object"===typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=r(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}e.a=function(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=r(t))&&(i&&(i+=" "),i+=e);return i}},function(t,e,n){"use strict";n.d(e,"f",(function(){return s})),n.d(e,"p",(function(){return c})),n.d(e,"j",(function(){return u})),n.d(e,"k",(function(){return l})),n.d(e,"l",(function(){return g})),n.d(e,"m",(function(){return f})),n.d(e,"b",(function(){return h})),n.d(e,"q",(function(){return d})),n.d(e,"g",(function(){return I})),n.d(e,"c",(function(){return p})),n.d(e,"e",(function(){return C})),n.d(e,"a",(function(){return y})),n.d(e,"o",(function(){return v})),n.d(e,"d",(function(){return B})),n.d(e,"i",(function(){return m})),n.d(e,"h",(function(){return b})),n.d(e,"r",(function(){return E})),n.d(e,"n",(function(){return F}));var r=n(29),i=n(48),o=n(22),a=n(45);function A(){var t=new r.a(4);return r.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function s(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function u(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=n[0],s=n[1],c=n[2],u=n[3];return t[0]=r*u+a*A+i*c-o*s,t[1]=i*u+a*s+o*A-r*c,t[2]=o*u+a*c+r*s-i*A,t[3]=a*u-r*A-i*s-o*c,t}function l(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],A=Math.sin(n),s=Math.cos(n);return t[0]=r*s+a*A,t[1]=i*s+o*A,t[2]=o*s-i*A,t[3]=a*s-r*A,t}function g(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],A=Math.sin(n),s=Math.cos(n);return t[0]=r*s-o*A,t[1]=i*s+a*A,t[2]=o*s+r*A,t[3]=a*s-i*A,t}function f(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],A=Math.sin(n),s=Math.cos(n);return t[0]=r*s+i*A,t[1]=i*s-r*A,t[2]=o*s+a*A,t[3]=a*s-o*A,t}function h(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function d(t,e,n,i){var o,a,A,s,c,u=e[0],l=e[1],g=e[2],f=e[3],h=n[0],d=n[1],I=n[2],p=n[3];return(a=u*h+l*d+g*I+f*p)<0&&(a=-a,h=-h,d=-d,I=-I,p=-p),1-a>r.b?(o=Math.acos(a),A=Math.sin(o),s=Math.sin((1-i)*o)/A,c=Math.sin(i*o)/A):(s=1-i,c=i),t[0]=s*u+c*h,t[1]=s*l+c*d,t[2]=s*g+c*I,t[3]=s*f+c*p,t}function I(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,A=a?1/a:0;return t[0]=-n*A,t[1]=-r*A,t[2]=-i*A,t[3]=o*A,t}function p(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function C(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}a.b,a.g,a.c,a.l;var y=a.a,v=a.k,B=a.d,m=a.i,b=a.h,E=a.m,Q=a.j,F=(a.f,a.e,function(){var t=o.b(),e=o.e(1,0,0),n=o.e(0,1,0);return function(r,i,a){var A=o.d(i,a);return A<-.999999?(o.c(t,e,i),o.f(t)<1e-6&&o.c(t,n,i),o.j(t,t),c(r,t,Math.PI),r):A>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(o.c(t,i,a),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+A,Q(r,r))}}());(function(){var t=A(),e=A()})(),function(){var t=i.a()}()},function(t,e,n){"use strict";var r=n(6);function i(t,e,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return A}));var r=n(31);function i(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e,n){if(r.f.debug&&!function(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(""|n," some fields set to invalid numbers'"));return t}var a={};function A(t,e){a[t]||(a[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return A})),n.d(e,"c",(function(){return s})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"j",(function(){return g})),n.d(e,"f",(function(){return f}));var r=n(29);function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function a(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function A(t,e){return t[0]=-e[0],t[1]=-e[1],t}function s(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function c(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function u(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function l(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function g(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}var f=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t=function(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},function(t,e,n){"use strict";var r=n(437);n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.b})),n.d(e,"c",(function(){return r.c})),n.d(e,"d",(function(){return r.d})),n.d(e,"e",(function(){return r.e})),n.d(e,"f",(function(){return r.f})),n.d(e,"g",(function(){return r.g}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return A})),n.d(e,"f",(function(){return s})),n.d(e,"h",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return g})),n.d(e,"g",(function(){return f})),n.d(e,"d",(function(){return h}));n(27),n(79),n(23),n(122);var r=1/Math.PI*180,i=1/180*Math.PI,o={};function a(t){return Math.round(t/o.EPSILON)*o.EPSILON}function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?o.precision||4:n;return t=a(t),"".concat(parseFloat(t.toPrecision(r)))}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function c(t,e,n){if(s(t)){n=n||((i=t).clone?i.clone():new Array(i.length));for(var r=0;r<n.length&&r<t.length;++r)n[r]=e(t[r],r,n);return n}var i;return e(t)}function u(t,e){return c(t,(function(t){return t*i}),e)}function l(t,e){return c(t,(function(t){return t*r}),e)}function g(t,e,n){return c(t,(function(t){return Math.max(e,Math.min(n,t))}))}function f(t,e,n){return s(t)?t.map((function(t,r){return f(t,e[r],n)})):n*e+(1-n)*t}function h(t,e,n){var r=o.EPSILON;n&&(o.EPSILON=n);try{if(t===e)return!0;if(s(t)&&s(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!h(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=r}}o.EPSILON=1e-12,o.debug=!1,o.precision=4,o.printTypes=!1,o.printDegrees=!1,o.printRowMajor=!0},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(44),i={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(i,"IDENTITY",{get:function(){return r.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(t,e,n){"use strict";var r=n(703);function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function o(t){for(var e in t)return!1;return!0}function a(t,e){if(t===e)return!0;var n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function A(t){if(t.canvas&&t.luma){var e=t.luma.canvasSizeInfo.clientWidth;return e?t.drawingBufferWidth/e:1}return 1}function s(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=A(t),i=t.drawingBufferWidth,o=t.drawingBufferHeight;return u(e,r,i,o,n)}function c(t){var e="undefined"===typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}function u(t,e,n,r,i){var o,a=l(t[0],e,n),A=g(t[1],e,r,i),s=l(t[0]+1,e,n),c=s===n-1?s:s-1;return s=g(t[1]+1,e,r,i),i?(o=A,A=s=0===s?s:s+1):o=s===r-1?s:s-1,{x:a,y:A,width:Math.max(c-a+1,1),height:Math.max(o-A+1,1)}}function l(t,e,n){return Math.min(Math.round(t*e),n-1)}function g(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}function f(t){return Boolean(t&&Number.isFinite(t._version))}function h(t){return Boolean(t&&2===t._version)}n.d(e,"i",(function(){return d})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return a})),n.d(e,"f",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return A})),n.d(e,"e",(function(){return c})),n.d(e,"g",(function(){return f})),n.d(e,"h",(function(){return h}));var d=new r.a({id:"luma.gl"})},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=n.n(o),A=(n(20),n(318)),s=n.n(A),c=n(542),u=n(866),l=n(714),g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=e.defaultTheme,A=e.withTheme,g=void 0!==A&&A,f=e.name,h=Object(i.a)(e,["defaultTheme","withTheme","name"]);var d=f,I=Object(c.a)(t,Object(r.a)({defaultTheme:o,Component:n,name:f||n.displayName,classNamePrefix:d},h)),p=a.a.forwardRef((function(t,e){t.classes;var A,s=t.innerRef,c=Object(i.a)(t,["classes","innerRef"]),h=I(Object(r.a)({},n.defaultProps,{},t)),d=c;return("string"===typeof f||g)&&(A=Object(l.a)()||o,f&&(d=Object(u.a)({theme:A,name:f,props:c})),g&&!d.theme&&(d.theme=A)),a.a.createElement(n,Object(r.a)({ref:s||e,classes:h},d))}));return s()(p,n),p}},f=n(175);e.a=function(t,e){return g(t,Object(r.a)({defaultTheme:f.a},e))}},function(t,e,n){"use strict";var r=n(703);e.a=new r.a({id:"deck"})},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"g",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"l",(function(){return A})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"m",(function(){return l})),n.d(e,"j",(function(){return g})),n.d(e,"d",(function(){return f})),n.d(e,"i",(function(){return h})),n.d(e,"n",(function(){return d})),n.d(e,"o",(function(){return I})),n.d(e,"f",(function(){return p})),n.d(e,"e",(function(){return C}));var r=n(29);function i(t){var e=new r.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,n,i){var o=new r.a(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function A(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function s(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function c(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function u(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function l(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function g(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function f(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function h(t,e,n,r){var i=e[0],o=e[1],a=e[2],A=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=A+r*(n[3]-A),t}function d(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function I(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],A=n[1],s=n[2],c=n[3],u=c*r+A*o-s*i,l=c*i+s*r-a*o,g=c*o+a*i-A*r,f=-a*r-A*i-s*o;return t[0]=u*c+f*-a+l*-s-g*-A,t[1]=l*c+f*-A+g*-a-u*-s,t[2]=g*c+f*-s+u*-A-l*-a,t[3]=e[3],t}function p(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function C(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],A=e[0],s=e[1],c=e[2],u=e[3];return Math.abs(n-A)<=r.b*Math.max(1,Math.abs(n),Math.abs(A))&&Math.abs(i-s)<=r.b*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-c)<=r.b*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-u)<=r.b*Math.max(1,Math.abs(a),Math.abs(u))}!function(){var t=function(){var t=new r.a(4);return r.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},function(t,e,n){"use strict";n.r(e),e.default={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"i",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A})),n.d(e,"e",(function(){return s})),n.d(e,"h",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return l})),n.d(e,"c",(function(){return g}));var r=n(29);function i(){var t=new r.a(9);return r.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],A=e[5],s=e[6],c=e[7],u=e[8],l=u*a-A*c,g=-u*o+A*s,f=c*o-a*s,h=n*l+r*g+i*f;return h?(h=1/h,t[0]=l*h,t[1]=(-u*r+i*c)*h,t[2]=(A*r-i*a)*h,t[3]=g*h,t[4]=(u*n-i*s)*h,t[5]=(-A*n+i*o)*h,t[6]=f*h,t[7]=(-c*n+r*s)*h,t[8]=(a*n-r*o)*h,t):null}function A(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],A=t[6],s=t[7],c=t[8];return e*(c*o-a*s)+n*(-c*i+a*A)+r*(s*i-o*A)}function s(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=e[4],s=e[5],c=e[6],u=e[7],l=e[8],g=n[0],f=n[1],h=n[2],d=n[3],I=n[4],p=n[5],C=n[6],y=n[7],v=n[8];return t[0]=g*r+f*a+h*c,t[1]=g*i+f*A+h*u,t[2]=g*o+f*s+h*l,t[3]=d*r+I*a+p*c,t[4]=d*i+I*A+p*u,t[5]=d*o+I*s+p*l,t[6]=C*r+y*a+v*c,t[7]=C*i+y*A+v*u,t[8]=C*o+y*s+v*l,t}function c(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=e[4],s=e[5],c=e[6],u=e[7],l=e[8],g=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=A,t[5]=s,t[6]=g*r+f*a+c,t[7]=g*i+f*A+u,t[8]=g*o+f*s+l,t}function u(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=e[4],s=e[5],c=e[6],u=e[7],l=e[8],g=Math.sin(n),f=Math.cos(n);return t[0]=f*r+g*a,t[1]=f*i+g*A,t[2]=f*o+g*s,t[3]=f*a-g*r,t[4]=f*A-g*i,t[5]=f*s-g*o,t[6]=c,t[7]=u,t[8]=l,t}function l(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function g(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,A=r+r,s=i+i,c=n*a,u=r*a,l=r*A,g=i*a,f=i*A,h=i*s,d=o*a,I=o*A,p=o*s;return t[0]=1-l-h,t[3]=u-p,t[6]=g+I,t[1]=u+p,t[4]=1-c-h,t[7]=f-d,t[2]=g-I,t[5]=f+d,t[8]=1-c-l,t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return A})),n.d(e,"b",(function(){return s}));n(27),n(79),n(23),n(95),Math.PI,Math.PI;var r={};function i(t){return Math.round(t/r.EPSILON)*r.EPSILON}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,o=void 0===n?r.precision||4:n;return t=i(t),"".concat(parseFloat(t.toPrecision(o)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t,e,n){return a(t)?t.map((function(t,r){return A(t,e[r],n)})):n*e+(1-n)*t}function s(t,e,n){var i=r.EPSILON;n&&(r.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!s(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}r.EPSILON=1e-12,r.debug=!1,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(49);function i(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function o(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.a.debug&&!i(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var A={};function s(t,e){A[t]||(A[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){"use strict";n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return A})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"e",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return f})),n.d(e,"h",(function(){return h}));var r=n(27),i=function(t){return"boolean"===typeof t},o=function(t){return"function"===typeof t},a=function(t){return null!==t&&"object"===Object(r.a)(t)},A=function(t){return a(t)&&t.constructor==={}.constructor},s=function(t){return t&&"function"===typeof t[Symbol.iterator]},c=function(t){return t&&"function"===typeof t[Symbol.asyncIterator]},u=function(t){return t&&o(t.next)},l=function(t){return"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json},g=function(t){return"undefined"!==typeof Blob&&t instanceof Blob},f=function(t){return t&&"object"===Object(r.a)(t)&&t.isBuffer},h=function(t){return function(t){return"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||a(t)&&o(t.tee)&&o(t.cancel)&&o(t.getReader)}(t)||function(t){return a(t)&&o(t.read)&&o(t.pipe)&&i(t.readable)}(t)}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n(242),n(297),n(241);n(289);n(177);n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A}));Math.PI,Math.PI;var r={};function i(t){return Math.round(t/r.EPSILON)*r.EPSILON}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,o=void 0===n?r.precision||4:n;return t=i(t),"".concat(parseFloat(t.toPrecision(o)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t,e,n){var i=r.EPSILON;n&&(r.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!A(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}r.EPSILON=1e-12,r.debug=!1,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var r=n(19),i=n(247),o=n(353),a=n(702),A=n(76),s=n(929),c=n(133),u=n(186),l=n(218),g=n(474),f=n(301),h=n(358),d=n(473),I=n(475),p=n(924),C=n(932),y=n(379),v=n(930),B=n(479),m=n(925),b=n(235),E=n(1379),Q=n(111),F=n(3),w=n(8),S=n(6),R=n(7),U=n(197),x={x:[2,0,1],y:[0,1,2],z:[1,2,0]},k=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("truncated-code-geometry"):n,i=O(t),o=i.indices,a=i.attributes;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,indices:o,attributes:Object(Q.a)({},a,t.attributes)})))}return Object(R.a)(e,t),e}(b.a);function O(t){for(var e=t.bottomRadius,n=void 0===e?0:e,r=t.topRadius,i=void 0===r?0:r,o=t.height,a=void 0===o?1:o,A=t.nradial,s=void 0===A?10:A,c=t.nvertical,u=void 0===c?10:c,l=t.verticalAxis,g=void 0===l?"y":l,f=t.topCap,h=void 0!==f&&f,d=t.bottomCap,I=void 0!==d&&d,p=(h?2:0)+(I?2:0),C=(s+1)*(u+1+p),y=Math.atan2(n-i,a),v=Math.sin,B=Math.cos,m=Math.PI,b=B(y),E=v(y),Q=h?-2:0,F=u+(I?2:0),w=s+1,S=new Uint16Array(s*(u+p)*6),R=x[g],U=new Float32Array(3*C),k=new Float32Array(3*C),O=new Float32Array(2*C),N=0,D=0,G=Q;G<=F;G++){var _=G/u,M=a*_,T=void 0;G<0?(M=0,_=1,T=n):G>u?(M=a,_=1,T=i):T=n+G/u*(i-n),-2!==G&&G!==u+2||(T=0,_=0),M-=a/2;for(var j=0;j<w;j++){var L=v(j*m*2/s),V=B(j*m*2/s);U[N+R[0]]=L*T,U[N+R[1]]=M,U[N+R[2]]=V*T,k[N+R[0]]=G<0||G>u?0:L*b,k[N+R[1]]=G<0?-1:G>u?1:E,k[N+R[2]]=G<0||G>u?0:V*b,O[D+0]=j/s,O[D+1]=_,D+=2,N+=3}}for(var Z=0;Z<u+p;Z++)for(var P=0;P<s;P++){var W=6*(Z*s+P);S[W+0]=w*(Z+0)+0+P,S[W+1]=w*(Z+0)+1+P,S[W+2]=w*(Z+1)+1+P,S[W+3]=w*(Z+0)+0+P,S[W+4]=w*(Z+1)+1+P,S[W+5]=w*(Z+1)+0+P}return{indices:S,attributes:{POSITION:{size:3,value:U},NORMAL:{size:3,value:k},TEXCOORD_0:{size:2,value:O}}}}var N=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("cone-geometry"):n,i=t.radius,o=void 0===i?1:i,a=t.cap,A=void 0===a||a;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,topRadius:0,topCap:Boolean(A),bottomCap:Boolean(A),bottomRadius:o})))}return Object(R.a)(e,t),e}(k),D=n(1378),G=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("cylinder-geometry"):n,i=t.radius,o=void 0===i?1:i;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,bottomRadius:o,topRadius:o})))}return Object(R.a)(e,t),e}(k),_=n(820),M=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],T=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],j=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("ico-sphere-geometry"):n,i=L(t),o=i.indices,a=i.attributes;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,indices:o,attributes:Object(Q.a)({},a,t.attributes)})))}return Object(R.a)(e,t),e}(b.a);function L(t){var e=t.iterations,n=void 0===e?0:e,r=Math.PI,i=2*r,o=[].concat(M),a=[].concat(T);o.push(),a.push();for(var A=function(){var t={};return function(e,n){var r=(e*=3)>(n*=3)?e:n,i="".concat(e<n?e:n,"|").concat(r);if(i in t)return t[i];var a=o[e],A=o[e+1],s=o[e+2],c=(a+o[n])/2,u=(A+o[n+1])/2,l=(s+o[n+2])/2,g=Math.sqrt(c*c+u*u+l*l);return c/=g,u/=g,l/=g,o.push(c,u,l),t[i]=o.length/3-1}}(),s=0;s<n;s++){for(var c=[],u=0;u<a.length;u+=3){var l=A(a[u+0],a[u+1]),g=A(a[u+1],a[u+2]),f=A(a[u+2],a[u+0]);c.push(f,a[u+0],l,l,a[u+1],g,g,a[u+2],f,l,g,f)}a=c}for(var h=new Array(o.length),d=new Array(o.length/3*2),I=a.length-3;I>=0;I-=3){var p=a[I+0],C=a[I+1],y=a[I+2],v=3*p,B=3*C,m=3*y,b=2*p,E=2*C,Q=2*y,F=o[v+0],w=o[v+1],S=o[v+2],R=Math.acos(S/Math.sqrt(F*F+w*w+S*S))/r,U=1-(Math.atan2(w,F)+r)/i,x=o[B+0],k=o[B+1],O=o[B+2],N=Math.acos(O/Math.sqrt(x*x+k*k+O*O))/r,D=1-(Math.atan2(k,x)+r)/i,G=o[m+0],j=o[m+1],L=o[m+2],V=Math.acos(L/Math.sqrt(G*G+j*j+L*L))/r,Z=1-(Math.atan2(j,G)+r)/i,P=[G-x,j-k,L-O],W=[F-x,w-k,S-O],J=new _.a(P).cross(W).normalize(),H=void 0;(0===U||0===D||0===Z)&&(0===U||U>.5)&&(0===D||D>.5)&&(0===Z||Z>.5)&&(o.push(o[v+0],o[v+1],o[v+2]),H=o.length/3-1,a.push(H),d[2*H+0]=1,d[2*H+1]=R,h[3*H+0]=J.x,h[3*H+1]=J.y,h[3*H+2]=J.z,o.push(o[B+0],o[B+1],o[B+2]),H=o.length/3-1,a.push(H),d[2*H+0]=1,d[2*H+1]=N,h[3*H+0]=J.x,h[3*H+1]=J.y,h[3*H+2]=J.z,o.push(o[m+0],o[m+1],o[m+2]),H=o.length/3-1,a.push(H),d[2*H+0]=1,d[2*H+1]=V,h[3*H+0]=J.x,h[3*H+1]=J.y,h[3*H+2]=J.z),h[v+0]=h[B+0]=h[m+0]=J.x,h[v+1]=h[B+1]=h[m+1]=J.y,h[v+2]=h[B+2]=h[m+2]=J.z,d[b+0]=U,d[b+1]=R,d[E+0]=D,d[E+1]=N,d[Q+0]=Z,d[Q+1]=V}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}}}}var V=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("plane-geometry"):n,i=Z(t),o=i.indices,a=i.attributes;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,indices:o,attributes:Object(Q.a)({},a,t.attributes)})))}return Object(R.a)(e,t),e}(b.a);function Z(t){var e=t.type,n=void 0===e?"x,y":e,r=t.offset,i=void 0===r?0:r,o=t.flipCull,a=void 0!==o&&o,A=t.unpack,s=void 0!==A&&A,c=n.split(","),u=t["".concat(c[0],"len")]||1,l=t["".concat(c[1],"len")]||1,g=t["n".concat(c[0])]||1,f=t["n".concat(c[1])]||1,h=(g+1)*(f+1),d=new Float32Array(3*h),I=new Float32Array(3*h),p=new Float32Array(2*h);a&&(u=-u);for(var C=0,y=0,v=0;v<=f;v++)for(var B=0;B<=g;B++){var m=B/g,b=v/f;switch(p[C+0]=a?1-m:m,p[C+1]=b,n){case"x,y":d[y+0]=u*m-.5*u,d[y+1]=l*b-.5*l,d[y+2]=i,I[y+0]=0,I[y+1]=0,I[y+2]=a?1:-1;break;case"x,z":d[y+0]=u*m-.5*u,d[y+1]=i,d[y+2]=l*b-.5*l,I[y+0]=0,I[y+1]=a?1:-1,I[y+2]=0;break;case"y,z":d[y+0]=i,d[y+1]=u*m-.5*u,d[y+2]=l*b-.5*l,I[y+0]=a?1:-1,I[y+1]=0,I[y+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}C+=2,y+=3}for(var E=g+1,Q=new Uint16Array(g*f*6),F=0;F<f;F++)for(var w=0;w<g;w++){var S=6*(F*g+w);Q[S+0]=(F+0)*E+w,Q[S+1]=(F+1)*E+w,Q[S+2]=(F+0)*E+w+1,Q[S+3]=(F+1)*E+w,Q[S+4]=(F+1)*E+w+1,Q[S+5]=(F+0)*E+w+1}var R={indices:{size:1,value:Q},attributes:{POSITION:{size:3,value:d},NORMAL:{size:3,value:I},TEXCOORD_0:{size:2,value:p}}};return s?function(t){var e=t.indices,n=t.attributes;if(!e)return t;var r=e.value.length,i={};for(var o in n){var a=n[o],A=a.constant,s=a.value,c=a.size;if(!A&&c){for(var u=new s.constructor(r*c),l=0;l<r;++l)for(var g=e.value[l],f=0;f<c;f++)u[l*c+f]=s[g*c+f];i[o]={size:c,value:u}}}return{attributes:Object.assign({},n,i)}}(R):R}var P=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(F.a)(this,e);var n=t.id,r=void 0===n?Object(U.c)("sphere-geometry"):n,i=W(t),o=i.indices,a=i.attributes;return Object(w.a)(this,Object(S.a)(e).call(this,Object(Q.a)({},t,{id:r,indices:o,attributes:Object(Q.a)({},a,t.attributes)})))}return Object(R.a)(e,t),e}(b.a);function W(t){var e=t.nlat,n=void 0===e?10:e,r=t.nlong,i=void 0===r?10:r,o=t.radius,a=void 0===o?1:o,A=Math.PI-0,s=2*Math.PI-0,c=(n+1)*(i+1);if("number"===typeof a){var u=a;a=function(t,e,n,r,i){return u}}for(var l=new Float32Array(3*c),g=new Float32Array(3*c),f=new Float32Array(2*c),h=new(c>65535?Uint32Array:Uint16Array)(n*i*6),d=0;d<=n;d++)for(var I=0;I<=i;I++){var p=I/i,C=d/n,y=I+d*(i+1),v=2*y,B=3*y,m=s*p,b=A*C,E=Math.sin(m),Q=Math.cos(m),F=Math.sin(b),w=Q*F,S=Math.cos(b),R=E*F,U=a(w,S,R,p,C);l[B+0]=U*w,l[B+1]=U*S,l[B+2]=U*R,g[B+0]=w,g[B+1]=S,g[B+2]=R,f[v+0]=p,f[v+1]=1-C}for(var x=i+1,k=0;k<i;k++)for(var O=0;O<n;O++){var N=6*(k*n+O);h[N+0]=O*x+k,h[N+1]=O*x+k+1,h[N+2]=(O+1)*x+k,h[N+3]=(O+1)*x+k,h[N+4]=O*x+k+1,h[N+5]=(O+1)*x+k+1}return{indices:{size:1,value:h},attributes:{POSITION:{size:3,value:l},NORMAL:{size:3,value:g},TEXCOORD_0:{size:2,value:f}}}}var J=n(357),H=n(923);function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function X(t){return t-Math.fround(t)}var z={ONE:1};var K={name:"fp64",vs:"const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04,  -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n    if (d == floor(d)) return d;\n    return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n    float hi = nint(a.x);\n    float lo;\n    vec2 tmp;\n    if (hi == a.x) {\n        lo = nint(a.y);\n        tmp = quickTwoSum(hi, lo);\n    } else {\n        lo = 0.0;\n        if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n            hi -= 1.0;\n        }\n        tmp = vec2(hi, lo);\n    }\n    return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n  const int k_power = 4;\n  const float k = 16.0;\n\n  const float inv_k = 1.0 / k;\n\n  if (a.x <= -88.0) return vec2(0.0, 0.0);\n  if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n  if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n  if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n  float m = floor(a.x / LOG2_FP64.x + 0.5);\n  vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n  vec2 s, t, p;\n\n  p = mul_fp64(r, r);\n  s = sum_fp64(r, p * 0.5);\n  p = mul_fp64(p, r);\n  t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n  s = sum_fp64(s, t);\n  p = mul_fp64(p, r);\n  t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n  s = sum_fp64(s, t);\n  p = mul_fp64(p, r);\n  t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n  s = sum_fp64(s, t);\n  for (int i = 0; i < k_power; i++) {\n    s = sum_fp64(s * 2.0, mul_fp64(s, s));\n  }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n  s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n  s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n  return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n  if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n  if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n  vec2 x = vec2(log(a.x), 0.0);\n  vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n  s = vec2(ONE, 0.0);\n#else\n  s = vec2(1.0, 0.0);\n#endif\n\n  x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n  return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n  vec2 r, s, t, x;\n\n  if (a.x == 0.0 && a.y == 0.0) {\n    return vec2(0.0, 0.0);\n  }\n\n  x = -mul_fp64(a, a);\n  s = a;\n  r = a;\n\n  r = mul_fp64(r, x);\n  t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n  s = sum_fp64(s, t);\n\n  r = mul_fp64(r, x);\n  t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n  s = sum_fp64(s, t);\n\n\n\n\n\n\n  return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n  vec2 r, s, t, x;\n\n  if (a.x == 0.0 && a.y == 0.0) {\n    return vec2(1.0, 0.0);\n  }\n\n  x = -mul_fp64(a, a);\n  r = x;\n  s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n  r = mul_fp64(r, x);\n  t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n  s = sum_fp64(s, t);\n\n  r = mul_fp64(r, x);\n  t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n  s = sum_fp64(s, t);\n\n\n\n\n\n\n  return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n  if (a.x == 0.0 && a.y == 0.0) {\n    sin_t = vec2(0.0, 0.0);\n    cos_t = vec2(1.0, 0.0);\n  }\n\n  sin_t = sin_taylor_fp64(a);\n  cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n    if (a.x == 0.0 && a.y == 0.0) {\n        return vec2(0.0, 0.0);\n    }\n    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n    vec2 t;\n    float q = floor(r.x / PI_2_FP64.x + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    }\n\n    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n    q = floor(t.x / PI_16_FP64.x + 0.5);\n    int k = int(q);\n\n    if (k == 0) {\n        if (j == 0) {\n            return sin_taylor_fp64(t);\n        } else if (j == 1) {\n            return cos_taylor_fp64(t);\n        } else if (j == -1) {\n            return -cos_taylor_fp64(t);\n        } else {\n            return -sin_taylor_fp64(t);\n        }\n    }\n\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    } else {\n        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n    }\n\n    vec2 u = vec2(0.0, 0.0);\n    vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n    if (abs(float(abs_k) - 1.0) < 0.5) {\n        u = COS_TABLE_0_FP64;\n        v = SIN_TABLE_0_FP64;\n    } else if (abs(float(abs_k) - 2.0) < 0.5) {\n        u = COS_TABLE_1_FP64;\n        v = SIN_TABLE_1_FP64;\n    } else if (abs(float(abs_k) - 3.0) < 0.5) {\n        u = COS_TABLE_2_FP64;\n        v = SIN_TABLE_2_FP64;\n    } else if (abs(float(abs_k) - 4.0) < 0.5) {\n        u = COS_TABLE_3_FP64;\n        v = SIN_TABLE_3_FP64;\n    }\n#else\n    if (abs_k == 1) {\n        u = COS_TABLE_0_FP64;\n        v = SIN_TABLE_0_FP64;\n    } else if (abs_k == 2) {\n        u = COS_TABLE_1_FP64;\n        v = SIN_TABLE_1_FP64;\n    } else if (abs_k == 3) {\n        u = COS_TABLE_2_FP64;\n        v = SIN_TABLE_2_FP64;\n    } else if (abs_k == 4) {\n        u = COS_TABLE_3_FP64;\n        v = SIN_TABLE_3_FP64;\n    }\n#endif\n\n    vec2 sin_t, cos_t;\n    sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n    vec2 result = vec2(0.0, 0.0);\n    if (j == 0) {\n        if (k > 0) {\n            result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        } else {\n            result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        }\n    } else if (j == 1) {\n        if (k > 0) {\n            result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        } else {\n            result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        }\n    } else if (j == -1) {\n        if (k > 0) {\n            result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n        } else {\n            result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n        }\n    } else {\n        if (k > 0) {\n            result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        } else {\n            result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n        }\n    }\n\n    return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n    if (a.x == 0.0 && a.y == 0.0) {\n        return vec2(1.0, 0.0);\n    }\n    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n    vec2 t;\n    float q = floor(r.x / PI_2_FP64.x + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    }\n\n    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n    q = floor(t.x / PI_16_FP64.x + 0.5);\n    int k = int(q);\n\n    if (k == 0) {\n        if (j == 0) {\n            return cos_taylor_fp64(t);\n        } else if (j == 1) {\n            return -sin_taylor_fp64(t);\n        } else if (j == -1) {\n            return sin_taylor_fp64(t);\n        } else {\n            return -cos_taylor_fp64(t);\n        }\n    }\n\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    } else {\n        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n    }\n\n    vec2 u = vec2(0.0, 0.0);\n    vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n    if (abs(float(abs_k) - 1.0) < 0.5) {\n        u = COS_TABLE_0_FP64;\n        v = SIN_TABLE_0_FP64;\n    } else if (abs(float(abs_k) - 2.0) < 0.5) {\n        u = COS_TABLE_1_FP64;\n        v = SIN_TABLE_1_FP64;\n    } else if (abs(float(abs_k) - 3.0) < 0.5) {\n        u = COS_TABLE_2_FP64;\n        v = SIN_TABLE_2_FP64;\n    } else if (abs(float(abs_k) - 4.0) < 0.5) {\n        u = COS_TABLE_3_FP64;\n        v = SIN_TABLE_3_FP64;\n    }\n#else\n    if (abs_k == 1) {\n        u = COS_TABLE_0_FP64;\n        v = SIN_TABLE_0_FP64;\n    } else if (abs_k == 2) {\n        u = COS_TABLE_1_FP64;\n        v = SIN_TABLE_1_FP64;\n    } else if (abs_k == 3) {\n        u = COS_TABLE_2_FP64;\n        v = SIN_TABLE_2_FP64;\n    } else if (abs_k == 4) {\n        u = COS_TABLE_3_FP64;\n        v = SIN_TABLE_3_FP64;\n    }\n#endif\n\n    vec2 sin_t, cos_t;\n    sincos_taylor_fp64(t, sin_t, cos_t);\n\n    vec2 result = vec2(0.0, 0.0);\n    if (j == 0) {\n        if (k > 0) {\n            result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        } else {\n            result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        }\n    } else if (j == 1) {\n        if (k > 0) {\n            result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        } else {\n            result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n        }\n    } else if (j == -1) {\n        if (k > 0) {\n            result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        } else {\n            result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n        }\n    } else {\n        if (k > 0) {\n            result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n        } else {\n            result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        }\n    }\n\n    return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n    vec2 sin_a;\n    vec2 cos_a;\n\n    if (a.x == 0.0 && a.y == 0.0) {\n        return vec2(0.0, 0.0);\n    }\n    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n    vec2 t;\n    float q = floor(r.x / PI_2_FP64.x + 0.5);\n    int j = int(q);\n\n\n    if (j < -2 || j > 2) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    }\n\n    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n    q = floor(t.x / PI_16_FP64.x + 0.5);\n    int k = int(q);\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return vec2(0.0 / 0.0, 0.0 / 0.0);\n    } else {\n        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n    }\n\n\n    vec2 u = vec2(0.0, 0.0);\n    vec2 v = vec2(0.0, 0.0);\n\n    vec2 sin_t, cos_t;\n    vec2 s, c;\n    sincos_taylor_fp64(t, sin_t, cos_t);\n\n    if (k == 0) {\n        s = sin_t;\n        c = cos_t;\n    } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n        if (abs(float(abs_k) - 1.0) < 0.5) {\n            u = COS_TABLE_0_FP64;\n            v = SIN_TABLE_0_FP64;\n        } else if (abs(float(abs_k) - 2.0) < 0.5) {\n            u = COS_TABLE_1_FP64;\n            v = SIN_TABLE_1_FP64;\n        } else if (abs(float(abs_k) - 3.0) < 0.5) {\n            u = COS_TABLE_2_FP64;\n            v = SIN_TABLE_2_FP64;\n        } else if (abs(float(abs_k) - 4.0) < 0.5) {\n            u = COS_TABLE_3_FP64;\n            v = SIN_TABLE_3_FP64;\n        }\n#else\n        if (abs_k == 1) {\n            u = COS_TABLE_0_FP64;\n            v = SIN_TABLE_0_FP64;\n        } else if (abs_k == 2) {\n            u = COS_TABLE_1_FP64;\n            v = SIN_TABLE_1_FP64;\n        } else if (abs_k == 3) {\n            u = COS_TABLE_2_FP64;\n            v = SIN_TABLE_2_FP64;\n        } else if (abs_k == 4) {\n            u = COS_TABLE_3_FP64;\n            v = SIN_TABLE_3_FP64;\n        }\n#endif\n        if (k > 0) {\n            s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n            c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        } else {\n            s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n            c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n        }\n    }\n\n    if (j == 0) {\n        sin_a = s;\n        cos_a = c;\n    } else if (j == 1) {\n        sin_a = c;\n        cos_a = -s;\n    } else if (j == -1) {\n        sin_a = -c;\n        cos_a = s;\n    } else {\n        sin_a = -s;\n        cos_a = -c;\n    }\n    return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n  return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n  vec2 range = sub_fp64(b, a);\n  return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n    out_val[0] = sum_fp64(a[0], b[0]);\n    out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n    out_val[0] = sub_fp64(a[0], b[0]);\n    out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n    out_val[0] = mul_fp64(a[0], b[0]);\n    out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n    out_val[0] = div_fp64(a[0], b[0]);\n    out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n  vec2 range[2];\n  vec2_sub_fp64(y, x, range);\n  vec2 portion[2];\n  portion[0] = range[0] * a;\n  portion[1] = range[1] * a;\n  vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n  return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n  vec2 length = vec2_length_fp64(x);\n  vec2 length_vec2[2];\n  length_vec2[0] = length;\n  length_vec2[1] = length;\n\n  vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n  vec2 diff[2];\n  vec2_sub_fp64(x, y, diff);\n  return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n  vec2 v[2];\n\n  v[0] = mul_fp64(a[0], b[0]);\n  v[1] = mul_fp64(a[1], b[1]);\n\n  return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n  for (int i = 0; i < 3; i++) {\n    out_val[i] = sum_fp64(a[i], b[i]);\n  }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n  for (int i = 0; i < 3; i++) {\n    out_val[i] = sum_fp64(a[i], b[i]);\n  }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n  return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n    mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n  vec2 diff[3];\n  vec3_sub_fp64(x, y, diff);\n  return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n  out_val[0].x = a[0];\n  out_val[0].y = 0.0;\n\n  out_val[1].x = a[1];\n  out_val[1].y = 0.0;\n\n  out_val[2].x = a[2];\n  out_val[2].y = 0.0;\n\n  out_val[3].x = a[3];\n  out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n  out_val[0] = mul_fp64(a[0], b);\n  out_val[1] = mul_fp64(a[1], b);\n  out_val[2] = mul_fp64(a[2], b);\n  out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n  for (int i = 0; i < 4; i++) {\n    out_val[i] = sum_fp64(a[i], b[i]);\n  }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n  vec2 v[4];\n\n  v[0] = mul_fp64(a[0], b[0]);\n  v[1] = mul_fp64(a[1], b[1]);\n  v[2] = mul_fp64(a[2], b[2]);\n  v[3] = mul_fp64(a[3], b[3]);\n\n  out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n  vec2 tmp[4];\n\n  for (int i = 0; i < 4; i++)\n  {\n    for (int j = 0; j < 4; j++)\n    {\n      tmp[j] = b[j + i * 4];\n    }\n    vec4_dot_fp64(a, tmp, out_val[i]);\n  }\n}\n",fs:null,dependencies:[{name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n  const float SPLIT = 4097.0;\n  float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float a_hi = t * ONE - (t - a);\n  float a_lo = a * ONE - a_hi;\n#else\n  float a_hi = t - (t - a);\n  float a_lo = a - a_hi;\n#endif\n  return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n  vec2 b = split(a.x);\n  b.y += a.y;\n  return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float sum = (a + b) * ONE;\n  float err = b - (sum - a) * ONE;\n#else\n  float sum = a + b;\n  float err = b - (sum - a);\n#endif\n  return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n  float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) + (b - v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n  float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) - (b + v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n  float prod = a * a;\n  vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n    a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n  float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n  return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n  float prod = a * b;\n  vec2 a_fp64 = split(a);\n  vec2 b_fp64 = split(b);\n  float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n    a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n  return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSum(a.x, b.x);\n  t = twoSum(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSub(a.x, b.x);\n  t = twoSub(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n  vec2 prod = twoProd(a.x, b.x);\n  prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n  float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n  vec2 yn = a * xn;\n#endif\n  float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n  vec2 prod = twoProd(xn, diff);\n  return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n  if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n  if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n  float x = 1.0 / sqrt(a.x);\n  float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n  vec2 yn_sqr = twoSqr(yn);\n#endif\n  float diff = sub_fp64(a, yn_sqr).x;\n  vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  return sum_fp64(split(yn), prod);\n#else\n  return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return z},fp64ify:Y,fp64LowPart:X}],fp64ify:Y,fp64LowPart:X,fp64ifyMatrix4:function(t){for(var e=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var i=4*n+r;Y(t[4*r+n],e,2*i)}return e}},q=n(821),$=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],tt={modelMatrix:$,viewMatrix:$,projectionMatrix:$,cameraPositionWorld:[0,0,0]};var et="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n  return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n  return project_vNormalWorld;\n}\n",nt={name:"project",getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tt,e=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==t.modelMatrix&&(e.modelMatrix=t.modelMatrix),void 0!==t.viewMatrix&&(e.viewMatrix=t.viewMatrix),void 0!==t.projectionMatrix&&(e.projectionMatrix=t.projectionMatrix),void 0!==t.cameraPositionWorld&&(e.cameraPositionWorld=t.cameraPositionWorld),void 0===t.projectionMatrix&&void 0===t.viewMatrix||(e.viewProjectionMatrix=new q.a(t.projectionMatrix).multiplyRight(t.viewMatrix)),e},vs:"".concat(et,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n  vec3 position;\n  vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n  project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n  project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n  world.position = position;\n  world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n  world.position = (modelMatrix * vec4(position, 1.)).xyz;\n  world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n  return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n  return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n  return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n  return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n  return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(et)},rt={lightDirection:new Float32Array([1,1,2])};var it={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n  vec3 normal = project_getNormal_World();\n  float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n  return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt,e={};return t.lightDirection&&(e.dirlight_uLightDirection=t.lightDirection),e},dependencies:[nt]},ot=n(700),at=n(933),At=n(1386),st=n(47);n.d(e,"createGLContext",(function(){return r.a})),n.d(e,"instrumentGLContext",(function(){return r.e})),n.d(e,"isWebGL",(function(){return r.f})),n.d(e,"isWebGL2",(function(){return r.g})),n.d(e,"getParameters",(function(){return r.d})),n.d(e,"setParameters",(function(){return r.k})),n.d(e,"withParameters",(function(){return r.l})),n.d(e,"resetParameters",(function(){return r.i})),n.d(e,"cssToDeviceRatio",(function(){return r.c})),n.d(e,"cssToDevicePixels",(function(){return r.b})),n.d(e,"lumaStats",(function(){return i.a})),n.d(e,"FEATURES",(function(){return o.a})),n.d(e,"hasFeature",(function(){return a.b})),n.d(e,"hasFeatures",(function(){return a.c})),n.d(e,"Buffer",(function(){return A.a})),n.d(e,"Program",(function(){return s.a})),n.d(e,"Framebuffer",(function(){return c.a})),n.d(e,"Renderbuffer",(function(){return u.a})),n.d(e,"Texture2D",(function(){return l.a})),n.d(e,"TextureCube",(function(){return g.a})),n.d(e,"clear",(function(){return f.a})),n.d(e,"readPixelsToArray",(function(){return h.c})),n.d(e,"readPixelsToBuffer",(function(){return h.d})),n.d(e,"cloneTextureFrom",(function(){return d.a})),n.d(e,"copyToTexture",(function(){return h.b})),n.d(e,"Texture3D",(function(){return I.a})),n.d(e,"TransformFeedback",(function(){return p.a})),n.d(e,"AnimationLoop",(function(){return C.a})),n.d(e,"Model",(function(){return y.a})),n.d(e,"Transform",(function(){return v.a})),n.d(e,"ProgramManager",(function(){return B.a})),n.d(e,"Timeline",(function(){return m.a})),n.d(e,"Geometry",(function(){return b.a})),n.d(e,"ClipSpace",(function(){return E.a})),n.d(e,"ConeGeometry",(function(){return N})),n.d(e,"CubeGeometry",(function(){return D.a})),n.d(e,"CylinderGeometry",(function(){return G})),n.d(e,"IcoSphereGeometry",(function(){return j})),n.d(e,"PlaneGeometry",(function(){return V})),n.d(e,"SphereGeometry",(function(){return P})),n.d(e,"TruncatedConeGeometry",(function(){return k})),n.d(e,"normalizeShaderModule",(function(){return J.b})),n.d(e,"fp32",(function(){return H.a})),n.d(e,"fp64",(function(){return K})),n.d(e,"project",(function(){return nt})),n.d(e,"dirlight",(function(){return it})),n.d(e,"picking",(function(){return ot.a})),n.d(e,"gouraudLighting",(function(){return at.a})),n.d(e,"phongLighting",(function(){return at.b})),n.d(e,"pbr",(function(){return At.a})),n.d(e,"log",(function(){return r.h})),n.d(e,"assert",(function(){return st.a})),n.d(e,"uid",(function(){return U.c}))},function(t,e,n){t.exports=n(631)},function(t,e,n){"use strict";n.r(e);var r=n(40),i=n(305),o=n(368),a=n(260),A=n(3),s=n(2),c=n(307),u=[255,255,255],l=[0,0,1],g=[0,0,1],f=0,h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(A.a)(this,t);var n=e.color,r=void 0===n?u:n,i=e.intensity,o=void 0===i?1:i,a=e.position,s=void 0===a?g:a;this.id=e.id||"point-".concat(f++),this.color=r,this.intensity=o,this.type="point",this.position=s,this.attenuation=d(e),this.projectedLight=Object.assign({},this)}return Object(s.a)(t,[{key:"getProjectedLight",value:function(t){var e=t.layer,n=this.projectedLight,i=e.context.viewport,o=e.props,a=o.coordinateSystem,A=o.coordinateOrigin,s=Object(c.b)(this.position,{viewport:i,coordinateSystem:a,coordinateOrigin:A,fromCoordinateSystem:i.isGeospatial?r.a.LNGLAT:r.a.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return n.color=this.color,n.intensity=this.intensity,n.position=s,n}}]),t}();function d(t){return"attenuation"in t?t.attenuation:"intensity"in t?[0,0,t.intensity]:l}var I=n(7),p=n(8),C=n(6),y=n(256);function v(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var B=function(t){Object(I.a)(n,t);var e=v(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(s.a)(n,[{key:"getProjectedLight",value:function(t){var e=t.layer,n=this.projectedLight,r=e.context.viewport,i=e.props,o=i.coordinateSystem,a=i.coordinateOrigin,A=i.modelMatrix,s=Object(y.b)({viewport:r,modelMatrix:A,coordinateSystem:o,coordinateOrigin:a}).project_uCameraPosition;return n.color=this.color,n.intensity=this.intensity,n.position=s,n}}]),n}(h),m=n(28),b=Math.PI/180,E=23.4397*b;function Q(t,e,n){var r=b*-n,i=b*e,o=function(t){return function(t){return t/864e5-.5+2440588}(t)-2451545}(t),a=function(t){var e=function(t){var e=t,n=b*(1.9148*Math.sin(e)+.02*Math.sin(2*e)+3e-4*Math.sin(3*e));return e+n+102.9372*b+Math.PI}((n=t,b*(357.5291+.98560028*n)));var n;return{declination:w(e,0),rightAscension:F(e,0)}}(o),A=function(t,e){return b*(280.147+360.9856235*t)-e}(o,r)-a.rightAscension;return{azimuth:S(A,i,a.declination),altitude:R(A,i,a.declination)}}function F(t,e){var n=t;return Math.atan2(Math.sin(n)*Math.cos(E)-Math.tan(e)*Math.sin(E),Math.cos(n))}function w(t,e){var n=t;return Math.asin(Math.sin(e)*Math.cos(E)+Math.cos(e)*Math.sin(E)*Math.sin(n))}function S(t,e,n){var r=t,i=e,o=n;return Math.atan2(Math.sin(r),Math.cos(r)*Math.sin(i)-Math.tan(o)*Math.cos(i))}function R(t,e,n){var r=t,i=e,o=n;return Math.asin(Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos(r))}function U(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var x=function(t){Object(I.a)(n,t);var e=U(n);function n(t){var r,i=t.timestamp,o=Object(m.a)(t,["timestamp"]);return Object(A.a)(this,n),(r=e.call(this,o)).timestamp=i,r}return Object(s.a)(n,[{key:"getProjectedLight",value:function(t){var e=t.layer.context.viewport,n=e.latitude,r=e.longitude;return this.direction=function(t,e,n){var r=Q(t,e,n),i=r.azimuth,o=r.altitude,a=i+Math.PI;return[-Math.sin(a),-Math.cos(a),-Math.sin(o)]}(this.timestamp,n,r),this}}]),n}(a.a),k=n(227),O=n(1379),N=n(19),D=n(301);function G(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var _=function(t){Object(I.a)(n,t);var e=G(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,n),r=e.call(this,t,i);var o=i.module,a=i.fs,s=i.id;return r.model=new O.a(t,{id:s,fs:a,modules:[o]}),r}return Object(s.a)(n,[{key:"render",value:function(t){var e=this,n=this.gl;Object(N.l)(n,{framebuffer:t.outputBuffer,clearColor:[0,0,0,0]},(function(){return e._renderPass(n,t)}))}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_renderPass",value:function(t,e){var n=e.inputBuffer;e.outputBuffer;Object(D.a)(t,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),n}(n(378).a),M=n(357);function T(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function L(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var V=function(t){Object(I.a)(n,t);var e=L(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(A.a)(this,n),(r=e.call(this,i)).id="".concat(t.name,"-pass"),Object(M.b)(t),r.module=t,r}return Object(s.a)(n,[{key:"postRender",value:function(t,e){this.passes||(this.passes=function(t,e,n,r){if(e.filter||e.sampler){var i=W(e);return[new _(t,{id:n,module:e,fs:i,moduleSettings:r})]}return(e.passes||[]).map((function(i,o){var a=W(e,i),A="".concat(n,"-").concat(o);return new _(t,{id:A,module:e,fs:a,moduleSettings:r})}))}(t,this.module,this.id,this.props));for(var n=e.target,r=e.inputBuffer,i=e.swapBuffer,o=0;o<this.passes.length;o++){n&&o===this.passes.length-1&&(i=n),this.passes[o].render({inputBuffer:r,outputBuffer:i});var a=i;i=r,r=a}return r}},{key:"cleanup",value:function(){if(this.passes){var t,e=T(this.passes);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}this.passes=null}}}]),n}(k.a);var Z=function(t){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n  vec2 texCoord = coordinate;\n\n  gl_FragColor = texture2D(texture, texCoord);\n  gl_FragColor = ".concat(t,"(gl_FragColor, texSize, texCoord);\n}\n")},P=function(t){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n  vec2 texCoord = coordinate;\n\n  gl_FragColor = ".concat(t,"(texture, texSize, texCoord);\n}\n")};function W(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e.filter){var n="string"===typeof e.filter?e.filter:"".concat(t.name,"_filterColor");return Z(n)}if(e.sampler){var r="string"===typeof e.sampler?e.sampler:"".concat(t.name,"_sampleColor");return P(r)}return null}var J=n(191),H=n(711),Y=n(371),X=n(369),z=n(252),K=n(360),q=n(374),$=n(98),tt=n(251),et=n(17),nt=n(37),rt=n(22),it=n(45);function ot(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var at=Math.PI/180,At=180/Math.PI;function st(){var t=Math.PI/180*256;return{unitsPerMeter:[256/6370972,256/6370972,256/6370972],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[t,t,256/6370972],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,24886.609375]}}var ct=function(t){Object(I.a)(n,t);var e=ot(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(A.a)(this,n);var i=r.latitude,o=void 0===i?0:i,a=r.longitude,s=void 0===a?0:a,c=r.zoom,u=void 0===c?11:c,l=r.nearZMultiplier,g=void 0===l?.1:l,f=r.farZMultiplier,h=void 0===f?2:f,d=r.resolution,I=void 0===d?10:d,p=r.width,C=r.height,y=r.altitude,v=void 0===y?1.5:y;p=p||1,C=C||1,v=Math.max(.75,v);var B=(new nt.a).lookAt({eye:[0,-v,0],up:[0,0,1]}),m=Math.pow(2,u);B.rotateX(o*at),B.rotateZ(-s*at),B.scale(m/C);var b=Math.atan(.5/v),E=512*m/C,Q=Object.assign({},r,{width:p,height:C,viewMatrix:B,longitude:s,latitude:o,zoom:u,fovyRadians:2*b,aspect:p/C,focalDistance:v,near:g,far:Math.min(2,1/E+1)*v*h});return(t=e.call(this,Q)).resolution=I,t.distanceScales=st(),t}return Object(s.a)(n,[{key:"getDistanceScales",value:function(){return this.distanceScales}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},n=this.unproject([0,this.height/2],e),r=this.unproject([this.width/2,0],e),i=this.unproject([this.width,this.height/2],e),o=this.unproject([this.width/2,this.height],e);return i[0]<this.longitude&&(i[0]+=360),n[0]>this.longitude&&(n[0]-=360),[Math.min(n[0],i[0],r[0],o[0]),Math.min(n[1],i[1],r[1],o[1]),Math.max(n[0],i[0],r[0],o[0]),Math.max(n[1],i[1],r[1],o[1])]}},{key:"unproject",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.topLeft,i=void 0===r||r,o=n.targetZ,a=Object(et.a)(t,3),A=a[0],s=a[1],c=a[2],u=i?s:this.height-s,l=this.pixelUnprojectionMatrix;if(Number.isFinite(c))e=ut(l,[A,u,c,1]);else{var g=ut(l,[A,u,-1,1]),f=ut(l,[A,u,1,1]),h=256*((o||0)/6370972+1),d=rt.n(rt.o([],g,f)),I=rt.n(g),p=rt.n(f),C=(4*I*p-Math.pow(d-I-p,2))/16,y=4*C/d,v=Math.sqrt(I-y),B=Math.sqrt(Math.max(0,h*h-y)),m=(v-B)/Math.sqrt(d);e=rt.h([],g,f,m)}var b=this.unprojectPosition(e),E=Object(et.a)(b,3),Q=E[0],F=E[1],w=E[2];return Number.isFinite(c)?[Q,F,w]:Number.isFinite(o)?[Q,F,o]:[Q,F]}},{key:"projectPosition",value:function(t){var e=Object(et.a)(t,3),n=e[0],r=e[1],i=e[2],o=void 0===i?0:i,a=n*at,A=r*at,s=Math.cos(A),c=256*(o/6370972+1);return[Math.sin(a)*s*c,-Math.cos(a)*s*c,Math.sin(A)*c]}},{key:"unprojectPosition",value:function(t){var e=Object(et.a)(t,3),n=e[0],r=e[1],i=e[2],o=rt.f(t),a=Math.asin(i/o);return[Math.atan2(n,-r)*At,a*At,6370972*(o/256-1)]}},{key:"projectFlat",value:function(t){return t}},{key:"unprojectFlat",value:function(t){return t}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=t.pos,r=this.unproject(n);return[e[0]-r[0]+this.longitude,e[1]-r[1]+this.latitude]}},{key:"projectionMode",get:function(){return r.c.GLOBE}}]),n}($.a);function ut(t,e){var n=it.n([],e,t);return it.k(n,n,1/n[3]),n}var lt=n(436),gt=n(179),ft=n(435),ht=n(933),dt=n(216),It=n(173),pt=n(367),Ct=n(67),yt=n(154),vt=n(257),Bt=n(86);function mt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var bt={position:[0,0,0],pitch:0,bearing:0,maxPitch:90,minPitch:-90},Et=function(t){Object(I.a)(n,t);var e=mt(n);function n(t){var r,i=t.width,o=t.height,a=t.position,s=void 0===a?bt.position:a,c=t.bearing,u=void 0===c?bt.bearing:c,l=t.pitch,g=void 0===l?bt.pitch:l,f=t.longitude,h=t.latitude,d=t.maxPitch,I=void 0===d?bt.maxPitch:d,p=t.minPitch,C=void 0===p?bt.minPitch:p,y=t.startBearing,v=t.startPitch,B=t.startZoomPosition,m=t.startZoom;return Object(A.a)(this,n),(r=e.call(this,{width:i,height:o,position:s,bearing:u,pitch:g,longitude:f,latitude:h,maxPitch:I,minPitch:C}))._interactiveState={startBearing:y,startPitch:v,startZoomPosition:B,startZoom:m},r}return Object(s.a)(n,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"getDirection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=new nt.d({bearing:this._viewportProps.bearing,pitch:t?90:90+this._viewportProps.pitch}),n=e.toVector3().normalize();return n}},{key:"panStart",value:function(){return this}},{key:"pan",value:function(){return this}},{key:"panEnd",value:function(){return this}},{key:"rotateStart",value:function(t){t.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=this._interactiveState,i=r.startBearing,o=r.startPitch;return Number.isFinite(i)&&Number.isFinite(o)?this._getUpdatedState({bearing:i-180*e,pitch:o-90*n}):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.scale,n=this._interactiveState.startZoomPosition;n||(n=this._viewportProps.position);var r=this.getDirection();return this._move(r,20*Math.log2(e),n)}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:Math.PI/2}),t)}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:-Math.PI/2}),t)}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e,t)}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.negate(),t)}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:t})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:1/t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=Object.assign({},this._viewportProps),r=n.bearing,i=n.longitude;return Math.abs(r-e.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(i-e.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}},{key:"_move",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._viewportProps.position,r=t.scale(e);return this._getUpdatedState({position:new nt.c(n).add(r)})}},{key:"_getUpdatedState",value:function(t){return new n(Object.assign({},this._viewportProps,this._interactiveState,t))}},{key:"_applyConstraints",value:function(t){var e=t.pitch,n=t.maxPitch,r=t.minPitch,i=t.longitude,o=t.bearing;return t.pitch=Object(nt.e)(e,r,n),(i<-180||i>180)&&(t.longitude=Object(Bt.e)(i+180,360)-180),(o<-180||o>180)&&(t.bearing=Object(Bt.e)(o+180,360)-180),t}}]),n}(vt.a),Qt=function(t){Object(I.a)(n,t);var e=mt(n);function n(t){return Object(A.a)(this,n),e.call(this,Et,t)}return n}(yt.a);function Ft(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var wt=function(t){Object(I.a)(n,t);var e=Ft(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(s.a)(n,[{key:"_getViewport",value:function(t){var e=t.modelMatrix,n=void 0===e?null:e,r=t.bearing,i=void 0===r?0:r,o=t.pitch,a=void 0===o?0:o,A=t.up,s=void 0===A?[0,0,1]:A,c=function(t){var e=t.bearing,n=t.pitch;return new nt.d({bearing:e,pitch:n}).toVector3().normalize()}({bearing:i,pitch:90+a}),u=n?n.transformDirection(c):c,l=Object(Ct.g)(t),g=Math.pow(2,l),f=(new nt.a).lookAt({eye:[0,0,0],center:u,up:s}).scale(g);return new $.a(Object.assign({},t,{zoom:l,viewMatrix:f}))}},{key:"controller",get:function(){return this._getControllerProps({type:Qt})}}]),n}(It.a);wt.displayName="FirstPersonView";var St=n(312);function Rt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var Ut=Math.PI/180;function xt(t){var e=t.height,n=t.fovy,r=t.orbitAxis,i=t.rotationX,o=t.rotationOrbit,a=t.zoom,A=.5/Math.tan(n*Ut/2),s="Z"===r?[0,0,1]:[0,1,0],c="Z"===r?[0,-A,0]:[0,0,A],u=(new nt.a).lookAt({eye:c,up:s});u.rotateX(i*Ut),"Z"===r?u.rotateZ(o*Ut):u.rotateY(o*Ut);var l=Math.pow(2,a)/(e||1);return u.scale(l),u}var kt=function(t){Object(I.a)(n,t);var e=Rt(n);function n(t){Object(A.a)(this,n);var r=t.id,i=t.x,o=t.y,a=t.width,s=t.height,c=t.fovy,u=void 0===c?50:c,l=t.near,g=t.far,f=t.orbitAxis,h=void 0===f?"Z":f,d=t.target,I=void 0===d?[0,0,0]:d,p=t.rotationX,C=void 0===p?0:p,y=t.rotationOrbit,v=void 0===y?0:y,B=t.zoom,m=void 0===B?0:B;return e.call(this,{id:r,viewMatrix:xt({height:s,fovy:u,orbitAxis:h,rotationX:C,rotationOrbit:v,zoom:m}),fovy:u,near:l,far:g,x:i,y:o,position:I,width:a,height:s,zoom:m})}return n}($.a),Ot=function(t){Object(I.a)(n,t);var e=Rt(n);function n(t){return Object(A.a)(this,n),e.call(this,Object.assign({},t,{type:kt}))}return Object(s.a)(n,[{key:"controller",get:function(){return this._getControllerProps({type:St.b})}}]),n}(It.a);Ot.displayName="OrbitView";var Nt=n(708),Dt=n(1),Gt=n(34),_t=n(313),Mt=n(138),Tt=n(139);function jt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var Lt={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new Mt.a(["longitude","latitude","zoom"]),transitionInterruption:Tt.a.BREAK},Vt=function(t){Object(I.a)(n,t);var e=jt(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(s.a)(n,[{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=Object(nt.e)(r,n,e);var i=t.longitude,o=t.latitude;return(i<-180||i>180)&&(t.longitude=Object(Bt.e)(i+180,360)-180),t.latitude=Object(nt.e)(o,-89,89),t}}]),n}(_t.a),Zt=function(t){Object(I.a)(n,t);var e=jt(n);function n(t){return Object(A.a)(this,n),t.dragMode=t.dragMode||"pan",e.call(this,Vt,t)}return Object(s.a)(n,[{key:"setProps",value:function(t){Object(Gt.a)(Object(C.a)(n.prototype),"setProps",this).call(this,t),this.dragRotate=!1,this.touchRotate=!1}},{key:"_getTransitionProps",value:function(){return Lt}}]),n}(yt.a);function Pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pt(Object(n),!0).forEach((function(e){Object(Dt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Jt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var Ht=function(t){Object(I.a)(n,t);var e=Jt(n);function n(t){return Object(A.a)(this,n),e.call(this,Wt(Wt({},t),{},{type:ct}))}return Object(s.a)(n,[{key:"controller",get:function(){return this._getControllerProps({type:Zt})}}]),n}(It.a);Ht.displayName="GlobeView";var Yt=n(366),Xt=n(815),zt=n(311);function Kt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return qt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $t(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(E){return!1}}();return function(){var n,r=Object(C.a)(t);if(e){var i=Object(C.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(p.a)(this,n)}}var te=["bearing","pitch"],ee={speed:1.2,curve:1.414},ne=function(t){Object(I.a)(n,t);var e=$t(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(A.a)(this,n),(t=e.call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]})).props=Object.assign({},ee,r),t}return Object(s.a)(n,[{key:"interpolateProps",value:function(t,e,n){var r,i=Object(Ct.c)(t,e,n,this.props),o=Kt(te);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[a]=Object(nt.g)(t[a]||0,e[a]||0,n)}}catch(A){o.e(A)}finally{o.f()}return i}},{key:"getDuration",value:function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=Object(Ct.f)(t,e,this.props)),n}}]),n}(zt.a),re=n(44),ie=n(110),oe=n(706),ae=n(144),Ae=n(365),se=n(169),ce=n(364),ue=n(304);n.d(e,"COORDINATE_SYSTEM",(function(){return r.a})),n.d(e,"LightingEffect",(function(){return i.a})),n.d(e,"AmbientLight",(function(){return o.a})),n.d(e,"DirectionalLight",(function(){return a.a})),n.d(e,"PointLight",(function(){return h})),n.d(e,"_CameraLight",(function(){return B})),n.d(e,"_SunLight",(function(){return x})),n.d(e,"PostProcessEffect",(function(){return V})),n.d(e,"_LayersPass",(function(){return J.a})),n.d(e,"Deck",(function(){return H.a})),n.d(e,"LayerManager",(function(){return Y.a})),n.d(e,"AttributeManager",(function(){return X.a})),n.d(e,"Layer",(function(){return z.a})),n.d(e,"CompositeLayer",(function(){return K.a})),n.d(e,"DeckRenderer",(function(){return q.a})),n.d(e,"Viewport",(function(){return $.a})),n.d(e,"WebMercatorViewport",(function(){return tt.a})),n.d(e,"_GlobeViewport",(function(){return ct})),n.d(e,"picking",(function(){return lt.a})),n.d(e,"project",(function(){return gt.a})),n.d(e,"project32",(function(){return ft.a})),n.d(e,"gouraudLighting",(function(){return ht.a})),n.d(e,"phongLighting",(function(){return ht.b})),n.d(e,"shadow",(function(){return dt.a})),n.d(e,"View",(function(){return It.a})),n.d(e,"MapView",(function(){return pt.a})),n.d(e,"FirstPersonView",(function(){return wt})),n.d(e,"OrbitView",(function(){return Ot})),n.d(e,"OrthographicView",(function(){return Nt.a})),n.d(e,"_GlobeView",(function(){return Ht})),n.d(e,"Controller",(function(){return yt.a})),n.d(e,"MapController",(function(){return _t.b})),n.d(e,"_GlobeController",(function(){return Zt})),n.d(e,"FirstPersonController",(function(){return Qt})),n.d(e,"OrbitController",(function(){return St.b})),n.d(e,"OrthographicController",(function(){return Yt.a})),n.d(e,"Effect",(function(){return k.a})),n.d(e,"LayerExtension",(function(){return Xt.a})),n.d(e,"TRANSITION_EVENTS",(function(){return Tt.a})),n.d(e,"TransitionInterpolator",(function(){return zt.a})),n.d(e,"LinearInterpolator",(function(){return Mt.a})),n.d(e,"FlyToInterpolator",(function(){return ne})),n.d(e,"log",(function(){return re.a})),n.d(e,"createIterable",(function(){return ie.a})),n.d(e,"fp64LowPart",(function(){return Bt.c})),n.d(e,"Tesselator",(function(){return oe.a})),n.d(e,"_fillArray",(function(){return ae.a})),n.d(e,"_flatten",(function(){return ae.b})),n.d(e,"_count",(function(){return Ae.a})),n.d(e,"_memoize",(function(){return se.a})),n.d(e,"_mergeShaders",(function(){return ce.a})),n.d(e,"_compareProps",(function(){return ue.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(106);function o(t,e){return r.useMemo((function(){return null==t&&null==e?null:function(n){Object(i.a)(t,n),Object(i.a)(e,n)}}),[t,e])}},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(38);function i(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function o(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.b.debug&&!i(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var A={};function s(t,e){A[t]||(A[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){"use strict";var r=n(12),i=n(16),o=n(26),a=n(0),A=n(5),s=n.n(A);function c(t){var e,n=new Set,r=function(t,r){var i="function"===typeof t?t(e):t;i!==e&&(e=r?i:Object.assign({},e,i),n.forEach((function(t){return t(e)})))},i=function(){return e},o={setState:r,getState:i,subscribe:function(t,r,o){return r||o?function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.is,a=r(e);function A(){try{var n=r(e);o(a,n)||t(a=n)}catch(i){t(null,i)}}return n.add(A),function(){return n.delete(A)}}(t,r,o):(n.add(t),function(){return n.delete(t)})},destroy:function(){return n.clear()}};return e=t(r,i,o),o}var u="undefined"===typeof window?a.useEffect:a.useLayoutEffect;var l=function(t){var e="function"===typeof t?c(t):t,n=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.getState,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.is,i=Object(a.useReducer)((function(t){return t+1}),0)[1],o=Object(a.useRef)(),A=Object(a.useRef)(n),s=Object(a.useRef)(r),c=Object(a.useRef)(!1),l=e.getState();void 0===o.current&&(o.current=n(l));var g=!1;(A.current!==n||s.current!==r||c.current)&&(t=n(l),g=!r(o.current,t)),u((function(){g&&(o.current=t),A.current=n,s.current=r,c.current=!1}));var f=Object(a.useRef)(l);return Object(a.useEffect)((function(){var t=function(){try{var t=A.current(e.getState());s.current(o.current,t)||(o.current=t,i())}catch(n){c.current=!0,i()}},n=e.subscribe(t);return e.getState()!==f.current&&t(),n}),[]),g?t:o.current};return Object.assign(n,e),n[Symbol.iterator]=s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),t.next=3,n;case 3:return t.next=5,e;case 5:case"end":return t.stop()}}),t)})),n},g=n(400),f=n.n(g),h=n(92);n.d(e,"o",(function(){return d})),n.d(e,"d",(function(){return v})),n.d(e,"h",(function(){return B})),n.d(e,"g",(function(){return m})),n.d(e,"i",(function(){return b})),n.d(e,"a",(function(){return E})),n.d(e,"l",(function(){return Q})),n.d(e,"m",(function(){return F})),n.d(e,"b",(function(){return w})),n.d(e,"j",(function(){return S})),n.d(e,"p",(function(){return R})),n.d(e,"n",(function(){return U})),n.d(e,"c",(function(){return x})),n.d(e,"k",(function(){return k})),n.d(e,"f",(function(){return O})),n.d(e,"e",(function(){return N}));var d=l((function(t){return{viewConfig:null,loaders:null,setViewConfig:function(e){return t({viewConfig:e})},setLoaders:function(e){return t({loaders:e})},setCoordinationValue:function(e){var n=e.parameter,r=e.scope,a=e.value;return t((function(t){return{viewConfig:Object(o.a)({},t.viewConfig,{coordinationSpace:Object(o.a)({},t.viewConfig.coordinationSpace,Object(i.a)({},n,Object(o.a)({},t.viewConfig.coordinationSpace[n],Object(i.a)({},r,a))))})}}))},removeComponent:function(e){return t((function(t){var n=t.viewConfig.layout.slice();return n.splice(e,1),{viewConfig:Object(o.a)({},t.viewConfig,{layout:n})}}))},changeLayout:function(e){return t((function(t){var n=t.viewConfig.layout.slice();return e.forEach((function(t){var e=Object(r.a)(t,2),i=e[0],a=e[1];n[i]=Object(o.a)({},n[i],{},a)})),{viewConfig:Object(o.a)({},t.viewConfig,{layout:n})}}))}}})),I=l((function(t){return{componentHover:null,setComponentHover:function(e){return t({componentHover:e})}}})),p=l((function(t){return{warning:null,setWarning:function(e){return t({warning:e})}}})),C=l((function(t){return{viewInfo:{},setComponentViewInfo:function(e,n){return t((function(t){return{viewInfo:Object(o.a)({},t.viewInfo,Object(i.a)({},e,n))}}))}}})),y=l((function(t){return{resizeCount:{},incrementResizeCount:function(){return t((function(t){return{resizeCount:t.resizeCount+1}}))}}}));function v(t,e){var n=d((function(t){return t.setCoordinationValue}));return[d((function(n){var r=n.viewConfig.coordinationSpace;return Object(h.b)(t.map((function(t){return r&&r[t]?[t,r[t][e[t]]]:[t,void 0]})))}),f.a),Object(h.b)(t.map((function(t){return["set".concat(Object(h.a)(t)),function(r){return n({parameter:t,scope:e[t],value:r})}]})))]}function B(){return d((function(t){return t.loaders}))}function m(){return d((function(t){var e;return null===(e=t.viewConfig)||void 0===e?void 0:e.layout}))}function b(){return d((function(t){return t.removeComponent}))}function E(){return d((function(t){return t.changeLayout}))}function Q(){return d((function(t){return t.setLoaders}))}function F(){return Object(a.useRef)(d.getState().setViewConfig).current}function w(){return I((function(t){return t.componentHover}))}function S(){return I((function(t){return t.setComponentHover}))}function R(){return p((function(t){return t.warning}))}function U(){return p((function(t){return t.setWarning}))}function x(t){return C(Object(a.useCallback)((function(e){return e.viewInfo[t]}),[t]))}function k(t){var e=Object(a.useRef)(C.getState().setComponentViewInfo);return function(n){return e.current(t,n)}}function O(){return y((function(t){return t.resizeCount}))}function N(){return y((function(t){return t.incrementResizeCount}))}},function(t,e,n){"use strict";function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}n.d(e,"a",(function(){return r}))},function(t,n){t.exports=e},,function(t,e,n){"use strict";var r=n(23),i=n(17),o=n(3),a=n(2),A=n(45);function s(t,e){var n=A.n([],e,t);return A.k(n,n,1/n[3]),n}function c(t,e){var n=t%e;return n<0?e+n:n}function u(t,e,n){return n*e+(1-n)*t}var l=n(10),g=n(36),f=n(22);function h(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var d=Math.PI,I=d/4,p=d/180,C=180/d;function y(t){return Math.pow(2,t)}function v(t){return Math.log2(t)}function B(t){var e=Object(i.a)(t,2),n=e[0],r=e[1];h(Number.isFinite(n)),h(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var o=r*p;return[512*(n*p+d)/(2*d),512*(d+Math.log(Math.tan(I+.5*o)))/(2*d)]}function m(t){var e=Object(i.a)(t,2),n=e[0],r=e[1],o=n/512*(2*d)-d,a=2*(Math.atan(Math.exp(r/512*(2*d)-d))-I);return[o*C,a*C]}function b(t){var e=t.latitude;return h(Number.isFinite(e)),v(4003e4*Math.cos(e*p))-9}function E(t){var e=t.latitude,n=t.longitude,r=t.highPrecision,i=void 0!==r&&r;h(Number.isFinite(e)&&Number.isFinite(n));var o={},a=Math.cos(e*p),A=512/360/a,s=512/4003e4/a;if(o.unitsPerMeter=[s,s,s],o.metersPerUnit=[1/s,1/s,1/s],o.unitsPerDegree=[512/360,A,s],o.degreesPerUnit=[.703125,1/A,1/s],i){var c=p*Math.tan(e*p)/a,u=512/360*c/2,l=512/4003e4*c,g=l/A*s;o.unitsPerDegree2=[0,u,l],o.unitsPerMeter2=[g,0,g]}return o}function Q(t,e){var n=Object(i.a)(t,3),r=n[0],o=n[1],a=n[2],A=Object(i.a)(e,3),s=A[0],c=A[1],u=A[2],l=E({longitude:r,latitude:o,highPrecision:!0}),g=l.unitsPerMeter,f=l.unitsPerMeter2,h=B(t);h[0]+=s*(g[0]+f[0]*c),h[1]+=c*(g[1]+f[1]*c);var d=m(h),I=(a||0)+(u||0);return Number.isFinite(a)||Number.isFinite(u)?[d[0],d[1],I]:d}function F(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.scale,a=t.center,A=void 0===a?null:a,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.p(s,s,[0,0,-i]),l.l(s,s,-n*p),l.n(s,s,r*p),o/=e,l.o(s,s,[o,o,o]),A&&l.p(s,s,f.i([],A)),s}function w(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?1.5:r,o=t.pitch,a=void 0===o?0:o,A=t.nearZMultiplier,s=void 0===A?1:A,c=t.farZMultiplier,u=void 0===c?1:c,l=a*p,g=Math.atan(.5/i),f=Math.sin(g)*i/Math.sin(Math.min(Math.max(Math.PI/2-l-g,.01),Math.PI-.01));return{fov:2*g,aspect:e/n,focalDistance:i,near:s,far:(Math.sin(l)*f+i)*u}}function S(t){var e=t.width,n=t.height,r=t.pitch,i=w({width:e,height:n,altitude:t.altitude,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=i.fov,a=i.aspect,A=i.near,s=i.far;return l.j([],o,a,A,s)}function R(t,e){var n=Object(i.a)(t,3),r=n[0],o=n[1],a=n[2],A=void 0===a?0:a;return h(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(A)),s(e,[r,o,A,1])}function U(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(i.a)(t,3),o=r[0],a=r[1],A=r[2];if(h(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(A)){var c=s(e,[o,a,A,1]);return c}var u=s(e,[o,a,0,1]),l=s(e,[o,a,1,1]),f=u[2],d=l[2],I=f===d?0:((n||0)-f)/(d-f);return g.c([],u,l,I)}function x(t){var e=t.width,n=t.height,r=t.bounds,o=t.minExtent,a=void 0===o?0:o,A=t.maxZoom,s=void 0===A?24:A,c=t.padding,u=void 0===c?0:c,l=t.offset,g=void 0===l?[0,0]:l,f=Object(i.a)(r,2),d=Object(i.a)(f[0],2),I=d[0],p=d[1],C=Object(i.a)(f[1],2),y=C[0],v=C[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else h(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var B=new D({width:e,height:n,longitude:0,latitude:0,zoom:0}),m=B.project([I,v]),b=B.project([y,p]),E=[Math.max(Math.abs(b[0]-m[0]),a),Math.max(Math.abs(b[1]-m[1]),a)],Q=[e-u.left-u.right-2*Math.abs(g[0]),n-u.top-u.bottom-2*Math.abs(g[1])];h(Q[0]>0&&Q[1]>0);var F=Q[0]/E[0],w=Q[1]/E[1],S=(u.right-u.left)/2/F,R=(u.bottom-u.top)/2/w,U=[(b[0]+m[0])/2+S,(b[1]+m[1])/2+R],x=B.unproject(U),k=Math.min(s,B.zoom+Math.log2(Math.abs(Math.min(F,w))));return h(Number.isFinite(k)),{longitude:x[0],latitude:x[1],zoom:k}}var k=Math.PI/180;function O(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width,o=t.height,a=t.unproject,A={targetZ:r},s=a([0,o],A),c=a([i,o],A),u=Math.atan(.5/t.altitude),l=(90-t.pitch)*k;return u>l-.01?(e=N(t,0,r),n=N(t,i,r)):(e=a([0,0],A),n=a([i,0],A)),[s,c,n,e]}function N(t,e,n){var r=t.pixelUnprojectionMatrix,i=s(r,[e,0,1,1]),o=s(r,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(o[2]-i[2]),A=m(g.c([],i,o,a));return A[2]=n,A}var D=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=e.width,r=e.height,i=e.latitude,a=void 0===i?0:i,A=e.longitude,s=void 0===A?0:A,c=e.zoom,u=void 0===c?0:c,l=e.pitch,g=void 0===l?0:l,f=e.bearing,h=void 0===f?0:f,d=e.altitude,I=void 0===d?1.5:d,p=e.nearZMultiplier,C=void 0===p?.02:p,v=e.farZMultiplier,m=void 0===v?1.01:v;Object(o.a)(this,t),n=n||1,r=r||1;var b=y(u);I=Math.max(.75,I);var Q=B([s,a]);Q[2]=0,this.projectionMatrix=S({width:n,height:r,pitch:g,altitude:I,nearZMultiplier:C,farZMultiplier:m}),this.viewMatrix=F({height:r,scale:b,center:Q,pitch:g,bearing:h,altitude:I}),this.width=n,this.height=r,this.scale=b,this.latitude=a,this.longitude=s,this.zoom=u,this.pitch=g,this.bearing=h,this.altitude=I,this.center=Q,this.distanceScales=E(this),this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(a.a)(t,[{key:"_initMatrices",value:function(){var t=this.width,e=this.height,n=this.projectionMatrix,r=this.viewMatrix,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.h(i,i,n),l.h(i,i,r),this.viewProjectionMatrix=i;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.o(o,o,[t/2,-e/2,1]),l.p(o,o,[1,-1,0]),l.h(o,o,i);var a=l.f([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&l.b(e.projectionMatrix,this.projectionMatrix)&&l.b(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=this.projectPosition(t),a=R(o,this.pixelProjectionMatrix),A=Object(i.a)(a,2),s=A[0],c=A[1],u=r?c:this.height-c;return 2===t.length?[s,u]:[s,u,a[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=e.targetZ,a=void 0===o?void 0:o,A=Object(i.a)(t,3),s=A[0],c=A[1],u=A[2],l=r?c:this.height-c,g=a&&a*this.distanceScales.unitsPerMeter[2],f=U([s,l,u],this.pixelUnprojectionMatrix,g),h=this.unprojectPosition(f),d=Object(i.a)(h,3),I=d[0],p=d[1],C=d[2];return Number.isFinite(u)?[I,p,C]:Number.isFinite(a)?[I,p,a]:[I,p]}},{key:"projectPosition",value:function(t){var e=B(t),n=Object(i.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=m(t),n=Object(i.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return B(t)}},{key:"unprojectFlat",value:function(t){return m(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=U(t.pos,this.pixelUnprojectionMatrix),r=B(e),i=g.a([],r,g.d([],n));return m(g.a([],this.center,i))}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=x(Object.assign({width:r,height:i,bounds:e},n)),a=o.longitude,A=o.latitude,s=o.zoom;return new t({width:r,height:i,longitude:a,latitude:A,zoom:s})}},{key:"getBounds",value:function(t){var e=this.getBoundingRegion(t),n=Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[0]}))));return[[n,Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))],[i,Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O(this,t.z||0)}}]),t}();function G(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,A=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s;(r<-180||r>180)&&(r=c(r+180,360)-180),(u<-180||u>180)&&(u=c(u+180,360)-180);var l=new D({width:e,height:n,longitude:r,latitude:i,zoom:o}),g=l.project([r,85.05113])[1],f=l.project([r,-85.05113])[1],h=0;return f-g<n&&(o+=Math.log2(n/(f-g)),g=(l=new D({width:e,height:n,longitude:r,latitude:i,zoom:o})).project([r,85.05113])[1],f=l.project([r,-85.05113])[1]),g>0?h=g:f<n&&(h=f-n),h&&(i=l.unproject([e/2,n/2+h])[1]),{width:e,height:n,longitude:r,latitude:i,zoom:o,pitch:A,bearing:u}}function _(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return M(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var T=["longitude","latitude","zoom"],j={curve:1.414,speed:1.2};function L(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={},o=Z(t,e,r),a=o.startZoom,A=o.startCenterXY,s=o.uDelta,c=o.w0,l=o.u1,f=o.S,h=o.rho,d=o.rho2,I=o.r0;if(l<.01){var p,C=_(T);try{for(C.s();!(p=C.n()).done;){var y=p.value,B=t[y],b=e[y];i[y]=u(B,b,n)}}catch(x){C.e(x)}finally{C.f()}return i}var E=n*f,Q=Math.cosh(I)/Math.cosh(I+h*E),F=c*((Math.cosh(I)*Math.tanh(I+h*E)-Math.sinh(I))/d)/l,w=1/Q,S=a+v(w),R=g.e([],s,F);g.a(R,R,A);var U=m(R);return i.longitude=U[0],i.latitude=U[1],i.zoom=S,i}function V(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r=Object.assign({},j,r),o=i.screenSpeed,a=i.speed,A=i.maxDuration,s=Z(t,e,r),c=s.S,u=s.rho,l=1e3*c;return n=Number.isFinite(o)?l/(o/u):l/a,Number.isFinite(A)&&n>A?0:n}function Z(t,e,n){var r=(n=Object.assign({},j,n)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=y(i),A=e.zoom,s=[e.longitude,e.latitude],c=y(A-i),u=B(o),l=B(s),f=g.f([],l,u),h=Math.max(t.width,t.height),d=h/c,I=g.b(f)*a,p=Math.max(I,.01),C=r*r,v=(d*d-h*h+C*C*p*p)/(2*h*C*p),m=(d*d-h*h-C*C*p*p)/(2*d*C*p),b=Math.log(Math.sqrt(v*v+1)-v),E=Math.log(Math.sqrt(m*m+1)-m);return{startZoom:i,startCenterXY:u,uDelta:f,w0:h,u1:I,S:(E-b)/r,rho:r,rho2:C,r0:b,r1:E}}n.d(e,"d",(function(){return O})),n.d(e,"b",(function(){return x})),n.d(e,"k",(function(){return G})),n.d(e,"c",(function(){return L})),n.d(e,"f",(function(){return V})),n.d(e,"j",(function(){return B})),n.d(e,"m",(function(){return m})),n.d(e,"n",(function(){return R})),n.d(e,"l",(function(){return U})),n.d(e,"g",(function(){return b})),n.d(e,"e",(function(){return E})),n.d(e,"a",(function(){return Q})),n.d(e,"i",(function(){return F})),n.d(e,"h",(function(){return w}))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function A(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],u=!1,l=-1;function g(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=A(g);u=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function d(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||u||A(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";function r(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function i(t,e,n){return void 0===n&&(n={}),r({type:"Point",coordinates:t},e,n)}function o(t,e,n){void 0===n&&(n={});for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var A=0;A<a[a.length-1].length;A++)if(a[a.length-1][A]!==a[0][A])throw new Error("First and last Position are not equivalent.")}return r({type:"Polygon",coordinates:t},e,n)}function a(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:t},e,n)}function A(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function s(t,e,n){return void 0===n&&(n={}),r({type:"MultiLineString",coordinates:t},e,n)}function c(t,e,n){return void 0===n&&(n={}),r({type:"MultiPoint",coordinates:t},e,n)}function u(t,e,n){return void 0===n&&(n={}),r({type:"MultiPolygon",coordinates:t},e,n)}function l(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function g(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function f(t){return 180*(t%(2*Math.PI))/Math.PI}function h(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:e.earthRadius/1.0936},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1/1.0936},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=r,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return i(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return c(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return u(e).geometry;default:throw new Error(t+" is invalid")}},e.point=i,e.points=function(t,e,n){return void 0===n&&(n={}),A(t.map((function(t){return i(t,e)})),n)},e.polygon=o,e.polygons=function(t,e,n){return void 0===n&&(n={}),A(t.map((function(t){return o(t,e)})),n)},e.lineString=a,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),A(t.map((function(t){return a(t,e)})),n)},e.featureCollection=A,e.multiLineString=s,e.multiPoint=c,e.multiPolygon=u,e.geometryCollection=function(t,e,n){return void 0===n&&(n={}),r({type:"GeometryCollection",geometries:t},e,n)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=l,e.lengthToRadians=g,e.lengthToDegrees=function(t,e){return f(g(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return l(g(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=h,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!h(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},e.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},e.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},e.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},e.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},e.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},e.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},e.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},function(t,e,n){"use strict";n.d(e,"l",(function(){return a})),n.d(e,"i",(function(){return A})),n.d(e,"h",(function(){return s})),n.d(e,"g",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"f",(function(){return l})),n.d(e,"e",(function(){return g})),n.d(e,"d",(function(){return f})),n.d(e,"c",(function(){return h})),n.d(e,"k",(function(){return d})),n.d(e,"a",(function(){return I})),n.d(e,"j",(function(){return p}));var r,i=n(16),o=n(46),a=2048,A=1,s=16,c=20,u=9,l=15,g=10,f=90,h=3,d={dark:[224,224,224],light:[64,64,64]},I="-apple-system, 'Helvetica Neue', Arial, sans-serif",p=(r={},Object(i.a)(r,o.default.TEXTURE_MIN_FILTER,o.default.NEAREST),Object(i.a)(r,o.default.TEXTURE_MAG_FILTER,o.default.NEAREST),Object(i.a)(r,o.default.TEXTURE_WRAP_S,o.default.CLAMP_TO_EDGE),Object(i.a)(r,o.default.TEXTURE_WRAP_T,o.default.CLAMP_TO_EDGE),r)},,function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(44),i={};function o(t){i=t}function a(t){var e;r.a.level>0&&i[t]&&(e=i[t]).call.apply(e,arguments)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},i={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")}},function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"g",(function(){return u})),n.d(e,"b",(function(){return l})),n.d(e,"d",(function(){return g})),n.d(e,"e",(function(){return f})),n.d(e,"a",(function(){return h})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return I})),n.d(e,"j",(function(){return p})),n.d(e,"k",(function(){return C})),n.d(e,"h",(function(){return y})),n.d(e,"m",(function(){return v})),n.d(e,"o",(function(){return B})),n.d(e,"n",(function(){return m})),n.d(e,"l",(function(){return b})),n.d(e,"f",(function(){return E}));var r=n(18),i=n(12),o=n(0),a=n.n(o),A=n(40),s=n(85),c=n(174);function u(t,e,n,r){return{coordinateSystem:A.a.CARTESIAN,data:t,pickable:!0,autoHighlight:!0,stroked:!0,filled:!0,getElevation:0,onHover:function(t){if(r&&r(),t.object){var o=Object(i.a)(t.object,2),a=o[0],A=o[1].factors;e&&e((s=void 0===A?{}:A,Object.entries(s).map((function(t){var e=Object(i.a)(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(r)})).join("; "))),n&&n(a)}else n&&n("");var s}}}var l=[128,128,128],g=[[68,119,170],[136,204,238],[68,170,153],[17,119,51],[153,153,51],[221,204,119],[204,102,119],[136,34,85],[170,68,153]],f=[[0,0,255],[0,255,0],[255,0,255],[255,255,0],[0,255,255],[255,255,255],[255,128,0],[255,0,0]],h=["viridis","greys","magma","jet","hot","bone","copper","summer","density","inferno"],d={webgl2:!0};function I(t){return function(e){return console.warn("".concat(t," updateCellsHover: ").concat(e.cellId))}}function p(t){return function(e){return console.warn("".concat(t," updateGenesHover: ").concat(e.geneId))}}function C(t){return function(e){return console.warn("".concat(t," updateViewInfo: ").concat(e))}}function y(t){var e=new ArrayBuffer(t.buffer.byteLength),n=new Uint8Array(e);return n.set(t),n}function v(t,e){var n=1;if(t)for(;t.find((function(t){return t.name==="".concat(e).concat(n)}));)n++;return"".concat(e).concat(n)}function B(t,e,n,i,o,a,A){var c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"Selection ",u="My Selections",l=null===e||void 0===e?void 0:e.tree.find((function(t){return t.name===u})),f={version:s.c[s.h].latestVersion,datatype:s.h,tree:Object(r.a)(e?e.tree:[])},h=v(null===l||void 0===l?void 0:l.children,c),d=0;l?(d=l.children.length,l.children.push({name:h,set:t.map((function(t){return[t,null]}))})):f.tree.push({name:u,children:[{name:h,set:t.map((function(t){return[t,null]}))}]}),o(f);var I=["My Selections",h];a([].concat(Object(r.a)(n||[]),[{path:I,color:g[d%g.length]}])),i([I]),A("cellSetSelection")}function m(t,e){return{version:s.c[s.h].latestVersion,datatype:s.h,tree:[].concat(Object(r.a)(t?t.tree:[]),Object(r.a)(e?e.tree:[]))}}function b(t){return function(){var e=t.title,n=t.message;return a.a.createElement("div",{className:c.b},a.a.createElement("h1",null,e),a.a.createElement("div",null,n))}}function E(t){return{__esModule:!0,default:t}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(54),s=n(7),c=n(82),u=n(115),l=n(127),g=n(152),f=n(19),h=n(361),d=n(47),I={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},p={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:I},C={removedProps:I},y=function(t){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,e),(n=Object(o.a)(this,Object(a.a)(e).call(this,t,i))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=i.target||(n.gl.webgl2?36662:34962),n.initialize(i),Object.seal(Object(A.a)(n)),n}return Object(s.a)(e,t),Object(i.a)(e,[{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/u.a.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/u.a.getBytesPerVertex(t))}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=Object(h.a)("Buffer",t,p),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}},{key:"setProps",value:function(t){return"accessor"in(t=Object(h.a)("Buffer",t,C))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new u.a(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,n=e.data,r=e.offset,i=void 0===r?0:r,o=e.srcOffset,a=void 0===o?0:o,A=t.byteLength||t.length;Object(d.a)(n);var s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==a||void 0!==A?(Object(l.a)(this.gl),this.gl.bufferSubData(this.target,i,n,a,A)):this.gl.bufferSubData(s,i,n),this.gl.bindBuffer(s,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,n=t.readOffset,r=void 0===n?0:n,i=t.writeOffset,o=void 0===i?0:i,a=t.size,A=this.gl;return Object(l.a)(A),A.bindBuffer(36662,e.handle),A.bindBuffer(36663,this.handle),A.copyBufferSubData(36662,36663,r,o,a),A.bindBuffer(36662,null),A.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,n=void 0===e?null:e,r=t.srcByteOffset,i=void 0===r?0:r,o=t.dstOffset,a=void 0===o?0:o,A=t.length,s=void 0===A?0:A;Object(l.a)(this.gl);var c,u,f=Object(g.c)(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),I=a;n?c=(u=n.length)-I:u=I+(c=Math.min(h,s||h));var p=Math.min(h,c);return s=s||p,Object(d.a)(s<=p),n=n||new f(u),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,n,a,s),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?this.target:e,r=t.index,i=void 0===r?this.accessor&&this.accessor.index:r,o=t.offset,a=void 0===o?0:o,A=t.size;return 35345===n||35982===n?void 0!==A?this.gl.bindBufferRange(n,i,this.handle,a,A):(Object(d.a)(0===a),this.gl.bindBufferBase(n,i,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?this.target:e,r=t.index,i=void 0===r?this.accessor&&this.accessor.index:r,o=35345===n||35982===n;return o?this.gl.bindBufferBase(n,i,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Object(d.a)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,this.usage),this.gl.bufferSubData(r,e,t),this.gl.bindBuffer(r,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);var i=Object(g.b)(t);return Object(d.a)(i),this.setAccessor(new u.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(d.a)(t>=0),this._trackDeallocatedMemory();var n=t;0===t&&(n=new Float32Array(0));var r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,e),this.gl.bindBuffer(r,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/Object(g.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new u.a(this.accessor,{type:Object(g.b)(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"setByteLength",value:function(t){return f.h.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return f.h.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new u.a(this.accessor,t),this}},{key:"type",get:function(){return f.h.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return f.h.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),e}(c.a)},function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),n)}function i(t){if(t.type)return t;if("#"===t.charAt(0))return i(function(t){t=t.substr(1);var e=new RegExp(".{1,".concat(t.length/3,"}"),"g"),n=t.match(e);return n&&1===n[0].length&&(n=n.map((function(t){return t+t}))),n?"rgb(".concat(n.map((function(t){return parseInt(t,16)})).join(", "),")"):""}(t));var e=t.indexOf("("),n=t.substring(0,e);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(["Material-UI: unsupported `".concat(t,"` color."),"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()."].join("\n"));var r=t.substring(e+1,t.length-1).split(",");return{type:n,values:r=r.map((function(t){return parseFloat(t)}))}}function o(t){var e=t.type,n=t.values;return-1!==e.indexOf("rgb")?n=n.map((function(t,e){return e<3?parseInt(t,10):t})):-1!==e.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(e,"(").concat(n.join(", "),")")}function a(t,e){var n=A(t),r=A(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function A(t){var e="hsl"===(t=i(t)).type?i(function(t){var e=(t=i(t)).values,n=e[0],r=e[1]/100,a=e[2]/100,A=r*Math.min(a,1-a),s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+n/30)%12;return a-A*Math.max(Math.min(e-3,9-e,1),-1)},c="rgb",u=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===t.type&&(c+="a",u.push(e[3])),o({type:c,values:u})}(t)).values:t.values;return e=e.map((function(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function s(t,e){return t=i(t),e=r(e),"rgb"!==t.type&&"hsl"!==t.type||(t.type+="a"),t.values[3]=e,o(t)}function c(t,e){if(t=i(t),e=r(e),-1!==t.type.indexOf("hsl"))t.values[2]*=1-e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]*=1-e;return o(t)}function u(t,e){if(t=i(t),e=r(e),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;return o(t)}n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return u}))},function(t,e,n){"use strict";var r=n(74),i=n(208);var o=n(377);function a(t){var e="function"===typeof Map?new Map:void 0;return(a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return Object(o.a)(t,arguments,Object(r.a)(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Object(i.a)(a,t)})(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(210);function i(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,n){return(o=i()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&Object(r.a)(o,n.prototype),o}).apply(null,arguments)}},function(t,e,n){"use strict";n.d(e,"e",(function(){return ht})),n.d(e,"b",(function(){return dt})),n.d(e,"d",(function(){return ft})),n.d(e,"f",(function(){return f})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return H}));var r=n(9),i=n(159),o=(n(223),n(2)),a=n(182),A=n(54),s=n(157),c={}.constructor;function u(t){if(null==t||"object"!==typeof t)return t;if(Array.isArray(t))return t.map(u);if(t.constructor!==c)return t;var e={};for(var n in t)e[n]=u(t[n]);return e}function l(t,e,n){void 0===t&&(t="unnamed");var r=n.jss,i=u(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var g=function(t,e){for(var n="",r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=e),n+=t[r];return n};function f(t,e){if(void 0===e&&(e=!1),!Array.isArray(t))return t;var n="";if(Array.isArray(t[0]))for(var r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=", "),n+=g(t[r]," ");else n=g(t,", ");return e||"!important"!==t[t.length-1]||(n+=" !important"),n}function h(t,e){for(var n="",r=0;r<e;r++)n+="  ";return n+t}function d(t,e,n){void 0===n&&(n={});var r="";if(!e)return r;var i=n.indent,o=void 0===i?0:i,a=e.fallbacks;if(t&&o++,a)if(Array.isArray(a))for(var A=0;A<a.length;A++){var s=a[A];for(var c in s){var u=s[c];null!=u&&(r&&(r+="\n"),r+=""+h(c+": "+f(u)+";",o))}}else for(var l in a){var g=a[l];null!=g&&(r&&(r+="\n"),r+=""+h(l+": "+f(g)+";",o))}for(var d in e){var I=e[d];null!=I&&"fallbacks"!==d&&(r&&(r+="\n"),r+=""+h(d+": "+f(I)+";",o))}return(r||n.allowEmpty)&&t?(r&&(r="\n"+r+"\n"),h(t+" {"+r,--o)+h("}",o)):r}var I=/([[\].#*$><+~=|^:(),"'`\s])/g,p="undefined"!==typeof CSS&&CSS.escape,C=function(t){return p?p(t):t.replace(I,"\\$1")},y=function(){function t(t,e,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=t,this.options=n,this.style=e,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return t.prototype.prop=function(t,e,n){if(void 0===e)return this.style[t];var r=!!n&&n.force;if(!r&&this.style[t]===e)return this;var i=e;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(e,t,this));var o=null==i||!1===i,a=t in this.style;if(o&&!a&&!r)return this;var A=o&&a;if(A?delete this.style[t]:this.style[t]=i,this.renderable&&this.renderer)return A?this.renderer.removeProperty(this.renderable,t):this.renderer.setProperty(this.renderable,t,i),this;var s=this.options.sheet;return s&&s.attached,this},t}(),v=function(t){function e(e,n,r){var i;(i=t.call(this,e,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,s=r.sheet,c=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=c(Object(A.a)(Object(A.a)(i)),s),i.selectorText="."+C(i.id)),i}Object(a.a)(e,t);var n=e.prototype;return n.applyTo=function(t){var e=this.renderer;if(e){var n=this.toJSON();for(var r in n)e.setProperty(t,r,n[r])}return this},n.toJSON=function(){var t={};for(var e in this.style){var n=this.style[e];"object"!==typeof n?t[e]=n:Array.isArray(n)&&(t[e]=f(n))}return t},n.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?Object(r.a)({},t,{allowEmpty:!0}):t;return d(this.selectorText,this.style,n)},Object(o.a)(e,[{key:"selector",set:function(t){if(t!==this.selectorText){this.selectorText=t;var e=this.renderer,n=this.renderable;if(n&&e)e.setSelector(n,t)||e.replaceRule(n,this)}},get:function(){return this.selectorText}}]),e}(y),B={onCreateRule:function(t,e,n){return"@"===t[0]||n.parent&&"keyframes"===n.parent.type?null:new v(t,e,n)}},m={indent:1,children:!0},b=/@([\w-]+)/,E=function(){function t(t,e,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.query=n.name;var i=t.match(b);for(var o in this.at=i?i[1]:"unknown",this.options=n,this.rules=new H(Object(r.a)({},n,{parent:this})),e)this.rules.add(o,e[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.indexOf=function(t){return this.rules.indexOf(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.toString=function(t){if(void 0===t&&(t=m),null==t.indent&&(t.indent=m.indent),null==t.children&&(t.children=m.children),!1===t.children)return this.query+" {}";var e=this.rules.toString(t);return e?this.query+" {\n"+e+"\n}":""},t}(),Q=/@media|@supports\s+/,F={onCreateRule:function(t,e,n){return Q.test(t)?new E(t,e,n):null}},w={indent:1,children:!0},S=/@keyframes\s+([\w-]+)/,R=function(){function t(t,e,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=t.match(S);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,A=n.generateId;for(var s in this.id=!1===o?this.name:C(A(this,a)),this.rules=new H(Object(r.a)({},n,{parent:this})),e)this.rules.add(s,e[s],Object(r.a)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(t){if(void 0===t&&(t=w),null==t.indent&&(t.indent=w.indent),null==t.children&&(t.children=w.children),!1===t.children)return this.at+" "+this.id+" {}";var e=this.rules.toString(t);return e&&(e="\n"+e+"\n"),this.at+" "+this.id+" {"+e+"}"},t}(),U=/@keyframes\s+/,x=/\$([\w-]+)/g,k=function(t,e){return"string"===typeof t?t.replace(x,(function(t,n){return n in e?e[n]:t})):t},O=function(t,e,n){var r=t[e],i=k(r,n);i!==r&&(t[e]=i)},N={onCreateRule:function(t,e,n){return"string"===typeof t&&U.test(t)?new R(t,e,n):null},onProcessStyle:function(t,e,n){return"style"===e.type&&n?("animation-name"in t&&O(t,"animation-name",n.keyframes),"animation"in t&&O(t,"animation",n.keyframes),t):t},onChangeValue:function(t,e,n){var r=n.options.sheet;if(!r)return t;switch(e){case"animation":case"animation-name":return k(t,r.keyframes);default:return t}}},D=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).renderable=void 0,e}return Object(a.a)(e,t),e.prototype.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?Object(r.a)({},t,{allowEmpty:!0}):t;return d(this.key,this.style,n)},e}(y),G={onCreateRule:function(t,e,n){return n.parent&&"keyframes"===n.parent.type?new D(t,e,n):null}},_=function(){function t(t,e,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.style)){for(var e="",n=0;n<this.style.length;n++)e+=d(this.at,this.style[n]),this.style[n+1]&&(e+="\n");return e}return d(this.at,this.style,t)},t}(),M=/@font-face/,T={onCreateRule:function(t,e,n){return M.test(t)?new _(t,e,n):null}},j=function(){function t(t,e,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){return d(this.key,this.style,t)},t}(),L={onCreateRule:function(t,e,n){return"@viewport"===t||"@-ms-viewport"===t?new j(t,e,n):null}},V=function(){function t(t,e,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t,this.value=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.value)){for(var e="",n=0;n<this.value.length;n++)e+=this.key+" "+this.value[n]+";",this.value[n+1]&&(e+="\n");return e}return this.key+" "+this.value+";"},t}(),Z={"@charset":!0,"@import":!0,"@namespace":!0},P=[B,F,N,G,T,L,{onCreateRule:function(t,e,n){return t in Z?new V(t,e,n):null}}],W={process:!0},J={force:!0,process:!0},H=function(){function t(t){this.map={},this.raw={},this.index=[],this.counter=0,this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=t,this.classes=t.classes,this.keyframes=t.keyframes}var e=t.prototype;return e.add=function(t,e,n){var i=this.options,o=i.parent,a=i.sheet,A=i.jss,s=i.Renderer,c=i.generateId,u=i.scoped,g=Object(r.a)({classes:this.classes,parent:o,sheet:a,jss:A,Renderer:s,generateId:c,scoped:u,name:t},n),f=t;t in this.raw&&(f=t+"-d"+this.counter++),this.raw[f]=e,f in this.classes&&(g.selector="."+C(this.classes[f]));var h=l(f,e,g);if(!h)return null;this.register(h);var d=void 0===g.index?this.index.length:g.index;return this.index.splice(d,0,h),h},e.get=function(t){return this.map[t]},e.remove=function(t){this.unregister(t),delete this.raw[t.key],this.index.splice(this.index.indexOf(t),1)},e.indexOf=function(t){return this.index.indexOf(t)},e.process=function(){var t=this.options.jss.plugins;this.index.slice(0).forEach(t.onProcessRule,t)},e.register=function(t){this.map[t.key]=t,t instanceof v?(this.map[t.selector]=t,t.id&&(this.classes[t.key]=t.id)):t instanceof R&&this.keyframes&&(this.keyframes[t.name]=t.id)},e.unregister=function(t){delete this.map[t.key],t instanceof v?(delete this.map[t.selector],delete this.classes[t.key]):t instanceof R&&delete this.keyframes[t.name]},e.update=function(){var t,e,n;if("string"===typeof(arguments.length<=0?void 0:arguments[0])?(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],t=null),t)this.updateOne(this.map[t],e,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],e,n)},e.updateOne=function(e,n,r){void 0===r&&(r=W);var i=this.options,o=i.jss.plugins,a=i.sheet;if(e.rules instanceof t)e.rules.update(n,r);else{var A=e,s=A.style;if(o.onUpdate(n,e,a,r),r.process&&s&&s!==A.style){for(var c in o.onProcessStyle(A.style,A,a),A.style){var u=A.style[c];u!==s[c]&&A.prop(c,u,J)}for(var l in s){var g=A.style[l],f=s[l];null==g&&g!==f&&A.prop(l,null,J)}}}},e.toString=function(t){for(var e="",n=this.options.sheet,r=!!n&&n.options.link,i=0;i<this.index.length;i++){var o=this.index[i].toString(t);(o||r)&&(e&&(e+="\n"),e+=o)}return e},t}(),Y=function(){function t(t,e){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(r.a)({},e,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),e.Renderer&&(this.renderer=new e.Renderer(this)),this.rules=new H(this.options),t)this.rules.add(n,t[n]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(t,e,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(t,e,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},e.insertRule=function(t){this.renderer&&this.renderer.insertRule(t)},e.addRules=function(t,e){var n=[];for(var r in t){var i=this.addRule(r,t[r],e);i&&n.push(i)}return n},e.getRule=function(t){return this.rules.get(t)},e.deleteRule=function(t){var e="object"===typeof t?t:this.rules.get(t);return!!e&&(this.rules.remove(e),!(this.attached&&e.renderable&&this.renderer)||this.renderer.deleteRule(e.renderable))},e.indexOf=function(t){return this.rules.indexOf(t)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var t;return(t=this.rules).update.apply(t,arguments),this},e.updateOne=function(t,e,n){return this.rules.updateOne(t,e,n),this},e.toString=function(t){return this.rules.toString(t)},t}(),X=function(){function t(){this.plugins={internal:[],external:[]},this.registry=void 0}var e=t.prototype;return e.onCreateRule=function(t,e,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](t,e,n);if(i)return i}return null},e.onProcessRule=function(t){if(!t.isProcessed){for(var e=t.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](t,e);t.style&&this.onProcessStyle(t.style,t,e),t.isProcessed=!0}},e.onProcessStyle=function(t,e,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)e.style=this.registry.onProcessStyle[r](e.style,e,n)},e.onProcessSheet=function(t){for(var e=0;e<this.registry.onProcessSheet.length;e++)this.registry.onProcessSheet[e](t)},e.onUpdate=function(t,e,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](t,e,n,r)},e.onChangeValue=function(t,e,n){for(var r=t,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,e,n);return r},e.use=function(t,e){void 0===e&&(e={queue:"external"});var n=this.plugins[e.queue];-1===n.indexOf(t)&&(n.push(t),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(t,e){for(var n in e)n in t&&t[n].push(e[n]);return t}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),z=new(function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(t){var e=this.registry,n=t.options.index;if(-1===e.indexOf(t))if(0===e.length||n>=this.index)e.push(t);else for(var r=0;r<e.length;r++)if(e[r].options.index>n)return void e.splice(r,0,t)},e.reset=function(){this.registry=[]},e.remove=function(t){var e=this.registry.indexOf(t);this.registry.splice(e,1)},e.toString=function(t){for(var e=void 0===t?{}:t,n=e.attached,r=Object(s.a)(e,["attached"]),i="",o=0;o<this.registry.length;o++){var a=this.registry[o];null!=n&&a.attached!==n||(i&&(i+="\n"),i+=a.toString(r))}return i},Object(o.a)(t,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),t}()),K="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),q="2f1acc6c3a606b082e5eef5e54414ffb";null==K[q]&&(K[q]=0);var $=K[q]++,tt=function(t){void 0===t&&(t={});var e=0;return function(n,r){e+=1;var i="",o="";return r&&(r.options.classNamePrefix&&(o=r.options.classNamePrefix),null!=r.options.jss.id&&(i=String(r.options.jss.id))),t.minify?""+(o||"c")+$+i+e:o+n.key+"-"+$+(i?"-"+i:"")+"-"+e}},et=function(t){var e;return function(){return e||(e=t()),e}};function nt(t,e){try{return t.attributeStyleMap?t.attributeStyleMap.get(e):t.style.getPropertyValue(e)}catch(n){return""}}function rt(t,e,n){try{var r=n;if(Array.isArray(n)&&(r=f(n,!0),"!important"===n[n.length-1]))return t.style.setProperty(e,r,"important"),!0;t.attributeStyleMap?t.attributeStyleMap.set(e,r):t.style.setProperty(e,r)}catch(i){return!1}return!0}function it(t,e){try{t.attributeStyleMap?t.attributeStyleMap.delete(e):t.style.removeProperty(e)}catch(n){}}function ot(t,e){return t.selectorText=e,t.selectorText===e}var at=et((function(){return document.querySelector("head")}));function At(t){var e=z.registry;if(e.length>0){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.attached&&r.options.index>e.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&"string"===typeof r){var i=function(t){for(var e=at(),n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===t)return r}return null}(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var st=et((function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null})),ct=function(t,e,n){var r=t.cssRules.length;(void 0===n||n>r)&&(n=r);try{if("insertRule"in t)t.insertRule(e,n);else if("appendRule"in t){t.appendRule(e)}}catch(i){return!1}return t.cssRules[n]},ut=function(){function t(t){this.getPropertyValue=nt,this.setProperty=rt,this.removeProperty=it,this.setSelector=ot,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,t&&z.add(t),this.sheet=t;var e=this.sheet?this.sheet.options:{},n=e.media,r=e.meta,i=e.element;this.element=i||function(){var t=document.createElement("style");return t.textContent="\n",t}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=st();o&&this.element.setAttribute("nonce",o)}var e=t.prototype;return e.attach=function(){if(!this.element.parentNode&&this.sheet){!function(t,e){var n=e.insertionPoint,r=At(e);if(!1!==r&&r.parent)r.parent.insertBefore(t,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling)}else at().appendChild(t)}(this.element,this.sheet.options);var t=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&t&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){var t=this.element.parentNode;t&&t.removeChild(this.element)},e.deploy=function(){var t=this.sheet;t&&(t.options.link?this.insertRules(t.rules):this.element.textContent="\n"+t.toString()+"\n")},e.insertRules=function(t,e){for(var n=0;n<t.index.length;n++)this.insertRule(t.index[n],n,e)},e.insertRule=function(t,e,n){if(void 0===n&&(n=this.element.sheet),t.rules){var r=t,i=n;return("conditional"!==t.type&&"keyframes"!==t.type||!1!==(i=ct(n,r.toString({children:!1}),e)))&&(this.insertRules(r.rules,i),i)}if(t.renderable&&t.renderable.parentStyleSheet===this.element.sheet)return t.renderable;var o=t.toString();if(!o)return!1;var a=ct(n,o,e);return!1!==a&&(this.hasInsertedRules=!0,t.renderable=a,a)},e.deleteRule=function(t){var e=this.element.sheet,n=this.indexOf(t);return-1!==n&&(e.deleteRule(n),!0)},e.indexOf=function(t){for(var e=this.element.sheet.cssRules,n=0;n<e.length;n++)if(t===e[n])return n;return-1},e.replaceRule=function(t,e){var n=this.indexOf(t);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(e,n))},e.getRules=function(){return this.element.sheet.cssRules},t}(),lt=0,gt=function(){function t(t){this.id=lt++,this.version="10.1.1",this.plugins=new X,this.options={id:{minify:!1},createGenerateId:tt,Renderer:i.a?ut:null,plugins:[]},this.generateId=tt({minify:!1});for(var e=0;e<P.length;e++)this.plugins.use(P[e],{queue:"internal"});this.setup(t)}var e=t.prototype;return e.setup=function(t){return void 0===t&&(t={}),t.createGenerateId&&(this.options.createGenerateId=t.createGenerateId),t.id&&(this.options.id=Object(r.a)({},this.options.id,t.id)),(t.createGenerateId||t.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=t.insertionPoint&&(this.options.insertionPoint=t.insertionPoint),"Renderer"in t&&(this.options.Renderer=t.Renderer),t.plugins&&this.use.apply(this,t.plugins),this},e.createStyleSheet=function(t,e){void 0===e&&(e={});var n=e.index;"number"!==typeof n&&(n=0===z.index?0:z.index+1);var i=new Y(t,Object(r.a)({},e,{jss:this,generateId:e.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(i),i},e.removeStyleSheet=function(t){return t.detach(),z.remove(t),this},e.createRule=function(t,e,n){if(void 0===e&&(e={}),void 0===n&&(n={}),"object"===typeof t)return this.createRule(void 0,t,e);var i=Object(r.a)({},n,{name:t,jss:this,Renderer:this.options.Renderer});i.generateId||(i.generateId=this.generateId),i.classes||(i.classes={}),i.keyframes||(i.keyframes={});var o=l(t,e,i);return o&&this.plugins.onProcessRule(o),o},e.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){t.plugins.use(e)})),this},t}();function ft(t){var e=null;for(var n in t){var r=t[n],i=typeof r;if("function"===i)e||(e={}),e[n]=r;else if("object"===i&&null!==r&&!Array.isArray(r)){var o=ft(r);o&&(e||(e={}),e[n]=o)}}return e}var ht="undefined"!==typeof CSS&&CSS&&"number"in CSS,dt=function(t){return new gt(t)};dt()},function(t,e,n){"use strict";var r={};function i(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}n.r(r),n.d(r,"dirname",(function(){return i})),n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(3),i=n(2),o=n(19),a=n(247),A=n(127),s=n(168),c=n(197),u=n(47),l=n(701),g="Resource subclass must define virtual methods",f=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t),Object(A.b)(e);var i=n.id,o=n.userData,a=void 0===o?{}:o;this.gl=e,this.id=i||Object(c.c)(this.constructor.name),this.userData=a,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(i.a)(t,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.deleteChildren,n=void 0!==e&&e,r=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,r&&n&&r.filter(Boolean).forEach((function(t){t.delete()})),this}},{key:"bind",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!==typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object(s.b)(this.gl,t),Object(u.a)(t);var n=this.constructor.PARAMETERS||{},r=n[t];if(r){var i=Object(o.g)(this.gl),a=(!("webgl2"in r)||i)&&(!("extension"in r)||this.gl.getExtension(r.extension));if(!a){var A=r.webgl1,c="webgl2"in r?r.webgl2:r.webgl1,l=i?c:A;return l}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=e.parameters,r=e.keys,i=this.constructor.PARAMETERS||{},a=Object(o.g)(this.gl),A={},c=n||Object.keys(i),u=!0,l=!1,g=void 0;try{for(var f,h=c[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,I=i[d],p=I&&(!("webgl2"in I)||a)&&(!("extension"in I)||this.gl.getExtension(I.extension));if(p){var C=r?Object(s.a)(this.gl,d):d;A[C]=this.getParameter(d,t),r&&"GLenum"===I.type&&(A[C]=Object(s.a)(this.gl,A[C]))}}}catch(y){l=!0,g=y}finally{try{u||null==h.return||h.return()}finally{if(l)throw g}}return A}},{key:"setParameter",value:function(t,e){t=Object(s.b)(this.gl,t),Object(u.a)(t);var n=(this.constructor.PARAMETERS||{})[t];if(n){var r=Object(o.g)(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Object(s.b)(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,n){return Object(l.a)(this,t,e,n)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(g)}},{key:"_deleteHandle",value:function(){throw new Error(g)}},{key:"_bindHandle",value:function(){throw new Error(g)}},{key:"_getOptsFromHandle",value:function(){throw new Error(g)}},{key:"_getParameter",value:function(t,e){throw new Error(g)}},{key:"_setParameter",value:function(t,e){throw new Error(g)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var t=this.constructor.name,e=a.a.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this.constructor.name;a.a.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get("".concat(e," Memory")).addCount(t),this.byteLength=t}},{key:"_trackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,e=a.a.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function o(t){var e=r.useRef(t);return i((function(){e.current=t})),r.useCallback((function(){return e.current.apply(void 0,arguments)}),[])}},function(t,e,n){var r=n(503);t.exports=function(t,e){return r(t,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A})),n.d(e,"e",(function(){return s})),n.d(e,"g",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"h",(function(){return l})),n.d(e,"c",(function(){return g})),n.d(e,"i",(function(){return f}));var r=n(335),i=n(462),o="json",a="application/json",A="csv",s="text/csv",c=",",u="NA",l="cell",g={cell:{latestVersion:"0.1.3",schema:r}},f={cell:{schema:i}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return A})),n.d(e,"d",(function(){return I})),n.d(e,"c",(function(){return p})),n.d(e,"f",(function(){return C}));var r=n(123),i=n(37);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(t,e){var n=t%e;return n<0?e+n:n}function A(t){var e=t.viewMatrix,n=t.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-e[2],-e[6],-e[10]],up:[e[1],e[5],e[9]],right:[e[0],e[4],e[8]]}}var s,c=new i.c,u=new i.c,l=new i.c,g=new i.c,f=new i.c,h=new i.c,d=new i.c;function I(t){var e=t.aspect,n=t.near,r=t.far,o=t.fovyRadians,a=t.position,A=t.direction,s=t.up,I=t.right;u.copy(A);var p=1/u.len();u.normalize(),c.copy(a),l.copy(s);var C=1/l.len();l.normalize(),g.copy(I).normalize();var y=2*Math.tan(o/2)*n*C,v=y*e;f.copy(u).scale(n*p).add(c),h.copy(u).scale(r*p).add(c);var B=u.clone().negate(),m=B.dot(f),b={near:{distance:m,normal:B},far:{distance:u.dot(h),normal:u.clone()}};return d.copy(g).scale(.5*v).add(f).subtract(c).normalize(),B=new i.c(d).cross(l),m=c.dot(B),b.right={normal:B,distance:m},d.copy(g).scale(.5*-v).add(f).subtract(c).normalize(),B=new i.c(l).cross(d),m=c.dot(B),b.left={normal:B,distance:m},d.copy(l).scale(.5*y).add(f).subtract(c).normalize(),B=new i.c(g).cross(d),m=c.dot(B),b.top={normal:B,distance:m},d.copy(l).scale(.5*-y).add(f).subtract(c).normalize(),B=new i.c(d).cross(g),m=c.dot(B),b.bottom={normal:B,distance:m},b}function p(t){return t-Math.fround(t)}function C(t,e){var n=e.size,i=void 0===n?1:n,o=e.startIndex,a=void 0===o?0:o,A=e.endIndex;Number.isFinite(A)||(A=t.length);var c=(A-a)/i;s=r.a.allocate(s,c,{type:Float32Array,size:2*i});for(var u=a,l=0;u<A;){for(var g=0;g<i;g++){var f=t[u++];s[l+g]=f,s[l+g+i]=p(f)}l+=2*i}return s.subarray(0,c*i*2)}},,function(t,e,n){"use strict";function r(t){return t&&t.ownerDocument||document}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e=t.source,n=t.target,r=t.start,i=void 0===r?0:r,o=t.end,a=t.size,A=t.getData;o=o||n.length;var s=e.length,c=o-i;if(s>c)n.set(e.subarray(0,c),i);else if(n.set(e,i),A)for(var u=s;u<c;)for(var l=A(u,e),g=0;g<a;g++)n[i+u]=l[g]||0,u++}n.d(e,"e",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return A})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"f",(function(){return u}));var i={interpolation:{duration:0,easing:function(t){return t}},spring:{stiffness:.05,damping:.5}};function o(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",Object.assign({},i[t.type],e,t)):null}function a(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function A(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function s(t){t.push(t.shift())}function c(t,e){var n=t.doublePrecision,r=t.settings,i=t.value,o=t.size,a=n&&i instanceof Float64Array?2:1;return(r.noAlloc?i.length:e*o)*a}function u(t){var e=t.buffer,n=t.numInstances,i=t.attribute,o=t.fromLength,a=t.fromStartIndices,A=t.getData,s=void 0===A?function(t){return t}:A,u=i.doublePrecision&&i.value instanceof Float64Array?2:1,l=i.size*u,g=i.byteOffset,f=i.startIndices,h=a&&f,d=c(i,n),I=i.state.constant;if(h||!(o>=d)){var p=I?i.value:i.getBuffer().getData({srcByteOffset:g});if(i.settings.normalized&&!I){var C=s;s=function(t,e){return i._normalizeConstant(C(t,e))}}var y=I?function(t,e){return s(p,e)}:function(t,e){return s(p.subarray(t,t+l),e)},v=e.getData({length:o}),B=new Float32Array(d);!function(t){var e=t.source,n=t.target,i=t.size,o=t.getData,a=t.sourceStartIndices,A=t.targetStartIndices;if(!Array.isArray(A))return r({source:e,target:n,size:i,getData:o}),n;for(var s=0,c=0,u=o&&function(t,e){return o(t+c,e)},l=Math.min(a.length,A.length),g=1;g<l;g++){var f=a[g]*i,h=A[g]*i;r({source:e.subarray(s,f),target:n,start:c,end:h,size:i,getData:u}),s=f,c=h}c<n.length&&r({source:[],target:n,start:c,size:i,getData:u})}({source:v,target:B,sourceStartIndices:a,targetStartIndices:f,size:l,getData:y}),e.byteLength<B.byteLength+g&&e.reallocate(B.byteLength+g),e.subData({data:B,offset:g})}}},function(t,e,n){"use strict";var r=n(74);function i(t,e,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A}));n(27),n(79),n(23),n(231),Math.PI,Math.PI;var r={};function i(t){return Math.round(t/r.EPSILON)*r.EPSILON}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,o=void 0===n?r.precision||4:n;return t=i(t),"".concat(parseFloat(t.toPrecision(o)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t,e,n){var i=r.EPSILON;n&&(r.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!A(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}r.EPSILON=1e-12,r.debug=!1,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"d",(function(){return A})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return c}));var r=n(16),i=n(18);function o(t){return Object(i.a)(t).reduce((function(t,e){var n=e[0],i=e[1];return Object.assign(t,Object(r.a)({},n,i))}),{})}function a(t){return Object(i.a)(Array(t).keys())}function A(t,e,n){return 1===n?t:e}function s(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t){var e,n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=[0];function i(){var t=[];r.forEach((function(e){t.unshift(n[e])}));for(var e=!0,i=0;i<r.length;i++){if(!(++r[i]>=n.length)){e=!1;break}r[i]=0}return e&&r.push(0),t.join("")}do{e=i()}while(t.includes(e));return e}},function(t,e,n){var r;!function(n){"use strict";var i=function(t){return.5*(Math.exp(t)+Math.exp(-t))},o=function(t){return.5*(Math.exp(t)-Math.exp(-t))},a=function(){throw SyntaxError("Invalid Param")};function A(t,e){var n=Math.abs(t),r=Math.abs(e);return 0===t?Math.log(r):0===e?Math.log(n):n<3e3&&r<3e3?.5*Math.log(t*t+e*e):Math.log(t/Math.cos(Math.atan2(e,t)))}function s(t,e){if(!(this instanceof s))return new s(t,e);var n=function(t,e){var n={re:0,im:0};if(void 0===t||null===t)n.re=n.im=0;else if(void 0!==e)n.re=t,n.im=e;else switch(typeof t){case"object":if("im"in t&&"re"in t)n.re=t.re,n.im=t.im;else if("abs"in t&&"arg"in t){if(!Number.isFinite(t.abs)&&Number.isFinite(t.arg))return s.INFINITY;n.re=t.abs*Math.cos(t.arg),n.im=t.abs*Math.sin(t.arg)}else if("r"in t&&"phi"in t){if(!Number.isFinite(t.r)&&Number.isFinite(t.phi))return s.INFINITY;n.re=t.r*Math.cos(t.phi),n.im=t.r*Math.sin(t.phi)}else 2===t.length?(n.re=t[0],n.im=t[1]):a();break;case"string":n.im=n.re=0;var r=t.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,o=0;null===r&&a();for(var A=0;A<r.length;A++){var c=r[A];" "===c||"\t"===c||"\n"===c||("+"===c?i++:"-"===c?o++:"i"===c||"I"===c?(i+o===0&&a()," "===r[A+1]||isNaN(r[A+1])?n.im+=parseFloat((o%2?"-":"")+"1"):(n.im+=parseFloat((o%2?"-":"")+r[A+1]),A++),i=o=0):((i+o===0||isNaN(c))&&a(),"i"===r[A+1]||"I"===r[A+1]?(n.im+=parseFloat((o%2?"-":"")+c),A++):n.re+=parseFloat((o%2?"-":"")+c),i=o=0))}i+o>0&&a();break;case"number":n.im=0,n.re=t;break;default:a()}return isNaN(n.re)||isNaN(n.im),n}(t,e);this.re=n.re,this.im=n.im}s.prototype={re:0,im:0,sign:function(){var t=this.abs();return new s(this.re/t,this.im/t)},add:function(t,e){var n=new s(t,e);return this.isInfinite()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:new s(this.re+n.re,this.im+n.im)},sub:function(t,e){var n=new s(t,e);return this.isInfinite()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:new s(this.re-n.re,this.im-n.im)},mul:function(t,e){var n=new s(t,e);return this.isInfinite()&&n.isZero()||this.isZero()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:0===n.im&&0===this.im?new s(this.re*n.re,0):new s(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(t,e){var n=new s(t,e);if(this.isZero()&&n.isZero()||this.isInfinite()&&n.isInfinite())return s.NAN;if(this.isInfinite()||n.isZero())return s.INFINITY;if(this.isZero()||n.isInfinite())return s.ZERO;t=this.re,e=this.im;var r,i,o=n.re,a=n.im;return 0===a?new s(t/o,e/o):Math.abs(o)<Math.abs(a)?new s((t*(i=o/a)+e)/(r=o*i+a),(e*i-t)/r):new s((t+e*(i=a/o))/(r=a*i+o),(e-t*i)/r)},pow:function(t,e){var n=new s(t,e);if(t=this.re,e=this.im,n.isZero())return s.ONE;if(0===n.im){if(0===e&&t>=0)return new s(Math.pow(t,n.re),0);if(0===t)switch((n.re%4+4)%4){case 0:return new s(Math.pow(e,n.re),0);case 1:return new s(0,Math.pow(e,n.re));case 2:return new s(-Math.pow(e,n.re),0);case 3:return new s(0,-Math.pow(e,n.re))}}if(0===t&&0===e&&n.re>0&&n.im>=0)return s.ZERO;var r=Math.atan2(e,t),i=A(t,e);return t=Math.exp(n.re*i-n.im*r),e=n.im*i+n.re*r,new s(t*Math.cos(e),t*Math.sin(e))},sqrt:function(){var t,e,n=this.re,r=this.im,i=this.abs();if(n>=0){if(0===r)return new s(Math.sqrt(n),0);t=.5*Math.sqrt(2*(i+n))}else t=Math.abs(r)/Math.sqrt(2*(i-n));return e=n<=0?.5*Math.sqrt(2*(i-n)):Math.abs(r)/Math.sqrt(2*(i+n)),new s(t,r<0?-e:e)},exp:function(){var t=Math.exp(this.re);return this.im,new s(t*Math.cos(this.im),t*Math.sin(this.im))},expm1:function(){var t=this.re,e=this.im;return new s(Math.expm1(t)*Math.cos(e)+function(t){var e=Math.PI/4;if(t<-e||t>e)return Math.cos(t)-1;var n=t*t;return n*(n*(1/24+n*(-1/720+n*(1/40320+n*(-1/3628800+n*(1/4790014600+n*(-1/87178291200+n*(1/20922789888e3)))))))-.5)}(e),Math.exp(t)*Math.sin(e))},log:function(){var t=this.re,e=this.im;return new s(A(t,e),Math.atan2(e,t))},abs:function(){return function(t,e){var n=Math.abs(t),r=Math.abs(e);return n<3e3&&r<3e3?Math.sqrt(n*n+r*r):(n<r?(n=r,r=t/e):r=e/t,n*Math.sqrt(1+r*r))}(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var t=this.re,e=this.im;return new s(Math.sin(t)*i(e),Math.cos(t)*o(e))},cos:function(){var t=this.re,e=this.im;return new s(Math.cos(t)*i(e),-Math.sin(t)*o(e))},tan:function(){var t=2*this.re,e=2*this.im,n=Math.cos(t)+i(e);return new s(Math.sin(t)/n,o(e)/n)},cot:function(){var t=2*this.re,e=2*this.im,n=Math.cos(t)-i(e);return new s(-Math.sin(t)/n,o(e)/n)},sec:function(){var t=this.re,e=this.im,n=.5*i(2*e)+.5*Math.cos(2*t);return new s(Math.cos(t)*i(e)/n,Math.sin(t)*o(e)/n)},csc:function(){var t=this.re,e=this.im,n=.5*i(2*e)-.5*Math.cos(2*t);return new s(Math.sin(t)*i(e)/n,-Math.cos(t)*o(e)/n)},asin:function(){var t=this.re,e=this.im,n=new s(e*e-t*t+1,-2*t*e).sqrt(),r=new s(n.re-e,n.im+t).log();return new s(r.im,-r.re)},acos:function(){var t=this.re,e=this.im,n=new s(e*e-t*t+1,-2*t*e).sqrt(),r=new s(n.re-e,n.im+t).log();return new s(Math.PI/2-r.im,r.re)},atan:function(){var t=this.re,e=this.im;if(0===t){if(1===e)return new s(0,1/0);if(-1===e)return new s(0,-1/0)}var n=t*t+(1-e)*(1-e),r=new s((1-e*e-t*t)/n,-2*t/n).log();return new s(-.5*r.im,.5*r.re)},acot:function(){var t=this.re,e=this.im;if(0===e)return new s(Math.atan2(1,t),0);var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).atan():new s(0!==t?t/0:0,0!==e?-e/0:0).atan()},asec:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new s(0,1/0);var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).acos():new s(0!==t?t/0:0,0!==e?-e/0:0).acos()},acsc:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new s(Math.PI/2,1/0);var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).asin():new s(0!==t?t/0:0,0!==e?-e/0:0).asin()},sinh:function(){var t=this.re,e=this.im;return new s(o(t)*Math.cos(e),i(t)*Math.sin(e))},cosh:function(){var t=this.re,e=this.im;return new s(i(t)*Math.cos(e),o(t)*Math.sin(e))},tanh:function(){var t=2*this.re,e=2*this.im,n=i(t)+Math.cos(e);return new s(o(t)/n,Math.sin(e)/n)},coth:function(){var t=2*this.re,e=2*this.im,n=i(t)-Math.cos(e);return new s(o(t)/n,-Math.sin(e)/n)},csch:function(){var t=this.re,e=this.im,n=Math.cos(2*e)-i(2*t);return new s(-2*o(t)*Math.cos(e)/n,2*i(t)*Math.sin(e)/n)},sech:function(){var t=this.re,e=this.im,n=Math.cos(2*e)+i(2*t);return new s(2*i(t)*Math.cos(e)/n,-2*o(t)*Math.sin(e)/n)},asinh:function(){var t=this.im;this.im=-this.re,this.re=t;var e=this.asin();return this.re=-this.im,this.im=t,t=e.re,e.re=-e.im,e.im=t,e},acosh:function(){var t=this.acos();if(t.im<=0){var e=t.re;t.re=-t.im,t.im=e}else{e=t.im;t.im=-t.re,t.re=e}return t},atanh:function(){var t=this.re,e=this.im,n=t>1&&0===e,r=1-t,i=1+t,o=r*r+e*e,a=0!==o?new s((i*r-e*e)/o,(e*r+i*e)/o):new s(-1!==t?t/0:0,0!==e?e/0:0),c=a.re;return a.re=A(a.re,a.im)/2,a.im=Math.atan2(a.im,c)/2,n&&(a.im=-a.im),a},acoth:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new s(0,Math.PI/2);var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).atanh():new s(0!==t?t/0:0,0!==e?-e/0:0).atanh()},acsch:function(){var t=this.re,e=this.im;if(0===e)return new s(0!==t?Math.log(t+Math.sqrt(t*t+1)):1/0,0);var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).asinh():new s(0!==t?t/0:0,0!==e?-e/0:0).asinh()},asech:function(){var t=this.re,e=this.im;if(this.isZero())return s.INFINITY;var n=t*t+e*e;return 0!==n?new s(t/n,-e/n).acosh():new s(0!==t?t/0:0,0!==e?-e/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var t=this.re,e=this.im,n=t*t+e*e;return new s(t/n,-e/n)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(t){return t=Math.pow(10,t||0),new s(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new s(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new s(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,e){var n=new s(t,e);return Math.abs(n.re-this.re)<=s.EPSILON&&Math.abs(n.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var t=this.re,e=this.im,n="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==t&&(n+=t),0!==e&&(0!==t?n+=e<0?" - ":" + ":e<0&&(n+="-"),1!==(e=Math.abs(e))&&(n+=e),n+="i"),n||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){return isNaN(this.re)||isNaN(this.im)})),isZero:function(){return(0===this.re||-0===this.re)&&(0===this.im||-0===this.im)},isFinite:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){return isFinite(this.re)&&isFinite(this.im)})),isInfinite:function(){return!(this.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-16,void 0===(r=function(){return s}.apply(e,[]))||(t.exports=r)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A}));n(27),n(79),n(23),n(271),Math.PI,Math.PI;var r={};function i(t){return Math.round(t/r.EPSILON)*r.EPSILON}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,o=void 0===n?r.precision||4:n;return t=i(t),"".concat(parseFloat(t.toPrecision(o)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t,e,n){var i=r.EPSILON;n&&(r.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!A(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}r.EPSILON=1e-12,r.debug=!1,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";(function(t){var r=n(582),i=n(521),o=n(414);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function A(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,n);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=g(t,e);return t}(t,e,n,r):"string"===typeof e?function(t,e,n){"string"===typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(e,n),i=(t=A(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(s.isBuffer(e)){var n=0|f(e.length);return 0===(t=A(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||(r=e.length)!==r?A(t,0):g(t,e);if("Buffer"===e.type&&o(e.data))return g(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(u(e),t=A(t,e<0?0:0|f(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function g(t,e){var n=e.length<0?0:0|f(e.length);t=A(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function d(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return F(this,e,n);case"ascii":return w(this,e,n);case"latin1":case"binary":return S(this,e,n);case"base64":return Q(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function I(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function p(t,e,n,r,i){if(0===t.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:C(t,e,n,r,i);if("number"===typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):C(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function C(t,e,n,r,i){var o,a=1,A=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,A/=2,s/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=n;o<A;o++)if(c(t,o)===c(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===s)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+s>A&&(n=A-s),o=n;o>=0;o--){for(var l=!0,g=0;g<s;g++)if(c(t,o+g)!==c(e,g)){l=!1;break}if(l)return o}return-1}function y(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var A=parseInt(e.substr(2*a,2),16);if(isNaN(A))return a;t[n+a]=A}return a}function v(t,e,n,r){return V(j(e,t.length-n),t,n,r)}function B(t,e,n,r){return V(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function m(t,e,n,r){return B(t,e,n,r)}function b(t,e,n,r){return V(L(e),t,n,r)}function E(t,e,n,r){return V(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function Q(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function F(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,A,s,c=t[i],u=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(u=c);break;case 2:128===(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(u=s);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:o=t[i+1],a=t[i+2],A=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&A)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&A)>65535&&s<1114112&&(u=s)}null===u?(u=65533,l=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return c(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return function(t,e,n,r){return u(e),e<=0?A(t,e):void 0!==n?"string"===typeof r?A(t,e).fill(n,r):A(t,e).fill(n):A(t,e)}(null,t,e,n)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=s.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)I(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)I(this,e,e+3),I(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)I(this,e,e+7),I(this,e+1,e+6),I(this,e+2,e+5),I(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?F(this,0,t):d.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,n,r,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),A=Math.min(o,a),c=this.slice(r,i),u=t.slice(e,n),l=0;l<A;++l)if(c[l]!==u[l]){o=c[l],a=u[l];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return p(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return p(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"===typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":return B(this,t,e,n);case"latin1":case"binary":return m(this,t,e,n);case"base64":return b(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function S(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function R(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=T(t[o]);return i}function U(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function x(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,n,r,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function G(t,e,n,r,o){return o||D(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function _(t,e,n,r,o){return o||D(t,0,n,8),i.write(t,e,n,r,52,8),n+8}s.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=s.prototype;else{var i=e-t;n=new s(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},s.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||x(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},s.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||x(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||x(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||x(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||k(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},s.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||k(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);k(this,t,e,n,i-1,-i)}var o=0,a=1,A=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===A&&0!==this[e+o-1]&&(A=1),this[e+o]=(t/a>>0)-A&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);k(this,t,e,n,i-1,-i)}var o=n-1,a=1,A=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===A&&0!==this[e+o+1]&&(A=1),this[e+o]=(t/a>>0)-A&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return G(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return G(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return _(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return _(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},s.prototype.fill=function(t,e,n,r){if("string"===typeof t){if("string"===typeof e?(r=e,e=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=s.isBuffer(t)?t:j(new s(t,r).toString()),A=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%A]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function T(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function L(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(M,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function V(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return A}));n(27),n(79),n(23),n(401),Math.PI,Math.PI;var r={};function i(t){return Math.round(t/r.EPSILON)*r.EPSILON}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,o=void 0===n?r.precision||4:n;return t=i(t),"".concat(parseFloat(t.toPrecision(o)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t,e,n){var i=r.EPSILON;n&&(r.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!A(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}r.EPSILON=1e-12,r.debug=!1,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(17),i=n(3),o=n(2),a=n(44),A=n(86),s=n(37),c=n(10),u=n(67),l=n(40),g=Math.PI/180,f=Object(A.a)(),h=[0,0,0],d={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?null:n,o=e.x,a=void 0===o?0:o,A=e.y,s=void 0===A?0:A,c=e.width,u=void 0===c?1:c,l=e.height,g=void 0===l?1:l;this.id=r||this.constructor.displayName||"viewport",this.x=a,this.y=s,this.width=u||1,this.height=g||1,this._frustumPlanes={},this._initViewMatrix(e),this._initProjectionMatrix(e),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return Object(o.a)(t,[{key:"equals",value:function(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Object(s.f)(e.projectionMatrix,this.projectionMatrix)&&Object(s.f)(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,i=void 0===n||n,o=this.projectPosition(t),a=Object(u.n)(o,this.pixelProjectionMatrix),A=Object(r.a)(a,2),s=A[0],c=A[1],l=i?c:this.height-c;return 2===t.length?[s,l]:[s,l,a[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,i=void 0===n||n,o=e.targetZ,a=Object(r.a)(t,3),A=a[0],s=a[1],c=a[2],l=i?s:this.height-s,g=o&&o*this.distanceScales.unitsPerMeter[2],f=Object(u.l)([A,l,c],this.pixelUnprojectionMatrix,g),h=this.unprojectPosition(f),d=Object(r.a)(h,3),I=d[0],p=d[1],C=d[2];return Number.isFinite(c)?[I,p,C]:Number.isFinite(o)?[I,p,o]:[I,p]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=Object(r.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),n=Object(r.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return this.isGeospatial?Object(u.j)(t):t}},{key:"unprojectFlat",value:function(t){return this.isGeospatial?Object(u.m)(t):t}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},n=this.unproject([0,0],e),r=this.unproject([this.width,0],e),i=this.unproject([0,this.height],e),o=this.unproject([this.width,this.height],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])]}},{key:"getDistanceScales",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t?Object(u.e)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(t){var e=t.x,n=t.y,r=t.width,i=void 0===r?1:r,o=t.height,a=void 0===o?1:o;return e<this.x+this.width&&this.x<e+i&&n<this.y+this.height&&this.y<n+a}},{key:"getFrustumPlanes",value:function(){if(this._frustumPlanes.near)return this._frustumPlanes;var t=this.projectionProps,e=t.near,n=t.far,r=t.fovyRadians,i=t.aspect;return Object.assign(this._frustumPlanes,Object(A.d)({aspect:i,near:e,far:n,fovyRadians:r,position:this.cameraPosition,direction:this.cameraDirection,up:this.cameraUp,right:this.cameraRight})),this._frustumPlanes}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"getCameraDirection",value:function(){return this.cameraDirection}},{key:"getCameraUp",value:function(){return this.cameraUp}},{key:"_createProjectionMatrix",value:function(t){var e=t.orthographic,n=t.fovyRadians,r=t.aspect,i=t.focalDistance,o=t.near,a=t.far;return e?(new s.a).orthographic({fovy:n,aspect:r,focalDistance:i,near:o,far:a}):(new s.a).perspective({fovy:n,aspect:r,near:o,far:a})}},{key:"_initViewMatrix",value:function(t){var e=t.viewMatrix,n=void 0===e?f:e,r=t.longitude,i=void 0===r?null:r,o=t.latitude,a=void 0===o?null:o,A=t.zoom,c=void 0===A?null:A,l=t.position,g=void 0===l?null:l,I=t.modelMatrix,p=void 0===I?null:I,C=t.focalDistance,y=void 0===C?1:C,v=t.distanceScales,B=void 0===v?null:v;this.isGeospatial=Number.isFinite(a)&&Number.isFinite(i),this.zoom=c,Number.isFinite(this.zoom)||(this.zoom=this.isGeospatial?Object(u.g)({latitude:a})+Math.log2(y):0);var m=Math.pow(2,this.zoom);this.scale=m,this.distanceScales=this.isGeospatial?Object(u.e)({latitude:a,longitude:i}):B||d,this.focalDistance=y,this.distanceScales.metersPerUnit=new s.c(this.distanceScales.metersPerUnit),this.distanceScales.unitsPerMeter=new s.c(this.distanceScales.unitsPerMeter),this.position=h,this.meterOffset=h,g&&(this.position=g,this.modelMatrix=p,this.meterOffset=p?p.transformVector(g):g),this.isGeospatial?(this.longitude=i,this.latitude=a,this.center=this._getCenterInWorld({longitude:i,latitude:a})):this.center=g?this.projectPosition(g):[0,0,0],this.viewMatrixUncentered=n,this.viewMatrix=(new s.a).multiplyRight(this.viewMatrixUncentered).translate(new s.c(this.center||h).negate())}},{key:"_getCenterInWorld",value:function(t){var e=t.longitude,n=t.latitude,r=this.meterOffset,i=this.distanceScales,o=new s.c(this.projectPosition([e,n,0]));if(r){var a=new s.c(r).scale(i.unitsPerMeter);o.add(a)}return o}},{key:"_initProjectionMatrix",value:function(t){var e=t.projectionMatrix,n=void 0===e?null:e,r=t.orthographic,i=void 0!==r&&r,o=t.fovyRadians,a=t.fovy,A=void 0===a?75:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?1e3:u,f=t.focalDistance,h=void 0===f?1:f;this.projectionProps={orthographic:i,fovyRadians:o||A*g,aspect:this.width/this.height,focalDistance:h,near:c,far:l},this.projectionMatrix=n||this._createProjectionMatrix(this.projectionProps)}},{key:"_initPixelMatrices",value:function(){var t=Object(A.a)();c.h(t,t,this.projectionMatrix),c.h(t,t,this.viewMatrix),this.viewProjectionMatrix=t,this.viewMatrixInverse=c.f([],this.viewMatrix)||this.viewMatrix;var e=Object(A.b)({viewMatrix:this.viewMatrix,viewMatrixInverse:this.viewMatrixInverse}),n=e.eye,r=e.direction,i=e.up,o=e.right;this.cameraPosition=n,this.cameraDirection=r,this.cameraUp=i,this.cameraRight=o;var s=Object(A.a)(),u=Object(A.a)();c.o(s,s,[this.width/2,-this.height/2,1]),c.p(s,s,[1,-1,0]),c.h(u,s,this.viewProjectionMatrix),this.pixelProjectionMatrix=u,this.viewportMatrix=s,this.pixelUnprojectionMatrix=c.f(Object(A.a)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||a.a.warn("Pixel project matrix not invertible")()}},{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?l.c.WEB_MERCATOR:l.c.WEB_MERCATOR_AUTO_OFFSET:l.c.IDENTITY}}]),t}();I.displayName="Viewport"},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},,function(t,e){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var r=n(3),i=n(8),o=n(6),a=n(2),A=n(7),s=n(82),c=n(76),u=n(151),l=n(19),g=n(58),f=n(127),h=n(197),d=n(47),I=[9729,9728],p=g.global.WebGLBuffer||function(){},C=function(t){function e(t,n){var a;Object(r.a)(this,e);var A=n.id,s=void 0===A?Object(h.c)("texture"):A,c=n.handle,u=n.target;return(a=Object(i.a)(this,Object(o.a)(e).call(this,t,{id:s,handle:c}))).target=u,a.textureUnit=void 0,a.loaded=!1,a.width=void 0,a.height=void 0,a.depth=void 0,a.format=void 0,a.type=void 0,a.dataFormat=void 0,a.border=void 0,a.textureUnit=void 0,a.mipmaps=void 0,a}return Object(A.a)(e,t),Object(a.a)(e,null,[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.format,r=e.linearFiltering,i=!0;return n&&(i=(i=i&&Object(u.d)(t,n))&&(!r||Object(u.e)(t,n))),i}}]),Object(a.a)(e,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.data;if(n instanceof Promise)return n.then((function(n){return t.initialize(Object.assign({},e,{pixels:n,data:n}))})),this;var r=e.pixels,i=void 0===r?null:r,o=e.format,a=void 0===o?6408:o,A=e.border,s=void 0===A?0:A,c=e.recreate,u=void 0!==c&&c,g=e.parameters,f=void 0===g?{}:g,h=e.pixelStore,d=void 0===h?{}:h,I=e.textureUnit,p=void 0===I?void 0:I,C=e.mipmaps,y=void 0===C||C;n||(n=i);var v=e.width,B=e.height,m=e.dataFormat,b=e.type,E=e.depth,Q=void 0===E?0:E,F=this._deduceParameters({format:a,type:b,dataFormat:m,compressed:!1,data:n,width:v,height:B});return v=F.width,B=F.height,m=F.dataFormat,b=F.type,this.width=v,this.height=B,this.depth=Q,this.format=a,this.type=b,this.dataFormat=m,this.border=s,this.textureUnit=p,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),y&&this._isNPOT()&&(l.h.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),y=!1,this._updateForNPOT(f)),this.mipmaps=y,this.setImageData({data:n,width:v,height:B,depth:Q,format:a,type:b,dataFormat:m,border:s,mipmaps:y,parameters:d}),y&&this.generateMipmap(),this.setParameters(f),u&&(this.data=n),this}},{key:"resize",value:function(t){var e=t.height,n=t.width,r=t.mipmaps,i=void 0!==r&&r;return n!==this.width||e!==this.height?this.initialize({width:n,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(l.h.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(l.l)(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,n=void 0===e?this.target:e,r=t.pixels,i=void 0===r?null:r,o=t.level,a=void 0===o?0:o,A=t.format,s=void 0===A?this.format:A,c=t.border,g=void 0===c?this.border:c,h=t.offset,I=void 0===h?0:h,p=t.parameters,C=void 0===p?{}:p,y=t.data,v=void 0===y?null:y,B=t.type,m=void 0===B?this.type:B,b=t.width,E=void 0===b?this.width:b,Q=t.height,F=void 0===Q?this.height:Q,w=t.dataFormat,S=void 0===w?this.dataFormat:w,R=t.compressed,U=void 0!==R&&R;v||(v=i);var x=this._deduceParameters({format:s,type:m,dataFormat:S,compressed:U,data:v,width:E,height:F});m=x.type,S=x.dataFormat,U=x.compressed,E=x.width,F=x.height;var k=this.gl;k.bindTexture(this.target,this.handle);var O,N=this._getDataType({data:v,compressed:U});if(v=N.data,O=N.dataType,Object(l.l)(this.gl,C,(function(){switch(O){case"null":k.texImage2D(n,a,s,E,F,g,S,m,v);break;case"typed-array":k.texImage2D(n,a,s,E,F,g,S,m,v,I);break;case"buffer":Object(f.a)(k),k.bindBuffer(35052,v.handle||v),k.texImage2D(n,a,s,E,F,g,S,m,I),k.bindBuffer(35052,null);break;case"browser-object":Object(l.g)(k)?k.texImage2D(n,a,s,E,F,g,S,m,v):k.texImage2D(n,a,s,S,m,v);break;case"compressed":k.compressedTexImage2D(n,a,s,E,F,g,v);break;default:Object(d.a)(!1,"Unknown image data type")}})),v&&v.byteLength)this._trackAllocatedMemory(v.byteLength,"Texture");else{var D=u.a[this.dataFormat]||4,G=u.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*D*G,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,n=t.target,r=void 0===n?this.target:n,i=t.pixels,o=void 0===i?null:i,a=t.data,A=void 0===a?null:a,s=t.x,u=void 0===s?0:s,g=t.y,h=void 0===g?0:g,I=t.width,C=void 0===I?this.width:I,y=t.height,v=void 0===y?this.height:y,B=t.level,m=void 0===B?0:B,b=t.format,E=void 0===b?this.format:b,Q=t.type,F=void 0===Q?this.type:Q,w=t.dataFormat,S=void 0===w?this.dataFormat:w,R=t.compressed,U=void 0!==R&&R,x=t.offset,k=void 0===x?0:x,O=t.border,N=(void 0===O&&this.border,t.parameters),D=void 0===N?{}:N,G=this._deduceParameters({format:E,type:F,dataFormat:S,compressed:U,data:A,width:C,height:v});if(F=G.type,S=G.dataFormat,U=G.compressed,C=G.width,v=G.height,Object(d.a)(0===this.depth,"texSubImage not supported for 3D textures"),A||(A=o),A&&A.data){var _=A;A=_.data,C=_.shape[0],v=_.shape[1]}A instanceof c.a&&(A=A.handle),this.gl.bindTexture(this.target,this.handle),Object(l.l)(this.gl,D,(function(){U?e.gl.compressedTexSubImage2D(r,m,u,h,C,v,E,A):null===A?e.gl.texSubImage2D(r,m,u,h,C,v,S,F,null):ArrayBuffer.isView(A)?e.gl.texSubImage2D(r,m,u,h,C,v,S,F,A,k):A instanceof p?(Object(f.a)(e.gl),e.gl.bindBuffer(35052,A),e.gl.texSubImage2D(r,m,u,h,C,v,S,F,k),e.gl.bindBuffer(35052,null)):Object(l.g)(e.gl)?e.gl.texSubImage2D(r,m,u,h,C,v,S,F,A):e.gl.texSubImage2D(r,m,u,h,S,F,A)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return l.h.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,n=t.compressed;return void 0!==n&&n?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof c.a?{data:e.handle,dataType:"buffer"}:e instanceof p?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,n=t.data,r=t.width,i=t.height,o=t.dataFormat,a=t.type,A=t.compressed,s=u.b[e];o=o||s&&s.dataFormat,a=a||s&&s.types[0],A=A||s&&s.compressed;var c=this._deduceImageSize(n,r,i);return{dataFormat:o,type:a,compressed:A,width:r=c.width,height:i=c.height,format:e,data:n}}},{key:"_deduceImageSize",value:function(t,e,n){var r;return r="undefined"!==typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},Object(d.a)(r,"Could not deduced texture size"),Object(d.a)(void 0===e||r.width===e,"Deduced texture width does not match supplied width"),Object(d.a)(void 0===n||r.height===n,"Deduced texture height does not match supplied height"),r}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Object(d.a)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(l.g)(this.gl)&&(!(!this.width||!this.height)&&(!Object(h.b)(this.width)||!Object(h.b)(this.height)))}},{key:"_updateForNPOT",value:function(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===I.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}]),e}(s.a)},function(t,e,n){"use strict";function r(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function o(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}function a(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t[3]=e[3],t}function A(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return A}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return A}));var r=Symbol("thread.errors"),i=Symbol("thread.events"),o=Symbol("thread.terminate"),a=Symbol("thread.transferable"),A=Symbol("thread.worker")},function(t,e,n){"use strict";var r=n(6),i=n(210);var o=n(79);function a(t){var e="function"===typeof Map?new Map:void 0;return(a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return Object(o.a)(t,arguments,Object(r.a)(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Object(i.a)(a,t)})(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function r(t,e){"function"===typeof t?t(e):t&&(t.current=e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"loader assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(91);function i(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function o(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.a.debug&&!i(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var A={};function s(t,e){A[t]||(A[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69);e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(e.length>1&&r.isNumber(e[0])&&r.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.features;r<i.length;r++){var o=i[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}},e.getGeom=function(t){return"Feature"===t.type?t.geometry:t},e.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return A}));var r=[],i=[];function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=r,a={index:-1,data:t,target:[]};return t?"function"===typeof t[Symbol.iterator]?o=t:t.length>0&&(i.length=t.length,o=i):o=r,(e>0||Number.isFinite(n))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,n),a.index=e-1),{iterable:o,objectInfo:a}}function a(t){return t&&t[Symbol.asyncIterator]}function A(t,e){var n=e.size,r=e.stride,i=e.offset,o=e.startIndices,a=e.nested,A=t.BYTES_PER_ELEMENT,s=r?r/A:n,c=i?i/A:0,u=Math.floor((t.length-c)/s);return function(e,r){var i=r.index,A=r.target;if(!o){for(var l=i*s+c,g=0;g<n;g++)A[g]=t[l+g];return A}var f,h=o[i],d=o[i+1]||u;if(a){f=new Array(d-h);for(var I=h;I<d;I++){var p=I*s+c;A=new Array(n);for(var C=0;C<n;C++)A[C]=t[p+C];f[I-h]=A}}else if(s===n)f=t.subarray(h*n+c,d*n+c);else{f=new t.constructor((d-h)*n);for(var y=0,v=h;v<d;v++)for(var B=v*s+c,m=0;m<n;m++)f[y++]=t[B+m]}return f}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1);function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),i.forEach((function(e){Object(r.a)(t,e,n[e])}))}return t}},function(t,e,n){"use strict";(function(t){var r=n(49),i=n(459);n.d(e,"b",(function(){return i.a}));var o=n(450);n.d(e,"a",(function(){return o.a})),n.d(e,"c",(function(){return r.e}));var a={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(a.global||a.self||a.window).mathgl={config:r.a}}).call(this,n(56))},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";(function(t,r){n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return A}));var i=n(27),o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t,document:"undefined"!==typeof document&&document,process:"object"===("undefined"===typeof r?"undefined":Object(i.a)(r))&&r},a=o.window||o.self||o.global,A=o.process||{};console}).call(this,n(56),n(68))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(79),i=n(3),o=n(2),a=n(152),A=n(47),s=n(361),c={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},u={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},l=function(){function t(){var e=this;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return Object(o.a)(t,null,[{key:"getBytesPerElement",value:function(t){return Object(a.c)(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return Object(A.a)(t.size),Object(a.c)(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Object(r.a)(t,[c].concat(n))}}]),Object(o.a)(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=Object(s.a)("Accessor",t,u)).type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"===typeof index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}}]),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return g})),n.d(e,"h",(function(){return f})),n.d(e,"a",(function(){return h})),n.d(e,"g",(function(){return d}));var r=n(18),i=n(411),o=n.n(i),a=n(84),A=n.n(a);function s(t,e,n){t.key===e&&(t.preventDefault(),n())}function c(t){return o()({r:t[0],g:t[1],b:t[2]}).toHexString()}function u(t){var e=o()(t).toRgb();return[e.r,e.g,e.b]}function l(t){if(0===t)return"Color by hierarchy";if(t<=2){return"Color by ".concat("sub".repeat(t-1),"cluster")}return"Color by cluster level ".concat(t)}function g(t,e){return t.length<=e.length&&A()(t,e.slice(0,t.length))}function f(t,e,n){return g(t,e)?[].concat(Object(r.a)(n),Object(r.a)(e.slice(n.length))):e}var h="___";function d(t){return t.join(h)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ReactCSS=e.loop=e.handleActive=e.handleHover=e.hover=void 0;var r=c(n(1229)),i=c(n(1251)),o=c(n(1271)),a=c(n(1272)),A=c(n(1273)),s=c(n(1274));function c(t){return t&&t.__esModule?t:{default:t}}e.hover=a.default,e.handleHover=a.default,e.handleActive=A.default,e.loop=s.default;var u=e.ReactCSS=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),a=1;a<e;a++)n[a-1]=arguments[a];var A=(0,r.default)(n),s=(0,i.default)(t,A);return(0,o.default)(s)};e.default=u},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){"use strict";n.d(e,"g",(function(){return r})),n.d(e,"e",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return A})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return c}));var r=["z","time"],i="Min/Max",o={colormap:null,opacity:1,domainType:i,transparentColor:[0,0,0]},a={type:"molecules",opacity:1,radius:20,visible:!0},A={type:"cells",opacity:1,radius:50,visible:!0,stroked:!1},s={type:"neighborhoods",visible:!1},c=["molecules","cells","neighborhoods","raster"]},function(t,e,n){"use strict";n.d(e,"l",(function(){return E})),n.d(e,"i",(function(){return Q})),n.d(e,"d",(function(){return F})),n.d(e,"f",(function(){return w})),n.d(e,"e",(function(){return S})),n.d(e,"t",(function(){return R})),n.d(e,"q",(function(){return U})),n.d(e,"o",(function(){return x})),n.d(e,"g",(function(){return k})),n.d(e,"j",(function(){return N})),n.d(e,"k",(function(){return D})),n.d(e,"m",(function(){return G})),n.d(e,"h",(function(){return _})),n.d(e,"n",(function(){return T})),n.d(e,"r",(function(){return j})),n.d(e,"s",(function(){return L})),n.d(e,"a",(function(){return V})),n.d(e,"p",(function(){return Z})),n.d(e,"u",(function(){return P})),n.d(e,"c",(function(){return W})),n.d(e,"b",(function(){return J}));var r=n(12),i=n(26),o=n(18),a=n(331),A=n.n(a),s=n(481),c=n.n(s),u=n(84),l=n.n(u),g=n(308),f=n.n(g),h=n(69),d=n(551),I=n.n(d),p=n(394),C=n.n(p),y=n(85),v=n(75),B=n(116);function m(t){return t.children?t.children.flatMap((function(t){return m(t)})):t.set||[]}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.children)return e;var n=e+1,r=t.children.map((function(t){return b(t,n)}));return Math.max.apply(Math,Object(o.a)(r).concat([n]))}function E(t,e){var n=t.tree.map((function(t){return function t(e,n,r){var i=n[r];if(e.name===i){if(r===n.length-1)return e;if(e.children){var o=e.children.map((function(e){return t(e,n,r+1)})).filter(Boolean);if(1===o.length)return o[0]}}return null}(t,e,0)})).filter(Boolean);return 1===n.length?n[0]:null}function Q(t,e,n,r,a){var A;return A=a?Object(o.a)(a):[t.name],e(t,A)?(r.push(A),n(t,A)):t.children?Object(i.a)({},t,{children:t.children.map((function(t){return Q(t,e,n,r,A.concat([t.name]))}))}):t}function F(t,e){return Object(i.a)({},t,{children:[].concat(Object(o.a)(t.children),[e])})}function w(t,e){return Object(i.a)({},t,{children:[e].concat(Object(o.a)(t.children))})}function S(t,e,n){var r=Array.from(t.children);return r.splice(n,0,e),Object(i.a)({},t,{children:r})}function R(t,e){var n=e.map((function(e){return E(t,e)})).map((function(t){return m(t).map((function(t){return Object(r.a)(t,1)[0]}))}));return n.reduce((function(t,e){return t.concat(e.filter((function(e){return!t.includes(e)})))}),n[0]||[])}function U(t,e){var n=e.map((function(e){return E(t,e)})).map((function(t){return m(t).map((function(t){return Object(r.a)(t,1)[0]}))}));return n.reduce((function(t,e){return e.filter((function(e){return t.includes(e)}))}),n[0]||[])}function x(t,e,n){var r=R(t,e);return n.filter((function(t){return!r.includes(t)}))}function k(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.children?0===e?[[].concat(Object(o.a)(n),[t.name])]:t.children.flatMap((function(i){return k(i,e-1,[].concat(Object(o.a)(n),[t.name]),r)})).filter(Boolean):r?[[].concat(Object(o.a)(n),[t.name])]:null}function O(t,e){return{version:y.c[e].latestVersion,datatype:e,tree:t.tree}}function N(t,e,n,r){var a=E(t,e),A=function t(e,n,r,a,A){var s;s=A?Object(o.a)(A):[e.name];var c=e;return n(e,s)&&(a.push(s),c=r(e,s)),e.children?Object(i.a)({},c,{children:c.children.map((function(e){return t(e,n,r,a,s.concat([e.name]))}))}):c}(a,(function(){return!0}),(function(t,e){var n,o,a=null!==(n=null===r||void 0===r||null===(o=r.find((function(t){return l()(t.path,e)})))||void 0===o?void 0:o.color)&&void 0!==n?n:v.b;return Object(i.a)({},t,{color:a.slice(0,3)})}),[]);return{treeToExport:O(Object(i.a)({},t,{tree:[A]}),n),nodeName:a.name}}function D(t,e){var n=E(t,e);return{setToExport:m(n),nodeName:n.name}}function G(t){return{version:y.c[t].latestVersion,datatype:t,tree:[]}}function _(t,e,n){var r,i=e.length-1;return{title:t.name,nodeKey:Object(B.g)(e),path:e,size:m(t).length,color:null===n||void 0===n||null===(r=n.find((function(t){return l()(t.path,e)})))||void 0===r?void 0:r.color,level:i,isLeaf:(!t.children||0===t.children.length)&&Boolean(t.set),height:b(t)}}function M(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[128,128,128];return[(t[0]-n[0])*e+n[0],(t[1]-n[1])*e+n[1],(t[2]-n[2])*e+n[2]]}function T(t,e,n){var i=[];return e.forEach((function(e){var a=E(t,e);if(a){var A,s=m(a),u=(null===n||void 0===n||null===(A=n.find((function(t){return l()(t.path,e)})))||void 0===A?void 0:A.color)||v.b;i=[].concat(Object(o.a)(i),Object(o.a)(s.map((function(t){var e=Object(r.a)(t,2),n=e[0],i=e[1];return[n,c()(i)?u:M(u,i)]}))))}})),new Map(i)}function j(t,e,n){var i=[];return e.forEach((function(e){var a=E(t,e);if(a){var A,s=m(a),c=(null===n||void 0===n||null===(A=n.find((function(t){return l()(t.path,e)})))||void 0===A?void 0:A.color)||v.b;i=[].concat(Object(o.a)(i),Object(o.a)(s.map((function(t){return{obsId:Object(r.a)(t,1)[0],name:a.name,color:c}}))))}})),i}function L(t,e,n){var r=[];return e.forEach((function(e){var i=E(t,e);if(i){var o,a=m(i),s=(null===(o=n.find((function(t){return l()(t.path,e)})))||void 0===o?void 0:o.color)||v.b;r.push({key:A()(),name:i.name,size:a.length,color:s})}})),r}function V(t,e,n){return l()([].concat(Object(o.a)(e),[t.name]),n)?null:t.children?Object(i.a)({},t,{children:t.children.map((function(r){return V(r,[].concat(Object(o.a)(e),[t.name]),n)})).filter(Boolean)}):t}function Z(t,e){var n=null;return t&&t.tree.forEach((function(t){var r=[t.name],i=b(t);f()(i).forEach((function(i){var o=i+1,a=k(t,o,[],!0);l()(a,e)&&(n={levelZeroPath:r,levelIndex:o})}))})),n}function P(t,e){var n=[],r=[],i=!1;function a(t,e){n.push([].concat(Object(o.a)(e),[t.name])),t.children&&t.children.forEach((function(n){return a(n,[].concat(Object(o.a)(e),[t.name]))}))}return t.tree.forEach((function(t){return a(t,[])})),e.tree.forEach((function(t){return e=t,n=[],r.push([].concat(Object(o.a)(n),[e.name])),void(e.children&&e.children.forEach((function(t){return a(t,[].concat(Object(o.a)(n),[e.name]))})));var e,n})),r.forEach((function(t){n.find((function(e){return l()(e,t)}))&&(i=!0)})),i}function W(t,e){var n=Object(o.a)(e||[]),r=t.tree.map((function(t){return Array.from({length:b(t)+1}).fill(0)}));return t.tree.forEach((function(t,e){return function t(e,i,a,A){var s=r[A][a],c=[].concat(Object(o.a)(i),[e.name]);n.find((function(t){return l()(t.path,c)}))||n.push({path:c,color:v.d[s%v.d.length]}),r[A][a]+=1,e.children&&e.children.forEach((function(e){return t(e,c,a+1,A)}))}(t,[],0,e)})),n}function J(t){var e=t.cells,n=t.mapping,i=t.cellSets,o=t.cellSetSelection,a=t.cellSetColor;return o&&o.length>0&&i&&e?function(t,e,n,i,o){var a=[];return i.forEach((function(i){var A=E(t,i);if(A){var s,c=m(A),u=(null===o||void 0===o||null===(s=o.find((function(t){return l()(t.path,i)})))||void 0===s?void 0:s.color)||v.b,g=c.map((function(t){var i,o,a=Object(r.a)(t,1)[0];return[null===(i=e[a])||void 0===i?void 0:i.mappings[n][0],-(null===(o=e[a])||void 0===o?void 0:o.mappings[n][1])]})).filter(Boolean);if(g.length>2){var f=Object(h.featureCollection)(g.map(h.point)),d=I()(f);if(d){var p=d.geometry.coordinates,y=C()(f).geometry.coordinates;a.push({path:i,name:i[i.length-1],hull:p,color:u,centroid:y})}}}})),a}(i,e,n,o,a):[]}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(3),i=n(2),o=function(){function t(e){Object(r.a)(this,t),this._pool=[],this.props={overAlloc:2,poolSize:100},this.setProps(e)}return Object(i.a)(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"allocate",value:function(t,e,n){var r,i=n.size,o=void 0===i?1:i,a=n.type,A=n.padding,s=void 0===A?0:A,c=n.copy,u=void 0!==c&&c,l=n.initialize,g=void 0!==l&&l,f=n.maxCount,h=a||t&&t.constructor||Float32Array,d=e*o+s;if(ArrayBuffer.isView(t)){if(d<=t.length)return t;if(d*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new h(t.buffer,0,d)}f&&(r=f*o+s);var I=this._allocate(h,d,g,r);return t&&u?I.set(t):g||I.fill(0,0,4),this._release(t),I}},{key:"release",value:function(t){this._release(t)}},{key:"_allocate",value:function(t,e,n,r){var i=Math.max(Math.ceil(e*this.props.overAlloc),1);i>r&&(i=r);var o=this._pool,a=t.BYTES_PER_ELEMENT*i,A=o.findIndex((function(t){return t.byteLength>=a}));if(A>=0){var s=new t(o.splice(A,1)[0],0,i);return n&&s.fill(0),s}return new t(i)}},{key:"_release",value:function(t){if(ArrayBuffer.isView(t)){var e=this._pool,n=t.buffer,r=n.byteLength,i=e.findIndex((function(t){return t.byteLength>=r}));i<0?e.push(n):(i>0||e.length<this.props.poolSize)&&e.splice(i,0,n),e.length>this.props.poolSize&&e.shift()}}}]),t}();e.a=new o},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(55);function i(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function o(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.a.debug&&!i(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var A={};function s(t,e){A[t]||(A[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return d})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return C})),n.d(e,"d",(function(){return v}));var r,i,o,a=n(17),A=n(23),s=n(1),c=n(41),u=(r={},Object(s.a)(r,3042,!1),Object(s.a)(r,32773,new Float32Array([0,0,0,0])),Object(s.a)(r,32777,32774),Object(s.a)(r,34877,32774),Object(s.a)(r,32969,1),Object(s.a)(r,32968,0),Object(s.a)(r,32971,1),Object(s.a)(r,32970,0),Object(s.a)(r,3106,new Float32Array([0,0,0,0])),Object(s.a)(r,3107,[!0,!0,!0,!0]),Object(s.a)(r,2884,!1),Object(s.a)(r,2885,1029),Object(s.a)(r,2929,!1),Object(s.a)(r,2931,1),Object(s.a)(r,2932,513),Object(s.a)(r,2928,new Float32Array([0,1])),Object(s.a)(r,2930,!0),Object(s.a)(r,3024,!0),Object(s.a)(r,36006,null),Object(s.a)(r,2886,2305),Object(s.a)(r,33170,4352),Object(s.a)(r,2849,1),Object(s.a)(r,32823,!1),Object(s.a)(r,32824,0),Object(s.a)(r,10752,0),Object(s.a)(r,32938,1),Object(s.a)(r,32939,!1),Object(s.a)(r,3089,!1),Object(s.a)(r,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(r,2960,!1),Object(s.a)(r,2961,0),Object(s.a)(r,2968,4294967295),Object(s.a)(r,36005,4294967295),Object(s.a)(r,2962,519),Object(s.a)(r,2967,0),Object(s.a)(r,2963,4294967295),Object(s.a)(r,34816,519),Object(s.a)(r,36003,0),Object(s.a)(r,36004,4294967295),Object(s.a)(r,2964,7680),Object(s.a)(r,2965,7680),Object(s.a)(r,2966,7680),Object(s.a)(r,34817,7680),Object(s.a)(r,34818,7680),Object(s.a)(r,34819,7680),Object(s.a)(r,2978,[0,0,1024,1024]),Object(s.a)(r,3333,4),Object(s.a)(r,3317,4),Object(s.a)(r,37440,!1),Object(s.a)(r,37441,!1),Object(s.a)(r,37443,37444),Object(s.a)(r,35723,4352),Object(s.a)(r,36010,null),Object(s.a)(r,35977,!1),Object(s.a)(r,3330,0),Object(s.a)(r,3332,0),Object(s.a)(r,3331,0),Object(s.a)(r,3314,0),Object(s.a)(r,32878,0),Object(s.a)(r,3316,0),Object(s.a)(r,3315,0),Object(s.a)(r,32877,0),r),l=function(t,e,n){return e?t.enable(n):t.disable(n)},g=function(t,e,n){return t.hint(n,e)},f=function(t,e,n){return t.pixelStorei(n,e)};function h(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var d=(i={},Object(s.a)(i,3042,l),Object(s.a)(i,32773,(function(t,e){return t.blendColor.apply(t,Object(A.a)(e))})),Object(s.a)(i,32777,"blendEquation"),Object(s.a)(i,34877,"blendEquation"),Object(s.a)(i,32969,"blendFunc"),Object(s.a)(i,32968,"blendFunc"),Object(s.a)(i,32971,"blendFunc"),Object(s.a)(i,32970,"blendFunc"),Object(s.a)(i,3106,(function(t,e){return t.clearColor.apply(t,Object(A.a)(e))})),Object(s.a)(i,3107,(function(t,e){return t.colorMask.apply(t,Object(A.a)(e))})),Object(s.a)(i,2884,l),Object(s.a)(i,2885,(function(t,e){return t.cullFace(e)})),Object(s.a)(i,2929,l),Object(s.a)(i,2931,(function(t,e){return t.clearDepth(e)})),Object(s.a)(i,2932,(function(t,e){return t.depthFunc(e)})),Object(s.a)(i,2928,(function(t,e){return t.depthRange.apply(t,Object(A.a)(e))})),Object(s.a)(i,2930,(function(t,e){return t.depthMask(e)})),Object(s.a)(i,3024,l),Object(s.a)(i,35723,g),Object(s.a)(i,36006,(function(t,e){var n=Object(c.h)(t)?36009:36160;return t.bindFramebuffer(n,e)})),Object(s.a)(i,2886,(function(t,e){return t.frontFace(e)})),Object(s.a)(i,33170,g),Object(s.a)(i,2849,(function(t,e){return t.lineWidth(e)})),Object(s.a)(i,32823,l),Object(s.a)(i,32824,"polygonOffset"),Object(s.a)(i,10752,"polygonOffset"),Object(s.a)(i,35977,l),Object(s.a)(i,32938,"sampleCoverage"),Object(s.a)(i,32939,"sampleCoverage"),Object(s.a)(i,3089,l),Object(s.a)(i,3088,(function(t,e){return t.scissor.apply(t,Object(A.a)(e))})),Object(s.a)(i,2960,l),Object(s.a)(i,2961,(function(t,e){return t.clearStencil(e)})),Object(s.a)(i,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),Object(s.a)(i,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),Object(s.a)(i,2962,"stencilFuncFront"),Object(s.a)(i,2967,"stencilFuncFront"),Object(s.a)(i,2963,"stencilFuncFront"),Object(s.a)(i,34816,"stencilFuncBack"),Object(s.a)(i,36003,"stencilFuncBack"),Object(s.a)(i,36004,"stencilFuncBack"),Object(s.a)(i,2964,"stencilOpFront"),Object(s.a)(i,2965,"stencilOpFront"),Object(s.a)(i,2966,"stencilOpFront"),Object(s.a)(i,34817,"stencilOpBack"),Object(s.a)(i,34818,"stencilOpBack"),Object(s.a)(i,34819,"stencilOpBack"),Object(s.a)(i,2978,(function(t,e){return t.viewport.apply(t,Object(A.a)(e))})),Object(s.a)(i,3333,f),Object(s.a)(i,3317,f),Object(s.a)(i,37440,f),Object(s.a)(i,37441,f),Object(s.a)(i,37443,f),Object(s.a)(i,3330,f),Object(s.a)(i,3332,f),Object(s.a)(i,3331,f),Object(s.a)(i,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),Object(s.a)(i,3314,f),Object(s.a)(i,32878,f),Object(s.a)(i,3316,f),Object(s.a)(i,3315,f),Object(s.a)(i,32877,f),Object(s.a)(i,"framebuffer",(function(t,e){var n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)})),Object(s.a)(i,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),Object(s.a)(i,"blendColor",(function(t,e){return t.blendColor.apply(t,Object(A.a)(e))})),Object(s.a)(i,"blendEquation",(function(t,e){e=h(e)?e:[e,e],t.blendEquationSeparate.apply(t,Object(A.a)(e))})),Object(s.a)(i,"blendFunc",(function(t,e){e=h(e)&&2===e.length?[].concat(Object(A.a)(e),Object(A.a)(e)):e,t.blendFuncSeparate.apply(t,Object(A.a)(e))})),Object(s.a)(i,"clearColor",(function(t,e){return t.clearColor.apply(t,Object(A.a)(e))})),Object(s.a)(i,"clearDepth",(function(t,e){return t.clearDepth(e)})),Object(s.a)(i,"clearStencil",(function(t,e){return t.clearStencil(e)})),Object(s.a)(i,"colorMask",(function(t,e){return t.colorMask.apply(t,Object(A.a)(e))})),Object(s.a)(i,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),Object(s.a)(i,"cullFace",(function(t,e){return t.cullFace(e)})),Object(s.a)(i,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),Object(s.a)(i,"depthFunc",(function(t,e){return t.depthFunc(e)})),Object(s.a)(i,"depthMask",(function(t,e){return t.depthMask(e)})),Object(s.a)(i,"depthRange",(function(t,e){return t.depthRange.apply(t,Object(A.a)(e))})),Object(s.a)(i,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),Object(s.a)(i,"derivativeHint",(function(t,e){t.hint(35723,e)})),Object(s.a)(i,"frontFace",(function(t,e){return t.frontFace(e)})),Object(s.a)(i,"mipmapHint",(function(t,e){return t.hint(33170,e)})),Object(s.a)(i,"lineWidth",(function(t,e){return t.lineWidth(e)})),Object(s.a)(i,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),Object(s.a)(i,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,Object(A.a)(e))})),Object(s.a)(i,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,Object(A.a)(e))})),Object(s.a)(i,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),Object(s.a)(i,"scissor",(function(t,e){return t.scissor.apply(t,Object(A.a)(e))})),Object(s.a)(i,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),Object(s.a)(i,"stencilMask",(function(t,e){var n=e=h(e)?e:[e,e],r=Object(a.a)(n,2),i=r[0],o=r[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,o)})),Object(s.a)(i,"stencilFunc",(function(t,e){var n=e=h(e)&&3===e.length?[].concat(Object(A.a)(e),Object(A.a)(e)):e,r=Object(a.a)(n,6),i=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5];t.stencilFuncSeparate(1028,i,o,s),t.stencilFuncSeparate(1029,c,u,l)})),Object(s.a)(i,"stencilOp",(function(t,e){var n=e=h(e)&&3===e.length?[].concat(Object(A.a)(e),Object(A.a)(e)):e,r=Object(a.a)(n,6),i=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5];t.stencilOpSeparate(1028,i,o,s),t.stencilOpSeparate(1029,c,u,l)})),Object(s.a)(i,"viewport",(function(t,e){return t.viewport.apply(t,Object(A.a)(e))})),i);function I(t,e,n){return void 0!==e[t]?e[t]:n[t]}var p={blendEquation:function(t,e,n){return t.blendEquationSeparate(I(32777,e,n),I(34877,e,n))},blendFunc:function(t,e,n){return t.blendFuncSeparate(I(32969,e,n),I(32968,e,n),I(32971,e,n),I(32970,e,n))},polygonOffset:function(t,e,n){return t.polygonOffset(I(32824,e,n),I(10752,e,n))},sampleCoverage:function(t,e,n){return t.sampleCoverage(I(32938,e,n),I(32939,e,n))},stencilFuncFront:function(t,e,n){return t.stencilFuncSeparate(1028,I(2962,e,n),I(2967,e,n),I(2963,e,n))},stencilFuncBack:function(t,e,n){return t.stencilFuncSeparate(1029,I(34816,e,n),I(36003,e,n),I(36004,e,n))},stencilOpFront:function(t,e,n){return t.stencilOpSeparate(1028,I(2964,e,n),I(2965,e,n),I(2966,e,n))},stencilOpBack:function(t,e,n){return t.stencilOpSeparate(1029,I(34817,e,n),I(34818,e,n),I(34819,e,n))}},C={enable:function(t,e){return t(Object(s.a)({},e,!0))},disable:function(t,e){return t(Object(s.a)({},e,!1))},pixelStorei:function(t,e,n){return t(Object(s.a)({},e,n))},hint:function(t,e,n){return t(Object(s.a)({},e,n))},bindFramebuffer:function(t,e,n){var r;switch(e){case 36160:return t((r={},Object(s.a)(r,36006,n),Object(s.a)(r,36010,n),r));case 36009:return t(Object(s.a)({},36006,n));case 36008:return t(Object(s.a)({},36010,n));default:return null}},blendColor:function(t,e,n,r,i){return t(Object(s.a)({},32773,new Float32Array([e,n,r,i])))},blendEquation:function(t,e){var n;return t((n={},Object(s.a)(n,32777,e),Object(s.a)(n,34877,e),n))},blendEquationSeparate:function(t,e,n){var r;return t((r={},Object(s.a)(r,32777,e),Object(s.a)(r,34877,n),r))},blendFunc:function(t,e,n){var r;return t((r={},Object(s.a)(r,32969,e),Object(s.a)(r,32968,n),Object(s.a)(r,32971,e),Object(s.a)(r,32970,n),r))},blendFuncSeparate:function(t,e,n,r,i){var o;return t((o={},Object(s.a)(o,32969,e),Object(s.a)(o,32968,n),Object(s.a)(o,32971,r),Object(s.a)(o,32970,i),o))},clearColor:function(t,e,n,r,i){return t(Object(s.a)({},3106,new Float32Array([e,n,r,i])))},clearDepth:function(t,e){return t(Object(s.a)({},2931,e))},clearStencil:function(t,e){return t(Object(s.a)({},2961,e))},colorMask:function(t,e,n,r,i){return t(Object(s.a)({},3107,[e,n,r,i]))},cullFace:function(t,e){return t(Object(s.a)({},2885,e))},depthFunc:function(t,e){return t(Object(s.a)({},2932,e))},depthRange:function(t,e,n){return t(Object(s.a)({},2928,new Float32Array([e,n])))},depthMask:function(t,e){return t(Object(s.a)({},2930,e))},frontFace:function(t,e){return t(Object(s.a)({},2886,e))},lineWidth:function(t,e){return t(Object(s.a)({},2849,e))},polygonOffset:function(t,e,n){var r;return t((r={},Object(s.a)(r,32824,e),Object(s.a)(r,10752,n),r))},sampleCoverage:function(t,e,n){var r;return t((r={},Object(s.a)(r,32938,e),Object(s.a)(r,32939,n),r))},scissor:function(t,e,n,r,i){return t(Object(s.a)({},3088,new Int32Array([e,n,r,i])))},stencilMask:function(t,e){var n;return t((n={},Object(s.a)(n,2968,e),Object(s.a)(n,36005,e),n))},stencilMaskSeparate:function(t,e,n){return t(Object(s.a)({},1028===e?2968:36005,n))},stencilFunc:function(t,e,n,r){var i;return t((i={},Object(s.a)(i,2962,e),Object(s.a)(i,2967,n),Object(s.a)(i,2963,r),Object(s.a)(i,34816,e),Object(s.a)(i,36003,n),Object(s.a)(i,36004,r),i))},stencilFuncSeparate:function(t,e,n,r,i){var o;return t((o={},Object(s.a)(o,1028===e?2962:34816,n),Object(s.a)(o,1028===e?2967:36003,r),Object(s.a)(o,1028===e?2963:36004,i),o))},stencilOp:function(t,e,n,r){var i;return t((i={},Object(s.a)(i,2964,e),Object(s.a)(i,2965,n),Object(s.a)(i,2966,r),Object(s.a)(i,34817,e),Object(s.a)(i,34818,n),Object(s.a)(i,34819,r),i))},stencilOpSeparate:function(t,e,n,r,i){var o;return t((o={},Object(s.a)(o,1028===e?2964:34817,n),Object(s.a)(o,1028===e?2965:34818,r),Object(s.a)(o,1028===e?2966:34819,i),o))},viewport:function(t,e,n,r,i){return t(Object(s.a)({},2978,[e,n,r,i]))}},y=function(t,e){return t.isEnabled(e)},v=(o={},Object(s.a)(o,3042,y),Object(s.a)(o,2884,y),Object(s.a)(o,2929,y),Object(s.a)(o,3024,y),Object(s.a)(o,32823,y),Object(s.a)(o,32926,y),Object(s.a)(o,32928,y),Object(s.a)(o,3089,y),Object(s.a)(o,2960,y),Object(s.a)(o,35977,y),o)},function(t,e,n){"use strict";(function(t,r,i){n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return P})),n.d(e,"c",(function(){return er})),n.d(e,"d",(function(){return M})),n.d(e,"e",(function(){return nr})),n.d(e,"f",(function(){return W}));var o=n(21),a=n(129),A=n(12),s=n(18),c=n(14),u=n(5),l=n.n(u),g=n(15),f=n(11),h=n(61),d=n(24),I=n(25),p=n(78),C=l.a.mark(nt);function y(t){return new Proxy(t,{set:function(t,e,n,r){return t.setItem(e,n)},get:function(t,e,n){return t.getItem(e)},deleteProperty:function(t,e){return t.deleteItem(e)},has:function(t,e){return t.containsItem(e)}})}function v(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(e){o(e)}}function A(t){try{s(r.throw(t))}catch(e){o(e)}}function s(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,A)}s((r=r.apply(t,e||[])).next())}))}var B="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{};function m(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function b(t,e){return t(e={exports:{}},e.exports),e.exports}var E=b((function(t,e){var n=B&&B.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var r=t.call(this,n)||this;return r.path=e,r}return n(e,t),e}(Error);e.VError=r;var i=function(){function t(){}return t.prototype.fail=function(t,e,n){return!1},t.prototype.unionResolver=function(){return this},t.prototype.createContext=function(){return this},t.prototype.resolveUnion=function(t){},t}();e.NoopContext=i;var o=function(){function t(){this._propNames=[""],this._messages=[null],this._score=0}return t.prototype.fail=function(t,e,n){return this._propNames.push(t),this._messages.push(e),this._score+=n,!1},t.prototype.unionResolver=function(){return new a},t.prototype.resolveUnion=function(t){for(var e,n,r=null,i=0,o=t.contexts;i<o.length;i++){var a=o[i];(!r||a._score>=r._score)&&(r=a)}r&&r._score>0&&((e=this._propNames).push.apply(e,r._propNames),(n=this._messages).push.apply(n,r._messages))},t.prototype.getError=function(t){for(var e=[],n=this._propNames.length-1;n>=0;n--){var i=this._propNames[n];t+="number"===typeof i?"["+i+"]":i?"."+i:"";var o=this._messages[n];o&&e.push(t+" "+o)}return new r(t,e.join("; "))},t.prototype.getErrorDetail=function(t){for(var e=[],n=this._propNames.length-1;n>=0;n--){var r=this._propNames[n];t+="number"===typeof r?"["+r+"]":r?"."+r:"";var i=this._messages[n];i&&e.push({path:t,message:i})}var o=null;for(n=e.length-1;n>=0;n--)o&&(e[n].nested=[o]),o=e[n];return o},t}();e.DetailContext=o;var a=function(){function t(){this.contexts=[]}return t.prototype.createContext=function(){var t=new o;return this.contexts.push(t),t},t}()}));m(E);E.VError,E.NoopContext,E.DetailContext;var Q=b((function(t,e){var n=B&&B.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=function(){};function o(t){return"string"===typeof t?A(t):t}function a(t,e){var n=t[e];if(!n)throw new Error("Unknown type "+e);return n}function A(t){return new s(t)}e.TType=i,e.name=A;var s=function(t){function e(e){var n=t.call(this)||this;return n.name=e,n._failMsg="is not a "+e,n}return n(e,t),e.prototype.getChecker=function(t,n){var r=this,i=a(t,this.name),o=i.getChecker(t,n);return i instanceof b||i instanceof e?o:function(t,e){return!!o(t,e)||e.fail(null,r._failMsg,0)}},e}(i);e.TName=s,e.lit=function(t){return new c(t)};var c=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n.name=JSON.stringify(e),n._failMsg="is not "+n.name,n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this;return function(t,e){return t===n.value||e.fail(null,n._failMsg,-1)}},e}(i);e.TLiteral=c,e.array=function(t){return new u(o(t))};var u=function(t){function e(e){var n=t.call(this)||this;return n.ttype=e,n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this.ttype.getChecker(t,e);return function(t,e){if(!Array.isArray(t))return e.fail(null,"is not an array",0);for(var r=0;r<t.length;r++){if(!n(t[r],e))return e.fail(r,null,1)}return!0}},e}(i);e.TArray=u,e.tuple=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new l(t.map((function(t){return o(t)})))};var l=function(t){function e(e){var n=t.call(this)||this;return n.ttypes=e,n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this.ttypes.map((function(n){return n.getChecker(t,e)})),r=function(t,e){if(!Array.isArray(t))return e.fail(null,"is not an array",0);for(var r=0;r<n.length;r++){if(!n[r](t[r],e))return e.fail(r,null,1)}return!0};return e?function(t,e){return!!r(t,e)&&(t.length<=n.length||e.fail(n.length,"is extraneous",2))}:r},e}(i);e.TTuple=l,e.union=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new g(t.map((function(t){return o(t)})))};var g=function(t){function e(e){var n=t.call(this)||this;n.ttypes=e;var r=e.map((function(t){return t instanceof s||t instanceof c?t.name:null})).filter((function(t){return t})),i=e.length-r.length;return r.length?(i>0&&r.push(i+" more"),n._failMsg="is none of "+r.join(", ")):n._failMsg="is none of "+i+" types",n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this,r=this.ttypes.map((function(n){return n.getChecker(t,e)}));return function(t,e){for(var i=e.unionResolver(),o=0;o<r.length;o++){if(r[o](t,i.createContext()))return!0}return e.resolveUnion(i),e.fail(null,n._failMsg,0)}},e}(i);e.TUnion=g,e.enumtype=function(t){return new f(t)};var f=function(t){function e(e){var n=t.call(this)||this;return n.members=e,n.validValues=new Set,n._failMsg="is not a valid enum value",n.validValues=new Set(Object.keys(e).map((function(t){return e[t]}))),n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this;return function(t,e){return!!n.validValues.has(t)||e.fail(null,n._failMsg,0)}},e}(i);e.TEnumType=f,e.enumlit=function(t,e){return new h(t,e)};var h=function(t){function e(e,n){var r=t.call(this)||this;return r.enumName=e,r.prop=n,r._failMsg="is not "+e+"."+n,r}return n(e,t),e.prototype.getChecker=function(t,e){var n=this,r=a(t,this.enumName);if(!(r instanceof f))throw new Error("Type "+this.enumName+" used in enumlit is not an enum type");var i=r.members[this.prop];if(!r.members.hasOwnProperty(this.prop))throw new Error("Unknown value "+this.enumName+"."+this.prop+" used in enumlit");return function(t,e){return t===i||e.fail(null,n._failMsg,-1)}},e}(i);function d(t){return Object.keys(t).map((function(e){return function(t,e){return e instanceof p?new C(t,e.ttype,!0):new C(t,o(e),!1)}(e,t[e])}))}e.TEnumLiteral=h,e.iface=function(t,e){return new I(t,d(e))};var I=function(t){function e(e,n){var r=t.call(this)||this;return r.bases=e,r.props=n,r.propSet=new Set(n.map((function(t){return t.name}))),r}return n(e,t),e.prototype.getChecker=function(t,e){var n=this,r=this.bases.map((function(n){return a(t,n).getChecker(t,e)})),i=this.props.map((function(n){return n.ttype.getChecker(t,e)})),o=new E.NoopContext,A=this.props.map((function(t,e){return!t.isOpt&&!i[e](void 0,o)})),s=function(t,e){if("object"!==typeof t||null===t)return e.fail(null,"is not an object",0);for(var o=0;o<r.length;o++)if(!r[o](t,e))return!1;for(o=0;o<i.length;o++){var a=n.props[o].name,s=t[a];if(void 0===s){if(A[o])return e.fail(a,"is missing",1)}else if(!i[o](s,e))return e.fail(a,null,1)}return!0};return e?function(t,e){if(!s(t,e))return!1;for(var r in t)if(!n.propSet.has(r))return e.fail(r,"is extraneous",2);return!0}:s},e}(i);e.TIface=I,e.opt=function(t){return new p(o(t))};var p=function(t){function e(e){var n=t.call(this)||this;return n.ttype=e,n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this.ttype.getChecker(t,e);return function(t,e){return void 0===t||n(t,e)}},e}(i);e.TOptional=p;var C=function(t,e,n){this.name=t,this.ttype=e,this.isOpt=n};e.TProp=C,e.func=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new y(new m(e),o(t))};var y=function(t){function e(e,n){var r=t.call(this)||this;return r.paramList=e,r.result=n,r}return n(e,t),e.prototype.getChecker=function(t,e){return function(t,e){return"function"===typeof t||e.fail(null,"is not a function",0)}},e}(i);e.TFunc=y,e.param=function(t,e,n){return new v(t,o(e),Boolean(n))};var v=function(t,e,n){this.name=t,this.ttype=e,this.isOpt=n};e.TParam=v;var m=function(t){function e(e){var n=t.call(this)||this;return n.params=e,n}return n(e,t),e.prototype.getChecker=function(t,e){var n=this,r=this.params.map((function(n){return n.ttype.getChecker(t,e)})),i=new E.NoopContext,o=this.params.map((function(t,e){return!t.isOpt&&!r[e](void 0,i)})),a=function(t,e){if(!Array.isArray(t))return e.fail(null,"is not an array",0);for(var i=0;i<r.length;i++){var a=n.params[i];if(void 0===t[i]){if(o[i])return e.fail(a.name,"is missing",1)}else if(!r[i](t[i],e))return e.fail(a.name,null,1)}return!0};return e?function(t,e){return!!a(t,e)&&(t.length<=r.length||e.fail(r.length,"is extraneous",2))}:a},e}(i);e.TParamList=m;var b=function(t){function e(e,n){var r=t.call(this)||this;return r.validator=e,r.message=n,r}return n(e,t),e.prototype.getChecker=function(t,e){var n=this;return function(t,e){return!!n.validator(t)||e.fail(null,n.message,0)}},e}(i);e.BasicType=b,e.basicTypes={any:new b((function(t){return!0}),"is invalid"),number:new b((function(t){return"number"===typeof t}),"is not a number"),object:new b((function(t){return"object"===typeof t&&t}),"is not an object"),boolean:new b((function(t){return"boolean"===typeof t}),"is not a boolean"),string:new b((function(t){return"string"===typeof t}),"is not a string"),symbol:new b((function(t){return"symbol"===typeof t}),"is not a symbol"),void:new b((function(t){return null==t}),"is not void"),undefined:new b((function(t){return void 0===t}),"is not undefined"),null:new b((function(t){return null===t}),"is not null"),never:new b((function(t){return!1}),"is unexpected"),Date:new b(F("[object Date]"),"is not a Date"),RegExp:new b(F("[object RegExp]"),"is not a RegExp")};var Q=Object.prototype.toString;function F(t){return function(e){return"object"===typeof e&&e&&Q.call(e)===t}}"undefined"!==typeof r&&(e.basicTypes.Buffer=new b((function(t){return r.isBuffer(t)}),"is not a Buffer"));for(var w=function(t){e.basicTypes[t.name]=new b((function(e){return e instanceof t}),"is not a "+t.name)},S=0,R=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];S<R.length;S++){w(R[S])}}));m(Q);Q.TType,Q.name,Q.TName,Q.lit,Q.TLiteral,Q.array,Q.TArray,Q.tuple,Q.TTuple,Q.union,Q.TUnion,Q.enumtype,Q.TEnumType,Q.enumlit,Q.TEnumLiteral,Q.iface,Q.TIface,Q.opt,Q.TOptional,Q.TProp,Q.func,Q.TFunc,Q.param,Q.TParam,Q.TParamList,Q.BasicType,Q.basicTypes;var F=b((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Q;e.TArray=n.TArray,e.TEnumType=n.TEnumType,e.TEnumLiteral=n.TEnumLiteral,e.TFunc=n.TFunc,e.TIface=n.TIface,e.TLiteral=n.TLiteral,e.TName=n.TName,e.TOptional=n.TOptional,e.TParam=n.TParam,e.TParamList=n.TParamList,e.TProp=n.TProp,e.TTuple=n.TTuple,e.TType=n.TType,e.TUnion=n.TUnion,e.array=n.array,e.enumlit=n.enumlit,e.enumtype=n.enumtype,e.func=n.func,e.iface=n.iface,e.lit=n.lit,e.name=n.name,e.opt=n.opt,e.param=n.param,e.tuple=n.tuple,e.union=n.union,e.BasicType=n.BasicType,e.createCheckers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Object.assign.apply(Object,[{},Q.basicTypes].concat(t)),i={},o=0,a=t;o<a.length;o++)for(var A=a[o],s=0,c=Object.keys(A);s<c.length;s++){var u=c[s];i[u]=new r(n,A[u])}return i};var r=function(){function t(t,e,n){if(void 0===n&&(n="value"),this.suite=t,this.ttype=e,this._path=n,this.props=new Map,e instanceof Q.TIface)for(var r=0,i=e.props;r<i.length;r++){var o=i[r];this.props.set(o.name,o.ttype)}this.checkerPlain=this.ttype.getChecker(t,!1),this.checkerStrict=this.ttype.getChecker(t,!0)}return t.prototype.setReportedPath=function(t){this._path=t},t.prototype.check=function(t){return this._doCheck(this.checkerPlain,t)},t.prototype.test=function(t){return this.checkerPlain(t,new E.NoopContext)},t.prototype.validate=function(t){return this._doValidate(this.checkerPlain,t)},t.prototype.strictCheck=function(t){return this._doCheck(this.checkerStrict,t)},t.prototype.strictTest=function(t){return this.checkerStrict(t,new E.NoopContext)},t.prototype.strictValidate=function(t){return this._doValidate(this.checkerStrict,t)},t.prototype.getProp=function(e){var n=this.props.get(e);if(!n)throw new Error("Type has no property "+e);return new t(this.suite,n,this._path+"."+e)},t.prototype.methodArgs=function(e){var n=this._getMethod(e);return new t(this.suite,n.paramList)},t.prototype.methodResult=function(e){var n=this._getMethod(e);return new t(this.suite,n.result)},t.prototype.getArgs=function(){if(!(this.ttype instanceof Q.TFunc))throw new Error("getArgs() applied to non-function");return new t(this.suite,this.ttype.paramList)},t.prototype.getResult=function(){if(!(this.ttype instanceof Q.TFunc))throw new Error("getResult() applied to non-function");return new t(this.suite,this.ttype.result)},t.prototype.getType=function(){return this.ttype},t.prototype._doCheck=function(t,e){if(!t(e,new E.NoopContext)){var n=new E.DetailContext;throw t(e,n),n.getError(this._path)}},t.prototype._doValidate=function(t,e){if(t(e,new E.NoopContext))return null;var n=new E.DetailContext;return t(e,n),n.getErrorDetail(this._path)},t.prototype._getMethod=function(t){var e=this.props.get(t);if(!e)throw new Error("Type has no property "+t);if(!(e instanceof Q.TFunc))throw new Error("Property "+t+" is not a method");return e},t}();e.Checker=r}));m(F);F.TArray,F.TEnumType,F.TEnumLiteral,F.TFunc,F.TIface,F.TLiteral,F.TName,F.TOptional,F.TParam,F.TParamList,F.TProp,F.TTuple,F.TType,F.TUnion;var w=F.array,S=(F.enumlit,F.enumtype,F.func,F.iface),R=F.lit,U=F.name,x=(F.opt,F.param,F.tuple,F.union),k=(F.BasicType,F.createCheckers),O=(F.Checker,{ZarrMetadataType:x("ZarrArrayMetadata","ZarrGroupMetadata"),UserAttributes:U("object"),FillType:x("number",R("NaN"),R("Infinity"),R("-Infinity"),"null"),Order:x(R("C"),R("F")),DtypeString:x(R("<u1"),R("<i1"),R("<i4"),R("<f4"),R("<f8"),R("<b"),R("<B")),ChunksArgument:x("number",w(x("number","null")),"boolean","null"),Compressor:S([],{id:"string"}),Filter:S([],{id:"string"}),ZarrArrayMetadata:S([],{zarr_format:x(R(1),R(2)),shape:w("number"),chunks:w("number"),dtype:"DtypeString",compressor:x("null",S([],{id:"string"})),fill_value:"FillType",order:"Order",filters:x("null",w("Filter"))}),ZarrGroupMetadata:S([],{zarr_format:x(R(1),R(2))})}),N=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,"path ".concat(t," contains an array")),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error)),D=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,"path ".concat(t," contains a group")),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error)),G=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,"array not found at path ".concat(t)),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error)),_=(Error,Error,function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,t),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error))),M=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,"key ".concat(t," not present")),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error)),T=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t,r){var i;return Object(f.a)(this,n),i=e.call(this,"too many indices for array; expected ".concat(r.length,", got ").concat(t.length)),Object.setPrototypeOf(Object(h.a)(i),n.prototype),i}return n}(Object(p.a)(RangeError)),j=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,t),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(RangeError)),L=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t,r,i,o){var a;return Object(f.a)(this,n),a=e.call(this,"slice arguments slice(".concat(t,", ").concat(r,", ").concat(i,") invalid: ").concat(o)),Object.setPrototypeOf(Object(h.a)(a),n.prototype),a}return n}(Object(p.a)(RangeError)),V=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(){var t;return Object(f.a)(this,n),t=e.call(this,"Negative step size is not supported when indexing."),Object.setPrototypeOf(Object(h.a)(t),n.prototype),t}return n}(Object(p.a)(Error)),Z=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,t),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error)),P=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),r=e.call(this,t),Object.setPrototypeOf(Object(h.a)(r),n.prototype),r}return n}(Object(p.a)(Error));function W(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===t)throw new L(t,e,n,"The first argument must not be undefined");if("string"===typeof t&&":"!==t||"string"===typeof e&&":"!==e)throw new L(t,e,n,'Arguments can only be integers, ":" or null');return void 0===e&&(e=t,t=null),{start:":"===t?null:t,stop:":"===e?null:e,step:n,_slice:!0}}function J(t,e){var n,r,i;i=null===t.step?1:t.step,null===t.start?n=i<0?Number.MAX_SAFE_INTEGER:0:(n=t.start)<0&&(n+=e),null===t.stop?r=i<0?-Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER:(r=t.stop)<0&&(r+=e);var o=function(t,e,n,r){if(t<0?(t+=r)<0&&(t=n<0?-1:0):t>=r&&(t=n<0?r-1:r),e<0?(e+=r)<0&&(e=n<0?-1:0):e>=r&&(e=n<0?r-1:r),n<0){if(e<t)return[t,e,n,Math.floor((t-e-1)/-n+1)]}else if(t<e)return[t,e,n,Math.floor((e-t-1)/n+1)];return[t,e,n,0]}(n,r,i,e);if(n=o[0],r=o[1],i=o[2],e=o[3],0===i)throw new Error("Step size 0 is invalid");return[n,r,i,e]}function H(t){return Array.isArray(t)?t:[t]}function Y(t,e){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];if("number"===typeof o)n.push(o);else{var a=J(o,e[i]),A=a[3];r.push(A),n.push(a)}}return[n,r]}function X(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=z(t,e);for(var r=0;r<t.length;r++){var i=t[r];if("number"===typeof i)t[r]=n?W(i,i+1,1):K(i,e[r]);else{if(q(i))throw new TypeError("Integer array selections are not supported (yet)");":"!==i&&null!==i||(t[r]=W(null,null,1))}}return t}function z(t,e){t=H(t);for(var n=-1,r=0,i=0;i<t.length;i++)"..."===t[i]&&(n=i,r+=1);if(r>1)throw new RangeError("an index can only have a single ellipsis ('...')");if(1===r){var o=n,a=t.length-(o+1),A=t.length-1;if(A>=e.length)t=t.filter((function(t){return"..."!==t}));else{var s=e.length-A,c=t.slice(0,o).concat(new Array(s).fill(null));a>0&&(c=c.concat(t.slice(t.length-a))),t=c}}if(t.length<e.length){var u=e.length-t.length;t=t.concat(new Array(u).fill(null))}return function(t,e){if(t.length>e.length)throw new T(t,e)}(t,e),t}function K(t,e){if(t<0&&(t=e+t),t>=e||t<0)throw new j("index out of bounds for dimension with length ".concat(e));return t}function q(t){if(!Array.isArray(t))return!1;var e,n=Object(g.a)(t);try{for(n.s();!(e=n.n()).done;){if("number"!==typeof e.value)return!1}}catch(we){n.e(we)}finally{n.f()}return!0}function $(t){return null!==t&&!0===t._slice}function tt(t){return $(t)&&(null===t.step||1===t.step)}function et(t){t=H(t);for(var e=0;e<t.length;e++){var n=t[e];if(!q(n)&&!tt(n)&&"..."!==n)return!1}return!0}function nt(){var t,e,n,r,i,o,a=arguments;return l.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:for(t=a.length,e=new Array(t),n=0;n<t;n++)e[n]=a[n];if(0!==e.length){A.next=3;break}return A.abrupt("return");case 3:r=e.map((function(t){return t()})),i=r.map((function(t){return t.next()})),o=0;case 6:if(!i[o].done){A.next=13;break}if(r[o]=e[o](),i[o]=r[o].next(),!(++o>=r.length)){A.next=11;break}return A.abrupt("return");case 11:A.next=16;break;case 13:return A.next=15,i.map((function(t){return t.value}));case 15:o=0;case 16:i[o]=r[o].next();case 17:A.next=6;break;case 19:case"end":return A.stop()}}),C)}var rt=function(){function t(e,n){Object(f.a)(this,t),e=X(e,n.shape),this.dimIndexers=[];for(var r=n.shape,i=0;i<r.length;i++){var o=e[i],a=r[i],A=n.chunks[i];if(null===o&&(o=W(null)),"number"===typeof o)this.dimIndexers.push(new it(o,a,A));else{if(!$(o))throw new RangeError("Unspported selection item for basic indexing; expected integer or slice, got ".concat(o));this.dimIndexers.push(new ot(o,a,A))}}this.shape=[];var s,c=Object(g.a)(this.dimIndexers);try{for(c.s();!(s=c.n()).done;){var u=s.value;u instanceof ot&&this.shape.push(u.numItems)}}catch(we){c.e(we)}finally{c.f()}this.dropAxes=null}return Object(c.a)(t,[{key:"iter",value:l.a.mark((function t(){var e,n,r,i,o,a,A,c,u,f,h;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.dimIndexers.map((function(t){return function(){return t.iter()}})),n=nt.apply(void 0,Object(s.a)(e)),r=Object(g.a)(n),t.prev=3,r.s();case 5:if((i=r.n()).done){t.next=16;break}o=i.value,a=[],A=[],c=[],u=Object(g.a)(o);try{for(u.s();!(f=u.n()).done;)h=f.value,a.push(h.dimChunkIndex),A.push(h.dimChunkSelection),null!==h.dimOutSelection&&c.push(h.dimOutSelection)}catch(we){u.e(we)}finally{u.f()}return t.next=14,{chunkCoords:a,chunkSelection:A,outSelection:c};case 14:t.next=5;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(3),r.e(t.t0);case 21:return t.prev=21,r.f(),t.finish(21);case 24:case"end":return t.stop()}}),t,this,[[3,18,21,24]])}))}]),t}(),it=function(){function t(e,n,r){Object(f.a)(this,t),e=K(e,n),this.dimSelection=e,this.dimLength=n,this.dimChunkLength=r,this.numItems=1}return Object(c.a)(t,[{key:"iter",value:l.a.mark((function t(){var e,n,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Math.floor(this.dimSelection/this.dimChunkLength),n=e*this.dimChunkLength,r=this.dimSelection-n,null,t.next=6,{dimChunkIndex:e,dimChunkSelection:r,dimOutSelection:null};case 6:case"end":return t.stop()}}),t,this)}))}]),t}(),ot=function(){function t(e,n,r){Object(f.a)(this,t);var i=J(e,n),o=Object(A.a)(i,3),a=o[0],s=o[1],c=o[2];if(this.start=a,this.stop=s,this.step=c,this.step<1)throw new V;this.dimLength=n,this.dimChunkLength=r,this.numItems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.numChunks=Math.ceil(this.dimLength/this.dimChunkLength)}return Object(c.a)(t,[{key:"iter",value:l.a.mark((function t(){var e,n,r,i,o,a,A,s,c,u,g,f,h;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Math.floor(this.start/this.dimChunkLength),n=Math.ceil(this.stop/this.dimChunkLength),r=e;case 3:if(!(r<n)){t.next=20;break}return i=r*this.dimChunkLength,o=Math.min(this.dimLength,(r+1)*this.dimChunkLength),a=o-i,A=void 0,s=void 0,c=void 0,this.start<i?(A=0,(u=(i-this.start)%this.step)>0&&(A+=this.step-u),c=Math.ceil((i-this.start)/this.step)):(A=this.start-i,c=0),s=this.stop>o?a:this.stop-i,g=W(A,s,this.step),f=Math.ceil((s-A)/this.step),h=W(c,c+f),t.next=17,{dimChunkIndex:r,dimChunkSelection:g,dimOutSelection:h};case 17:r++,t.next=3;break;case 20:case"end":return t.stop()}}),t,this)}))}]),t}(),at=k(O),At="undefined"!==typeof i&&i.versions&&i.versions.node;function st(t){if(null===t)return"";for(t instanceof String&&(t=t.valueOf()),t=t.replace(/\\/g,"/");t.length>0&&"/"===t[0];)t=t.slice(1);for(;t.length>0&&"/"===t[t.length-1];)t=t.slice(0,t.length-1);var e,n=(t=t.replace(/\/\/+/g,"/")).split("/"),r=Object(g.a)(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if("."===i||".."===i)throw Error("path containing '.' or '..' segment not allowed")}}catch(we){r.e(we)}finally{r.f()}return t}function ct(t){return"number"===typeof t&&(t=[t]),t.map((function(t){return Math.floor(t)}))}function ut(t,e){if(at.ChunksArgument.check(t),null===t||!0===t)throw new Error("Chunk guessing is not supported yet");return!1===t?e:("number"===typeof t&&(t=[t]),t.length<e.length&&(t=t.concat(e.slice(t.length))),t.map((function(t,n){return-1===t||null===t?e[n]:Math.floor(t)})))}function lt(t){return t=t.toUpperCase(),at.Order.check(t),t}function gt(t){return at.DtypeString.check(t),t}function ft(t){return at.FillType.check(t),t}function ht(t,e){if(null===t)return!0;Array.isArray(t)||(t=[t]);for(var n=0;n<Math.min(t.length,e.length);n++){var r=t[n];if(null!==r){if($(r)){var i=r,o=1===i.step||null===i.step;if(null===i.start&&null===i.stop&&o)continue;if(i.stop-i.start===e[n]&&o)continue;return!1}return!1}}return!0}function dt(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function It(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.map((function(t,e){return 0===e?t.trim().replace(/[\/]*$/g,""):t.trim().replace(/(^[\/]*|[\/]*$)/g,"")})).filter((function(t){return t.length})).join("/")}function pt(t){var e=t.BYTES_PER_ELEMENT;if(1!==e){if(At){var n=r.from(t.buffer,t.byteOffset,t.length*e);return 2===e&&n.swap16(),4===e&&n.swap32(),void(8===e&&n.swap64())}for(var i,o=new Uint8Array(t.buffer,t.byteOffset,t.length*e),a=e/2,A=e-1,s=0;s<o.length;s+=e)for(var c=0;c<a;c++)i=o[s+c],o[s+c]=o[s+A-c],o[s+A-c]=i}}function Ct(t){var e=t.slice();return pt(e),e}function yt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return v(this,void 0,void 0,l.a.mark((function n(){var r,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=st(e),r=Bt(e),i=r+".zarray",n.abrupt("return",t.containsItem(i));case 4:case"end":return n.stop()}}),n)})))}function vt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return v(this,void 0,void 0,l.a.mark((function n(){var r,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=st(e),r=Bt(e),i=r+".zgroup",n.abrupt("return",t.containsItem(i));case 4:case"end":return n.stop()}}),n)})))}function Bt(t){return t.length>0?t+"/":""}function mt(t,e,n,r){return v(this,void 0,void 0,l.a.mark((function n(){var i,o,a,A,s;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!==e.length){n.next=2;break}return n.abrupt("return");case 2:i=e.split("/"),o="",a=Object(g.a)(i.slice(0,i.length-1)),n.prev=5,a.s();case 7:if((A=a.n()).done){n.next=25;break}return s=A.value,o+=s,n.next=12,yt(t,o);case 12:if(!n.sent){n.next=17;break}return n.next=15,bt(t,o,r);case 15:n.next=22;break;case 17:return n.next=19,vt(t,o);case 19:if(n.sent){n.next=22;break}return n.next=22,bt(t,o);case 22:o+="/";case 23:n.next=7;break;case 25:n.next=30;break;case 27:n.prev=27,n.t0=n.catch(5),a.e(n.t0);case 30:return n.prev=30,a.f(),n.finish(30);case 33:case"end":return n.stop()}}),n,null,[[5,27,30,33]])})))}function bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return v(this,void 0,void 0,l.a.mark((function r(){var i,o;return l.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=st(e),!n){r.next=5;break}throw Error("Group overwriting not implemented yet :(");case 5:return r.next=7,yt(t,e);case 7:if(!r.sent){r.next=11;break}throw new N(e);case 11:return r.next=13,vt(t,e);case 13:if(!r.sent){r.next=15;break}throw new D(e);case 15:return i={zarr_format:2},o=Bt(e)+".zgroup",r.next=19,t.setItem(o,JSON.stringify(i));case 19:case"end":return r.stop()}}),r)})))}function Et(t,e,n,r,i,o,a,A,s,c,u){return v(this,void 0,void 0,l.a.mark((function c(){var g,f,h;return l.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(!s){c.next=4;break}throw Error("Array overwriting not implemented yet :(");case 4:return c.next=6,yt(t,i);case 6:if(!c.sent){c.next=10;break}throw new N(i);case 10:return c.next=12,vt(t,i);case 12:if(!c.sent){c.next=14;break}throw new D(i);case 14:if(r=gt(r),e=ct(e),n=ut(n,e),A=lt(A),a=ft(a),!(null!==u&&u.length>0)){c.next=21;break}throw Error("Filters are not supported yet");case 21:return g=a,"number"===typeof a&&(Number.isNaN(a)&&(g="NaN"),Number.POSITIVE_INFINITY===a&&(g="Infinity"),Number.NEGATIVE_INFINITY===a&&(g="-Infinity")),f={zarr_format:2,shape:e,chunks:n,dtype:r,fill_value:g,order:A,compressor:o,filters:u=null},h=Bt(i)+".zarray",c.next=28,t.setItem(h,JSON.stringify(f));case 28:case"end":return c.stop()}}),c)})))}function Qt(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,A=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"C",s=arguments.length>8&&void 0!==arguments[8]&&arguments[8],c=(arguments.length>9&&void 0!==arguments[9]&&arguments[9],arguments.length>10&&void 0!==arguments[10]?arguments[10]:null);return v(this,void 0,void 0,l.a.mark((function u(){return l.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return i=st(i),u.next=3,mt(t,i,0,s);case 3:return u.next=5,Et(t,e,n,r,i,o,a,A,s,0,c);case 5:case"end":return u.stop()}}),u)})))}function Ft(t){return"string"!==typeof t?At&&r.isBuffer(t)?JSON.parse(t.toString()):t instanceof ArrayBuffer?JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))):t:JSON.parse(t)}var wt=function(){function t(e,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Object(f.a)(this,t),this.store=e,this.key=n,this.readOnly=r,this.cache=i,this.cachedValue=null}return Object(c.a)(t,[{key:"asObject",value:function(){return v(this,void 0,void 0,l.a.mark((function t(){var e;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.cache||null===this.cachedValue){t.next=2;break}return t.abrupt("return",this.cachedValue);case 2:return t.next=4,this.getNoSync();case 4:return e=t.sent,this.cache&&(this.cachedValue=e),t.abrupt("return",e);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getNoSync",value:function(){return v(this,void 0,void 0,l.a.mark((function t(){var e;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.store.getItem(this.key);case 3:return e=t.sent,t.abrupt("return",Ft(e));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"setNoSync",value:function(t,e){return v(this,void 0,void 0,l.a.mark((function n(){var r;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNoSync();case 2:return(r=n.sent)[t]=e,n.next=6,this.putNoSync(r);case 6:return n.abrupt("return",!0);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"putNoSync",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.store.setItem(this.key,JSON.stringify(t));case 2:this.cache&&(this.cachedValue=t);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"delNoSync",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNoSync();case 2:return delete(n=e.sent)[t],e.next=6,this.putNoSync(n);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"put",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.readOnly){e.next=2;break}throw new _("attributes are read-only");case 2:return e.abrupt("return",this.putNoSync(t));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"setItem",value:function(t,e){return v(this,void 0,void 0,l.a.mark((function n(){return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.readOnly){n.next=2;break}throw new _("attributes are read-only");case 2:return n.abrupt("return",this.setNoSync(t,e));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"getItem",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.asObject();case 2:return e.t0=t,e.abrupt("return",e.sent[e.t0]);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"deleteItem",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.readOnly){e.next=2;break}throw new _("attributes are read-only");case 2:return e.abrupt("return",this.delNoSync(t));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"containsItem",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.asObject();case 2:return e.t0=t,e.t1=e.sent[e.t0],e.t2=void 0,e.abrupt("return",e.t1!==e.t2);case 6:case"end":return e.stop()}}),e,this)})))}},{key:"proxy",value:function(){return y(this)}}]),t}(),St={"|b":Int8Array,"|B":Uint8Array,"|u1":Uint8Array,"|i1":Int8Array,"<b":Int8Array,"<B":Uint8Array,"<u1":Uint8Array,"<i1":Int8Array,"<u2":Uint16Array,"<i2":Int16Array,"<u4":Uint32Array,"<i4":Int32Array,"<f4":Float32Array,"<f8":Float64Array,">b":Int8Array,">B":Uint8Array,">u1":Uint8Array,">i1":Int8Array,">u2":Uint16Array,">i2":Int16Array,">u4":Uint32Array,">i4":Int32Array,">f4":Float32Array,">f8":Float64Array};function Rt(t){if(t instanceof Uint8Array)return"|u1";if(t instanceof Int8Array)return"|i1";if(t instanceof Uint16Array)return"<u2";if(t instanceof Int16Array)return"<i2";if(t instanceof Uint32Array)return"<u4";if(t instanceof Int32Array)return"<i4";if(t instanceof Float32Array)return"<f4";if(t instanceof Float64Array)return"<f8";throw new Z("Mapping for TypedArray to Dtypestring not known")}function Ut(t){return void 0!==t.byteLength?t.constructor:Ut(t[0])}function xt(t,e,n){var r=Y(X(n,e),e),i=Object(A.a)(r,2),o=i[0],a=i[1];return[function t(e,n,r){var i=r[0];if("number"===typeof i)return 1===n.length?e[i]:t(e[i],n.slice(1),r.slice(1));var o=Object(A.a)(i,4),a=o[0],s=o[1],c=o[2],u=o[3];if(0===u)return new(Ut(e))(0);if(1===n.length){if(1===c)return e.slice(a,s);for(var l=new e.constructor(u),g=0;g<u;g++)l[g]=e[a+g*c];return l}for(var f=new Array(u),h=0;h<u;h++)f[h]=t(e[a+h*c],n.slice(1),r.slice(1));if(u>0&&"number"===typeof f[0]){var d=e[0].constructor;f=d.from(f)}return f}(t,e,o),a]}function kt(t,e,n,r){var i=Y(X(r,n,!0),n),o=Object(A.a)(i,2),a=o[0];o[1];Nt(t,e,n,a)}function Ot(t,e,n,r,i){var o=Y(X(i,n,!1),n),a=Object(A.a)(o,2),s=a[0],c=a[1];if(JSON.stringify(c)!==JSON.stringify(r))throw new Z("Shape mismatch in target and source NestedArray: ".concat(c," and ").concat(r));!function t(e,n,r,i){var o=i[0];if("number"===typeof n)return void Nt(e,n,r,i.map((function(t){return"number"===typeof t?[t,t+1,1,1]:t})));if("number"===typeof o)return void t(e[o],n,r.slice(1),i.slice(1));var a=Object(A.a)(o,4),s=a[0],c=(a[1],a[2]),u=a[3];if(1===r.length){if(1===c)e.set(n,s);else for(var l=0;l<u;l++)e[s+l*c]=n[l];return}for(var g=0;g<u;g++)t(e[s+g*c],n[g],r.slice(1),i.slice(1))}(t,e,n,s)}function Nt(t,e,n,r){var i=r[0],o=Object(A.a)(i,4),a=o[0],s=o[1],c=o[2],u=o[3];if(1!==n.length)for(var l=0;l<u;l++)Nt(t[a+l*c],e,n.slice(1),r.slice(1));else if(1===c)t.fill(e,a,s);else for(var g=0;g<u;g++)t[a+g*c]=e}function Dt(t,e,n){void 0===n&&(n=Ut(t));var r=new n(e.reduce((function(t,e){return t*e}),1));return function t(e,n,r,i){if(1===n.length)return void r.set(e,i);if(2===n.length){for(var o=0;o<n[0];o++)r.set(e[o],i+n[1]*o);return e}for(var a=n.slice(1),A=a.reduce((function(t,e){return t*e}),1),s=0;s<n[0];s++)t(e[s],a,r,i+A*s);return e}(t,e,r,0),r}var Gt=function(){function t(e,n,i){Object(f.a)(this,t);var o=null!==e&&!!e.BYTES_PER_ELEMENT;if(void 0===n){if(!o)throw new Z("Shape argument is required unless you pass in a TypedArray");n=[e.length]}if(void 0===i){if(!o)throw new Z("Dtype argument is required unless you pass in a TypedArray");i=Rt(e)}if(n=ct(n),this.shape=n,this.dtype=i,o&&1!==n.length&&(e=e.buffer),0===this.shape.length)this.data=new St[i](1);else if(At&&r.isBuffer(e)||e instanceof ArrayBuffer||null===e||e.toString().startsWith("[object ArrayBuffer]")){var a=n.reduce((function(t,e){return t*e}),1);null===e&&(e=new ArrayBuffer(a*parseInt(i[i.length-1],10)));var A=e.byteLength/parseInt(i[i.length-1],10);if(a!==A)throw new Error("Buffer has ".concat(A," of dtype ").concat(i,", shape is too large or small ").concat(n," (flat=").concat(a,")"));var s=St[i];this.data=function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(1===r.length)return new n(e.slice(i,i+r[0]*n.BYTES_PER_ELEMENT));var o=new Array(r[0]);if(2===r.length){for(var a=0;a<r[0];a++)o[a]=new n(e.slice(i+r[1]*a*n.BYTES_PER_ELEMENT,i+r[1]*(a+1)*n.BYTES_PER_ELEMENT));return o}for(var A=r.slice(1),s=A.reduce((function(t,e){return t*e}),1),c=0;c<r[0];c++)o[c]=t(e,n,A,i+s*c*n.BYTES_PER_ELEMENT);return o}(e,s,n)}else this.data=e}return Object(c.a)(t,[{key:"get",value:function(e){var n=xt(this.data,this.shape,e),r=Object(A.a)(n,2),i=r[0],o=r[1];return 0===o.length?i:new t(i,o,this.dtype)}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;null===t&&(t=[W(null)]),"number"===typeof e?0===this.shape.length?this.data[0]=e:kt(this.data,e,this.shape,t):Ot(this.data,e.data,this.shape,e.shape,t)}},{key:"flatten",value:function(){return 1===this.shape.length?this.data:Dt(this.data,this.shape,St[this.dtype])}}],[{key:"arange",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"<i4",r=St[n],i=_t([e],r);return new t(i,[e],n)}}]),t}();function _t(t,e){var n=t.reduce((function(t,e){return t*e}),1),r=new e(n);return r.set(Object(s.a)(Array(n).keys())),r}function Mt(t,e,n,r,i){var o=Y(X(r,n,!0),n);!function t(e,n,r,i){var o=Object(a.a)(i),s=o[0],c=o.slice(1),u=Object(a.a)(r),l=u[0],g=u.slice(1),f=Object(A.a)(s,4),h=f[0],d=(f[1],f[2]),I=f[3];if(1===r.length){if(1===d&&1===l)n.fill(e,h,h+I);else for(var p=0;p<I;p++)n[l*(h+d*p)]=e;return}for(var C=0;C<I;C++)t(e,n.subarray(l*(h+d*C)),g,c)}(i,t,e,Object(A.a)(o,1)[0])}function Tt(t,e,n,r,i,o,s){var c=Y(X(r,n,!1),n),u=Object(A.a)(c,2),l=u[0],g=u[1];if(JSON.stringify(g)!==JSON.stringify(s))throw new Z("Shape mismatch in target and source RawArray: ".concat(g," and ").concat(s));!function t(e,n,r,i,o){if(0===r.length)return void e.set(i);var s=Object(a.a)(r),c=s[0],u=s.slice(1),l=Object(a.a)(n),g=l[0],f=l.slice(1);if("number"===typeof c)return void t(e.subarray(c*g),f,u,i,o);var h=Object(a.a)(o),d=h[0],I=h.slice(1),p=Object(A.a)(c,4),C=p[0],y=(p[1],p[2]),v=p[3];if(1===n.length){if(1===y&&1===g&&1===d)e.set(i.subarray(0,v),C);else for(var B=0;B<v;B++)e[g*(C+y*B)]=i[d*B];return}for(var m=0;m<v;m++)t(e.subarray(g*(C+m*y)),f,u,i.subarray(d*m),I)}(t,e,l,i,o)}function jt(t,e,n,r,i,o,s,c){var u=Y(X(r,n,!0),n),l=Object(A.a)(u,1)[0],g=Y(X(c,s,!1),s);!function t(e,n,r,i,o,s){if(0===s.length)return void e.set(i.subarray(0,e.length));var c=Object(a.a)(r),u=c[0],l=c.slice(1),g=Object(a.a)(s),f=g[0],h=g.slice(1),d=Object(a.a)(n),I=d[0],p=d.slice(1),C=Object(a.a)(o),y=C[0],v=C.slice(1);if("number"===typeof f)return void t(e,n,r,i.subarray(y*f),v,h);var B=Object(A.a)(u,4),m=B[0],b=(B[1],B[2]),E=B[3],Q=Object(A.a)(f,4),F=Q[0],w=(Q[1],Q[2]);Q[3];if(1===n.length&&1===o.length){if(1===b&&1===I&&1===w&&1===y)e.set(i.subarray(F,F+E),m);else for(var S=0;S<E;S++)e[I*(m+b*S)]=i[y*(F+w*S)];return}for(var R=0;R<E;R++)t(e.subarray(I*(m+R*b)),p,l,i.subarray(y*(F+R*w)),v,h)}(t,e,l,i,o,Object(A.a)(g,1)[0])}var Lt=function(){function t(e,n,i,o){Object(f.a)(this,t);var a=null!==e&&!!e.BYTES_PER_ELEMENT;if(void 0===n){if(!a)throw new Z("Shape argument is required unless you pass in a TypedArray");n=[e.length]}if(n=ct(n),void 0===i){if(!a)throw new Z("Dtype argument is required unless you pass in a TypedArray");i=Rt(e)}if(void 0===o&&(o=function(t){for(var e=t.length,n=Array(e),r=1,i=e-1;i>=0;i--)n[i]=r,r*=t[i];return n}(n)),this.shape=n,this.dtype=i,this.strides=o,a&&1!==n.length&&(e=e.buffer),0===this.shape.length)this.data=new St[i](1);else if(At&&r.isBuffer(e)||e instanceof ArrayBuffer||null===e||e.toString().startsWith("[object ArrayBuffer]")){var A=n.reduce((function(t,e){return t*e}),1);null===e&&(e=new ArrayBuffer(A*parseInt(i[i.length-1],10)));var s=e.byteLength/parseInt(i[i.length-1],10);if(A!==s)throw new Error("Buffer has ".concat(s," of dtype ").concat(i,", shape is too large or small ").concat(n," (flat=").concat(A,")"));var c=St[i];this.data=new c(e)}else this.data=e}return Object(c.a)(t,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;null===e&&(e=[W(null)]),"number"===typeof n?0===this.shape.length?this.data[0]=n:Mt(this.data,this.strides,this.shape,e,n):n instanceof t&&r?jt(this.data,this.strides,this.shape,e,n.data,n.strides,n.shape,r):Tt(this.data,this.strides,this.shape,e,n.data,n.strides,n.shape)}}]),t}();var Vt=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var n="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!==typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(t[i]=n[i])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(n)}));Vt.assign,Vt.shrinkBuf,Vt.setTyped,Vt.Buf8,Vt.Buf16,Vt.Buf32;function Zt(t){for(var e=t.length;--e>=0;)t[e]=0}var Pt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Wt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Jt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ht=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Yt=new Array(576);Zt(Yt);var Xt=new Array(60);Zt(Xt);var zt=new Array(512);Zt(zt);var Kt=new Array(256);Zt(Kt);var qt=new Array(29);Zt(qt);var $t,te,ee,ne=new Array(30);function re(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function ie(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function oe(t){return t<256?zt[t]:zt[256+(t>>>7)]}function ae(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Ae(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,ae(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function se(t,e,n){Ae(t,n[2*e],n[2*e+1])}function ce(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function ue(t,e,n){var r,i,o=new Array(16),a=0;for(r=1;r<=15;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++){var A=t[2*i+1];0!==A&&(t[2*i]=ce(o[A]++,A))}}function le(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function ge(t){t.bi_valid>8?ae(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function fe(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function he(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&fe(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!fe(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function de(t,e,n){var r,i,o,a,A=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*A]<<8|t.pending_buf[t.d_buf+2*A+1],i=t.pending_buf[t.l_buf+A],A++,0===r?se(t,i,e):(se(t,(o=Kt[i])+256+1,e),0!==(a=Pt[o])&&Ae(t,i-=qt[o],a),se(t,o=oe(--r),n),0!==(a=Wt[o])&&Ae(t,r-=ne[o],a))}while(A<t.last_lit);se(t,256,e)}function Ie(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,A=e.stat_desc.has_stree,s=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<s;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[i]=0,t.opt_len--,A&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)he(t,o,n);i=s;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],he(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,he(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,o,a,A,s=e.dyn_tree,c=e.max_code,u=e.stat_desc.static_tree,l=e.stat_desc.has_stree,g=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,h=e.stat_desc.max_length,d=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(s[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=s[2*s[2*(r=t.heap[n])+1]+1]+1)>h&&(o=h,d++),s[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=f&&(a=g[r-f]),A=s[2*r],t.opt_len+=A*(o+a),l&&(t.static_len+=A*(u[2*r+1]+a)));if(0!==d){do{for(o=h-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[h]--,d-=2}while(d>0);for(o=h;0!==o;o--)for(r=t.bl_count[o];0!==r;)(i=t.heap[--n])>c||(s[2*i+1]!==o&&(t.opt_len+=(o-s[2*i+1])*s[2*i],s[2*i+1]=o),r--)}}(t,e),ue(o,c,t.bl_count)}function pe(t,e,n){var r,i,o=-1,a=e[1],A=0,s=7,c=4;for(0===a&&(s=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=e[2*(r+1)+1],++A<s&&i===a||(A<c?t.bl_tree[2*i]+=A:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):A<=10?t.bl_tree[34]++:t.bl_tree[36]++,A=0,o=i,0===a?(s=138,c=3):i===a?(s=6,c=3):(s=7,c=4))}function Ce(t,e,n){var r,i,o=-1,a=e[1],A=0,s=7,c=4;for(0===a&&(s=138,c=3),r=0;r<=n;r++)if(i=a,a=e[2*(r+1)+1],!(++A<s&&i===a)){if(A<c)do{se(t,i,t.bl_tree)}while(0!==--A);else 0!==i?(i!==o&&(se(t,i,t.bl_tree),A--),se(t,16,t.bl_tree),Ae(t,A-3,2)):A<=10?(se(t,17,t.bl_tree),Ae(t,A-3,3)):(se(t,18,t.bl_tree),Ae(t,A-11,7));A=0,o=i,0===a?(s=138,c=3):i===a?(s=6,c=3):(s=7,c=4)}}Zt(ne);var ye=!1;function ve(t,e,n,r){Ae(t,0+(r?1:0),3),function(t,e,n,r){ge(t),r&&(ae(t,n),ae(t,~n)),Vt.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}var Be={_tr_init:function(t){ye||(!function(){var t,e,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(qt[r]=n,t=0;t<1<<Pt[r];t++)Kt[n++]=r;for(Kt[n-1]=r,i=0,r=0;r<16;r++)for(ne[r]=i,t=0;t<1<<Wt[r];t++)zt[i++]=r;for(i>>=7;r<30;r++)for(ne[r]=i<<7,t=0;t<1<<Wt[r]-7;t++)zt[256+i++]=r;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)Yt[2*t+1]=8,t++,o[8]++;for(;t<=255;)Yt[2*t+1]=9,t++,o[9]++;for(;t<=279;)Yt[2*t+1]=7,t++,o[7]++;for(;t<=287;)Yt[2*t+1]=8,t++,o[8]++;for(ue(Yt,287,o),t=0;t<30;t++)Xt[2*t+1]=5,Xt[2*t]=ce(t,5);$t=new re(Yt,Pt,257,286,15),te=new re(Xt,Wt,0,30,15),ee=new re(new Array(0),Jt,0,19,7)}(),ye=!0),t.l_desc=new ie(t.dyn_ltree,$t),t.d_desc=new ie(t.dyn_dtree,te),t.bl_desc=new ie(t.bl_tree,ee),t.bi_buf=0,t.bi_valid=0,le(t)},_tr_stored_block:ve,_tr_flush_block:function(t,e,n,r){var i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),Ie(t,t.l_desc),Ie(t,t.d_desc),a=function(t){var e;for(pe(t,t.dyn_ltree,t.l_desc.max_code),pe(t,t.dyn_dtree,t.d_desc.max_code),Ie(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Ht[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==e?ve(t,e,n,r):4===t.strategy||o===i?(Ae(t,2+(r?1:0),3),de(t,Yt,Xt)):(Ae(t,4+(r?1:0),3),function(t,e,n,r){var i;for(Ae(t,e-257,5),Ae(t,n-1,5),Ae(t,r-4,4),i=0;i<r;i++)Ae(t,t.bl_tree[2*Ht[i]+1],3);Ce(t,t.dyn_ltree,e-1),Ce(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),de(t,t.dyn_ltree,t.dyn_dtree)),le(t),r&&ge(t)},_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(Kt[n]+256+1)]++,t.dyn_dtree[2*oe(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){Ae(t,2,3),se(t,256,Yt),function(t){16===t.bi_valid?(ae(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}};var me=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};var be=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();var Ee,Qe=function(t,e,n,r){var i=be,o=r+n;t^=-1;for(var a=r;a<o;a++)t=t>>>8^i[255&(t^e[a])];return-1^t},Fe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function we(t,e){return t.msg=Fe[e],e}function Se(t){return(t<<1)-(t>4?9:0)}function Re(t){for(var e=t.length;--e>=0;)t[e]=0}function Ue(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(Vt.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function xe(t,e){Be._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ue(t.strm)}function ke(t,e){t.pending_buf[t.pending++]=e}function Oe(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function Ne(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,Vt.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=me(t.adler,e,i,n):2===t.state.wrap&&(t.adler=Qe(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function De(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,A=t.nice_match,s=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,c=t.window,u=t.w_mask,l=t.prev,g=t.strstart+258,f=c[o+a-1],h=c[o+a];t.prev_length>=t.good_match&&(i>>=2),A>t.lookahead&&(A=t.lookahead);do{if(c[(n=e)+a]===h&&c[n+a-1]===f&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<g);if(r=258-(g-o),o=g-258,r>a){if(t.match_start=e,a=r,r>=A)break;f=c[o+a-1],h=c[o+a]}}}while((e=l[e&u])>s&&0!==--i);return a<=t.lookahead?a:t.lookahead}function Ge(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-262)){Vt.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,e=n=t.hash_size;do{r=t.head[--e],t.head[e]=r>=a?r-a:0}while(--n);e=n=a;do{r=t.prev[--e],t.prev[e]=r>=a?r-a:0}while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=Ne(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function _e(t,e){for(var n,r;;){if(t.lookahead<262){if(Ge(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=De(t,n)),t.match_length>=3)if(r=Be._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=Be._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(xe(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(xe(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xe(t,!1),0===t.strm.avail_out)?1:2}function Me(t,e){for(var n,r,i;;){if(t.lookahead<262){if(Ge(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=De(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=Be._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(xe(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=Be._tr_tally(t,0,t.window[t.strstart-1]))&&xe(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Be._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(xe(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xe(t,!1),0===t.strm.avail_out)?1:2}function Te(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function je(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Vt.Buf16(1146),this.dyn_dtree=new Vt.Buf16(122),this.bl_tree=new Vt.Buf16(78),Re(this.dyn_ltree),Re(this.dyn_dtree),Re(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Vt.Buf16(16),this.heap=new Vt.Buf16(573),Re(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Vt.Buf16(573),Re(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Le(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,Be._tr_init(e),0):we(t,-2)}function Ve(t){var e,n=Le(t);return 0===n&&((e=t.state).window_size=2*e.w_size,Re(e.head),e.max_lazy_match=Ee[e.level].max_lazy,e.good_match=Ee[e.level].good_length,e.nice_match=Ee[e.level].nice_length,e.max_chain_length=Ee[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function Ze(t,e,n,r,i,o){if(!t)return-2;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||e<0||e>9||o<0||o>4)return we(t,-2);8===r&&(r=9);var A=new je;return t.state=A,A.strm=t,A.wrap=a,A.gzhead=null,A.w_bits=r,A.w_size=1<<A.w_bits,A.w_mask=A.w_size-1,A.hash_bits=i+7,A.hash_size=1<<A.hash_bits,A.hash_mask=A.hash_size-1,A.hash_shift=~~((A.hash_bits+3-1)/3),A.window=new Vt.Buf8(2*A.w_size),A.head=new Vt.Buf16(A.hash_size),A.prev=new Vt.Buf16(A.w_size),A.lit_bufsize=1<<i+6,A.pending_buf_size=4*A.lit_bufsize,A.pending_buf=new Vt.Buf8(A.pending_buf_size),A.d_buf=1*A.lit_bufsize,A.l_buf=3*A.lit_bufsize,A.level=e,A.strategy=o,A.method=n,Ve(t)}Ee=[new Te(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ge(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,xe(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(xe(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(xe(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(xe(t,!1),t.strm.avail_out),1)})),new Te(4,4,8,4,_e),new Te(4,5,16,8,_e),new Te(4,6,32,32,_e),new Te(4,4,16,16,Me),new Te(8,16,32,32,Me),new Te(8,16,128,128,Me),new Te(8,32,128,256,Me),new Te(32,128,258,1024,Me),new Te(32,258,258,4096,Me)];var Pe={deflateInit:function(t,e){return Ze(t,e,8,15,8,0)},deflateInit2:Ze,deflateReset:Ve,deflateResetKeep:Le,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},deflate:function(t,e){var n,r,i,o;if(!t||!t.state||e>5||e<0)return t?we(t,-2):-2;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return we(t,0===t.avail_out?-5:-2);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,ke(r,31),ke(r,139),ke(r,8),r.gzhead?(ke(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ke(r,255&r.gzhead.time),ke(r,r.gzhead.time>>8&255),ke(r,r.gzhead.time>>16&255),ke(r,r.gzhead.time>>24&255),ke(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ke(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ke(r,255&r.gzhead.extra.length),ke(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Qe(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(ke(r,0),ke(r,0),ke(r,0),ke(r,0),ke(r,0),ke(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),ke(r,3),r.status=113);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=113,Oe(r,a),0!==r.strstart&&(Oe(r,t.adler>>>16),Oe(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),Ue(t),i=r.pending,r.pending!==r.pending_buf_size));)ke(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),Ue(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,ke(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),Ue(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,ke(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Qe(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Ue(t),r.pending+2<=r.pending_buf_size&&(ke(r,255&t.adler),ke(r,t.adler>>8&255),t.adler=0,r.status=113)):r.status=113),0!==r.pending){if(Ue(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&Se(e)<=Se(n)&&4!==e)return we(t,-5);if(666===r.status&&0!==t.avail_in)return we(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var A=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(Ge(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=Be._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(xe(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(xe(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xe(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,r,i,o,a=t.window;;){if(t.lookahead<=258){if(Ge(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[i=t.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=t.strstart+258;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);t.match_length=258-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=Be._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Be._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(xe(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(xe(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xe(t,!1),0===t.strm.avail_out)?1:2}(r,e):Ee[r.level].func(r,e);if(3!==A&&4!==A||(r.status=666),1===A||3===A)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===A&&(1===e?Be._tr_align(r):5!==e&&(Be._tr_stored_block(r,0,0,!1),3===e&&(Re(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Ue(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(ke(r,255&t.adler),ke(r,t.adler>>8&255),ke(r,t.adler>>16&255),ke(r,t.adler>>24&255),ke(r,255&t.total_in),ke(r,t.total_in>>8&255),ke(r,t.total_in>>16&255),ke(r,t.total_in>>24&255)):(Oe(r,t.adler>>>16),Oe(r,65535&t.adler)),Ue(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},deflateEnd:function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?we(t,-2):(t.state=null,113===e?we(t,-3):0):-2},deflateSetDictionary:function(t,e){var n,r,i,o,a,A,s,c,u=e.length;if(!t||!t.state)return-2;if(2===(o=(n=t.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(t.adler=me(t.adler,e,u,0)),n.wrap=0,u>=n.w_size&&(0===o&&(Re(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new Vt.Buf8(n.w_size),Vt.arraySet(c,e,u-n.w_size,n.w_size,0),e=c,u=n.w_size),a=t.avail_in,A=t.next_in,s=t.input,t.avail_in=u,t.next_in=0,t.input=e,Ge(n);n.lookahead>=3;){r=n.strstart,i=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--i);n.strstart=r,n.lookahead=2,Ge(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=A,t.input=s,t.avail_in=a,n.wrap=o,0},deflateInfo:"pako deflate (from Nodeca project)"},We=!0,Je=!0;try{String.fromCharCode.apply(null,[0])}catch(ir){We=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(ir){Je=!1}for(var He=new Vt.Buf8(256),Ye=0;Ye<256;Ye++)He[Ye]=Ye>=252?6:Ye>=248?5:Ye>=240?4:Ye>=224?3:Ye>=192?2:1;He[254]=He[254]=1;function Xe(t,e){if(e<65534&&(t.subarray&&Je||!t.subarray&&We))return String.fromCharCode.apply(null,Vt.shrinkBuf(t,e));for(var n="",r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n}var ze=function(t){var e,n,r,i,o,a=t.length,A=0;for(i=0;i<a;i++)55296===(64512&(n=t.charCodeAt(i)))&&i+1<a&&56320===(64512&(r=t.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),A+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Vt.Buf8(A),o=0,i=0;o<A;i++)55296===(64512&(n=t.charCodeAt(i)))&&i+1<a&&56320===(64512&(r=t.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e},Ke=function(t){return Xe(t,t.length)},qe=function(t){for(var e=new Vt.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},$e=function(t,e){var n,r,i,o,a=e||t.length,A=new Array(2*a);for(r=0,n=0;n<a;)if((i=t[n++])<128)A[r++]=i;else if((o=He[i])>4)A[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&t[n++],o--;o>1?A[r++]=65533:i<65536?A[r++]=i:(i-=65536,A[r++]=55296|i>>10&1023,A[r++]=56320|1023&i)}return Xe(A,r)},tn=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0||0===n?e:n+He[t[n]]>e?n:e};var en=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},nn=Object.prototype.toString;function rn(t){if(!(this instanceof rn))return new rn(t);this.options=Vt.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new en,this.strm.avail_out=0;var n=Pe.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(Fe[n]);if(e.header&&Pe.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"===typeof e.dictionary?ze(e.dictionary):"[object ArrayBuffer]"===nn.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=Pe.deflateSetDictionary(this.strm,r)))throw new Error(Fe[n]);this._dict_set=!0}}function on(t,e){var n=new rn(e);if(n.push(t,!0),n.err)throw n.msg||Fe[n.err];return n.result}rn.prototype.push=function(t,e){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:!0===e?4:0,"string"===typeof t?i.input=ze(t):"[object ArrayBuffer]"===nn.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Vt.Buf8(o),i.next_out=0,i.avail_out=o),1!==(n=Pe.deflate(i,r))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(Ke(Vt.shrinkBuf(i.output,i.next_out))):this.onData(Vt.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==n);return 4===r?(n=Pe.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==r||(this.onEnd(0),i.avail_out=0,!0)},rn.prototype.onData=function(t){this.chunks.push(t)},rn.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Vt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var an={Deflate:rn,deflate:on,deflateRaw:function(t,e){return(e=e||{}).raw=!0,on(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,on(t,e)}},An=function(t,e){var n,r,i,o,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F;n=t.state,r=t.next_in,Q=t.input,i=r+(t.avail_in-5),o=t.next_out,F=t.output,a=o-(e-t.avail_out),A=o+(t.avail_out-257),s=n.dmax,c=n.wsize,u=n.whave,l=n.wnext,g=n.window,f=n.hold,h=n.bits,d=n.lencode,I=n.distcode,p=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;t:do{h<15&&(f+=Q[r++]<<h,h+=8,f+=Q[r++]<<h,h+=8),y=d[f&p];e:for(;;){if(f>>>=v=y>>>24,h-=v,0===(v=y>>>16&255))F[o++]=65535&y;else{if(!(16&v)){if(0===(64&v)){y=d[(65535&y)+(f&(1<<v)-1)];continue e}if(32&v){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}B=65535&y,(v&=15)&&(h<v&&(f+=Q[r++]<<h,h+=8),B+=f&(1<<v)-1,f>>>=v,h-=v),h<15&&(f+=Q[r++]<<h,h+=8,f+=Q[r++]<<h,h+=8),y=I[f&C];n:for(;;){if(f>>>=v=y>>>24,h-=v,!(16&(v=y>>>16&255))){if(0===(64&v)){y=I[(65535&y)+(f&(1<<v)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(m=65535&y,h<(v&=15)&&(f+=Q[r++]<<h,(h+=8)<v&&(f+=Q[r++]<<h,h+=8)),(m+=f&(1<<v)-1)>s){t.msg="invalid distance too far back",n.mode=30;break t}if(f>>>=v,h-=v,m>(v=o-a)){if((v=m-v)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(b=0,E=g,0===l){if(b+=c-v,v<B){B-=v;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}}else if(l<v){if(b+=c+l-v,(v-=l)<B){B-=v;do{F[o++]=g[b++]}while(--v);if(b=0,l<B){B-=v=l;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}}}else if(b+=l-v,v<B){B-=v;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}for(;B>2;)F[o++]=E[b++],F[o++]=E[b++],F[o++]=E[b++],B-=3;B&&(F[o++]=E[b++],B>1&&(F[o++]=E[b++]))}else{b=o-m;do{F[o++]=F[b++],F[o++]=F[b++],F[o++]=F[b++],B-=3}while(B>2);B&&(F[o++]=F[b++],B>1&&(F[o++]=F[b++]))}break}}break}}while(r<i&&o<A);r-=B=h>>3,f&=(1<<(h-=B<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<A?A-o+257:257-(o-A),n.hold=f,n.bits=h},sn=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cn=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],un=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ln=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],gn=function(t,e,n,r,i,o,a,A){var s,c,u,l,g,f,h,d,I,p=A.bits,C=0,y=0,v=0,B=0,m=0,b=0,E=0,Q=0,F=0,w=0,S=null,R=0,U=new Vt.Buf16(16),x=new Vt.Buf16(16),k=null,O=0;for(C=0;C<=15;C++)U[C]=0;for(y=0;y<r;y++)U[e[n+y]]++;for(m=p,B=15;B>=1&&0===U[B];B--);if(m>B&&(m=B),0===B)return i[o++]=20971520,i[o++]=20971520,A.bits=1,0;for(v=1;v<B&&0===U[v];v++);for(m<v&&(m=v),Q=1,C=1;C<=15;C++)if(Q<<=1,(Q-=U[C])<0)return-1;if(Q>0&&(0===t||1!==B))return-1;for(x[1]=0,C=1;C<15;C++)x[C+1]=x[C]+U[C];for(y=0;y<r;y++)0!==e[n+y]&&(a[x[e[n+y]]++]=y);if(0===t?(S=k=a,f=19):1===t?(S=sn,R-=257,k=cn,O-=257,f=256):(S=un,k=ln,f=-1),w=0,y=0,C=v,g=o,b=m,E=0,u=-1,l=(F=1<<m)-1,1===t&&F>852||2===t&&F>592)return 1;for(;;){h=C-E,a[y]<f?(d=0,I=a[y]):a[y]>f?(d=k[O+a[y]],I=S[R+a[y]]):(d=96,I=0),s=1<<C-E,v=c=1<<b;do{i[g+(w>>E)+(c-=s)]=h<<24|d<<16|I|0}while(0!==c);for(s=1<<C-1;w&s;)s>>=1;if(0!==s?(w&=s-1,w+=s):w=0,y++,0===--U[C]){if(C===B)break;C=e[n+a[y]]}if(C>m&&(w&l)!==u){for(0===E&&(E=m),g+=v,Q=1<<(b=C-E);b+E<B&&!((Q-=U[b+E])<=0);)b++,Q<<=1;if(F+=1<<b,1===t&&F>852||2===t&&F>592)return 1;i[u=w&l]=m<<24|b<<16|g-o|0}}return 0!==w&&(i[g+w]=C-E<<24|64<<16|0),A.bits=m,0};function fn(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function hn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Vt.Buf16(320),this.work=new Vt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function dn(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Vt.Buf32(852),e.distcode=e.distdyn=new Vt.Buf32(592),e.sane=1,e.back=-1,0):-2}function In(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,dn(t)):-2}function pn(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,In(t))):-2}function Cn(t,e){var n,r;return t?(r=new hn,t.state=r,r.window=null,0!==(n=pn(t,e))&&(t.state=null),n):-2}var yn,vn,Bn=!0;function mn(t){if(Bn){var e;for(yn=new Vt.Buf32(512),vn=new Vt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(gn(1,t.lens,0,288,yn,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;gn(2,t.lens,0,32,vn,0,t.work,{bits:5}),Bn=!1}t.lencode=yn,t.lenbits=9,t.distcode=vn,t.distbits=5}function bn(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Vt.Buf8(o.wsize)),r>=o.wsize?(Vt.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),Vt.arraySet(o.window,e,n-r,i,o.wnext),(r-=i)?(Vt.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}var En={inflateReset:In,inflateReset2:pn,inflateResetKeep:dn,inflateInit:function(t){return Cn(t,15)},inflateInit2:Cn,inflate:function(t,e){var n,r,i,o,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F=0,w=new Vt.Buf8(4),S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),a=t.next_out,i=t.output,s=t.avail_out,o=t.next_in,r=t.input,A=t.avail_in,c=n.hold,u=n.bits,l=A,g=s,b=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;u<16;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(2&n.wrap&&35615===c){n.check=0,w[0]=255&c,w[1]=c>>>8&255,n.check=Qe(n.check,w,2,0),c=0,u=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!==(15&c)){t.msg="unknown compression method",n.mode=30;break}if(u-=4,m=8+(15&(c>>>=4)),0===n.wbits)n.wbits=m;else if(m>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<m,t.adler=n.check=1,n.mode=512&c?10:12,c=0,u=0;break;case 2:for(;u<16;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(n.flags=c,8!==(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(w[0]=255&c,w[1]=c>>>8&255,n.check=Qe(n.check,w,2,0)),c=0,u=0,n.mode=3;case 3:for(;u<32;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.head&&(n.head.time=c),512&n.flags&&(w[0]=255&c,w[1]=c>>>8&255,w[2]=c>>>16&255,w[3]=c>>>24&255,n.check=Qe(n.check,w,4,0)),c=0,u=0,n.mode=4;case 4:for(;u<16;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(w[0]=255&c,w[1]=c>>>8&255,n.check=Qe(n.check,w,2,0)),c=0,u=0,n.mode=5;case 5:if(1024&n.flags){for(;u<16;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(w[0]=255&c,w[1]=c>>>8&255,n.check=Qe(n.check,w,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((f=n.length)>A&&(f=A),f&&(n.head&&(m=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Vt.arraySet(n.head.extra,r,o,f,m)),512&n.flags&&(n.check=Qe(n.check,r,f,o)),A-=f,o+=f,n.length-=f),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===A)break t;f=0;do{m=r[o+f++],n.head&&m&&n.length<65536&&(n.head.name+=String.fromCharCode(m))}while(m&&f<A);if(512&n.flags&&(n.check=Qe(n.check,r,f,o)),A-=f,o+=f,m)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===A)break t;f=0;do{m=r[o+f++],n.head&&m&&n.length<65536&&(n.head.comment+=String.fromCharCode(m))}while(m&&f<A);if(512&n.flags&&(n.check=Qe(n.check,r,f,o)),A-=f,o+=f,m)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;u<16;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;u<32;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}t.adler=n.check=fn(c),c=0,u=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=a,t.avail_out=s,t.next_in=o,t.avail_in=A,n.hold=c,n.bits=u,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){c>>>=7&u,u-=7&u,n.mode=27;break}for(;u<3;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}switch(n.last=1&c,u-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(mn(n),n.mode=20,6===e){c>>>=2,u-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}c>>>=2,u-=2;break;case 14:for(c>>>=7&u,u-=7&u;u<32;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if((65535&c)!==(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&c,c=0,u=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(f=n.length){if(f>A&&(f=A),f>s&&(f=s),0===f)break t;Vt.arraySet(i,r,o,f,a),A-=f,o+=f,s-=f,a+=f,n.length-=f;break}n.mode=12;break;case 17:for(;u<14;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(n.nlen=257+(31&c),c>>>=5,u-=5,n.ndist=1+(31&c),c>>>=5,u-=5,n.ncode=4+(15&c),c>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;u<3;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.lens[S[n.have++]]=7&c,c>>>=3,u-=3}for(;n.have<19;)n.lens[S[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},b=gn(0,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,b){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;p=(F=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,C=65535&F,!((I=F>>>24)<=u);){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(C<16)c>>>=I,u-=I,n.lens[n.have++]=C;else{if(16===C){for(Q=I+2;u<Q;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(c>>>=I,u-=I,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}m=n.lens[n.have-1],f=3+(3&c),c>>>=2,u-=2}else if(17===C){for(Q=I+3;u<Q;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}u-=I,m=0,f=3+(7&(c>>>=I)),c>>>=3,u-=3}else{for(Q=I+7;u<Q;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}u-=I,m=0,f=11+(127&(c>>>=I)),c>>>=7,u-=7}if(n.have+f>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;f--;)n.lens[n.have++]=m}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,E={bits:n.lenbits},b=gn(1,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,b){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},b=gn(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,b){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(A>=6&&s>=258){t.next_out=a,t.avail_out=s,t.next_in=o,t.avail_in=A,n.hold=c,n.bits=u,An(t,g),a=t.next_out,i=t.output,s=t.avail_out,o=t.next_in,r=t.input,A=t.avail_in,c=n.hold,u=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;p=(F=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,C=65535&F,!((I=F>>>24)<=u);){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(p&&0===(240&p)){for(y=I,v=p,B=C;p=(F=n.lencode[B+((c&(1<<y+v)-1)>>y)])>>>16&255,C=65535&F,!(y+(I=F>>>24)<=u);){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}c>>>=y,u-=y,n.back+=y}if(c>>>=I,u-=I,n.back+=I,n.length=C,0===p){n.mode=26;break}if(32&p){n.back=-1,n.mode=12;break}if(64&p){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&p,n.mode=22;case 22:if(n.extra){for(Q=n.extra;u<Q;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;p=(F=n.distcode[c&(1<<n.distbits)-1])>>>16&255,C=65535&F,!((I=F>>>24)<=u);){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(0===(240&p)){for(y=I,v=p,B=C;p=(F=n.distcode[B+((c&(1<<y+v)-1)>>y)])>>>16&255,C=65535&F,!(y+(I=F>>>24)<=u);){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}c>>>=y,u-=y,n.back+=y}if(c>>>=I,u-=I,n.back+=I,64&p){t.msg="invalid distance code",n.mode=30;break}n.offset=C,n.extra=15&p,n.mode=24;case 24:if(n.extra){for(Q=n.extra;u<Q;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===s)break t;if(f=g-s,n.offset>f){if((f=n.offset-f)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}f>n.wnext?(f-=n.wnext,h=n.wsize-f):h=n.wnext-f,f>n.length&&(f=n.length),d=n.window}else d=i,h=a-n.offset,f=n.length;f>s&&(f=s),s-=f,n.length-=f;do{i[a++]=d[h++]}while(--f);0===n.length&&(n.mode=21);break;case 26:if(0===s)break t;i[a++]=n.length,s--,n.mode=21;break;case 27:if(n.wrap){for(;u<32;){if(0===A)break t;A--,c|=r[o++]<<u,u+=8}if(g-=s,t.total_out+=g,n.total+=g,g&&(t.adler=n.check=n.flags?Qe(n.check,i,g,a-g):me(n.check,i,g,a-g)),g=s,(n.flags?c:fn(c))!==n.check){t.msg="incorrect data check",n.mode=30;break}c=0,u=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;u<32;){if(0===A)break t;A--,c+=r[o++]<<u,u+=8}if(c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}c=0,u=0}n.mode=29;case 29:b=1;break t;case 30:b=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=a,t.avail_out=s,t.next_in=o,t.avail_in=A,n.hold=c,n.bits=u,(n.wsize||g!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&bn(t,t.output,t.next_out,g-t.avail_out),l-=t.avail_in,g-=t.avail_out,t.total_in+=l,t.total_out+=g,n.total+=g,n.wrap&&g&&(t.adler=n.check=n.flags?Qe(n.check,i,g,t.next_out-g):me(n.check,i,g,t.next_out-g)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===l&&0===g||4===e)&&0===b&&(b=-5),b},inflateEnd:function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},inflateGetHeader:function(t,e){var n;return t&&t.state?0===(2&(n=t.state).wrap)?-2:(n.head=e,e.done=!1,0):-2},inflateSetDictionary:function(t,e){var n,r=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?-2:11===n.mode&&me(1,e,r,0)!==n.check?-3:bn(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},inflateInfo:"pako inflate (from Nodeca project)"},Qn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var Fn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},wn=Object.prototype.toString;function Sn(t){if(!(this instanceof Sn))return new Sn(t);this.options=Vt.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new en,this.strm.avail_out=0;var n=En.inflateInit2(this.strm,e.windowBits);if(n!==Qn.Z_OK)throw new Error(Fe[n]);if(this.header=new Fn,En.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"===typeof e.dictionary?e.dictionary=ze(e.dictionary):"[object ArrayBuffer]"===wn.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=En.inflateSetDictionary(this.strm,e.dictionary))!==Qn.Z_OK))throw new Error(Fe[n])}function Rn(t,e){var n=new Sn(e);if(n.push(t,!0),n.err)throw n.msg||Fe[n.err];return n.result}Sn.prototype.push=function(t,e){var n,r,i,o,a,A=this.strm,s=this.options.chunkSize,c=this.options.dictionary,u=!1;if(this.ended)return!1;r=e===~~e?e:!0===e?Qn.Z_FINISH:Qn.Z_NO_FLUSH,"string"===typeof t?A.input=qe(t):"[object ArrayBuffer]"===wn.call(t)?A.input=new Uint8Array(t):A.input=t,A.next_in=0,A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new Vt.Buf8(s),A.next_out=0,A.avail_out=s),(n=En.inflate(A,Qn.Z_NO_FLUSH))===Qn.Z_NEED_DICT&&c&&(n=En.inflateSetDictionary(this.strm,c)),n===Qn.Z_BUF_ERROR&&!0===u&&(n=Qn.Z_OK,u=!1),n!==Qn.Z_STREAM_END&&n!==Qn.Z_OK)return this.onEnd(n),this.ended=!0,!1;A.next_out&&(0!==A.avail_out&&n!==Qn.Z_STREAM_END&&(0!==A.avail_in||r!==Qn.Z_FINISH&&r!==Qn.Z_SYNC_FLUSH)||("string"===this.options.to?(i=tn(A.output,A.next_out),o=A.next_out-i,a=$e(A.output,i),A.next_out=o,A.avail_out=s-o,o&&Vt.arraySet(A.output,A.output,i,o,0),this.onData(a)):this.onData(Vt.shrinkBuf(A.output,A.next_out)))),0===A.avail_in&&0===A.avail_out&&(u=!0)}while((A.avail_in>0||0===A.avail_out)&&n!==Qn.Z_STREAM_END);return n===Qn.Z_STREAM_END&&(r=Qn.Z_FINISH),r===Qn.Z_FINISH?(n=En.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qn.Z_OK):r!==Qn.Z_SYNC_FLUSH||(this.onEnd(Qn.Z_OK),A.avail_out=0,!0)},Sn.prototype.onData=function(t){this.chunks.push(t)},Sn.prototype.onEnd=function(t){t===Qn.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Vt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Un={Inflate:Sn,inflate:Rn,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Rn(t,e)},ungzip:Rn},xn={};(0,Vt.assign)(xn,an,Un,Qn);var kn=xn,On=function(){var t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(Object(f.a)(this,t),e<0||e>9)throw new Error("Invalid gzip compression level, it should be between 0 and 9");this.level=e}return Object(c.a)(t,[{key:"encode",value:function(t){return kn.gzip(t,{level:this.level})}},{key:"decode",value:function(t,e){var n=kn.ungzip(t);return void 0!==e?(e.set(n),e):n}}],[{key:"fromConfig",value:function(e){return new t(e.level)}}]),t}();return t.codecId="gzip",t}(),Nn=function(){var t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(Object(f.a)(this,t),e<-1||e>9)throw new Error("Invalid zlib compression level, it should be between -1 and 9");this.level=e}return Object(c.a)(t,[{key:"encode",value:function(t){return kn.deflate(t,{level:this.level})}},{key:"decode",value:function(t,e){var n=kn.inflate(t);return void 0!==e?(e.set(n),e):n}}],[{key:"fromConfig",value:function(e){return new t(e.level)}}]),t}();return t.codecId="zlib",t}();function Dn(t,e){var n=function(t){if("undefined"!==typeof i&&null!=i.versions&&null!=i.versions.node)return r.from(t,"base64");for(var e=globalThis.atob(t),n=e.length,o=new Uint8Array(n),a=0;a<n;a++)o[a]=e.charCodeAt(a);return o}(e);return new Promise((function(e){var r=t({noInitialRun:!0,onRuntimeInitialized:function(){delete r.then,e(r)},wasmBinary:n})}))}var Gn,_n=function(){"undefined"!==typeof document&&document.currentScript&&document.currentScript.src;return function(t){var e;t=t||{},e||(e="undefined"!==typeof t?t:{});var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);var i,o="./this.program",a=e.print||console.log.bind(console),A=e.printErr||console.warn.bind(console);for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);r=null,e.thisProgram&&(o=e.thisProgram),e.wasmBinary&&(i=e.wasmBinary),e.noExitRuntime&&e.noExitRuntime,"object"!==typeof WebAssembly&&A("no native wasm support detected");var s,c=new WebAssembly.Table({initial:86,maximum:86,element:"anyfunc"}),u=!1,l="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(t,e,n){var r=e+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.subarray&&l)return l.decode(t.subarray(e,n));for(r="";e<n;){var i=t[e++];if(128&i){var o=63&t[e++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var a=63&t[e++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}var f,h,d,I,p,C,y,v,B,m="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function b(t){var e;for(e=t>>1;I[e];)++e;if(32<(e<<=1)-t&&m)return m.decode(d.subarray(t,e));e=0;for(var n="";;){var r=I[t+2*e>>1];if(0==r)return n;++e,n+=String.fromCharCode(r)}}function E(t,e,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=e;n=(n-=2)<2*t.length?n/2:t.length;for(var i=0;i<n;++i)I[e>>1]=t.charCodeAt(i),e+=2;return I[e>>1]=0,e-r}function Q(t){return 2*t.length}function F(t){for(var e=0,n="";;){var r=C[t+4*e>>2];if(0==r)return n;++e,65536<=r?(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r)):n+=String.fromCharCode(r)}}function w(t,e,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=e;n=r+n-4;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o)o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i);if(C[e>>2]=o,(e+=4)+4>n)break}return C[e>>2]=0,e-r}function S(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&++n,e+=4}return e}function R(t){f=t,e.HEAP8=h=new Int8Array(t),e.HEAP16=I=new Int16Array(t),e.HEAP32=C=new Int32Array(t),e.HEAPU8=d=new Uint8Array(t),e.HEAPU16=p=new Uint16Array(t),e.HEAPU32=y=new Uint32Array(t),e.HEAPF32=v=new Float32Array(t),e.HEAPF64=B=new Float64Array(t)}var U=e.INITIAL_MEMORY||16777216;function x(t){for(;0<t.length;){var n=t.shift();if("function"==typeof n)n(e);else{var r=n.ba;"number"===typeof r?void 0===n.Y?e.dynCall_v(r):e.dynCall_vi(r,n.Y):r(void 0===n.Y?null:n.Y)}}}(s=e.wasmMemory?e.wasmMemory:new WebAssembly.Memory({initial:U/65536,maximum:32768}))&&(f=s.buffer),U=f.byteLength,R(f),C[8104]=5275456;var k=[],O=[],N=[],D=[];function G(){var t=e.preRun.shift();k.unshift(t)}var _=0,M=null;function T(t){throw e.onAbort&&e.onAbort(t),a(t),A(t),u=!0,new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info.")}function j(t){var e=V;return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}function L(){return j("data:application/octet-stream;base64,")}e.preloadedImages={},e.preloadedAudios={};var V="blosc_codec.wasm";if(!L()){var Z=V;V=e.locateFile?e.locateFile(Z,""):""+Z}function P(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}O.push({ba:function(){Et()}});var W=void 0;function J(t){for(var e="";d[t];)e+=W[d[t++]];return e}var H={},Y={},X={};function z(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+t:t}function K(t,e){return t=z(t),new Function("body","return function "+t+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n')(e)}function q(t){var e=Error,n=K(t,(function(e){this.name=t,this.message=e,void 0!==(e=Error(e).stack)&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var $=void 0;function tt(t){throw new $(t)}var et=void 0;function nt(t,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||tt('type "'+r+'" must have a positive integer typeid pointer'),Y.hasOwnProperty(t)){if(n.ca)return;tt("Cannot register type '"+r+"' twice")}Y[t]=e,delete X[t],H.hasOwnProperty(t)&&(e=H[t],delete H[t],e.forEach((function(t){t()})))}var rt=[],it=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ot(t){4<t&&0===--it[t].Z&&(it[t]=void 0,rt.push(t))}function at(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=rt.length?rt.pop():it.length;return it[e]={Z:1,value:t},e}}function At(t){return this.fromWireType(y[t>>2])}function st(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function ct(t,e){switch(e){case 2:return function(t){return this.fromWireType(v[t>>2])};case 3:return function(t){return this.fromWireType(B[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ut(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function lt(t,n,r){e.hasOwnProperty(t)?((void 0===r||void 0!==e[t].W&&void 0!==e[t].W[r])&&tt("Cannot register public name '"+t+"' twice"),function(t,n){var r=e;if(void 0===r[t].W){var i=r[t];r[t]=function(){return r[t].W.hasOwnProperty(arguments.length)||tt("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[t].W+")!"),r[t].W[arguments.length].apply(this,arguments)},r[t].W=[],r[t].W[i.aa]=i}}(t,t),e.hasOwnProperty(r)&&tt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[t].W[r]=n):(e[t]=n,void 0!==r&&(e[t].ea=r))}var gt=void 0;function ft(t){var e=J(t=wt(t));return Ft(t),e}function ht(t,e,n){switch(e){case 0:return n?function(t){return h[t]}:function(t){return d[t]};case 1:return n?function(t){return I[t>>1]}:function(t){return p[t>>1]};case 2:return n?function(t){return C[t>>2]}:function(t){return y[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var dt={};function It(){if(!pt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:o||"./this.program"};for(t in dt)e[t]=dt[t];var n=[];for(t in e)n.push(t+"="+e[t]);pt=n}return pt}for(var pt,Ct=[null,[],[]],yt=Array(256),vt=0;256>vt;++vt)yt[vt]=String.fromCharCode(vt);W=yt,$=e.BindingError=q("BindingError"),et=e.InternalError=q("InternalError"),e.count_emval_handles=function(){for(var t=0,e=5;e<it.length;++e)void 0!==it[e]&&++t;return t},e.get_first_emval=function(){for(var t=5;t<it.length;++t)if(void 0!==it[t])return it[t];return null},gt=e.UnboundTypeError=q("UnboundTypeError");var Bt={o:function(t){return Qt(t)},n:function(t){throw t},u:function(t,e,n,r,i){var o=P(n);nt(t,{name:e=J(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var r=h;else if(2===n)r=I;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=C}return this.fromWireType(r[t>>o])},X:null})},s:function(t,e){nt(t,{name:e=J(e),fromWireType:function(t){var e=it[t].value;return ot(t),e},toWireType:function(t,e){return at(e)},argPackAdvance:8,readValueFromPointer:At,X:null})},f:function(t,e,n){n=P(n),nt(t,{name:e=J(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!==typeof e&&"boolean"!==typeof e)throw new TypeError('Cannot convert "'+st(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:ct(e,n),X:null})},d:function(t,n,r,i,o,a){var A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(C[(e>>2)+r]);return n}(n,r);t=J(t),o=function(t,n){t=J(t);for(var r=e["dynCall_"+t],i=[],o=1;o<t.length;++o)i.push("a"+o);return o="return function dynCall_"+t+"_"+n+"("+i.join(", ")+") {\n",o+="    return dynCall(rawFunction"+(i.length?", ":"")+i.join(", ")+");\n","function"!==typeof(r=new Function("dynCall","rawFunction",o+"};\n")(r,n))&&tt("unknown function pointer with signature "+t+": "+n),r}(i,o),lt(t,(function(){!function(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||Y[e]||(X[e]?X[e].forEach(t):(n.push(e),r[e]=!0))})),new gt(t+": "+n.map(ft).join([", "]))}("Cannot call "+t+" due to unbound types",A)}),n-1),function(t,e){function n(t){if((t=e(t)).length!==r.length)throw new et("Mismatched type converter count");for(var n=0;n<r.length;++n)nt(r[n],t[n])}var r=[];r.forEach((function(e){X[e]=t}));var i=Array(t.length),o=[],a=0;t.forEach((function(t,e){Y.hasOwnProperty(t)?i[e]=Y[t]:(o.push(t),H.hasOwnProperty(t)||(H[t]=[]),H[t].push((function(){i[e]=Y[t],++a===o.length&&n(i)})))})),0===o.length&&n(i)}(A,(function(r){var i=t,A=t;r=[r[0],null].concat(r.slice(1));var s=o,c=r.length;2>c&&tt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=null!==r[1]&&!1,l=!1,g=1;g<r.length;++g)if(null!==r[g]&&void 0===r[g].X){l=!0;break}var f="void"!==r[0].name,h="",d="";for(g=0;g<c-2;++g)h+=(0!==g?", ":"")+"arg"+g,d+=(0!==g?", ":"")+"arg"+g+"Wired";A="return function "+z(A)+"("+h+") {\nif (arguments.length !== "+(c-2)+") {\nthrowBindingError('function "+A+" called with ' + arguments.length + ' arguments, expected "+(c-2)+" args!');\n}\n",l&&(A+="var destructors = [];\n");var I=l?"destructors":"null";for(h="throwBindingError invoker fn runDestructors retType classParam".split(" "),s=[tt,s,a,ut,r[0],r[1]],u&&(A+="var thisWired = classParam.toWireType("+I+", this);\n"),g=0;g<c-2;++g)A+="var arg"+g+"Wired = argType"+g+".toWireType("+I+", arg"+g+"); // "+r[g+2].name+"\n",h.push("argType"+g),s.push(r[g+2]);if(u&&(d="thisWired"+(0<d.length?", ":"")+d),A+=(f?"var rv = ":"")+"invoker(fn"+(0<d.length?", ":"")+d+");\n",l)A+="runDestructors(destructors);\n";else for(g=u?1:2;g<r.length;++g)c=1===g?"thisWired":"arg"+(g-2)+"Wired",null!==r[g].X&&(A+=c+"_dtor("+c+"); // "+r[g].name+"\n",h.push(c+"_dtor"),s.push(r[g].X));if(f&&(A+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),h.push(A+"}\n"),r=function(t){var e=Function;if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=K(e.name||"unknownFunctionName",(function(){}));return n.prototype=e.prototype,n=new n,(t=e.apply(n,t))instanceof Object?t:n}(h).apply(null,s),g=n-1,!e.hasOwnProperty(i))throw new et("Replacing nonexistant public symbol");return void 0!==e[i].W&&void 0!==g?e[i].W[g]=r:(e[i]=r,e[i].aa=g),[]}))},b:function(t,e,n,r,i){function o(t){return t}e=J(e),-1===i&&(i=4294967295);var a=P(n);if(0===r){var A=32-8*n;o=function(t){return t<<A>>>A}}var s=-1!=e.indexOf("unsigned");nt(t,{name:e,fromWireType:o,toWireType:function(t,n){if("number"!==typeof n&&"boolean"!==typeof n)throw new TypeError('Cannot convert "'+st(n)+'" to '+this.name);if(n<r||n>i)throw new TypeError('Passing a number "'+st(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+i+"]!");return s?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:ht(e,a,0!==r),X:null})},a:function(t,e,n){function r(t){var e=y;return new i(f,e[(t>>=2)+1],e[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];nt(t,{name:n=J(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{ca:!0})},g:function(t,e){var n="std::string"===(e=J(e));nt(t,{name:e,fromWireType:function(t){var e=y[t>>2];if(n){var r=d[t+4+e],i=0;0!=r&&(i=r,d[t+4+e]=0);var o=t+4;for(r=0;r<=e;++r){var a=t+4+r;if(0==d[a]){if(o=o?g(d,o,void 0):"",void 0===A)var A=o;else A+=String.fromCharCode(0),A+=o;o=a+1}}0!=i&&(d[t+4+e]=i)}else{for(A=Array(e),r=0;r<e;++r)A[r]=String.fromCharCode(d[t+4+r]);A=A.join("")}return Ft(t),A},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"===typeof e;r||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||tt("Cannot pass non-string to std::string");var i=(n&&r?function(){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),127>=r?++t:t=2047>=r?t+2:65535>=r?t+3:t+4}return t}:function(){return e.length})(),o=Qt(4+i+1);if(y[o>>2]=i,n&&r)!function(t,e,n){var r=d;if(0<n){n=e+n-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o)o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i);if(127>=o){if(e>=n)break;r[e++]=o}else{if(2047>=o){if(e+1>=n)break;r[e++]=192|o>>6}else{if(65535>=o){if(e+2>=n)break;r[e++]=224|o>>12}else{if(e+3>=n)break;r[e++]=240|o>>18,r[e++]=128|o>>12&63}r[e++]=128|o>>6&63}r[e++]=128|63&o}}r[e]=0}}(e,o+4,i+1);else if(r)for(r=0;r<i;++r){var a=e.charCodeAt(r);255<a&&(Ft(o),tt("String has UTF-16 code units that do not fit in 8 bits")),d[o+4+r]=a}else for(r=0;r<i;++r)d[o+4+r]=e[r];return null!==t&&t.push(Ft,o),o},argPackAdvance:8,readValueFromPointer:At,X:function(t){Ft(t)}})},c:function(t,e,n){if(n=J(n),2===e)var r=b,i=E,o=Q,a=function(){return p},A=1;else 4===e&&(r=F,i=w,o=S,a=function(){return y},A=2);nt(t,{name:n,fromWireType:function(t){var n=y[t>>2],i=a(),o=i[t+4+n*e>>A],s=0;0!=o&&(s=o,i[t+4+n*e>>A]=0);var c=t+4;for(o=0;o<=n;++o){var u=t+4+o*e;if(0==i[u>>A]){if(c=r(c),void 0===l)var l=c;else l+=String.fromCharCode(0),l+=c;c=u+e}}return 0!=s&&(i[t+4+n*e>>A]=s),Ft(t),l},toWireType:function(t,r){"string"!==typeof r&&tt("Cannot pass non-string to C++ string type "+n);var a=o(r),s=Qt(4+a+e);return y[s>>2]=a>>A,i(r,s+4,a+e),null!==t&&t.push(Ft,s),s},argPackAdvance:8,readValueFromPointer:At,X:function(t){Ft(t)}})},v:function(t,e){nt(t,{da:!0,name:e=J(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},m:ot,t:function(t){4<t&&(it[t].Z+=1)},B:function(t,e){var n=Y[t];return void 0===n&&tt("_emval_take_value has unknown type "+ft(t)),at(t=n.readValueFromPointer(e))},w:function(){T()},q:function(t,e,n){d.copyWithin(t,e,e+n)},r:function(t){t>>>=0;var e=d.length;if(2147483648<t)return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296),0<(r=Math.max(16777216,t,r))%65536&&(r+=65536-r%65536);t:{try{s.grow(Math.min(2147483648,r)-f.byteLength+65535>>>16),R(s.buffer);var i=1;break t}catch(o){}i=void 0}if(i)return!0}return!1},x:function(t,e){var n=0;return It().forEach((function(r,i){var o=e+n;for(i=C[t+4*i>>2]=o,o=0;o<r.length;++o)h[i++>>0]=r.charCodeAt(o);h[i>>0]=0,n+=r.length+1})),0},y:function(t,e){var n=It();C[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),C[e>>2]=r,0},z:function(){return 0},p:function(){},h:function(t,e,n,r){for(var i=0,o=0;o<n;o++){for(var s=C[e+8*o>>2],c=C[e+(8*o+4)>>2],u=0;u<c;u++){var l=d[s+u],f=Ct[t];0===l||10===l?((1===t?a:A)(g(f,0)),f.length=0):f.push(l)}i+=c}return C[r>>2]=i,0},memory:s,k:function(){return 0},j:function(){return 0},i:function(){},A:function(){return 6},l:function(){},e:function(){},table:c},mt=function(){function t(t){e.asm=t.exports,_--,e.monitorRunDependencies&&e.monitorRunDependencies(_),0==_&&M&&(t=M,M=null,t())}function n(e){t(e.instance)}function r(t){return new Promise((function(t){t:{try{if(i){var e=new Uint8Array(i);break t}throw"both async and sync fetching of the wasm failed"}catch(r){T(r)}e=void 0}t(e)})).then((function(t){return WebAssembly.instantiate(t,o)})).then(t,(function(t){A("failed to asynchronously prepare wasm: "+t),T(t)}))}var o={a:Bt};if(_++,e.monitorRunDependencies&&e.monitorRunDependencies(_),e.instantiateWasm)try{return e.instantiateWasm(o,t)}catch(a){return A("Module.instantiateWasm callback failed with error: "+a),!1}return function(){if(i||"function"!==typeof WebAssembly.instantiateStreaming||L()||j("file://")||"function"!==typeof fetch)return r(n);fetch(V,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,o).then(n,(function(t){A("wasm streaming compile failed: "+t),A("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),{}}();e.asm=mt;var bt,Et=e.___wasm_call_ctors=function(){return(Et=e.___wasm_call_ctors=e.asm.C).apply(null,arguments)},Qt=e._malloc=function(){return(Qt=e._malloc=e.asm.D).apply(null,arguments)},Ft=e._free=function(){return(Ft=e._free=e.asm.E).apply(null,arguments)},wt=e.___getTypeName=function(){return(wt=e.___getTypeName=e.asm.F).apply(null,arguments)};function St(){function t(){if(!bt&&(bt=!0,e.calledRun=!0,!u)){if(x(O),x(N),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();D.unshift(t)}x(D)}}if(!(0<_)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)G();x(k),0<_||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.G).apply(null,arguments)},e.dynCall_ii=function(){return(e.dynCall_ii=e.asm.H).apply(null,arguments)},e.dynCall_vi=function(){return(e.dynCall_vi=e.asm.I).apply(null,arguments)},e.dynCall_iii=function(){return(e.dynCall_iii=e.asm.J).apply(null,arguments)},e.dynCall_vii=function(){return(e.dynCall_vii=e.asm.K).apply(null,arguments)},e.dynCall_viii=function(){return(e.dynCall_viii=e.asm.L).apply(null,arguments)},e.dynCall_iiii=function(){return(e.dynCall_iiii=e.asm.M).apply(null,arguments)},e.dynCall_iiiiiii=function(){return(e.dynCall_iiiiiii=e.asm.N).apply(null,arguments)},e.dynCall_viiiiii=function(){return(e.dynCall_viiiiii=e.asm.O).apply(null,arguments)},e.dynCall_v=function(){return(e.dynCall_v=e.asm.P).apply(null,arguments)},e.dynCall_iiiii=function(){return(e.dynCall_iiiii=e.asm.Q).apply(null,arguments)},e.dynCall_jiiiii=function(){return(e.dynCall_jiiiii=e.asm.R).apply(null,arguments)},e.dynCall_viiii=function(){return(e.dynCall_viiii=e.asm.S).apply(null,arguments)},e.dynCall_iiiiii=function(){return(e.dynCall_iiiiii=e.asm.T).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.U).apply(null,arguments)},e.dynCall_viiiii=function(){return(e.dynCall_viiiii=e.asm.V).apply(null,arguments)},e.asm=mt,e.then=function(t){if(bt)t(e);else{var n=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){n&&n(),t(e)}}return e},M=function t(){bt||St(),bt||(M=t)},e.run=St,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return!0,St(),t}}(),Mn=" ";!function(t){t[t.NOSHUFFLE=0]="NOSHUFFLE",t[t.SHUFFLE=1]="SHUFFLE",t[t.BITSHUFFLE=2]="BITSHUFFLE",t[t.AUTOSHUFFLE=-1]="AUTOSHUFFLE"}(Gn||(Gn={}));var Tn,jn=new Set(["blosclz","lz4","lz4hc","snappy","zlib","zstd"]),Ln=function(){var t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"lz4",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gn.SHUFFLE,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(Object(f.a)(this,t),e<0||e>9)throw new Error("Invalid compression level: '".concat(e,"'. It should be between 0 and 9"));if(!jn.has(n))throw new Error("Invalid compressor '".concat(n,"'. Valid compressors include\n        'blosclz', 'lz4', 'lz4hc','snappy', 'zlib', 'zstd'."));if(r<-1||r>2)throw new Error("Invalid shuffle ".concat(r,". Must be one of 0 (NOSHUFFLE),\n        1 (SHUFFLE), 2 (BITSHUFFLE), -1 (AUTOSHUFFLE)."));this.blocksize=i,this.clevel=e,this.cname=n,this.shuffle=r}return Object(c.a)(t,[{key:"encode",value:function(){var t=Object(o.a)(l.a.mark((function t(e){var n,r,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Tn||(Tn=Dn(_n,Mn)),t.next=3,Tn;case 3:return n=t.sent,r=n.compress(e,this.cname,this.clevel,this.shuffle,this.blocksize),i=new Uint8Array(r),n.free_result(),t.abrupt("return",i);case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"decode",value:function(){var t=Object(o.a)(l.a.mark((function t(e,n){var r,i,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Tn||(Tn=Dn(_n,Mn)),t.next=3,Tn;case 3:if(r=t.sent,i=r.decompress(e),o=new Uint8Array(i),r.free_result(),void 0===n){t.next=10;break}return n.set(o),t.abrupt("return",n);case 10:return t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}],[{key:"fromConfig",value:function(e){var n=e.blocksize;return new t(e.clevel,e.cname,e.shuffle,n)}}]),t}();return t.codecId="blosc",t.COMPRESSORS=Object(s.a)(jn),t.NOSHUFFLE=Gn.NOSHUFFLE,t.SHUFFLE=Gn.SHUFFLE,t.BITSHUFFLE=Gn.BITSHUFFLE,t.AUTOSHUFFLE=Gn.AUTOSHUFFLE,t}(),Vn=(new Map).set(Nn.codecId,Nn).set(On.codecId,On).set(Ln.codecId,Ln);function Zn(t){if(!Vn.has(t.id))throw new Error("Compression codec ".concat(t.id," is not supported by Zarr.js yet."));return Vn.get(t.id).fromConfig(t)}var Pn=b((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var A=new i(r,o||t,a),s=n?n+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],A]:t._events[s].push(A):(t._events[s]=A,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function A(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),A.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},A.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},A.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},A.prototype.emit=function(t,e,r,i,o,a){var A=n?n+t:t;if(!this._events[A])return!1;var s,c,u=this._events[A],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(c=1,s=new Array(l-1);c<l;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var g,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),l){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,r);break;case 4:u[c].fn.call(u[c].context,e,r,i);break;default:if(!s)for(g=1,s=new Array(l-1);g<l;g++)s[g-1]=arguments[g];u[c].fn.apply(u[c].context,s)}}return!0},A.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},A.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},A.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var A=this._events[o];if(A.fn)A.fn!==e||i&&!A.once||r&&A.context!==r||a(this,o);else{for(var s=0,c=[],u=A.length;s<u;s++)(A[s].fn!==e||i&&!A[s].once||r&&A[s].context!==r)&&c.push(A[s]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},A.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=n,A.EventEmitter=A,t.exports=A})),Wn=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(f.a)(this,n),(r=e.call(this,t)).name="TimeoutError",r}return n}(Object(p.a)(Error)),Jn=function(t,e,n){return new Promise((function(r,i){if("number"!==typeof e||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e!==1/0){var o=setTimeout((function(){if("function"!==typeof n){var o="string"===typeof n?n:"Promise timed out after ".concat(e," milliseconds"),a=n instanceof Error?n:new Wn(o);"function"===typeof t.cancel&&t.cancel(),i(a)}else try{r(n())}catch(A){i(A)}}),e);!function(t,e){e=e||function(){},t.then((function(t){return new Promise((function(t){t(e())})).then((function(){return t}))}),(function(t){return new Promise((function(t){t(e())})).then((function(){throw t}))}))}(t.then(r,i),(function(){clearTimeout(o)}))}else r(t)}))},Hn=Jn,Yn=Jn,Xn=Wn;Hn.default=Yn,Hn.TimeoutError=Xn;var zn=b((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){for(var r=0,i=t.length;i>0;){var o=i/2|0,a=r+o;n(t[a],e)<=0?(r=++a,i-=o+1):i=o}return r}}));m(zn);var Kn=b((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){Object(f.a)(this,t),this._queue=[]}return Object(c.a)(t,[{key:"enqueue",value:function(t,e){var n={priority:(e=Object.assign({priority:0},e)).priority,run:t};if(this.size&&this._queue[this.size-1].priority>=e.priority)this._queue.push(n);else{var r=zn.default(this._queue,n,(function(t,e){return e.priority-t.priority}));this._queue.splice(r,0,n)}}},{key:"dequeue",value:function(){var t=this._queue.shift();return t&&t.run}},{key:"size",get:function(){return this._queue.length}}]),t}();e.default=n}));m(Kn);var qn=m(b((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){},r=new Hn.default.TimeoutError,i=function(t){Object(d.a)(i,t);var e=Object(I.a)(i);function i(t){var r;if(Object(f.a)(this,i),(r=e.call(this))._intervalCount=0,r._intervalEnd=0,r._pendingCount=0,r._resolveEmpty=n,r._resolveIdle=n,!("number"===typeof(t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Kn.default},t)).intervalCap&&t.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(t.intervalCap,"` (").concat(typeof t.intervalCap,")"));if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(t.interval,"` (").concat(typeof t.interval,")"));return r._carryoverConcurrencyCount=t.carryoverConcurrencyCount,r._isIntervalIgnored=t.intervalCap===1/0||0===t.interval,r._intervalCap=t.intervalCap,r._interval=t.interval,r._queue=new t.queueClass,r._queueClass=t.queueClass,r.concurrency=t.concurrency,r._timeout=t.timeout,r._throwOnTimeout=!0===t.throwOnTimeout,r._isPaused=!1===t.autoStart,r}return Object(c.a)(i,[{key:"_next",value:function(){this._pendingCount--,this._tryToStartAnother()}},{key:"_resolvePromises",value:function(){this._resolveEmpty(),this._resolveEmpty=n,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=n)}},{key:"_onResumeInterval",value:function(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}},{key:"_isIntervalPaused",value:function(){var t=this,e=Date.now();if(void 0===this._intervalId){var n=this._intervalEnd-e;if(!(n<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout((function(){t._onResumeInterval()}),n)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}},{key:"_tryToStartAnother",value:function(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){var t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother)return this.emit("active"),this._queue.dequeue()(),t&&this._initializeIntervalIfNeeded(),!0}return!1}},{key:"_initializeIntervalIfNeeded",value:function(){var t=this;this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((function(){t._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}},{key:"_onInterval",value:function(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}},{key:"_processQueue",value:function(){for(;this._tryToStartAnother(););}},{key:"add",value:function(){var t=Object(o.a)(l.a.mark((function t(e){var n,i=this,a=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},t.abrupt("return",new Promise((function(t,a){var A=function(){var A=Object(o.a)(l.a.mark((function o(){var A;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i._pendingCount++,i._intervalCount++,o.prev=2,A=void 0===i._timeout&&void 0===n.timeout?e():Hn.default(Promise.resolve(e()),void 0===n.timeout?i._timeout:n.timeout,(function(){(void 0===n.throwOnTimeout?i._throwOnTimeout:n.throwOnTimeout)&&a(r)})),o.t0=t,o.next=7,A;case 7:o.t1=o.sent,(0,o.t0)(o.t1),o.next=14;break;case 11:o.prev=11,o.t2=o.catch(2),a(o.t2);case 14:i._next();case 15:case"end":return o.stop()}}),o,null,[[2,11]])})));return function(){return A.apply(this,arguments)}}();i._queue.enqueue(A,n),i._tryToStartAnother()})));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"addAll",value:function(){var t=Object(o.a)(l.a.mark((function t(e,n){var r=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.all(e.map(function(){var t=Object(o.a)(l.a.mark((function t(e){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.add(e,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"start",value:function(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}},{key:"pause",value:function(){this._isPaused=!0}},{key:"clear",value:function(){this._queue=new this._queueClass}},{key:"onEmpty",value:function(){var t=Object(o.a)(l.a.mark((function t(){var e=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==this._queue.size){t.next=2;break}return t.abrupt("return");case 2:return t.abrupt("return",new Promise((function(t){var n=e._resolveEmpty;e._resolveEmpty=function(){n(),t()}})));case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"onIdle",value:function(){var t=Object(o.a)(l.a.mark((function t(){var e=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==this._pendingCount||0!==this._queue.size){t.next=2;break}return t.abrupt("return");case 2:return t.abrupt("return",new Promise((function(t){var n=e._resolveIdle;e._resolveIdle=function(){n(),t()}})));case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_doesIntervalAllowAnother",get:function(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}},{key:"_doesConcurrentAllowAnother",get:function(){return this._pendingCount<this._concurrency}},{key:"concurrency",get:function(){return this._concurrency},set:function(t){if(!("number"===typeof t&&t>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(t,"` (").concat(typeof t,")"));this._concurrency=t,this._processQueue()}},{key:"size",get:function(){return this._queue.size}},{key:"pending",get:function(){return this._pendingCount}},{key:"isPaused",get:function(){return this._isPaused}},{key:"timeout",set:function(t){this._timeout=t},get:function(){return this._timeout}}]),i}(Pn);e.default=i}))),$n=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],A=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];Object(f.a)(this,t),this.store=e,this._chunkStore=o,this.path=st(n),this.keyPrefix=Bt(this.path),this.readOnly=i,this.cacheMetadata=a,this.cacheAttrs=A,this.meta=r,null!==this.meta.compressor?this.compressor=Zn(this.meta.compressor):this.compressor=null;var s=this.keyPrefix+".zattributes";this.attrs=new wt(this.store,s,this.readOnly,A)}return Object(c.a)(t,[{key:"reloadMetadata",value:function(){return v(this,void 0,void 0,l.a.mark((function t(){var e,n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.keyPrefix+".zarray",n=this.store.getItem(e),t.t0=Ft,t.next=5,n;case 5:return t.t1=t.sent,this.meta=(0,t.t0)(t.t1),t.abrupt("return",this.meta);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"refreshMetadata",value:function(){return v(this,void 0,void 0,l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.cacheMetadata){t.next=3;break}return t.next=3,this.reloadMetadata();case 3:case"end":return t.stop()}}),t,this)})))}},{key:"get",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getBasicSelection(t,!1,e)}},{key:"getRaw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getBasicSelection(t,!0,e)}},{key:"getBasicSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.concurrencyLimit,i=void 0===r?10:r,o=n.progressCallback;return v(this,void 0,void 0,l.a.mark((function n(){return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.cacheMetadata){n.next=3;break}return n.next=3,this.reloadMetadata();case 3:if(this.shape!==[]){n.next=7;break}throw new Error("Shape [] indexing is not supported yet");case 7:return n.abrupt("return",this.getBasicSelectionND(t,e,i,o));case 8:case"end":return n.stop()}}),n,this)})))}},{key:"getBasicSelectionND",value:function(t,e,n,r){var i=new rt(t,this);return this.getSelection(i,e,n,r)}},{key:"getSelection",value:function(t,e,n,r){return v(this,void 0,void 0,l.a.mark((function i(){var o,a,A,s,c,u,f,h,d,I,p,C,y=this;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(o=this.dtype,a=t.shape,A=t.shape.reduce((function(t,e){return t*e}),1),!e||A!==this.chunkSize){i.next=12;break}if(s=t.iter(),!1!==(c=s.next()).done||!0!==s.next().done){i.next=12;break}return u=c.value,i.next=10,this.decodeDirectToRawArray(u,a,A);case 10:return f=i.sent,i.abrupt("return",f);case 12:if(h=e?new Lt(null,a,o):new Gt(null,a,o),0!==A){i.next=15;break}return i.abrupt("return",h);case 15:if(d=new qn({concurrency:n}),r)!function(){var e,n=0,i=0,o=Object(g.a)(t.iter());try{for(o.s();!(e=o.n()).done;){e.value;i+=1}}catch(we){o.e(we)}finally{o.f()}r({progress:0,queueSize:i});var a,A=Object(g.a)(t.iter());try{var s=function(){var e=a.value;v(y,void 0,void 0,l.a.mark((function o(){var a=this;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,d.add((function(){return a.chunkGetItem(e.chunkCoords,e.chunkSelection,h,e.outSelection,t.dropAxes)}));case 2:r({progress:n+=1,queueSize:i});case 4:case"end":return o.stop()}}),o)})))};for(A.s();!(a=A.n()).done;)s()}catch(we){A.e(we)}finally{A.f()}}();else{I=Object(g.a)(t.iter());try{for(C=function(){var e=p.value;d.add((function(){return y.chunkGetItem(e.chunkCoords,e.chunkSelection,h,e.outSelection,t.dropAxes)}))},I.s();!(p=I.n()).done;)C()}catch(we){I.e(we)}finally{I.f()}}return i.next=19,d.onIdle();case 19:if(0!==h.shape.length){i.next=21;break}return i.abrupt("return",h.data[0]);case 21:return i.abrupt("return",h);case 22:case"end":return i.stop()}}),i,this)})))}},{key:"chunkGetItem",value:function(t,e,n,r,i){return v(this,void 0,void 0,l.a.mark((function o(){var a,A,s,c,u;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(t.length===this._chunkDataShape.length){o.next=2;break}throw new Z("Inconsistent shapes: chunkCoordsLength: ".concat(t.length,", cDataShapeLength: ").concat(this.chunkDataShape.length));case 2:return a=this.chunkKey(t),o.prev=3,o.next=6,this.chunkStore.getItem(a);case 6:return A=o.sent,o.next=9,this.decodeChunk(A);case 9:if(s=o.sent,!(n instanceof Gt)){o.next=21;break}if(!et(r)||!ht(e,this.chunks)||this.meta.filters){o.next=14;break}return n.set(r,this.toNestedArray(s)),o.abrupt("return");case 14:if(c=this.toNestedArray(s),u=c.get(e),null===i){o.next=18;break}throw new Error("Drop axes is not supported yet");case 18:n.set(r,u),o.next=22;break;case 21:n.set(r,this.chunkBufferToRawArray(s),e);case 22:o.next=31;break;case 24:if(o.prev=24,o.t0=o.catch(3),!(o.t0 instanceof M)){o.next=30;break}null!==this.fillValue&&n.set(r,this.fillValue),o.next=31;break;case 30:throw new o.t0;case 31:case"end":return o.stop()}}),o,this,[[3,24]])})))}},{key:"getRawChunk",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n,r,i,o,a,A;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length===this.shape.length){e.next=2;break}throw new Error("Chunk coordinates ".concat(t.join(".")," do not correspond to shape ").concat(this.shape,"."));case 2:for(e.prev=2,n=0;n<t.length;n++)r=Math.ceil(this.shape[n]/this.chunks[n]),t[n]=K(t[n],r);e.next=13;break;case 6:if(e.prev=6,e.t0=e.catch(2),!(e.t0 instanceof j)){e.next=12;break}throw new j("index ".concat(t.join(".")," is out of bounds for shape: ").concat(this.shape," and chunks ").concat(this.chunks));case 12:throw new e.t0;case 13:return i=this.chunkKey(t),o=this.chunkStore.getItem(i),e.t1=this,e.next=18,o;case 18:return e.t2=e.sent,e.next=21,e.t1.decodeChunk.call(e.t1,e.t2);case 21:return a=e.sent,A=this.chunks.filter((function(t){return 1!==t})),e.abrupt("return",new Lt(a,A,this.dtype));case 24:case"end":return e.stop()}}),e,this,[[2,6]])})))}},{key:"chunkKey",value:function(t){return this.keyPrefix+t.join(".")}},{key:"ensureByteArray",value:function(t){return"string"===typeof t?new Uint8Array(r.from(t).buffer):new Uint8Array(t)}},{key:"toTypedArray",value:function(t){return new St[this.dtype](t)}},{key:"toNestedArray",value:function(t){var e=this.ensureByteArray(t).buffer;return new Gt(e,this.chunks,this.dtype)}},{key:"decodeChunk",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.ensureByteArray(t),null===this.compressor){e.next=5;break}return e.next=4,this.compressor.decode(n);case 4:n=e.sent;case 5:return this.dtype.includes(">")&&pt(this.toTypedArray(n.buffer)),e.abrupt("return",n.buffer);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"chunkBufferToRawArray",value:function(t){return new Lt(t,this.chunks,this.dtype)}},{key:"decodeDirectToRawArray",value:function(t,e,n){var r=t.chunkCoords;return v(this,void 0,void 0,l.a.mark((function t(){var i,o,a;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.chunkKey(r),t.prev=1,t.next=4,this.chunkStore.getItem(i);case 4:return o=t.sent,t.t0=Lt,t.next=8,this.decodeChunk(o);case 8:return t.t1=t.sent,t.t2=e,t.t3=this.dtype,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3));case 14:if(t.prev=14,t.t4=t.catch(1),!(t.t4 instanceof M)){t.next=21;break}return a=new St[this.dtype](n),t.abrupt("return",new Lt(a.fill(this.fillValue),e));case 21:throw new t.t4;case 22:case"end":return t.stop()}}),t,this,[[1,14]])})))}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,void 0,void 0,l.a.mark((function r(){return l.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.setBasicSelection(t,e,n);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"setBasicSelection",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.concurrencyLimit,i=void 0===r?10:r,o=n.progressCallback;return v(this,void 0,void 0,l.a.mark((function n(){return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.readOnly){n.next=2;break}throw new _("Object is read only");case 2:if(this.cacheMetadata){n.next=5;break}return n.next=5,this.reloadMetadata();case 5:if(this.shape!==[]){n.next=9;break}throw new Error("Shape [] indexing is not supported yet");case 9:return n.next=11,this.setBasicSelectionND(t,e,i,o);case 11:case"end":return n.stop()}}),n,this)})))}},{key:"setBasicSelectionND",value:function(t,e,n,r){return v(this,void 0,void 0,l.a.mark((function i(){var o;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=new rt(t,this),i.next=3,this.setSelection(o,e,n,r);case 3:case"end":return i.stop()}}),i,this)})))}},{key:"getChunkValue",value:function(t,e,n,r){var i;if(r===[])i=n;else if("number"===typeof n)i=n;else if(i=n.get(t.outSelection),null!==e.dropAxes)throw new Error("Handling drop axes not supported yet");return i}},{key:"setSelection",value:function(t,e,n,r){return v(this,void 0,void 0,l.a.mark((function i(){var o,a,A,s,c,u=this;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if((o=t.shape)!==[]){i.next=5;break}i.next=15;break;case 5:if("number"!==typeof e){i.next=9;break}i.next=15;break;case 9:if(!(e instanceof Gt)){i.next=14;break}if(dt(e.shape,o)){i.next=12;break}throw new Z("Shape mismatch in source NestedArray and set selection: ".concat(e.shape," and ").concat(o));case 12:i.next=15;break;case 14:throw new Error("Unknown data type for setting :(");case 15:if(a=new qn({concurrency:n}),r)!function(){var n,i=0,A=Object(g.a)(t.iter());try{for(A.s();!(n=A.n()).done;){n.value;i+=1}}catch(we){A.e(we)}finally{A.f()}var s=0;r({progress:0,queueSize:i});var c,f=Object(g.a)(t.iter());try{var h=function(){var n=c.value,A=u.getChunkValue(n,t,e,o);v(u,void 0,void 0,l.a.mark((function t(){var e=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.add((function(){return e.chunkSetItem(n.chunkCoords,n.chunkSelection,A)}));case 2:r({progress:s+=1,queueSize:i});case 4:case"end":return t.stop()}}),t)})))};for(f.s();!(c=f.n()).done;)h()}catch(we){f.e(we)}finally{f.f()}}();else{A=Object(g.a)(t.iter());try{for(c=function(){var n=s.value,r=u.getChunkValue(n,t,e,o);a.add((function(){return u.chunkSetItem(n.chunkCoords,n.chunkSelection,r)}))},A.s();!(s=A.n()).done;)c()}catch(we){A.e(we)}finally{A.f()}}return i.next=19,a.onIdle();case 19:case"end":return i.stop()}}),i)})))}},{key:"chunkSetItem",value:function(t,e,n){return v(this,void 0,void 0,l.a.mark((function r(){var i,o,a,A,s,c,u,g,f;return l.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=this.chunkKey(t),o=null,a=St[this.dtype],A=this.chunkSize,!ht(e,this.chunks)){r.next=8;break}"number"===typeof n?(o=new a(A)).fill(n):o=n.flatten(),r.next=29;break;case 8:return r.prev=8,r.next=11,this.chunkStore.getItem(i);case 11:return c=r.sent,r.next=14,this.decodeChunk(c);case 14:u=r.sent,s=this.toTypedArray(u),r.next=26;break;case 18:if(r.prev=18,r.t0=r.catch(8),!(r.t0 instanceof M)){r.next=25;break}s=new a(A),null!==this.fillValue&&s.fill(this.fillValue),r.next=26;break;case 25:throw r.t0;case 26:(g=new Gt(s,this.chunks,this.dtype)).set(e,n),o=g.flatten();case 29:return r.next=31,this.encodeChunk(o);case 31:f=r.sent,this.chunkStore.setItem(i,f);case 33:case"end":return r.stop()}}),r,this,[[8,18]])})))}},{key:"encodeChunk",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.dtype.includes(">")&&(t=Ct(t)),null===this.compressor){e.next=7;break}return n=new Uint8Array(t.buffer),e.next=5,this.compressor.encode(n);case 5:return r=e.sent,e.abrupt("return",r.buffer);case 7:return e.abrupt("return",t.buffer);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"chunkStore",get:function(){return this._chunkStore?this._chunkStore:this.store}},{key:"name",get:function(){return this.path.length>0?"/"!==this.path[0]?"/"+this.path:this.path:null}},{key:"basename",get:function(){var t=this.name;if(null===t)return null;var e=t.split("/");return e[e.length-1]}},{key:"shape",get:function(){return this.meta.shape}},{key:"chunks",get:function(){return this.meta.chunks}},{key:"chunkSize",get:function(){return this.chunks.reduce((function(t,e){return t*e}),1)}},{key:"dtype",get:function(){return this.meta.dtype}},{key:"fillValue",get:function(){var t=this.meta.fill_value;return"NaN"===t?NaN:"Infinity"===t?1/0:"-Infinity"===t?-1/0:this.meta.fill_value}},{key:"nDims",get:function(){return this.meta.shape.length}},{key:"size",get:function(){return this.meta.shape.reduce((function(t,e){return t*e}),1)}},{key:"length",get:function(){return this.shape[0]}},{key:"_chunkDataShape",get:function(){if(this.shape===[])return[1];for(var t=[],e=0;e<this.shape.length;e++)t[e]=Math.ceil(this.shape[e]/this.chunks[e]);return t}},{key:"chunkDataShape",get:function(){return this._chunkDataShape}},{key:"numChunks",get:function(){return this.chunkDataShape.reduce((function(t,e){return t*e}),1)}}],[{key:"create",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];return v(this,void 0,void 0,l.a.mark((function A(){var s;return l.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.loadMetadataForConstructor(e,n);case 2:return s=A.sent,A.abrupt("return",new t(e,n,s,r,i,o,a));case 4:case"end":return A.stop()}}),A,this)})))}},{key:"loadMetadataForConstructor",value:function(t,e){return v(this,void 0,void 0,l.a.mark((function n(){var r,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e=st(e),r=Bt(e),n.next=5,t.getItem(r+".zarray");case 5:return i=n.sent,n.abrupt("return",Ft(i));case 9:throw n.prev=9,n.t0=n.catch(0),new Error("Failed to load metadata for ZarrArray:"+n.t0.toString());case 12:case"end":return n.stop()}}),n,null,[[0,9]])})))}}]),t}(),tr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,t),this.root=e}return Object(c.a)(t,[{key:"proxy",value:function(){return y(this)}},{key:"getParent",value:function(t){var e,n=this.root,r=t.split("/"),i=Object(g.a)(r.slice(0,r.length-1));try{for(i.s();!(e=i.n()).done;){if(!(n=n[e.value]))throw Error(t)}}catch(we){i.e(we)}finally{i.f()}return[n,r[r.length-1]]}},{key:"requireParent",value:function(t){var e,n=this.root,r=t.split("/"),i=Object(g.a)(r.slice(0,r.length-1));try{for(i.s();!(e=i.n()).done;){var o=e.value;void 0===n[o]&&(n[o]={}),n=n[o]}}catch(we){i.e(we)}finally{i.f()}return[n,r[r.length-1]]}},{key:"getItem",value:function(t){var e=this.getParent(t),n=Object(A.a)(e,2),r=n[0][n[1]];if(void 0===r)throw new M(t);return r}},{key:"setItem",value:function(t,e){var n=this.requireParent(t),r=Object(A.a)(n,2);return r[0][r[1]]=e,!0}},{key:"deleteItem",value:function(t){var e=this.getParent(t),n=Object(A.a)(e,2);return delete n[0][n[1]]}},{key:"containsItem",value:function(t){try{return void 0!==this.getItem(t)}catch(e){return!1}}},{key:"keys",value:function(){throw new Error("Method not implemented.")}}]),t}(),er=function(){function t(e){Object(f.a)(this,t),this.url=e}return Object(c.a)(t,[{key:"keys",value:function(){throw new Error("Method not implemented.")}},{key:"getItem",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=It(this.url,t),e.next=3,fetch(n);case 3:if(404!==(i=e.sent).status){e.next=8;break}throw new M(t);case 8:if(200===i.status){e.next=10;break}throw new P(String(i.status));case 10:if(!At){e.next=18;break}return e.t0=r,e.next=14,i.arrayBuffer();case 14:return e.t1=e.sent,e.abrupt("return",e.t0.from.call(e.t0,e.t1));case 18:return e.abrupt("return",i.arrayBuffer());case 19:case"end":return e.stop()}}),e,this)})))}},{key:"setItem",value:function(t,e){return v(this,void 0,void 0,l.a.mark((function n(){var r,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=It(this.url,t),"string"===typeof e&&(e=(new TextEncoder).encode(e).buffer),n.next=4,fetch(r,{method:"PUT",body:e});case 4:return i=n.sent,n.abrupt("return","2"===i.status.toString()[0]);case 6:case"end":return n.stop()}}),n,this)})))}},{key:"deleteItem",value:function(t){throw new Error("Method not implemented.")}},{key:"containsItem",value:function(t){return v(this,void 0,void 0,l.a.mark((function e(){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=It(this.url,t),e.next=3,fetch(n);case 3:return r=e.sent,e.abrupt("return",200===r.status);case 5:case"end":return e.stop()}}),e,this)})))}}]),t}();function nr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.shape,n=t.mode,r=void 0===n?"a":n,i=t.chunks,o=void 0===i||i,a=t.dtype,A=void 0===a?"<i4":a,s=t.compressor,c=void 0===s?null:s,u=t.fillValue,g=void 0===u?null:u,f=t.order,h=void 0===f?"C":f,d=t.store,I=t.overwrite,p=void 0!==I&&I,C=t.path,y=void 0===C?null:C,B=t.chunkStore,m=t.filters,b=t.cacheMetadata,E=void 0===b||b,Q=t.cacheAttrs,F=void 0===Q||Q;return v(this,void 0,void 0,l.a.mark((function t(){var n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d=rr(d),void 0===B&&(B=rr(d)),y=st(y),"r"!==r&&"r+"!==r){t.next=16;break}return t.next=6,vt(d,y);case 6:if(!t.sent){t.next=10;break}throw new D(y);case 10:return t.next=12,yt(d,y);case 12:if(t.sent){t.next=14;break}throw new G(y);case 14:t.next=59;break;case 16:if("w"!==r){t.next=23;break}if(void 0!==e){t.next=19;break}throw new Z("Shape can not be undefined when creating a new array");case 19:return t.next=21,Qt(d,e,o,A,y,c,g,h,p,B,m);case 21:t.next=59;break;case 23:if("a"!==r){t.next=39;break}return t.next=26,vt(d,y);case 26:if(!t.sent){t.next=30;break}throw new D(y);case 30:return t.next=32,yt(d,y);case 32:if(t.sent){t.next=37;break}if(void 0!==e){t.next=35;break}throw new Z("Shape can not be undefined when creating a new array");case 35:return t.next=37,Qt(d,e,o,A,y,c,g,h,p,B,m);case 37:t.next=59;break;case 39:if("w-"!==r&&"x"!==r){t.next=58;break}return t.next=42,yt(d,y);case 42:if(!t.sent){t.next=46;break}throw new N(y);case 46:return t.next=48,vt(d,y);case 48:if(!t.sent){t.next=52;break}throw new D(y);case 52:if(void 0!==e){t.next=54;break}throw new Z("Shape can not be undefined when creating a new array");case 54:return t.next=56,Qt(d,e,o,A,y,c,g,h,p,B,m);case 56:t.next=59;break;case 58:throw new Z("Invalid mode argument: ".concat(r));case 59:return n="r"===r,t.abrupt("return",$n.create(d,y,n,B,E,F));case 61:case"end":return t.stop()}}),t)})))}function rr(t){return void 0===t?new tr:"string"===typeof t?new er(t):t}}).call(this,n(56),n(96).Buffer,n(68))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(47),i=n(19);function o(t){Object(r.a)(Object(i.f)(t),"Invalid WebGLRenderingContext")}function a(t){Object(r.a)(Object(i.g)(t),"Requires WebGL2")}},function(t,e,n){"use strict";var r=n(11),i=n(14),o=function(){function t(e){Object(r.a)(this,t),this.message=e}return Object(i.a)(t,[{key:"warnInConsole",value:function(){throw new Error("The warnInConsole() method has not been implemented.")}}]),t}(),a=n(24),A=n(25),s=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(t,i,o,a){var A;return Object(r.a)(this,n),(A=e.call(this,"Error HTTP status fetching ".concat(t,"."))).name="LoaderFetchError",A.datasetType=t,A.datasetFileType=i,A.datasetUrl=o,A.responseHeaders=a,A}return Object(i.a)(n,[{key:"warnInConsole",value:function(){var t=this.datasetType,e=this.datasetUrl,n=this.responseHeaders;console.warn("".concat(t," from ").concat(e,": fetch failed"),n)}}]),n}(o),c=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(t,i,o,a){var A;return Object(r.a)(this,n),(A=e.call(this,"Error while validating ".concat(t,"."))).name="LoaderValidationError",A.datasetType=t,A.datasetFileType=i,A.datasetUrl=o,A.reason=a,A}return Object(i.a)(n,[{key:"warnInConsole",value:function(){var t=this.datasetType,e=this.datasetUrl,n=this.reason;console.warn("".concat(t," from ").concat(e,": validation failed"),JSON.stringify(n,null,2))}}]),n}(o),u=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(t,i,o){var a;return Object(r.a)(this,n),(a=e.call(this,"Error finding loader for ".concat(t,"."))).name="LoaderNotFoundError",a.datasetType=t,a.datasetFileType=i,a.datasetUrl=o,a}return Object(i.a)(n,[{key:"warnInConsole",value:function(){var t=this.datasetType,e=this.datasetFileType,n=this.datasetUrl;e&&n?console.warn("".concat(t," from ").concat(n,": unable to find loader for fileType ").concat(e)):console.warn("".concat(t,": unable to find loader"))}}]),n}(o);n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return u}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r=n(254),i=n(263),o=n(146),a=n(255);function A(t){return Object(r.a)(t)||Object(i.a)(t)||Object(o.a)(t)||Object(a.a)()}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(412),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return g})),n.d(e,"c",(function(){return f})),n.d(e,"b",(function(){return h}));var r=n(3),i=n(2),o=n(125),a=n(160),A=n(41);function s(t,e){var n=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache||(t.state.cache[e]=n.apply(void 0,arguments)),t.state.enable?t.state.cache[e]:n.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function c(t,e,n){var r=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=n.apply(void 0,[t.state._updateCache].concat(i)),A=a.valueChanged,s=a.oldValue;return A&&r.apply(void 0,i),s},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function u(t){var e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}var l=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.copyState,A=void 0!==i&&i,s=n.log,c=void 0===s?function(){}:s;Object(r.a)(this,t),this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=A?Object(a.a)(e):Object.assign({},o.c),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(i.a)(t,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(A.a)(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];Object(a.c)(this.gl,t,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,n=!1,r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in t){Object(A.a)(void 0!==i);var o=t[i],a=this.cache[i];Object(A.d)(o,a)||(n=!0,e=a,r&&!(i in r)&&(r[i]=a),this.cache[i]=o)}return{valueChanged:n,oldValue:e}}}]),t}();function g(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.enable,i=void 0===r||r,a=n.copyState;if(Object(A.a)(void 0!==a),!e.state){var g="undefined"!==typeof t?t:window;for(var f in g.polyfillContext&&g.polyfillContext(e),e.state=new l(e,{copyState:a,enable:i}),u(e),o.b){var h=o.b[f];c(e,f,h)}s(e,"getParameter"),s(e,"isEnabled")}return e.state.enable=i,e}function f(t){t.state||g(t,{copyState:!1}),t.state.push()}function h(t){Object(A.a)(t.state),t.state.pop()}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(1),i=n(17),o=n(3),a=n(8),A=n(54),s=n(6),c=n(34),u=n(2),l=n(7),g=n(19),f=n(82),h=n(218),d=n(186),I=n(301),p=n(358),C=n(702),y=n(127),v=n(168),B=n(47),m=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,e),(n=Object(a.a)(this,Object(s.a)(e).call(this,t,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(r),Object.seal(Object(A.a)(n)),n}return Object(l.a)(e,t),Object(u.a)(e,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.colorBufferFloat,r=e.colorBufferHalfFloat,i=!0;return n&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),r&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new e(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),Object(u.a)(e,[{key:"initialize",value:function(t){var e=t.width,n=void 0===e?1:e,r=t.height,i=void 0===r?1:r,o=t.attachments,a=void 0===o?null:o,A=t.color,s=void 0===A||A,c=t.depth,u=void 0===c||c,l=t.stencil,g=void 0!==l&&l,f=t.check,h=void 0===f||f,d=t.readBuffer,I=t.drawBuffers;if(Object(B.a)(n>=0&&i>=0,"Width and height need to be integers"),this.width=n,this.height=i,a)for(var p in a){var C=a[p];(Array.isArray(C)?C[0]:C).resize({width:n,height:i})}else a=this._createDefaultAttachments(s,u,g,n,i);this.update({clearAttachments:!0,attachments:a,readBuffer:d,drawBuffers:I}),a&&h&&this.checkStatus()}},{key:"delete",value:function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this.ownResources[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.delete()}}catch(a){n=!0,r=a}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}Object(c.a)(Object(s.a)(e.prototype),"delete",this).call(this)}},{key:"update",value:function(t){var e=t.attachments,n=void 0===e?{}:e,r=t.readBuffer,i=t.drawBuffers,o=t.clearAttachments,a=void 0!==o&&o,A=t.resizeAttachments,s=void 0===A||A;this.attach(n,{clearAttachments:a,resizeAttachments:s});var c=this.gl,u=c.bindFramebuffer(36160,this.handle);return r&&this._setReadBuffer(r),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,u||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,n=t.height;if(null===this.handle)return Object(B.a)(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var r in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&g.h.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(n))(),this.attachments)this.attachments[r].resize({width:e,height:n});return this.width=e,this.height=n,this}},{key:"attach",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.clearAttachments,o=void 0!==r&&r,a=n.resizeAttachments,A=void 0===a||a,s={};o&&Object.keys(this.attachments).forEach((function(t){s[t]=null})),Object.assign(s,t);var c=this.gl.bindFramebuffer(36160,this.handle);for(var u in s){Object(B.a)(void 0!==u,"Misspelled framebuffer binding point?");var l=Number(u),g=s[l],f=g;if(f)if(f instanceof d.a)this._attachRenderbuffer({attachment:l,renderbuffer:f});else if(Array.isArray(g)){var h=Object(i.a)(g,3),I=h[0],p=h[1],C=void 0===p?0:p,y=h[2],v=void 0===y?0:y;f=I,this._attachTexture({attachment:l,texture:I,layer:C,level:v})}else this._attachTexture({attachment:l,texture:f,layer:0,level:0});else this._unattach(l);A&&f&&f.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(b(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.color,n=t.depth,r=t.stencil,i=t.drawBuffers,o=void 0===i?[]:i,a=this.gl.bindFramebuffer(36160,this.handle);return(e||n||r)&&Object(I.a)(this.gl,{color:e,depth:n,stencil:r}),o.forEach((function(t,e){Object(I.b)({drawBuffer:e,value:t})})),this.gl.bindFramebuffer(36160,a||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.h.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,n=void 0===e?[]:e,r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,A=t.width,s=t.height,c=this.gl;Object(y.a)(c);var u=c.bindFramebuffer(36008,this.handle);return 0===i&&0===a&&void 0===A&&void 0===s?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,i,a,A,s),c.bindFramebuffer(36008,u),this}},{key:"getAttachmentParameter",value:function(t,e,n){var r=this._getAttachmentParameterFallback(e);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&r>1e3&&(r=Object(v.a)(this.gl,r)),r}},{key:"getAttachmentParameters",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],r={},i=!0,o=!1,a=void 0;try{for(var A,s=n[Symbol.iterator]();!(i=(A=s.next()).done);i=!0){var c=A.value,u=e?Object(v.a)(this.gl,c):c;r[u]=this.getAttachmentParameter(t,c,e)}}catch(l){o=!0,a=l}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return r}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.keys(this.attachments),n={},r=0,i=e;r<i.length;r++){var o=i[r],a=Number(o),A=t?Object(v.a)(this.gl,a):a;n[A]=this.getAttachmentParameters(a,t)}return n}},{key:"show",value:function(){return"undefined"!==typeof window&&window.open(Object(p.a)(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>g.h.level||"undefined"===typeof window)return this;e=e||"Framebuffer ".concat(this.id);var n=Object(p.a)(this,{maxHeight:100});return g.h.image({logLevel:t,message:e,image:n},e)(),this}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?36160:e;return this.gl.bindFramebuffer(n,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?36160:e;return this.gl.bindFramebuffer(n,null),this}},{key:"_createDefaultAttachments",value:function(t,e,n,i,o){var a,A=null;t&&((A=A||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:o,mipmaps:!1,parameters:(a={},Object(r.a)(a,10241,9729),Object(r.a)(a,10240,9729),Object(r.a)(a,10242,33071),Object(r.a)(a,10243,33071),a)}),this.ownResources.push(A[36064]));return e&&n?((A=A||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(A[33306])):e?((A=A||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:o}),this.ownResources.push(A[36096])):n&&Object(B.a)(!1),A}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof d.a?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,n=void 0===e?36064:e,r=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,r.handle),this.attachments[n]=r}},{key:"_attachTexture",value:function(t){var e=t.attachment,n=void 0===e?36064:e,r=t.texture,i=t.layer,o=t.level,a=this.gl;switch(a.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:a.framebufferTextureLayer(36160,n,r.target,o,i);break;case 34067:var A=function(t){return t<34069?t+34069:t}(i);a.framebufferTexture2D(36160,n,A,r.handle,o);break;case 3553:a.framebufferTexture2D(36160,n,3553,r.handle,o);break;default:Object(B.a)(!1,"Illegal texture type")}a.bindTexture(r.target,null),this.attachments[n]=r}},{key:"_setReadBuffer",value:function(t){var e=this.gl;Object(g.g)(e)?e.readBuffer(t):Object(B.a)(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl;if(Object(g.g)(e))e.drawBuffers(t);else{var n=e.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(t):Object(B.a)(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=Object(C.a)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),e}(f.a);function b(t){return(m.STATUS||{})[t]||"Framebuffer error ".concat(t)}m.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r=n(3),i=n(2);function o(){}var a={onStart:o,onUpdate:o,onInterrupt:o,onEnd:o},A=function(){function t(e){Object(r.a)(this,t),this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}return Object(i.a)(t,[{key:"start",value:function(t){this.cancel(),this.settings=Object.assign({},a,t),this._inProgress=!0,this.settings.onStart(this)}},{key:"end",value:function(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}},{key:"cancel",value:function(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}},{key:"update",value:function(){if(!this._inProgress)return!1;if(null===this._handle){var t=this.timeline,e=this.settings;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}},{key:"_onUpdate",value:function(){}},{key:"inProgress",get:function(){return this._inProgress}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r="vs",i="fs"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69);function i(t,e,n){if(null!==t)for(var r,o,a,A,s,c,u,l,g=0,f=0,h=t.type,d="FeatureCollection"===h,I="Feature"===h,p=d?t.features.length:1,C=0;C<p;C++){s=(l=!!(u=d?t.features[C].geometry:I?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var v=0,B=0;if(null!==(A=l?u.geometries[y]:u)){c=A.coordinates;var m=A.type;switch(g=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(c,f,C,v,B))return!1;f++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===e(c[r],f,C,v,B))return!1;f++,"MultiPoint"===m&&v++}"LineString"===m&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-g;o++){if(!1===e(c[r][o],f,C,v,B))return!1;f++}"MultiLineString"===m&&v++,"Polygon"===m&&B++}"Polygon"===m&&v++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(B=0,o=0;o<c[r].length;o++){for(a=0;a<c[r][o].length-g;a++){if(!1===e(c[r][o][a],f,C,v,B))return!1;f++}B++}v++}break;case"GeometryCollection":for(r=0;r<A.geometries.length;r++)if(!1===i(A.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function A(t,e){var n,r,i,o,a,A,s,c,u,l,g=0,f="FeatureCollection"===t.type,h="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(A=f?t.features[n].geometry:h?t.geometry:t,c=f?t.features[n].properties:h?t.properties:{},u=f?t.features[n].bbox:h?t.bbox:void 0,l=f?t.features[n].id:h?t.id:void 0,a=(s=!!A&&"GeometryCollection"===A.type)?A.geometries.length:1,i=0;i<a;i++)if(null!==(o=s?A.geometries[i]:A))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,g,c,u,l))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],g,c,u,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,g,c,u,l))return!1;g++}}function s(t,e){A(t,(function(t,n,i,o,a){var A,s=null===t?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:a}),n,0)&&void 0}switch(s){case"MultiPoint":A="Point";break;case"MultiLineString":A="LineString";break;case"MultiPolygon":A="Polygon"}for(var c=0;c<t.coordinates.length;c++){var u={type:A,coordinates:t.coordinates[c]};if(!1===e(r.feature(u,i),n,c))return!1}}))}function c(t,e){s(t,(function(t,n,o){var a=0;if(t.geometry){var A=t.geometry.type;if("Point"!==A&&"MultiPoint"!==A){var s,c=0,u=0,l=0;return!1!==i(t,(function(i,A,g,f,h){if(void 0===s||n>c||f>u||h>l)return s=i,c=n,u=f,l=h,void(a=0);var d=r.lineString([s,i],t.properties);if(!1===e(d,n,o,h,a))return!1;a++,s=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");s(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var A=0;A<a.length;A++)if(!1===e(r.lineString(a[A],t.properties),n,i,A))return!1}}}))}e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,a,A){o=0===r&&void 0===n?t:e(o,t,r,i,a,A)}),r),o},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.featureEach=a,e.featureReduce=function(t,e,n){var r=n;return a(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.geomEach=A,e.geomReduce=function(t,e,n){var r=n;return A(t,(function(t,i,o,a,A){r=0===i&&void 0===n?t:e(r,t,i,o,a,A)})),r},e.flattenEach=s,e.flattenReduce=function(t,e,n){var r=n;return s(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.segmentEach=c,e.segmentReduce=function(t,e,n){var r=n,i=!1;return c(t,(function(t,o,a,A,s){r=!1===i&&void 0===n?t:e(r,t,o,a,A,s),i=!0})),r},e.lineEach=u,e.lineReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o,a){r=0===i&&void 0===n?t:e(r,t,i,o,a)})),r},e.findSegment=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,A=e.segmentIndex||0,s=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),s=s||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":s=s||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return A<0&&(A=c.length+A-1),r.lineString([c[A],c[A+1]],s,e);case"Polygon":return a<0&&(a=c.length+a),A<0&&(A=c[a].length+A-1),r.lineString([c[a][A],c[a][A+1]],s,e);case"MultiLineString":return o<0&&(o=c.length+o),A<0&&(A=c[o].length+A-1),r.lineString([c[o][A],c[o][A+1]],s,e);case"MultiPolygon":return o<0&&(o=c.length+o),a<0&&(a=c[o].length+a),A<0&&(A=c[o][a].length-A-1),r.lineString([c[o][a][A],c[o][a][A+1]],s,e)}throw new Error("geojson is invalid")},e.findPoint=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,A=e.coordIndex||0,s=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),s=s||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":s=s||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":return r.point(c,s,e);case"MultiPoint":return o<0&&(o=c.length+o),r.point(c[o],s,e);case"LineString":return A<0&&(A=c.length+A),r.point(c[A],s,e);case"Polygon":return a<0&&(a=c.length+a),A<0&&(A=c[a].length+A),r.point(c[a][A],s,e);case"MultiLineString":return o<0&&(o=c.length+o),A<0&&(A=c[o].length+A),r.point(c[o][A],s,e);case"MultiPolygon":return o<0&&(o=c.length+o),a<0&&(a=c[o].length+a),A<0&&(A=c[o][a].length-A),r.point(c[o][a][A],s,e)}throw new Error("geojson is invalid")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(311),c=n(37);function u(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var l=["longitude","latitude","zoom","bearing","pitch"],g=["longitude","latitude","zoom"],f=function(t){Object(o.a)(n,t);var e=u(n);function n(t){return Object(r.a)(this,n),e.call(this,t||{compare:l,extract:l,required:g})}return Object(i.a)(n,[{key:"interpolateProps",value:function(t,e,n){var r={};for(var i in e)r[i]=Object(c.g)(t[i]||0,e[i]||0,n);return r}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(3),i=n(2),o=n(138),a=n(134),A=function(){},s={BREAK:1,SNAP_TO_END:2,IGNORE:3},c={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new o.a,transitionInterruption:s.BREAK,onTransitionStart:A,onTransitionInterrupt:A,onTransitionEnd:A},u=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t),this.ControllerState=e,this.props=Object.assign({},c,n),this.propsInTransition=null,this.transition=new a.a(n.timeline),this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return Object(i.a)(t,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(t){var e=!1,n=this.props;if(t=Object.assign({},c,t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){var r=this.transition.settings,i=r.interruption,o=r.endProps,a=Object.assign({},n,i===s.SNAP_TO_END?o:this.propsInTransition||n);this._triggerTransition(a,t),e=!0}else this.transition.cancel();return e}},{key:"updateTransition",value:function(){this.transition.update()}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,n=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return this.transition.inProgress?this.transition.settings.interruption===s.IGNORE||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}},{key:"_triggerTransition",value:function(t,e){var n=new this.ControllerState(t),r=new this.ControllerState(e).shortestPathFrom(n),i=e.transitionInterpolator,o=i.getDuration?i.getDuration(t,e):e.transitionDuration;if(0!==o){var a=e.transitionInterpolator.initializeProps(t,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:a.start,endProps:a.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(t){var e=this;return function(n){e.propsInTransition=null,t(n)}}},{key:"_onTransitionUpdate",value:function(t){var e=t.time,n=t.settings,r=n.interpolator,i=n.startProps,o=n.endProps,a=n.duration,A=(0,n.easing)(e/a),s=r.interpolateProps(i,o,A);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,s)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),t}();u.defaultProps=c},function(t,e,n){"use strict";n.r(e);var r=n(440);n.d(e,"Vector2",(function(){return r.d})),n.d(e,"Vector3",(function(){return r.e})),n.d(e,"Vector4",(function(){return r.f})),n.d(e,"Matrix3",(function(){return r.a})),n.d(e,"Matrix4",(function(){return r.b})),n.d(e,"Quaternion",(function(){return r.c})),n.d(e,"config",(function(){return r.t})),n.d(e,"configure",(function(){return r.u})),n.d(e,"formatValue",(function(){return r.z})),n.d(e,"isArray",(function(){return r.A})),n.d(e,"clone",(function(){return r.s})),n.d(e,"equals",(function(){return r.x})),n.d(e,"exactEquals",(function(){return r.y})),n.d(e,"toRadians",(function(){return r.G})),n.d(e,"toDegrees",(function(){return r.F})),n.d(e,"radians",(function(){return r.C})),n.d(e,"degrees",(function(){return r.w})),n.d(e,"sin",(function(){return r.D})),n.d(e,"cos",(function(){return r.v})),n.d(e,"tan",(function(){return r.E})),n.d(e,"asin",(function(){return r.n})),n.d(e,"acos",(function(){return r.m})),n.d(e,"atan",(function(){return r.p})),n.d(e,"clamp",(function(){return r.r})),n.d(e,"lerp",(function(){return r.B})),n.d(e,"_withEpsilon",(function(){return r.l})),n.d(e,"checkNumber",(function(){return r.q})),n.d(e,"_MathUtils",(function(){return r.h})),n.d(e,"_SphericalCoordinates",(function(){return r.k})),n.d(e,"_Pose",(function(){return r.j})),n.d(e,"_Euler",(function(){return r.g})),n.d(e,"_Polygon",(function(){return r.i})),n.d(e,"assert",(function(){return r.o}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return g}));var r=n(18),i=n(12),o=n(0),a=n(269),A=n.n(a),s=n(63);function c(){var t=Object(o.useRef)(),e=Object(o.useState)(),n=Object(i.a)(e,2),r=n[0],a=n[1],c=Object(o.useState)(),u=Object(i.a)(c,2),l=u[0],g=u[1],f=Object(s.f)(),h=Object(s.e)();return Object(o.useEffect)((function(){function t(){h()}var e=A()(t,100,{trailing:!0});return window.addEventListener("resize",e),t(),function(){window.removeEventListener("resize",e)}}),[h]),Object(o.useEffect)((function(){if(t.current){var e=t.current.getBoundingClientRect();a(e.height),g(e.width)}}),[f]),[l,r,t]}function u(){var t=Object(o.useRef)(),e=Object(o.useState)(),n=Object(i.a)(e,2),r=n[0],a=n[1],c=Object(o.useState)(),u=Object(i.a)(c,2),l=u[0],g=u[1],f=Object(s.f)(),h=Object(s.e)();return Object(o.useEffect)((function(){function t(){h()}var e=A()(t,100,{trailing:!0});return window.addEventListener("resize",e),t(),function(){window.removeEventListener("resize",e)}}),[h]),Object(o.useEffect)((function(){if(t.current){var e=t.current.deck.canvas.getBoundingClientRect();a(e.height),g(e.width)}}),[f]),[l,r,t]}function l(t){var e=t,n=Object(o.useState)(e),r=Object(i.a)(n,2),a=r[0],A=r[1],s=Object(o.useCallback)((function(t){A((function(e){var n=e.filter((function(e){return e!==t}));return console.log("cleared ".concat(t,"; waiting on ").concat(n.length,": ").concat(JSON.stringify(n))),n}))}),[A]),c=Object(o.useCallback)((function(){A(e),console.log("waiting on ".concat(e.length,": ").concat(JSON.stringify(e)))}),[A,e]);return[0===a.length,s,c]}function g(){var t=Object(o.useState)([]),e=Object(i.a)(t,2),n=e[0],a=e[1];return[n,Object(o.useCallback)((function(t,e){t&&a((function(n){return[].concat(Object(r.a)(n),[{url:t,name:e}])}))}),[a]),Object(o.useCallback)((function(){a([])}),[a])]}},function(t,e,n){"use strict";n.r(e);var r=n(828),i=n(480),o=n(370),a=n(712),A=n(829),s=n(334),c=n(550),u=n(3),l=n(2),g=n(7),f=n(8),h=n(6),d=n(1378);function I(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(h.a)(t);if(e){var i=Object(h.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(f.a)(this,n)}}var p=function(t){Object(g.a)(n,t);var e=I(n);function n(){return Object(u.a)(this,n),e.apply(this,arguments)}return Object(l.a)(n,[{key:"getGeometry",value:function(t){return new d.a}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.elevationScale,i=n.extruded,o=n.offset,a=n.coverage,A=n.cellSize,s=n.angle;this.state.model.setUniforms(Object.assign({},e,{radius:A/2,angle:s,offset:o,extruded:i,coverage:a,elevationScale:r,edgeDistance:1,isWireframe:!1})).draw()}}]),n}(c.a);p.layerName="GridCellLayer",p.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}};var C=n(226),y=n(549),v=n(713),B=n(336),m=n(253),b=n(372);n.d(e,"ArcLayer",(function(){return r.a})),n.d(e,"BitmapLayer",(function(){return i.a})),n.d(e,"IconLayer",(function(){return o.a})),n.d(e,"LineLayer",(function(){return a.a})),n.d(e,"PointCloudLayer",(function(){return A.a})),n.d(e,"ScatterplotLayer",(function(){return s.a})),n.d(e,"ColumnLayer",(function(){return c.a})),n.d(e,"GridCellLayer",(function(){return p})),n.d(e,"PathLayer",(function(){return C.a})),n.d(e,"PolygonLayer",(function(){return y.a})),n.d(e,"GeoJsonLayer",(function(){return v.a})),n.d(e,"TextLayer",(function(){return B.a})),n.d(e,"SolidPolygonLayer",(function(){return m.a})),n.d(e,"_MultiIconLayer",(function(){return b.a}))},function(t,e,n){"use strict";var r=n(17),i=n(23),o=n(3),a=n(2),A=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),s=n(459),c=new s.a,u=new s.a,l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object(o.a)(this,t),r=r||c.copy(e).add(n).scale(.5),this.center=new s.a(r),this.halfDiagonal=new s.a(n).subtract(this.center),this.minimum=new s.a(e),this.maximum=new s.a(n)}return Object(a.a)(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"intersectPlane",value:function(t){var e=this.halfDiagonal,n=u.from(t.normal),r=e.x*Math.abs(n.x)+e.y*Math.abs(n.y)+e.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-r>0?A.INSIDE:i+r<0?A.OUTSIDE:A.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e,n=c.from(t).subtract(this.center),r=this.halfDiagonal,i=0;return(e=Math.abs(n.x)-r.x)>0&&(i+=e*e),(e=Math.abs(n.y)-r.y)>0&&(i+=e*e),(e=Math.abs(n.z)-r.z)>0&&(i+=e*e),i}}]),t}(),g=n(10),f=new s.a,h=new s.a,d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.a)(this,t),this.radius=-0,this.center=new s.a,this.fromCenterRadius(e,n)}return Object(a.a)(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=f.from(e),this.center=(new s.a).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,n=this.radius,r=t.center,i=t.radius,o=f.copy(r).subtract(e),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();var A=.5*(n+a+i);return h.copy(o).scale((-n+A)/a).add(e),this.center.copy(h),this.radius=A,this}},{key:"expand",value:function(t){var e=(t=f.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"intersectPlane",value:function(t){var e=this.center,n=this.radius,r=t.normal.dot(e)+t.distance;return r<-n?A.OUTSIDE:r<n?A.INTERSECTING:A.INSIDE}},{key:"transform",value:function(t){this.center.transform(t);var e=g.e(f,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){return(t=f.from(t)).subtract(this.center).lengthSquared()-this.radius*this.radius}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}}]),t}(),I=n(448),p=n(449),C=new s.a,y=new s.a,v=new s.a,B=new s.a,m=new s.a,b=new s.a,E=new s.a,Q=new s.a,F=new s.a,w=new s.a,S=0,R=1,U=2,x=3,k=4,O=5,N=6,D=7,G=8,_=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Object(o.a)(this,t),this.center=(new s.a).from(e),this.halfAxes=new I.a(n)}Object(a.a)(t,[{key:"fromCenterHalfSizeQuaternion",value:function(t,e,n){var r=new p.a(n),i=(new I.a).fromQuaternion(r);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new s.a).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new d,e=this.halfAxes,n=e.getColumn(0,Q),r=e.getColumn(1,F),i=e.getColumn(2,w),o=C.copy(n).add(r).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,n=t.normal,r=this.halfAxes,i=n.x,o=n.y,a=n.z,s=Math.abs(i*r[S]+o*r[R]+a*r[U])+Math.abs(i*r[x]+o*r[k]+a*r[O])+Math.abs(i*r[N]+o*r[D]+a*r[G]),c=n.dot(e)+t.distance;return c<=-s?A.OUTSIDE:c>=s?A.INSIDE:A.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=y.from(t).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,v),i=n.getColumn(1,B),o=n.getColumn(2,m),a=r.magnitude(),A=i.magnitude(),s=o.magnitude();r.normalize(),i.normalize(),o.normalize();var c,u=0;return(c=Math.abs(e.dot(r))-a)>0&&(u+=c*c),(c=Math.abs(e.dot(i))-A)>0&&(u+=c*c),(c=Math.abs(e.dot(o))-s)>0&&(u+=c*c),u}},{key:"computePlaneDistances",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,A=a.getColumn(0,v),s=a.getColumn(1,B),c=a.getColumn(2,m),u=b.copy(A).add(s).add(c).add(o),l=E.copy(u).subtract(t),g=e.dot(l);return r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).add(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).subtract(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).subtract(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).add(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).add(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).subtract(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).subtract(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),n[0]=r,n[1]=i,n}},{key:"getTransform",value:function(){}},{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new s.a(t).len(),new s.a(e).len(),new s.a(n).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new s.a(t).normalize(),o=new s.a(e).normalize(),a=new s.a(n).normalize();return(new p.a).fromMatrix3(new I.a([].concat(Object(i.a)(r),Object(i.a)(o),Object(i.a)(a))))}}])}(),n(95)),M=n(49),T=new s.a,j=new s.a,L=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.a)(this,t),this.normal=new s.a,this.distance=-0,this.fromNormalDistance(e,n)}return Object(a.a)(t,[{key:"fromNormalDistance",value:function(t,e){return Object(_.a)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=T.from(t),this.normal.from(e).normalize();var n=-this.normal.dot(t);return this.distance=n,this}},{key:"fromCoefficients",value:function(t,e,n,r){return this.normal.set(t,e,n),Object(_.a)(Object(M.b)(this.normal.len(),1)),this.distance=r,this}},{key:"clone",value:function(e){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return Object(M.b)(this.distance,t.distance)&&Object(M.b)(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=j.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=T.from(t);var n=this.getPointDistance(t),r=j.copy(this.normal).scale(n);return t.subtract(r).to(e)}}]),t}();function V(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var P=[new s.a([1,0,0]),new s.a([0,1,0]),new s.a([0,0,1])],W=new s.a,J=new s.a,H=(new L(new s.a(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Object(o.a)(this,t),this.planes=e,Object(_.a)(this.planes.every((function(t){return t instanceof L})))}return Object(a.a)(t,null,[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),Object(a.a)(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*P.length;var e,n=t.center,r=t.radius,i=0,o=V(P);try{for(o.s();!(e=o.n()).done;){var a=e.value,A=this.planes[i],s=this.planes[i+1];A||(A=this.planes[i]=new L),s||(s=this.planes[i+1]=new L);var c=W.copy(a).scale(-r).add(n);a.dot(c);A.fromPointNormal(c,a);var u=W.copy(a).scale(r).add(n),l=J.copy(a).negate();l.dot(u);s.fromPointNormal(u,l),i+=2}}catch(g){o.e(g)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){Object(_.a)(t);var e,n=A.INSIDE,r=V(this.planes);try{for(r.s();!(e=r.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case A.OUTSIDE:return A.OUTSIDE;case A.INTERSECTING:n=A.INTERSECTING}}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(e,n){if(Object(_.a)(e,"boundingVolume is required."),Object(_.a)(Number.isFinite(n),"parentPlaneMask is required."),n===t.MASK_OUTSIDE||n===t.MASK_INSIDE)return n;for(var r=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0===(n&a))){var s=i[o],c=e.intersectPlane(s);if(c===A.OUTSIDE)return t.MASK_OUTSIDE;c===A.INTERSECTING&&(r|=a)}}return r}}]),t}()),Y=n(1),X=n(450);function z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){Object(Y.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var q=new s.a,$=new s.a,tt=new s.a,et=new s.a,nt=new s.a,rt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t),e=K({near:1,far:5e8},e),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near,this._near=this.near,this.far=e.far,this._far=this.far,this._cullingVolume=new H([new L,new L,new L,new L,new L,new L]),this._perspectiveMatrix=new X.a,this._infinitePerspective=new X.a}return Object(a.a)(t,[{key:"clone",value:function(){return new t({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(e){return e&&e instanceof t&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far}},{key:"computeCullingVolume",value:function(t,e,n){Object(_.a)(t,"position is required."),Object(_.a)(e,"direction is required."),Object(_.a)(n,"up is required.");var r=this._cullingVolume.planes;n=q.copy(n).normalize();var i=$.copy(e).cross(n).normalize(),o=tt.copy(e).multiplyByScalar(this.near).add(t),a=et.copy(e).multiplyByScalar(this.far).add(t),A=nt;return A.copy(i).multiplyByScalar(this.left).add(o).subtract(t).cross(n),r[0].fromPointNormal(t,A),A.copy(i).multiplyByScalar(this.right).add(o).subtract(t).cross(n).negate(),r[1].fromPointNormal(t,A),A.copy(n).multiplyByScalar(this.bottom).add(o).subtract(t).cross(i).negate(),r[2].fromPointNormal(t,A),A.copy(n).multiplyByScalar(this.top).add(o).subtract(t).cross(i),r[3].fromPointNormal(t,A),A=(new s.a).copy(e),r[4].fromPointNormal(o,A),A.negate(),r[5].fromPointNormal(a,A),this._cullingVolume}},{key:"getPixelDimensions",value:function(t,e,n,r){it(this),Object(_.a)(Number.isFinite(t)&&Number.isFinite(e)),Object(_.a)(t>0),Object(_.a)(e>0),Object(_.a)(n>0),Object(_.a)(r);var i=1/this.near,o=this.top*i,a=2*n*o/e,A=2*n*(o=this.right*i)/t;return r.x=A,r.y=a,r}},{key:"projectionMatrix",get:function(){return it(this),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return it(this),this._infinitePerspective}}]),t}();function it(t){Object(_.a)(Number.isFinite(t.right)&&Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.near)&&Number.isFinite(t.far));var e=t.top,n=t.bottom,r=t.right,i=t.left,o=t.near,a=t.far;e===t._top&&n===t._bottom&&i===t._left&&r===t._right&&o===t._near&&a===t._far||(Object(_.a)(t.near>0&&t.near<t.far,"near must be greater than zero and less than far."),t._left=i,t._right=r,t._top=e,t._bottom=n,t._near=o,t._far=a,t._perspectiveMatrix=(new X.a).frustum({left:i,right:r,bottom:n,top:e,near:o,far:a}),t._infinitePerspective=(new X.a).frustum({left:i,right:r,bottom:n,top:e,near:o,far:1/0}))}function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){Object(Y.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}!function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t),e=at({near:1,far:5e8,xOffset:0,yOffset:0},e),this._offCenterFrustum=new rt,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near,this._near=this.near,this.far=e.far,this._far=this.far,this.xOffset=e.xOffset,this._xOffset=this.xOffset,this.yOffset=e.yOffset,this._yOffset=this.yOffset}Object(a.a)(t,[{key:"clone",value:function(){return new t({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(e){return null!==(n=e)&&"undefined"!==typeof n&&e instanceof t&&(At(this),At(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum));var n}},{key:"computeCullingVolume",value:function(t,e,n){return At(this),this._offCenterFrustum.computeCullingVolume(t,e,n)}},{key:"getPixelDimensions",value:function(t,e,n,r){return At(this),this._offCenterFrustum.getPixelDimensions(t,e,n,r)}},{key:"projectionMatrix",get:function(){return At(this),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return At(this),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return At(this),this._fovy}},{key:"sseDenominator",get:function(){return At(this),this._sseDenominator}}])}();function At(t){Object(_.a)(Number.isFinite(t.fov)&&Number.isFinite(t.aspectRatio)&&Number.isFinite(t.near)&&Number.isFinite(t.far));var e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(Object(_.a)(t.fov>=0&&t.fov<Math.PI),Object(_.a)(t.aspectRatio>0),Object(_.a)(t.near>=0&&t.near<t.far),t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,new s.a,Math.PI;n(451),new I.a,new I.a,new I.a,new I.a,new I.a;new s.a,new s.a,new s.a,new s.a,new s.a,new I.a,new I.a,new I.a;var st=n(181);function ct(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return ut(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ut(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var lt=function(){function t(e,n,r){Object(o.a)(this,t),this.x=e,this.y=n,this.z=r}return Object(a.a)(t,[{key:"update",value:function(t){var e=t.viewport,n=t.cullingVolume,r=t.elevationBounds,i=t.minZ,o=t.maxZ,a=t.offset,A=t.project,s=this.getBoundingVolume(r,a,A);if(n.computeVisibility(s)<0)return!1;if(!this.childVisible){var c=this.z;if(c<o&&c>=i){var u=s.distanceTo(e.cameraPosition)*e.scale/e.height;c+=Math.floor(Math.log2(u))}if(c>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var l,g=ct(this.children);try{for(g.s();!(l=g.n()).done;){l.value.update(t)}}catch(f){g.e(f)}finally{g.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children){var e,n=ct(this._children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.getSelected(t)}}catch(i){n.e(i)}finally{n.f()}}return t}},{key:"getBoundingVolume",value:function(t,e,n){if(n){var r=pt(this.x,this.y,this.z),i=pt(this.x+1,this.y+1,this.z),o=pt(this.x+.5,this.y+.5,this.z);r.z=t[1],i.z=t[1],o.z=t[0];var a=n(r),A=n(i),s=new st.b(n(o)),c=Math.max(s.distance(a),s.distance(A));return new d(s,c)}var u=512/Math.pow(2,this.z),g=this.x*u+512*e,f=512-(this.y+1)*u;return new l([g,f,t[0]],[g+u,f+u,t[1]])}},{key:"children",get:function(){if(!this._children){var e=2*this.x,n=2*this.y,r=this.z+1;this._children=[new t(e,n,r),new t(e,n+1,r),new t(e+1,n,r),new t(e+1,n+1,r)]}return this._children}}]),t}();n.d(e,"f",(function(){return ft})),n.d(e,"b",(function(){return dt})),n.d(e,"d",(function(){return pt})),n.d(e,"e",(function(){return yt})),n.d(e,"a",(function(){return Bt})),n.d(e,"c",(function(){return mt}));var gt=[-1/0,-1/0,1/0,1/0],ft={type:"url",value:"",validate:function(t){return"string"===typeof t||Array.isArray(t)&&t.every((function(t){return"string"===typeof t}))},equals:function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}};function ht(t,e){var n=[e.transformPoint([t[0],t[1]]),e.transformPoint([t[2],t[1]]),e.transformPoint([t[0],t[3]]),e.transformPoint([t[2],t[3]])];return[Math.min.apply(Math,Object(i.a)(n.map((function(t){return t[0]})))),Math.min.apply(Math,Object(i.a)(n.map((function(t){return t[1]})))),Math.max.apply(Math,Object(i.a)(n.map((function(t){return t[0]})))),Math.max.apply(Math,Object(i.a)(n.map((function(t){return t[1]}))))]}function dt(t,e){if(!t||!t.length)return null;Array.isArray(t)&&(t=t[Math.abs(e.x+e.y)%t.length]);var n=e.x,r=e.y,i=e.z;return t.replace("{x}",n).replace("{y}",r).replace("{z}",i).replace("{-y}",Math.pow(2,i)-r-1)}function It(t){return Math.pow(2,t)}function pt(t,e,n){var r=It(n),i=t/r*360-180,o=Math.PI-2*Math.PI*e/r;return[i,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function Ct(t,e,n){var r=It(n);return[t/r*512,e/r*512]}function yt(t,e,n,i){if(t.isGeospatial){var o=pt(e,n,i),a=Object(r.a)(o,2),A=a[0],s=a[1],c=pt(e+1,n+1,i),u=Object(r.a)(c,2);return{west:A,north:s,east:u[0],south:u[1]}}var l=Ct(e,n,i),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Ct(e+1,n+1,i),I=Object(r.a)(d,2);return{left:f,top:h,right:I[0],bottom:I[1]}}function vt(t,e,n,i){for(var o=function(t,e,n){return n?ht(t,n).map((function(t){return t*e/512})):t.map((function(t){return t*e/512}))}(function(t,e,n){var i;if(e&&2===e.length){var o=Object(r.a)(e,2),a=o[0],A=o[1],s=t.getBounds({z:a}),c=t.getBounds({z:A});i=[Math.min(s[0],c[0]),Math.min(s[1],c[1]),Math.max(s[2],c[2]),Math.max(s[3],c[3])]}else i=t.getBounds();return t.isGeospatial?[Math.max(i[0],n[0]),Math.max(i[1],n[1]),Math.min(i[2],n[2]),Math.min(i[3],n[3])]:[Math.max(Math.min(i[0],n[2]),n[0]),Math.max(Math.min(i[1],n[3]),n[1]),Math.min(Math.max(i[2],n[0]),n[2]),Math.min(Math.max(i[3],n[1]),n[3])]}(t,null,n),It(e),i),a=Object(r.a)(o,4),A=a[0],s=a[1],c=a[2],u=a[3],l=[],g=Math.floor(A);g<c;g++)for(var f=Math.floor(s);f<u;f++)l.push({x:g,y:f,z:e});return l}function Bt(t){var e=t.viewport,n=t.maxZoom,r=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,A=void 0===a?512:a,s=t.modelMatrix,c=t.modelMatrixInverse,u=Math.round(e.zoom+Math.log2(512/A));if(Number.isFinite(r)&&u<r){if(!o)return[];u=r}Number.isFinite(n)&&u>n&&(u=n);var l=o;return s&&c&&o&&!e.isGeospatial&&(l=ht(o,s)),e.isGeospatial?function(t,e,n){var r=t.resolution?t.projectPosition:null,i=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,n=t.distance;return new L(e.clone().negate(),n)})),o=new H(i),a=t.distanceScales.unitsPerMeter[2],A=n&&n[0]*a||0,s=n&&n[1]*a||0,c=t.pitch<=60?e:0,u=new lt(0,0,0),l={viewport:t,project:r,cullingVolume:o,elevationBounds:[A,s],minZ:c,maxZ:e,offset:0};if(u.update(l),t.subViewports&&t.subViewports.length>1){for(l.offset=-1;u.update(l)&&!(--l.offset<-3););for(l.offset=1;u.update(l)&&!(++l.offset>3););}return u.getSelected()}(e,u,i):vt(e,u,l||gt,c)}function mt(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}},function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(t)?i(t,e,[]):e(t)?[t]:[]}function i(t,e,n){for(var r=-1;++r<t.length;){var o=t[r];Array.isArray(o)?i(o,e,n):e(o)&&n.push(o)}return n}function o(t){for(var e=t.target,n=t.source,r=t.start,i=void 0===r?0:r,o=t.count,a=void 0===o?1:o,A=n.length,s=a*A,c=0,u=i;c<A;c++)e[u++]=n[c];for(;c<s;)c<s-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+s-c),c=s);return e}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";e.a={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(195);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){"use strict";var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+i+"$");e.isExist=function(t){return"undefined"!==typeof t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e)for(var r=Object.keys(e),i=r.length,o=0;o<i;o++)t[r[o]]="strict"===n?[e[r[o]]]:e[r[o]]},e.getValue=function(t){return e.isExist(t)?t:""},e.buildOptions=function(t,e,n){var r={};if(!t)return e;for(var i=0;i<n.length;i++)void 0!==t[n[i]]?r[n[i]]=t[n[i]]:r[n[i]]=e[n[i]];return r},e.isName=function(t){var e=o.exec(t);return!(null===e||"undefined"===typeof e)},e.getAllMatches=function(t,e){for(var n=[],r=e.exec(t);r;){for(var i=[],o=r.length,a=0;a<o;a++)i.push(r[a]);n.push(i),r=e.exec(t)}return n},e.nameRegexp=i},function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r,i=n(17),o=n(1),a=n(47),A=(r={},Object(o.a)(r,5126,[5126,1,"float"]),Object(o.a)(r,35664,[5126,2,"vec2"]),Object(o.a)(r,35665,[5126,3,"vec3"]),Object(o.a)(r,35666,[5126,4,"vec4"]),Object(o.a)(r,5124,[5124,1,"int"]),Object(o.a)(r,35667,[5124,2,"ivec2"]),Object(o.a)(r,35668,[5124,3,"ivec3"]),Object(o.a)(r,35669,[5124,4,"ivec4"]),Object(o.a)(r,5125,[5125,1,"uint"]),Object(o.a)(r,36294,[5125,2,"uvec2"]),Object(o.a)(r,36295,[5125,3,"uvec3"]),Object(o.a)(r,36296,[5125,4,"uvec4"]),Object(o.a)(r,35670,[5126,1,"bool"]),Object(o.a)(r,35671,[5126,2,"bvec2"]),Object(o.a)(r,35672,[5126,3,"bvec3"]),Object(o.a)(r,35673,[5126,4,"bvec4"]),Object(o.a)(r,35674,[5126,8,"mat2"]),Object(o.a)(r,35685,[5126,8,"mat2x3"]),Object(o.a)(r,35686,[5126,8,"mat2x4"]),Object(o.a)(r,35675,[5126,12,"mat3"]),Object(o.a)(r,35687,[5126,12,"mat3x2"]),Object(o.a)(r,35688,[5126,12,"mat3x4"]),Object(o.a)(r,35676,[5126,16,"mat4"]),Object(o.a)(r,35689,[5126,16,"mat4x2"]),Object(o.a)(r,35690,[5126,16,"mat4x3"]),r);function s(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Object(a.a)(!1),0}}function c(t){var e=A[t];if(!e)return null;var n=Object(i.a)(e,2);return{type:n[0],components:n[1]}}function u(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=5126}for(var n in A){var r=Object(i.a)(A[n],3),o=r[0],a=r[1],s=r[2];if(o===t&&a===e)return{glType:n,name:s}}return null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return s}));var r=n(1),i=n(107);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(t){if(!t)return!1;Array.isArray(t)&&(t=t[0]);var e=t.parseTextSync||t.parseSync||t.parse||t.parseStream||t.parseInBatches,n=t.options&&t.options[t.id];return e=e||n&&n.workerUrl}function s(t){var e;return Object(i.a)(t,"null loader"),Object(i.a)(A(t),"invalid loader"),Array.isArray(t)&&(e=t[1],t=a(a({},t=t[0]),{},{options:a(a({},t.options),e)})),t.extension&&(t.extensions=t.extensions||t.extension,delete t.extension),Array.isArray(t.extensions)||(t.extensions=[t.extensions]),Object(i.a)(t.extensions&&t.extensions.length>0&&t.extensions[0]),(t.parseTextSync||t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},function(t,e,n){"use strict";var r=n(1),i=n(190),o=n(52),a=n(13),A=n.n(a),s=n(30),c=n(385),u=n(184);function l(t){return g.apply(this,arguments)}function g(){return(g=Object(s.a)(A.a.mark((function t(e){var n;return A.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): "),t.prev=1,!e.headers.get("Content-Type").includes("application/json")){t.next=10;break}return t.t0=n,t.next=7,e.text();case 7:n=t.t0+=t.sent,t.next=11;break;case 10:n+=e.statusText;case 11:t.next=16;break;case 13:return t.prev=13,t.t1=t.catch(1),t.abrupt("return",n);case 16:return t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,null,[[1,13]])})))).apply(this,arguments)}function f(t){return h.apply(this,arguments)}function h(){return(h=Object(s.a)(A.a.mark((function t(e){var n,r,i=arguments;return A.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},"string"===typeof e){t.next=5;break}return t.next=4,Object(u.b)(e);case 4:return t.abrupt("return",t.sent);case 5:return e=Object(c.a)(e),t.next=8,fetch(e,n);case 8:if((r=t.sent).ok||!n.throws){t.next=15;break}return t.t0=Error,t.next=13,l(r);case 13:throw t.t1=t.sent,new t.t0(t.t1);case 15:return t.abrupt("return",r);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var d=n(3),I=n(2),p=function(){function t(){Object(d.a)(this,t)}return Object(I.a)(t,[{key:"log",value:function(){return function(t){}}},{key:"info",value:function(){return function(t){}}},{key:"warn",value:function(){return function(t){}}},{key:"error",value:function(){return function(t){}}}]),t}(),C=function(){function t(){Object(d.a)(this,t),this.console=console}return Object(I.a)(t,[{key:"log",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.log).bind.apply(t,[this.console].concat(n))}},{key:"info",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.info).bind.apply(t,[this.console].concat(n))}},{key:"warn",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.warn).bind.apply(t,[this.console].concat(n))}},{key:"error",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.error).bind.apply(t,[this.console].concat(n))}}]),t}();function y(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function B(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return w})),n.d(e,"a",(function(){return S}));var b={fetch:null,CDN:"https://unpkg.com/@loaders.gl",worker:!0,log:new C,metadata:!1,transforms:[]},E={dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"},Q=function(){i.a.loaders=i.a.loaders||{};var t=i.a.loaders;return t._state=t._state||{},t._state},F=function(){var t=Q();return t.globalOptions=t.globalOptions||m({},b),t.globalOptions};function w(t,e,n,r){return n=n||[],function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console;R(t,null,n,b,E,e);var r,i=y(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t&&t[o.id]||{},A=o.options&&o.options[o.id]||{},s=o.defaultOptions&&o.defaultOptions[o.id]||{};R(a,o.id,n,A,s,e)}}catch(c){i.e(c)}finally{i.f()}}(t,n=Array.isArray(n)?n:[n]),x(e,t,r)}function S(t,e){var n=F(),r=t.fetch||n.fetch;return"function"===typeof r?r:Object(o.f)(r)?function(t){return f(t,r)}:e&&e.fetch?e.fetch:function(e){return f(e,t)}}function R(t,e,n,r,i,a){var A=e||"Top level",s=e?"".concat(e,"."):"";for(var c in t){var u=!e&&Object(o.f)(t[c]);if(!(c in r))if(c in i)n.warn("".concat(A," loader option '").concat(s).concat(c,"' deprecated, use '").concat(i[c],"'"));else if(!u){var l=U(c,a);n.warn("".concat(A," loader option '").concat(s).concat(c,"' not recognized. ").concat(l))}}}function U(t,e){var n,r=t.toLowerCase(),i="",o=y(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;for(var A in a.options){if(t===A)return"Did you mean '".concat(a.id,".").concat(A,"'?");var s=A.toLowerCase();(r.startsWith(s)||s.startsWith(r))&&(i=i||"Did you mean '".concat(a.id,".").concat(A,"'?"))}}}catch(c){o.e(c)}finally{o.f()}return i}function x(t,e,n){var r=m({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(r,n),null===r.log&&(r.log=new p),k(r,F()),k(r,e),r}function k(t,e){for(var n in e)if(n in e){var r=e[n];Object(o.g)(r)&&Object(o.g)(t[n])?t[n]=m(m({},t[n]),e[n]):t[n]=e[n]}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"e",(function(){return g}));var r,i,o,a=n(1),A=n(19),s=(r={},Object(a.a)(r,6407,{dataFormat:6407,types:[5121,33635]}),Object(a.a)(r,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(a.a)(r,6406,{dataFormat:6406,types:[5121]}),Object(a.a)(r,6409,{dataFormat:6409,types:[5121]}),Object(a.a)(r,6410,{dataFormat:6410,types:[5121]}),Object(a.a)(r,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(a.a)(r,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(a.a)(r,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(a.a)(r,34836,{dataFormat:6408,types:[5126],gl2:!0}),r),c=(i={},Object(a.a)(i,6403,1),Object(a.a)(i,36244,1),Object(a.a)(i,33319,2),Object(a.a)(i,33320,2),Object(a.a)(i,6407,3),Object(a.a)(i,36248,3),Object(a.a)(i,6408,4),Object(a.a)(i,36249,4),Object(a.a)(i,6402,1),Object(a.a)(i,34041,1),Object(a.a)(i,6406,1),Object(a.a)(i,6409,1),Object(a.a)(i,6410,2),i),u=(o={},Object(a.a)(o,5126,4),Object(a.a)(o,5125,4),Object(a.a)(o,5124,4),Object(a.a)(o,5123,2),Object(a.a)(o,5122,2),Object(a.a)(o,5131,2),Object(a.a)(o,5120,1),Object(a.a)(o,5121,1),o);function l(t,e){var n=s[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var r=Object(A.g)(t)&&n.gl2||n.gl1;return"string"===typeof r?t.getExtension(r):r}function g(t,e){var n=s[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a}));function r(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.clamped,r=void 0===n||n;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(t){var e=t.data,n=t.width,r=t.height,i=t.bytesPerPixel,o=void 0===i?4:i,a=t.temp,A=n*o;a=a||new Uint8Array(A);for(var s=0;s<r/2;++s){var c=s*A,u=(r-s-1)*A;a.set(e.subarray(c,c+A)),e.copyWithin(c,u,u+A),e.set(a,u)}}function a(t){for(var e=t.data,n=t.width,r=t.height,i=Math.round(n/2),o=Math.round(r/2),a=new Uint8Array(i*o*4),A=0;A<o;A++)for(var s=0;s<i;s++)for(var c=0;c<4;c++)a[4*(A*i+s)+c]=e[4*(2*A*n+2*s)+c];return{data:a,width:i,height:o}}},function(t,e,n){"use strict";function r(t,e){if(t===e)return!0;if(!t||!e)return!1;for(var n in t){var i=t[n],o=e[n];if(!(i===o||Array.isArray(i)&&Array.isArray(o)&&r(i,o)))return!1}return!0}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(1),i=n(3),o=n(2),a=n(139),A=n(53);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u={transitionDuration:0},l=["wheel"],g=["panstart","panmove","panend"],f=["pinchstart","pinchmove","pinchend"],h=["doubletap"],d=["keydown"],I=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),Object(A.a)(e),this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new a.b(e,n),this._events=null,this._state={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return Object(o.a)(t,[{key:"finalize",value:function(){for(var t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(t){var e=this.ControllerState;switch(this.controllerState=new e(c(c({makeViewport:this.makeViewport},this.controllerStateProps),this._state)),t.type){case"panstart":return this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=this.controllerStateProps,n=e.x,r=e.y,i=t.offsetCenter;return[i.x-n,i.y-r]}},{key:"isPointInBounds",value:function(t,e){var n=this.controllerStateProps,r=n.width,i=n.height;if(e&&e.handled)return!1;var o=t[0]>=0&&t[0]<=r&&t[1]>=0&&t[1]<=i;return o&&e&&e.stopPropagation(),o}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var e=t.scrollZoom,n=void 0===e||e,r=t.dragPan,i=void 0===r||r,o=t.dragRotate,a=void 0===o||o,A=t.doubleClickZoom,s=void 0===A||A,c=t.touchZoom,u=void 0===c||c,I=t.touchRotate,p=void 0!==I&&I,C=t.keyboard,y=void 0===C||C,v=Boolean(this.onViewStateChange);this.toggleEvents(l,v&&n),this.toggleEvents(g,v&&(i||a)),this.toggleEvents(f,v&&(u||p)),this.toggleEvents(h,v&&s),this.toggleEvents(d,v&&y),this.scrollZoom=n,this.dragPan=i,this.dragRotate=a,this.doubleClickZoom=s,this.touchZoom=u,this.touchRotate=p,this.keyboard=y}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{key:"toggleEvents",value:function(t,e){var n=this;this.eventManager&&t.forEach((function(t){n._events[t]!==e&&(n._events[t]=e,e?n.eventManager.on(t,n.handleEvent):n.eventManager.off(t,n.handleEvent))}))}},{key:"updateViewport",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.assign({},t.getViewportProps(),e),i=this.controllerState!==t;if(i){var o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:n,oldViewState:o})}Object.assign(this._state,t.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(n=!n);var r=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(r,u,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}},{key:"_onPanEnd",value:function(t){var e=this.controllerState[this._panMove?"panEnd":"rotateEnd"]();return this.updateViewport(e,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,u,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=t.deltaX,n=t.deltaY,r=this.controllerState.getViewportProps(),i=e/r.width,o=n/r.height,a=this.controllerState.rotate({deltaScaleX:i,deltaScaleY:o});return this.updateViewport(a,u,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;t.preventDefault();var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=t.delta,r=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==r&&(r=1/r);var i=this.controllerState.zoom({pos:e,scale:r});return this.updateViewport(i,u,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._state.startPinchRotation=t.rotation,this.updateViewport(n,u,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var e=this.controllerState;if(this.touchZoom){var n=t.scale,r=this.getCenter(t);e=e.zoom({pos:r,scale:n})}if(this.touchRotate){var i=t.rotation,o=this._state.startPinchRotation;e=e.rotate({deltaScaleX:-(i-o)/180})}return this.updateViewport(e,u,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(t){var e=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(e,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.isFunctionKeyPressed(t),r=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(r,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),r=this.keyboard,i=r.zoomSpeed,o=r.moveSpeed,a=r.rotateSpeedX,A=r.rotateSpeedY,s=this.controllerState,c={};switch(t.srcEvent.code){case"Minus":e=n?s.zoomOut(i).zoomOut(i):s.zoomOut(i),c.isZooming=!0;break;case"Equal":e=n?s.zoomIn(i).zoomIn(i):s.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":n?(e=s.rotateLeft(a),c.isRotating=!0):(e=s.moveLeft(o),c.isPanning=!0);break;case"ArrowRight":n?(e=s.rotateRight(a),c.isRotating=!0):(e=s.moveRight(o),c.isPanning=!0);break;case"ArrowUp":n?(e=s.rotateUp(A),c.isRotating=!0):(e=s.moveUp(o),c.isPanning=!0);break;case"ArrowDown":n?(e=s.rotateDown(A),c.isRotating=!0):(e=s.moveDown(o),c.isPanning=!0);break;default:return!1}return this.updateViewport(e,this._getTransitionProps(),c),!0}},{key:"_getTransitionProps",value:function(){return u}},{key:"events",set:function(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getIntermediatePosition=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},e.GeoJsonEditMode=void 0;var r=c(n(991)),i=c(n(806)),o=c(n(992)),a=c(n(1086)),A=n(230),s=n(330);function c(t){return t&&t.__esModule?t:{default:t}}function u(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var h={type:"FeatureCollection",features:[]},d=[],I=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=[],(n="_clickSequence")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}var e,n,c;return e=t,(n=[{key:"getGuides",value:function(t){return h}},{key:"getTooltips",value:function(t){return d}},{key:"getSelectedFeature",value:function(t){return 1===t.selectedIndexes.length?t.data.features[t.selectedIndexes[0]]:null}},{key:"getSelectedGeometry",value:function(t){var e=this.getSelectedFeature(t);return e?e.geometry:null}},{key:"getSelectedFeaturesAsFeatureCollection",value:function(t){var e=t.data.features;return{type:"FeatureCollection",features:t.selectedIndexes.map((function(t){return e[t]}))}}},{key:"getClickSequence",value:function(){return this._clickSequence}},{key:"addClickSequence",value:function(t){var e=t.mapCoords;this._clickSequence.push(e)}},{key:"resetClickSequence",value:function(){this._clickSequence=[]}},{key:"getTentativeGuide",value:function(t){return this.getGuides(t).features.find((function(t){return t.properties&&"tentative"===t.properties.guideType}))}},{key:"isSelectionPicked",value:function(t,e){if(!t.length)return!1;var n=(0,A.getNonGuidePicks)(t).map((function(t){return t.index})),r=(0,A.getPickedEditHandles)(t).map((function(t){return t.properties.featureIndex})),i=new Set([].concat(u(n),u(r)));return e.selectedIndexes.some((function(t){return i.has(t)}))}},{key:"rewindPolygon",value:function(t){var e=t.geometry;return"Polygon"===e.type||"MultiPolygon"===e.type?(0,a.default)(t):t}},{key:"getAddFeatureAction",value:function(t,e){var n=t,r="Feature"===n.type?n:{type:"Feature",properties:{},geometry:n},i=this.rewindPolygon(r),o=new s.ImmutableFeatureCollection(e).addFeature(i).getObject();return{updatedData:o,editType:"addFeature",editContext:{featureIndexes:[o.features.length-1]}}}},{key:"getAddManyFeaturesAction",value:function(t,e){var n,r=t.features,i=new s.ImmutableFeatureCollection(e),o=i.getObject().features.length,a=[],A=function(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=l(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(r);try{for(A.s();!(n=A.n()).done;){var c=n.value,u=c.properties,g=c.geometry;i=i.addFeature({type:"Feature",properties:u,geometry:g}),a.push(o+a.length)}}catch(f){A.e(f)}finally{A.f()}return{updatedData:i.getObject(),editType:"addFeature",editContext:{featureIndexes:a}}}},{key:"getAddFeatureOrBooleanPolygonAction",value:function(t,e){var n=t,a=this.getSelectedFeature(e),A=e.modeConfig;if(A&&A.booleanOperation){if(!a||"Polygon"!==a.geometry.type&&"MultiPolygon"!==a.geometry.type)return console.warn("booleanOperation only supported for single Polygon or MultiPolygon selection"),null;var c,u="Feature"===n.type?n:{type:"Feature",geometry:n};if("union"===A.booleanOperation)c=(0,r.default)(a,u);else if("difference"===A.booleanOperation)c=(0,i.default)(a,u);else{if("intersection"!==A.booleanOperation)return console.warn("Invalid booleanOperation ".concat(A.booleanOperation)),null;c=(0,o.default)(a,u)}if(!c)return console.warn("Canceling edit. Boolean operation erased entire polygon."),null;var l=e.selectedIndexes[0];return{updatedData:new s.ImmutableFeatureCollection(e.data).replaceGeometry(l,c.geometry).getObject(),editType:"unionGeometry",editContext:{featureIndexes:[l]}}}return this.getAddFeatureAction(t,e.data)}},{key:"createTentativeFeature",value:function(t){return null}},{key:"handleClick",value:function(t,e){}},{key:"handlePointerMove",value:function(t,e){var n=this.createTentativeFeature(e);n&&e.onEdit({updatedData:e.data,editType:"updateTentativeFeature",editContext:{feature:n}})}},{key:"handleStartDragging",value:function(t,e){}},{key:"handleStopDragging",value:function(t,e){}},{key:"handleDragging",value:function(t,e){}},{key:"handleKeyUp",value:function(t,e){"Escape"===t.key&&(this.resetClickSequence(),e.onEdit({updatedData:e.data,editType:"cancelFeature",editContext:{}}))}}])&&f(e.prototype,n),c&&f(e,c),t}();e.GeoJsonEditMode=I},function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return g})),n.d(e,"f",(function(){return f})),n.d(e,"g",(function(){return h})),n.d(e,"h",(function(){return d})),n.d(e,"e",(function(){return I}));var r=n(12),i=n(0),o=n(63),a=n(128),A=n(267);function s(t,e){e(t.message),console.warn(t.message),t instanceof a.a&&t.warnInConsole()}function c(t,e){var n=Object(i.useState)(),o=Object(r.a)(n,2),a=o[0],A=o[1];return Object(i.useEffect)((function(){t[e]&&(t[e].description?A(t[e].description):A(null))}),[t,e]),[a]}function u(t,e,n,A,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,l=Object(i.useState)({}),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Object(i.useState)(0),I=Object(r.a)(d,2),p=I[0],C=I[1],y=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders.cells?t[e].loaders.cells.load().catch((function(t){return s(t,y)})).then((function(t){if(t){var e=t.data,r=t.url;h(e),C(Object.keys(e).length),A(r,"Cells"),u&&u(),n("cells")}})):(h({}),C(0),c?s(new a.c(e,"cells",null,null),y):n("cells")))}),[t,e]),[f,p]}function l(t,e,n,A,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,l=Object(i.useState)(),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders["cell-sets"]?t[e].loaders["cell-sets"].load().catch((function(t){return s(t,d)})).then((function(t){if(t){var e=t.data,r=t.url;h(e),A(r,"Cell Sets"),u&&u(e),n("cell-sets")}})):(h(null),c?s(new a.c(e,"cell-sets",null,null),d):n("cell-sets")))}),[t,e]),[f]}function g(t,e,n,A,c){var u=Object(i.useState)(),l=Object(r.a)(u,2),g=l[0],f=l[1],h=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders["expression-matrix"]?t[e].loaders["expression-matrix"].load().catch((function(t){return s(t,h)})).then((function(t){if(t){var e=t.data,i=t.url,o=Object(r.a)(e,2),a=o[0],s=o[1];f({cols:a.cols,rows:a.rows,matrix:s.data}),A(i,"Expression Matrix"),n("expression-matrix")}})):(f(null),c?s(new a.c(e,"expression-matrix",null,null),h):n("expression-matrix")))}),[t,e]),[g]}function f(t,e,n,A,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,l=Object(i.useState)(),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Object(i.useState)(0),I=Object(r.a)(d,2),p=I[0],C=I[1],y=Object(i.useState)(0),v=Object(r.a)(y,2),B=v[0],m=v[1],b=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders.molecules?t[e].loaders.molecules.load().catch((function(t){return s(t,b)})).then((function(t){if(t){var e=t.data,r=t.url;h(e),C(Object.keys(e).length),m(Object.values(e).map((function(t){return t.length})).reduce((function(t,e){return t+e}),0)),A(r,"Molecules"),u&&u(),n("molecules")}})):(h({}),C(0),m(0),c?s(new a.c(e,"molecules",null,null),b):n("molecules")))}),[t,e]),[f,p,B]}function h(t,e,n,A,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,l=Object(i.useState)(),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders.neighborhoods?t[e].loaders.neighborhoods.load().catch((function(t){return s(t,d)})).then((function(t){if(t){var e=t.data,r=t.url;h(e),A(r,"Neighborhoods"),u&&u(),n("neighborhoods")}})):(h({}),c?s(new a.c(e,"neighborhoods",null,null),d):n("neighborhoods")))}),[t,e]),[f]}function d(t,e,n,c,u){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,g=Object(i.useState)(),f=Object(r.a)(g,2),h=f[0],d=f[1],I=Object(i.useState)([]),p=Object(r.a)(I,2),C=p[0],y=p[1],v=Object(i.useState)([]),B=Object(r.a)(v,2),m=B[0],b=B[1],E=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders.raster?t[e].loaders.raster.load().catch((function(t){return s(t,E)})).then((function(t){if(t){var e=t.data,i=t.urls;d(e),i.forEach((function(t){var e=Object(r.a)(t,2),n=e[0],i=e[1];c(n,i)}));var o=e.layers,a=e.renderLayers,s=e.usePhysicalSizeScaling;Object(A.c)(o,a,s).then((function(t){var e=Object(r.a)(t,3),i=e[0],o=e[1],a=e[2];y(o),b(a),l&&l(i),n("raster")}))}})):(y([]),b([]),u?s(new a.c(e,"raster",null,null),E):n("raster")))}),[t,e]),[h,C,m]}function I(t,e,n,A,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,l=Object(i.useState)(),g=Object(r.a)(l,2),f=g[0],h=g[1],d=Object(o.n)();return Object(i.useEffect)((function(){t[e]&&(t[e].loaders["genomic-profiles"]?t[e].loaders["genomic-profiles"].load().catch((function(t){return s(t,d)})).then((function(t){if(t){var e=t.data,r=t.url;h(e),A(r),u&&u(),n("genomic-profiles")}})):(h(null),c?s(new a.c(e,"genomic-profiles",null,null),d):n("genomic-profiles")))}),[t,e]),[f]}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return s}));var r,i=n(16),o={DATASET:"dataset",EMBEDDING_TYPE:"embeddingType",EMBEDDING_ZOOM:"embeddingZoom",EMBEDDING_ROTATION:"embeddingRotation",EMBEDDING_TARGET_X:"embeddingTargetX",EMBEDDING_TARGET_Y:"embeddingTargetY",EMBEDDING_TARGET_Z:"embeddingTargetZ",EMBEDDING_CELL_SET_POLYGONS_VISIBLE:"embeddingCellSetPolygonsVisible",EMBEDDING_CELL_SET_LABELS_VISIBLE:"embeddingCellSetLabelsVisible",EMBEDDING_CELL_SET_LABEL_SIZE:"embeddingCellSetLabelSize",EMBEDDING_CELL_RADIUS:"embeddingCellRadius",SPATIAL_ZOOM:"spatialZoom",SPATIAL_ROTATION:"spatialRotation",SPATIAL_TARGET_X:"spatialTargetX",SPATIAL_TARGET_Y:"spatialTargetY",SPATIAL_TARGET_Z:"spatialTargetZ",HEATMAP_ZOOM_X:"heatmapZoomX",HEATMAP_ZOOM_Y:"heatmapZoomY",HEATMAP_TARGET_X:"heatmapTargetX",HEATMAP_TARGET_Y:"heatmapTargetY",CELL_FILTER:"cellFilter",CELL_HIGHLIGHT:"cellHighlight",CELL_SET_SELECTION:"cellSetSelection",CELL_SET_HIGHLIGHT:"cellSetHighlight",CELL_SET_COLOR:"cellSetColor",GENE_FILTER:"geneFilter",GENE_HIGHLIGHT:"geneHighlight",GENE_SELECTION:"geneSelection",GENE_EXPRESSION_COLORMAP:"geneExpressionColormap",GENE_EXPRESSION_COLORMAP_RANGE:"geneExpressionColormapRange",CELL_COLOR_ENCODING:"cellColorEncoding",SPATIAL_LAYERS:"spatialLayers",GENOMIC_ZOOM_X:"genomicZoomX",GENOMIC_ZOOM_Y:"genomicZoomY",GENOMIC_TARGET_X:"genomicTargetX",GENOMIC_TARGET_Y:"genomicTargetY",ADDITIONAL_CELL_SETS:"additionalCellSets",MOLECULE_HIGHLIGHT:"moleculeHighlight"},a=(r={},Object(i.a)(r,o.EMBEDDING_ZOOM,0),Object(i.a)(r,o.EMBEDDING_ROTATION,0),Object(i.a)(r,o.EMBEDDING_TARGET_X,0),Object(i.a)(r,o.EMBEDDING_TARGET_Y,0),Object(i.a)(r,o.EMBEDDING_TARGET_Z,0),Object(i.a)(r,o.EMBEDDING_CELL_SET_POLYGONS_VISIBLE,!1),Object(i.a)(r,o.EMBEDDING_CELL_SET_LABELS_VISIBLE,!1),Object(i.a)(r,o.EMBEDDING_CELL_SET_LABEL_SIZE,14),Object(i.a)(r,o.EMBEDDING_CELL_RADIUS,1),Object(i.a)(r,o.SPATIAL_ZOOM,0),Object(i.a)(r,o.SPATIAL_ROTATION,0),Object(i.a)(r,o.SPATIAL_TARGET_X,0),Object(i.a)(r,o.SPATIAL_TARGET_Y,0),Object(i.a)(r,o.SPATIAL_TARGET_Z,0),Object(i.a)(r,o.SPATIAL_LAYERS,null),Object(i.a)(r,o.HEATMAP_ZOOM_X,0),Object(i.a)(r,o.HEATMAP_ZOOM_Y,0),Object(i.a)(r,o.HEATMAP_TARGET_X,0),Object(i.a)(r,o.HEATMAP_TARGET_Y,0),Object(i.a)(r,o.GENE_EXPRESSION_COLORMAP,"plasma"),Object(i.a)(r,o.GENE_EXPRESSION_COLORMAP_RANGE,[0,1]),Object(i.a)(r,o.GENE_FILTER,null),Object(i.a)(r,o.GENE_HIGHLIGHT,null),Object(i.a)(r,o.GENE_SELECTION,null),Object(i.a)(r,o.CELL_FILTER,null),Object(i.a)(r,o.CELL_HIGHLIGHT,null),Object(i.a)(r,o.CELL_SET_SELECTION,null),Object(i.a)(r,o.CELL_SET_HIGHLIGHT,null),Object(i.a)(r,o.CELL_SET_COLOR,null),Object(i.a)(r,o.CELL_COLOR_ENCODING,"cellSetSelection"),Object(i.a)(r,o.GENOMIC_ZOOM_X,0),Object(i.a)(r,o.GENOMIC_ZOOM_Y,0),Object(i.a)(r,o.GENOMIC_TARGET_X,1549999999.5),Object(i.a)(r,o.GENOMIC_TARGET_Y,1549999999.5),Object(i.a)(r,o.ADDITIONAL_CELL_SETS,null),Object(i.a)(r,o.MOLECULE_HIGHLIGHT,null),r),A=[o.SPATIAL_ZOOM,o.SPATIAL_TARGET_X,o.SPATIAL_TARGET_Y,o.SPATIAL_TARGET_Z,o.HEATMAP_ZOOM_X,o.HEATMAP_ZOOM_Y,o.HEATMAP_TARGET_X,o.HEATMAP_TARGET_Y,o.EMBEDDING_ZOOM,o.EMBEDDING_TARGET_X,o.EMBEDDING_TARGET_Y,o.EMBEDDING_TARGET_Z,o.EMBEDDING_CELL_SET_POLYGONS_VISIBLE,o.EMBEDDING_CELL_SET_LABELS_VISIBLE,o.EMBEDDING_CELL_SET_LABEL_SIZE,o.EMBEDDING_CELL_RADIUS],s={scatterplot:[o.DATASET,o.EMBEDDING_TYPE,o.EMBEDDING_ZOOM,o.EMBEDDING_ROTATION,o.EMBEDDING_TARGET_X,o.EMBEDDING_TARGET_Y,o.EMBEDDING_TARGET_Z,o.EMBEDDING_CELL_SET_POLYGONS_VISIBLE,o.EMBEDDING_CELL_SET_LABELS_VISIBLE,o.EMBEDDING_CELL_SET_LABEL_SIZE,o.EMBEDDING_CELL_RADIUS,o.CELL_FILTER,o.CELL_HIGHLIGHT,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.GENE_HIGHLIGHT,o.GENE_SELECTION,o.GENE_EXPRESSION_COLORMAP,o.GENE_EXPRESSION_COLORMAP_RANGE,o.CELL_COLOR_ENCODING,o.ADDITIONAL_CELL_SETS],spatial:[o.DATASET,o.SPATIAL_ZOOM,o.SPATIAL_ROTATION,o.SPATIAL_LAYERS,o.SPATIAL_TARGET_X,o.SPATIAL_TARGET_Y,o.SPATIAL_TARGET_Z,o.CELL_FILTER,o.CELL_HIGHLIGHT,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.GENE_HIGHLIGHT,o.GENE_SELECTION,o.GENE_EXPRESSION_COLORMAP,o.GENE_EXPRESSION_COLORMAP_RANGE,o.CELL_COLOR_ENCODING,o.ADDITIONAL_CELL_SETS,o.MOLECULE_HIGHLIGHT],heatmap:[o.DATASET,o.HEATMAP_ZOOM_X,o.HEATMAP_ZOOM_Y,o.HEATMAP_TARGET_X,o.HEATMAP_TARGET_Y,o.CELL_FILTER,o.CELL_HIGHLIGHT,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.GENE_FILTER,o.GENE_HIGHLIGHT,o.GENE_SELECTION,o.GENE_EXPRESSION_COLORMAP,o.GENE_EXPRESSION_COLORMAP_RANGE,o.CELL_COLOR_ENCODING,o.ADDITIONAL_CELL_SETS],cellSets:[o.DATASET,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.CELL_COLOR_ENCODING,o.ADDITIONAL_CELL_SETS],cellSetSizes:[o.DATASET,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.ADDITIONAL_CELL_SETS],cellSetExpression:[o.DATASET,o.GENE_SELECTION,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.ADDITIONAL_CELL_SETS],status:[o.DATASET,o.CELL_HIGHLIGHT,o.GENE_HIGHLIGHT,o.CELL_SET_HIGHLIGHT,o.MOLECULE_HIGHLIGHT],genes:[o.DATASET,o.GENE_FILTER,o.GENE_HIGHLIGHT,o.GENE_SELECTION,o.CELL_COLOR_ENCODING],expressionHistogram:[o.DATASET,o.GENE_SELECTION],layerController:[o.DATASET,o.SPATIAL_LAYERS],higlass:[o.DATASET,o.GENOMIC_ZOOM_X,o.GENOMIC_ZOOM_Y,o.GENOMIC_TARGET_X,o.GENOMIC_TARGET_Y,o.GENE_FILTER,o.GENE_HIGHLIGHT,o.GENE_SELECTION],genomicProfiles:[o.DATASET,o.GENOMIC_ZOOM_X,o.GENOMIC_ZOOM_Y,o.GENOMIC_TARGET_X,o.GENOMIC_TARGET_Y,o.GENE_FILTER,o.GENE_HIGHLIGHT,o.GENE_SELECTION,o.CELL_SET_SELECTION,o.CELL_SET_HIGHLIGHT,o.CELL_SET_COLOR,o.ADDITIONAL_CELL_SETS],description:[o.DATASET,o.SPATIAL_LAYERS]}},function(t,e,n){"use strict";var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i="object"===("undefined"===typeof window?"undefined":r(window))&&"object"===("undefined"===typeof document?"undefined":r(document))&&9===document.nodeType;e.a=i},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return c}));var r=n(125),i=n(132),o=n(41);function a(t,e){if(Object(o.a)(Object(o.g)(t),"setParameters requires a WebGL context"),!Object(o.f)(e)){var n={};for(var i in e){var a=Number(i),A=r.e[i];A&&("string"===typeof A?n[A]=!0:A(t,e[i],a))}var s=t.state&&t.state.cache;if(s)for(var c in n){(0,r.a[c])(t,e,s)}}}function A(t,e){if("number"===typeof(e=e||r.c)){var n=e,i=r.d[n];return i?i(t,n):t.getParameter(n)}var o=Array.isArray(e)?e:Object.keys(e),a={},A=!0,s=!1,c=void 0;try{for(var u,l=o[Symbol.iterator]();!(A=(u=l.next()).done);A=!0){var g=u.value,f=r.d[g];a[g]=f?f(t,Number(g)):t.getParameter(Number(g))}}catch(h){s=!0,c=h}finally{try{A||null==l.return||l.return()}finally{if(s)throw c}}return a}function s(t){a(t,r.c)}function c(t,e,n){if(Object(o.f)(e))return n(t);var r,A=e.nocatch,s=void 0===A||A;if(Object(i.c)(t),a(t,e),s)r=n(t),Object(i.b)(t);else try{r=n(t)}finally{Object(i.b)(t)}return r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(105),c=n(31),u=function(t){function e(){return Object(r.a)(this,e),Object(o.a)(this,Object(a.a)(e).apply(this,arguments))}return Object(A.a)(e,t),Object(i.a)(e,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(c.m)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(c.f)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(c.l)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(c.j)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(c.f.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(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"elements",get:function(){return this}}]),e}(Object(s.a)(Array))},function(t,e,n){(function(r){e.log=function(){var t;return"object"===typeof console&&console.log&&(t=console).log.apply(t,arguments)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(n){}!t&&"undefined"!==typeof r&&"env"in r&&(t=Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).DEBUG);return t},e.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=n(604)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(68))},function(t,e,n){"use strict";function r(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function o(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";function r(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function o(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}function a(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";var r=n(52),i=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function a(t){if("string"!==typeof t)return"";var e=t.match(i);return e?e[1]:""}n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c}));var A=/\?.*/;function s(t){if(Object(r.i)(t)){var e=function(t){if("string"!==typeof t)return"";var e=t.match(o);return e?e[1]:t}(t.headers.get("content-type")),n=a(t.url);return{url:u(t.url||""),type:e||n||null}}return Object(r.b)(t)?{url:u(t.name||""),type:t.type||""}:"string"===typeof t?{url:u(t),type:a(t)}:{url:"",type:""}}function c(t){return Object(r.i)(t)?t.headers["content-length"]||-1:Object(r.b)(t)?t.size:"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function u(t){return t.replace(A,"")}},function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&t.push(a)}else if("object"===o)for(var A in r)n.call(r,A)&&r[A]&&t.push(A)}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(r=function(){return i}.apply(e,[]))||(t.exports=r)}()},function(t,e,n){"use strict";var r=function(t){return Object.assign(Error(t.message),{name:t.name,stack:t.stack})},i=function(t){return{__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack}},o={deserialize:function(t){return(e=t)&&"object"===typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker?r(t):t;var e},serialize:function(t){return t instanceof Error?i(t):t}};n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return s}));var a=o;function A(t){return a.deserialize(t)}function s(t){return a.serialize(t)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(47);function i(t,e){if("string"!==typeof e)return e;var n=Number(e);if(!isNaN(n))return n;var i=t[e=e.replace(/^.*\./,"")];return Object(r.a)(void 0!==i,"Accessing undefined constant GL.".concat(e)),i}function o(t,e){for(var n in e=Number(e),t)if(t[n]===e)return"GL.".concat(n);return String(e)}},function(t,e,n){"use strict";function r(t,e){if(t===e)return!0;if(Array.isArray(t)){var n=t.length;if(!e||e.length!==n)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}return!1}function i(t){var e,n={};return function(i){for(var o in i)if(!r(i[o],n[o])){e=t(i),n=i;break}return e}}n.d(e,"a",(function(){return i}))},function(t,e,n){var r=n(266),i=n(50);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?i(t):e}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var r=n(1171);t.exports=function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";var r=n(27),i=n(1),o=n(3),a=n(2),A=n(98),s=/([0-9]+\.?[0-9]*)(%|px)/;function c(t){switch(Object(r.a)(t)){case"number":return{position:t,relative:!1};case"string":var e=t.match(s);if(e&&e.length>=3){var n="%"===e[2],i=parseFloat(e[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(t))}}function u(t,e){return t.relative?Math.round(t.position*e):t.position}var l=n(153),g=n(53);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return d}));var d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t);var n=e.id,r=void 0===n?null:n,i=e.x,a=void 0===i?0:i,s=e.y,c=void 0===s?0:s,u=e.width,l=void 0===u?"100%":u,f=e.height,h=void 0===f?"100%":f,d=e.projectionMatrix,I=void 0===d?null:d,p=e.fovy,C=void 0===p?50:p,y=e.near,v=void 0===y?.1:y,B=e.far,m=void 0===B?1e3:B,b=e.modelMatrix,E=void 0===b?null:b,Q=e.viewportInstance,F=void 0===Q?null:Q,w=e.type,S=void 0===w?A.a:w;Object(g.a)(!F||F instanceof A.a),this.viewportInstance=F,this.id=r||this.constructor.displayName||"view",this.type=S,this.props=Object.assign({},e,{id:this.id,projectionMatrix:I,fovy:C,near:v,far:m,modelMatrix:E}),this._parseDimensions({x:a,y:c,width:l,height:h}),this.equals=this.equals.bind(this),Object.seal(this)}return Object(a.a)(t,[{key:"equals",value:function(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):Object(l.a)(this.props,t.props))}},{key:"makeViewport",value:function(t){var e=t.width,n=t.height,r=t.viewState;if(this.viewportInstance)return this.viewportInstance;r=this.filterViewState(r);var i=this.getDimensions({width:e,height:n}),o=h(h(h({},r),this.props),i);return this._getViewport(o)}},{key:"getViewStateId",value:function(){switch(Object(r.a)(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(t){if(this.props.viewState&&"object"===Object(r.a)(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var e=Object.assign({},t);for(var n in this.props.viewState)"id"!==n&&(e[n]=this.props.viewState[n]);return e}return t}},{key:"getDimensions",value:function(t){var e=t.width,n=t.height;return{x:u(this._x,e),y:u(this._y,n),width:u(this._width,e),height:u(this._height,n)}}},{key:"_getControllerProps",value:function(t){var e=this.props.controller;return e?!0===e?t:("function"===typeof e&&(e={type:e}),Object.assign({},t,e)):null}},{key:"_getViewport",value:function(t){return new(0,this.type)(t)}},{key:"_parseDimensions",value:function(t){var e=t.x,n=t.y,r=t.width,i=t.height;this._x=c(e),this._y=c(n),this._width=c(r),this._height=c(i)}}]),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return A}));var r="card card-body my-2 ".concat("tooltip-ancestor"),i="".concat(r," bg-primary"),o="".concat(r," bg-secondary"),a="".concat(r," bg-black"),A="".concat(i," scroll")},function(t,e,n){"use strict";var r=n(261),i=Object(r.a)();e.a=i},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=o.default.memo(o.default.forwardRef((function(e,n){return o.default.createElement(a.default,(0,i.default)({ref:n},e),t)})));0;return n.muiName=a.default.muiName,n};var i=r(n(225)),o=r(n(0)),a=r(n(490))},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(212),c=n(31),u=n(35),l=n(22),g=n(103),f=[0,0,0],h=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(r.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,-0,-0,-0)),1===arguments.length&&Object(c.m)(n)?t.copy(n):(c.f.debug&&(Object(u.a)(n),Object(u.a)(i),Object(u.a)(A)),t[0]=n,t[1]=i,t[2]=A),t}return Object(A.a)(e,t),Object(i.a)(e,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return c.f.debug&&(Object(u.a)(t.x),Object(u.a)(t.y),Object(u.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return l.a(this,t)}},{key:"cross",value:function(t){return l.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?f:n;return l.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?f:n;return l.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?f:n;return l.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return l.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(g.c)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return l.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Object(g.b)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return l.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){return this[2]=Object(u.a)(t)}}]),e}(s.a)},function(t,e,n){"use strict";var r=n(923),i=n(40),o=Object.keys(i.a).map((function(t){return"const int COORDINATE_SYSTEM_".concat(t," = ").concat(i.a[t],";")})).join(""),a=Object.keys(i.c).map((function(t){return"const int PROJECTION_MODE_".concat(t," = ").concat(i.c[t],";")})).join(""),A="".concat(o,"\n").concat(a,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n  return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n  return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n  return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n  return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n  vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n  return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n  float dy = offset.y;\n  if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n    dy = clamp(dy, -1., 1.);\n  }\n  vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n  return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n  float x = lnglat.x;\n  if (project_uWrapLongitude) {\n    x = mod(x + 180., 360.0) - 180.;\n  }\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n  );\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n  float lambda = radians(lnglatz.x);\n  float phi = radians(lnglatz.y);\n  float cosPhi = cos(phi);\n  float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n  return vec3(\n    sin(lambda) * cosPhi,\n    -cos(lambda) * cosPhi,\n    sin(phi)\n  ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n  vec4 position_world = project_uModelMatrix * position;\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_mercator_(position_world.xy) * WORLD_SCALE,\n        project_size(position_world.z),\n        position_world.w\n      );\n    }\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n      position_world.xyz += project_uCoordinateOrigin;\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_globe_(position_world.xyz),\n        position_world.w\n      );\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n    (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n    (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n     project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n    position_world.xyz -= project_uCoordinateOrigin;\n  }\n  return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n  return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n  vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n  return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n  vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n  return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n  vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n  return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n  return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n  return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n  vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n  return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n  return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n  return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n  return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n  vec3 uz = normalize(up);\n  vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n  vec3 uy = cross(uz, ux);\n  return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    transform = project_get_orientation_matrix(commonPosition);\n    return true;\n  }\n  return false;\n}\n"),s=n(256),c={};e.a={name:"project",dependencies:[r.a],vs:A,getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return t.viewport?Object(s.b)(t):{}}}},function(t,e,n){"use strict";var r=n(540);e.a=function(t,e){return e?Object(r.a)(t,e,{clone:!1}):t}},function(t,e,n){"use strict";var r=n(112);n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.b})),n.d(e,"c",(function(){return r.c}))},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(0),i=r.createContext({});e.a=i},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(13),i=n.n(r),o=n(30),a=n(52),A=n(165);function s(t){return c.apply(this,arguments)}function c(){return(c=Object(o.a)(i.a.mark((function t(e){var n,r,o,s,c,u,l;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Object(a.i)(e)){t.next=2;break}return t.abrupt("return",e);case 2:return n={},(r=Object(A.a)(e))>=0&&(n["content-length"]=String(r)),o=Object(A.b)(e),s=o.url,(c=o.type)&&(n["content-type"]=c),t.next=9,h(e);case 9:return(u=t.sent)&&(n["x-first-bytes"]=u),"string"===typeof e&&(e=(new TextEncoder).encode(e)),l=new Response(e,{headers:n}),Object.defineProperty(l,"url",{value:s}),t.abrupt("return",l);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(t){return l.apply(this,arguments)}function l(){return(l=Object(o.a)(i.a.mark((function t(e){var n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.ok){t.next=5;break}return t.next=3,g(e);case 3:throw n=t.sent,new Error(n);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t){return f.apply(this,arguments)}function f(){return(f=Object(o.a)(i.a.mark((function t(e){var n,r,o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): "),t.prev=1,r=e.headers.get("Content-Type"),o=e.statusText,!r.includes("application/json")){t.next=11;break}return t.t0=o,t.t1=" ",t.next=9,e.text();case 9:t.t2=t.sent,o=t.t0+=t.t1.concat.call(t.t1,t.t2);case 11:n=(n+=o).length>60?"".concat(n.slice(60),"..."):n,t.next=17;break;case 15:t.prev=15,t.t3=t.catch(1);case 17:return t.abrupt("return",n);case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function h(t){return d.apply(this,arguments)}function d(){return(d=Object(o.a)(i.a.mark((function t(e){var n,r,o,a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=5,"string"!==typeof e){t.next=3;break}return t.abrupt("return","data:,".concat(e.slice(0,n)));case 3:if(!(e instanceof Blob)){t.next=8;break}return r=e.slice(0,5),t.next=7,new Promise((function(t){var e=new FileReader;e.onload=function(e){return t(e.target&&e.target.result)},e.readAsDataURL(r)}));case 7:return t.abrupt("return",t.sent);case 8:if(!(e instanceof ArrayBuffer)){t.next=12;break}return o=e.slice(0,n),a=I(o),t.abrupt("return","data:base64,".concat(a));case 12:return t.abrupt("return",null);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return btoa(e)}},function(t,e,n){"use strict";var r=n(61),i=(n(325),n(5)),o=n.n(i),a=n(21),A=n(16),s=n(12),c=n(11),u=n(14),l=n(74),g=n(90),f=n(24),h=n(25),d=n(26),I=n(18),p=n(435),C=n(436),y=n(40),v=n(252),B=n(360),m=n(708),b=n(154),E=n(19),Q=n(379),F=n(235),w=n(218),S=n(413),R=n(46),U=n(347),x=n(480),k=n(549),O=n(712),N=n(336),D=n(0),G=n.n(D),_=n(931),M=n(464),T=n.n(M),j=n(126),L=n(78),V=n(465),Z=n.n(V),P={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams"},W={};for(var J in P)P.hasOwnProperty(J)&&(W[P[J]]=parseInt(J,10));var H=[W.BitsPerSample,W.ExtraSamples,W.SampleFormat,W.StripByteCounts,W.StripOffsets,W.StripRowCounts,W.TileByteCounts,W.TileOffsets],Y={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},X={};for(var z in Y)Y.hasOwnProperty(z)&&(X[Y[z]]=parseInt(z,10));var K=0,q=1,$=2,tt=3,et=5,nt=6,rt=8,it=0,ot={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},at={};for(var At in ot)ot.hasOwnProperty(At)&&(at[ot[At]]=parseInt(At,10));function st(t,e){for(var n,r=t.width,i=t.height,o=new Uint8Array(r*i*3),a=0,A=0;a<t.length;++a,A+=3)n=256-t[a]/e*256,o[A]=n,o[A+1]=n,o[A+2]=n;return o}function ct(t,e){for(var n,r=t.width,i=t.height,o=new Uint8Array(r*i*3),a=0,A=0;a<t.length;++a,A+=3)n=t[a]/e*256,o[A]=n,o[A+1]=n,o[A+2]=n;return o}function ut(t,e){for(var n=t.width,r=t.height,i=new Uint8Array(n*r*3),o=e.length/3,a=e.length/3*2,A=0,s=0;A<t.length;++A,s+=3){var c=t[A];i[s]=e[c]/65536*256,i[s+1]=e[c+o]/65536*256,i[s+2]=e[c+a]/65536*256}return i}function lt(t){for(var e=t.width,n=t.height,r=new Uint8Array(e*n*3),i=0,o=0;i<t.length;i+=4,o+=3){var a=t[i],A=t[i+1],s=t[i+2],c=t[i+3];r[o]=(255-a)/256*255*((255-c)/256),r[o+1]=(255-A)/256*255*((255-c)/256),r[o+2]=(255-s)/256*255*((255-c)/256)}return r}function gt(t){for(var e=t.width,n=t.height,r=new Uint8ClampedArray(e*n*3),i=0,o=0;i<t.length;i+=3,o+=3){var a=t[i],A=t[i+1],s=t[i+2];r[o]=a+1.402*(s-128),r[o+1]=a-.34414*(A-128)-.71414*(s-128),r[o+2]=a+1.772*(A-128)}return r}function ft(t){for(var e=t.width,n=t.height,r=new Uint8Array(e*n*3),i=0,o=0;i<t.length;i+=3,o+=3){var a=(t[i+0]+16)/116,A=(t[i+1]<<24>>24)/500+a,s=a-(t[i+2]<<24>>24)/200,c=void 0,u=void 0,l=void 0;u=-.9689*(A=.95047*(A*A*A>.008856?A*A*A:(A-16/116)/7.787))+1.8758*(a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+.0415*(s=1.08883*(s*s*s>.008856?s*s*s:(s-16/116)/7.787)),l=.0557*A+-.204*a+1.057*s,c=(c=3.2406*A+-1.5372*a+-.4986*s)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,u=u>.0031308?1.055*Math.pow(u,1/2.4)-.055:12.92*u,l=l>.0031308?1.055*Math.pow(l,1/2.4)-.055:12.92*l,r[o]=255*Math.max(0,Math.min(1,c)),r[o+1]=255*Math.max(0,Math.min(1,u)),r[o+2]=255*Math.max(0,Math.min(1,l))}return r}function ht(t,e){var n=t.length-e,r=0;do{for(var i=e;i>0;i--)t[r+e]+=t[r],r++;n-=e}while(n>0)}function dt(t,e,n){for(var r=0,i=t.length,o=i/n;i>e;){for(var a=e;a>0;--a)t[r+e]+=t[r],++r;i-=e}for(var A=t.slice(),s=0;s<o;++s)for(var c=0;c<n;++c)t[n*s+c]=A[(n-c-1)*o+s]}function It(t,e,n,r,i,o){if(!e||1===e)return t;for(var a=0;a<i.length;++a){if(i[a]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[a]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var A=i[0]/8,s=2===o?1:i.length,c=0;c<r&&!(c*s*n*A>=t.byteLength);++c){var u=void 0;if(2===e){switch(i[0]){case 8:u=new Uint8Array(t,c*s*n*A,s*n*A);break;case 16:u=new Uint16Array(t,c*s*n*A,s*n*A/2);break;case 32:u=new Uint32Array(t,c*s*n*A,s*n*A/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}ht(u,s)}else 3===e&&dt(u=new Uint8Array(t,c*s*n*A,s*n*A),s,A)}return t}var pt,Ct=function(){function t(){Object(c.a)(this,t)}return Object(u.a)(t,[{key:"decode",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n){var r,i,a,A,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.decodeBlock(n);case 2:if(r=t.sent,1===(i=e.Predictor||1)){t.next=9;break}return a=!e.StripOffsets,A=a?e.TileWidth:e.ImageWidth,s=a?e.TileLength:e.RowsPerStrip||e.ImageLength,t.abrupt("return",It(r,i,A,s,e.BitsPerSample,e.PlanarConfiguration));case 9:return t.abrupt("return",r);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()}]),t}(),yt=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"decodeBlock",value:function(t){return t}}]),n}(Ct),vt=null;function Bt(){return null!==vt&&vt.buffer===pt.memory.buffer||(vt=new Uint8Array(pt.memory.buffer)),vt}var mt=0,bt=null;function Et(){return null!==bt&&bt.buffer===pt.memory.buffer||(bt=new Int32Array(pt.memory.buffer)),bt}function Qt(t){return Ft.apply(this,arguments)}function Ft(){return(Ft=Object(a.a)(o.a.mark((function t(e){var n,r,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e="".replace(/\.js$/,"_bg.wasm")),("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e)),t.t0=function(){var t=Object(a.a)(o.a.mark((function t(e,n){var r,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!("function"==typeof Response&&e instanceof Response)){t.next=19;break}if("function"!=typeof WebAssembly.instantiateStreaming){t.next=13;break}return t.prev=2,t.next=5,WebAssembly.instantiateStreaming(e,n);case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),"application/wasm"!=e.headers.get("Content-Type")){t.next=12;break}throw t.t0;case 12:console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t.t0);case 13:return t.next=15,e.arrayBuffer();case 15:return r=t.sent,t.next=18,WebAssembly.instantiate(r,n);case 18:return t.abrupt("return",t.sent);case 19:return t.next=21,WebAssembly.instantiate(e,n);case 21:return i=t.sent,t.abrupt("return",i instanceof WebAssembly.Instance?{instance:i,module:e}:i);case 23:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,n){return t.apply(this,arguments)}}(),t.next=5,e;case 5:return t.t1=t.sent,t.t2={},t.next=9,(0,t.t0)(t.t1,t.t2);case 9:return n=t.sent,r=n.instance,i=n.module,t.abrupt("return",(pt=r.exports,Qt.__wbindgen_wasm_module=i,pt));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var wt=Object.freeze({__proto__:null,decompress:function(t,e){try{var n=pt.__wbindgen_export_0.value-16;pt.__wbindgen_export_0.value=n;var r=function(t,e){var n=e(1*t.length);return Bt().set(t,n/1),mt=t.length,n}(t,pt.__wbindgen_malloc),i=mt;pt.decompress(n,r,i,e);var o=Et()[n/4+0],a=Et()[n/4+1],A=(s=o,c=a,Bt().subarray(s/1,s/1+c)).slice();return pt.__wbindgen_free(o,1*a),A}finally{pt.__wbindgen_export_0.value+=16}var s,c},default:Qt}),St=[62,0,0,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,0,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function Rt(t){return St[t-43]}var Ut,xt=function(t){for(var e,n=t.endsWith("==")?2:t.endsWith("=")?1:0,r=t.length,i=new Uint8Array(r/4*3),o=0,a=0;o<r;o+=4,a+=3)e=Rt(t.charCodeAt(o))<<18|Rt(t.charCodeAt(o+1))<<12|Rt(t.charCodeAt(o+2))<<6|Rt(t.charCodeAt(o+3)),i[a]=e>>16,i[a+1]=e>>8&255,i[a+2]=255&e;return i.subarray(0,i.length-n)}(" ");function kt(t,e){return Ot.apply(this,arguments)}function Ot(){return(Ot=Object(a.a)(o.a.mark((function t(e,n){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=Ut,t.t0){t.next=5;break}return t.next=4,Object(a.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qt(xt);case 2:return t.abrupt("return",wt);case 3:case"end":return t.stop()}}),t)})))();case 4:Ut=t.sent;case 5:if(0!==(r=Ut.decompress(e,n)).length){t.next=8;break}throw Error("Failed to decode with LZW decoder.");case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Nt=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this);var i=t.TileWidth||t.ImageWidth,o=t.TileLength||t.ImageLength,a=t.BitsPerSample[0]/8;return r.maxUncompressedSize=i*o*a,r}return Object(u.a)(n,[{key:"decodeBlock",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Uint8Array(e),t.next=3,kt(n,this.maxUncompressedSize);case 3:return r=t.sent,t.abrupt("return",r.buffer);case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),n}(Ct),Dt=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function Gt(t,e){for(var n=0,r=[],i=16;i>0&&!t[i-1];)--i;r.push({children:[],index:0});for(var o,a=r[0],A=0;A<i;A++){for(var s=0;s<t[A];s++){for((a=r.pop()).children[a.index]=e[n];a.index>0;)a=r.pop();for(a.index++,r.push(a);r.length<=A;)r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;n++}A+1<i&&(r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o)}return r[0].children}function _t(t,e,n,r,i,o,a,A,s){var c=n.mcusPerLine,u=n.progressive,l=e,g=e,f=0,h=0;function d(){if(h>0)return h--,f>>h&1;if(255===(f=t[g++])){var e=t[g++];if(e)throw new Error("unexpected marker: ".concat((f<<8|e).toString(16)))}return h=7,f>>>7}function I(t){for(var e,n=t;null!==(e=d());){if("number"===typeof(n=n[e]))return n;if("object"!==typeof n)throw new Error("invalid huffman sequence")}return null}function p(t){for(var e=t,n=0;e>0;){var r=d();if(null===r)return;n=n<<1|r,--e}return n}function C(t){var e=p(t);return e>=1<<t-1?e:e+(-1<<t)+1}var y=0;var v,B=0;function m(t,e,n,r,i){var o=n%c,a=(n/c|0)*t.v+r,A=o*t.h+i;e(t,t.blocks[a][A])}function b(t,e,n){var r=n/t.blocksPerLine|0,i=n%t.blocksPerLine;e(t,t.blocks[r][i])}var E,Q,F,w,S,R,U=r.length;R=u?0===o?0===A?function(t,e){var n=I(t.huffmanTableDC),r=0===n?0:C(n)<<s;t.pred+=r,e[0]=t.pred}:function(t,e){e[0]|=d()<<s}:0===A?function(t,e){if(y>0)y--;else for(var n=o,r=a;n<=r;){var i=I(t.huffmanTableAC),A=15&i,c=i>>4;if(0===A){if(c<15){y=p(c)+(1<<c)-1;break}n+=16}else{e[Dt[n+=c]]=C(A)*(1<<s),n++}}}:function(t,e){for(var n=o,r=a,i=0;n<=r;){var A=Dt[n],c=e[A]<0?-1:1;switch(B){case 0:var u=I(t.huffmanTableAC),l=15&u;if(i=u>>4,0===l)i<15?(y=p(i)+(1<<i),B=4):(i=16,B=1);else{if(1!==l)throw new Error("invalid ACn encoding");v=C(l),B=i?2:3}continue;case 1:case 2:e[A]?e[A]+=(d()<<s)*c:0===--i&&(B=2===B?3:0);break;case 3:e[A]?e[A]+=(d()<<s)*c:(e[A]=v<<s,B=0);break;case 4:e[A]&&(e[A]+=(d()<<s)*c)}n++}4===B&&0===--y&&(B=0)}:function(t,e){var n=I(t.huffmanTableDC),r=0===n?0:C(n);t.pred+=r,e[0]=t.pred;for(var i=1;i<64;){var o=I(t.huffmanTableAC),a=15&o,A=o>>4;if(0===a){if(A<15)break;i+=16}else{e[Dt[i+=A]]=C(a),i++}}};var x,k,O=0;k=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:c*n.mcusPerColumn;for(var N=i||k;O<k;){for(Q=0;Q<U;Q++)r[Q].pred=0;if(y=0,1===U)for(E=r[0],S=0;S<N;S++)b(E,R,O),O++;else for(S=0;S<N;S++){for(Q=0;Q<U;Q++){var D=E=r[Q],G=D.h,_=D.v;for(F=0;F<_;F++)for(w=0;w<G;w++)m(E,R,O,F,w)}if(++O===k)break}if(h=0,(x=t[g]<<8|t[g+1])<65280)throw new Error("marker was not found");if(!(x>=65488&&x<=65495))break;g+=2}return g-l}function Mt(t,e){var n=[],r=e.blocksPerLine,i=e.blocksPerColumn,o=r<<3,a=new Int32Array(64),A=new Uint8Array(64);function s(t,n,r){var i,o,a,A,s,c,u,l,g,f,h=e.quantizationTable,d=r;for(f=0;f<64;f++)d[f]=t[f]*h[f];for(f=0;f<8;++f){var I=8*f;0!==d[1+I]||0!==d[2+I]||0!==d[3+I]||0!==d[4+I]||0!==d[5+I]||0!==d[6+I]||0!==d[7+I]?(i=5793*d[0+I]+128>>8,o=5793*d[4+I]+128>>8,a=d[2+I],A=d[6+I],s=2896*(d[1+I]-d[7+I])+128>>8,l=2896*(d[1+I]+d[7+I])+128>>8,c=d[3+I]<<4,g=i-o+1>>1,i=i+o+1>>1,o=g,g=3784*a+1567*A+128>>8,a=1567*a-3784*A+128>>8,A=g,g=s-(u=d[5+I]<<4)+1>>1,s=s+u+1>>1,u=g,g=l+c+1>>1,c=l-c+1>>1,l=g,g=i-A+1>>1,i=i+A+1>>1,A=g,g=o-a+1>>1,o=o+a+1>>1,a=g,g=2276*s+3406*l+2048>>12,s=3406*s-2276*l+2048>>12,l=g,g=799*c+4017*u+2048>>12,c=4017*c-799*u+2048>>12,u=g,d[0+I]=i+l,d[7+I]=i-l,d[1+I]=o+u,d[6+I]=o-u,d[2+I]=a+c,d[5+I]=a-c,d[3+I]=A+s,d[4+I]=A-s):(g=5793*d[0+I]+512>>10,d[0+I]=g,d[1+I]=g,d[2+I]=g,d[3+I]=g,d[4+I]=g,d[5+I]=g,d[6+I]=g,d[7+I]=g)}for(f=0;f<8;++f){var p=f;0!==d[8+p]||0!==d[16+p]||0!==d[24+p]||0!==d[32+p]||0!==d[40+p]||0!==d[48+p]||0!==d[56+p]?(i=5793*d[0+p]+2048>>12,o=5793*d[32+p]+2048>>12,a=d[16+p],A=d[48+p],s=2896*(d[8+p]-d[56+p])+2048>>12,l=2896*(d[8+p]+d[56+p])+2048>>12,c=d[24+p],g=i-o+1>>1,i=i+o+1>>1,o=g,g=3784*a+1567*A+2048>>12,a=1567*a-3784*A+2048>>12,A=g,g=s-(u=d[40+p])+1>>1,s=s+u+1>>1,u=g,g=l+c+1>>1,c=l-c+1>>1,l=g,g=i-A+1>>1,i=i+A+1>>1,A=g,g=o-a+1>>1,o=o+a+1>>1,a=g,g=2276*s+3406*l+2048>>12,s=3406*s-2276*l+2048>>12,l=g,g=799*c+4017*u+2048>>12,c=4017*c-799*u+2048>>12,u=g,d[0+p]=i+l,d[56+p]=i-l,d[8+p]=o+u,d[48+p]=o-u,d[16+p]=a+c,d[40+p]=a-c,d[24+p]=A+s,d[32+p]=A-s):(g=5793*r[f+0]+8192>>14,d[0+p]=g,d[8+p]=g,d[16+p]=g,d[24+p]=g,d[32+p]=g,d[40+p]=g,d[48+p]=g,d[56+p]=g)}for(f=0;f<64;++f){var C=128+(d[f]+8>>4);n[f]=C<0?0:C>255?255:C}}for(var c=0;c<i;c++){for(var u=c<<3,l=0;l<8;l++)n.push(new Uint8Array(o));for(var g=0;g<r;g++){s(e.blocks[c][g],A,a);for(var f=0,h=g<<3,d=0;d<8;d++)for(var I=n[u+d],p=0;p<8;p++)I[h+p]=A[f++]}}return n}var Tt=function(){function t(){Object(c.a)(this,t),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return Object(u.a)(t,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(t){var e=0;function n(){var n=t[e]<<8|t[e+1];return e+=2,n}function r(){var r=n(),i=t.subarray(e,e+r-2);return e+=i.length,i}function i(t){var e,n,r=0,i=0;for(n in t.components)t.components.hasOwnProperty(n)&&(r<(e=t.components[n]).h&&(r=e.h),i<e.v&&(i=e.v));var o=Math.ceil(t.samplesPerLine/8/r),a=Math.ceil(t.scanLines/8/i);for(n in t.components)if(t.components.hasOwnProperty(n)){e=t.components[n];for(var A=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/r),s=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),c=o*e.h,u=a*e.v,l=[],g=0;g<u;g++){for(var f=[],h=0;h<c;h++)f.push(new Int32Array(64));l.push(f)}e.blocksPerLine=A,e.blocksPerColumn=s,e.blocks=l}t.maxH=r,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=a}var o=n();if(65496!==o)throw new Error("SOI not found");for(o=n();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var a=r();65504===o&&74===a[0]&&70===a[1]&&73===a[2]&&70===a[3]&&0===a[4]&&(this.jfif={version:{major:a[5],minor:a[6]},densityUnits:a[7],xDensity:a[8]<<8|a[9],yDensity:a[10]<<8|a[11],thumbWidth:a[12],thumbHeight:a[13],thumbData:a.subarray(14,14+3*a[12]*a[13])}),65518===o&&65===a[0]&&100===a[1]&&111===a[2]&&98===a[3]&&101===a[4]&&0===a[5]&&(this.adobe={version:a[6],flags0:a[7]<<8|a[8],flags1:a[9]<<8|a[10],transformCode:a[11]});break;case 65499:for(var A=n()+e-2;e<A;){var s=t[e++],c=new Int32Array(64);if(s>>4===0)for(var u=0;u<64;u++){c[Dt[u]]=t[e++]}else{if(s>>4!==1)throw new Error("DQT: invalid table spec");for(var l=0;l<64;l++){c[Dt[l]]=n()}}this.quantizationTables[15&s]=c}break;case 65472:case 65473:case 65474:n();for(var g={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:n(),samplesPerLine:n(),components:{},componentsOrder:[]},f=t[e++],h=void 0,d=0;d<f;d++){h=t[e];var I=t[e+1]>>4,p=15&t[e+1],C=t[e+2];g.componentsOrder.push(h),g.components[h]={h:I,v:p,quantizationIdx:C},e+=3}i(g),this.frames.push(g);break;case 65476:for(var y=n(),v=2;v<y;){for(var B=t[e++],m=new Uint8Array(16),b=0,E=0;E<16;E++,e++)m[E]=t[e],b+=m[E];for(var Q=new Uint8Array(b),F=0;F<b;F++,e++)Q[F]=t[e];v+=17+b,B>>4===0?this.huffmanTablesDC[15&B]=Gt(m,Q):this.huffmanTablesAC[15&B]=Gt(m,Q)}break;case 65501:n(),this.resetInterval=n();break;case 65498:n();for(var w=t[e++],S=[],R=this.frames[0],U=0;U<w;U++){var x=R.components[t[e++]],k=t[e++];x.huffmanTableDC=this.huffmanTablesDC[k>>4],x.huffmanTableAC=this.huffmanTablesAC[15&k],S.push(x)}var O=t[e++],N=t[e++],D=t[e++],G=_t(t,e,R,S,this.resetInterval,O,N,D>>4,15&D);e+=G;break;case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=n()}}},{key:"getResult",value:function(){var t=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e<this.frames.length;e++)for(var n=this.frames[e].components,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];n[o].quantizationTable=this.quantizationTables[n[o].quantizationIdx],delete n[o].quantizationIdx}for(var a=t[0],A=a.components,s=a.componentsOrder,c=[],u=a.samplesPerLine,l=a.scanLines,g=0;g<s.length;g++){var f=A[s[g]];c.push({lines:Mt(0,f),scaleX:f.h/a.maxH,scaleY:f.v/a.maxV})}for(var h=new Uint8Array(u*l*c.length),d=0,I=0;I<l;++I)for(var p=0;p<u;++p)for(var C=0;C<c.length;++C){var y=c[C];h[d]=y.lines[0|I*y.scaleY][0|p*y.scaleX],++d}return h}}]),t}(),jt=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t){var r;return Object(c.a)(this,n),(r=e.call(this)).reader=new Tt,t.JPEGTables&&r.reader.parse(t.JPEGTables),r}return Object(u.a)(n,[{key:"decodeBlock",value:function(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}]),n}(Ct),Lt=n(466),Vt=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"decodeBlock",value:function(t){return Object(Lt.inflate)(new Uint8Array(t)).buffer}}]),n}(Ct),Zt=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"decodeBlock",value:function(t){for(var e=new DataView(t),n=[],r=0;r<t.byteLength;++r){var i=e.getInt8(r);if(i<0){var o=e.getUint8(r+1);i=-i;for(var a=0;a<=i;++a)n.push(o);r+=1}else{for(var A=0;A<=i;++A)n.push(e.getUint8(r+A+1));r+=i+1}}return new Uint8Array(n).buffer}}]),n}(Ct);function Pt(t){switch(t.Compression){case void 0:case 1:return new yt;case 5:return new Nt(t);case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new jt(t);case 8:case 32946:return new Vt;case 32773:return new Zt;default:throw new Error("Unknown compression method identifier: ".concat(t.Compression))}}function Wt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(e*n*r)}function Jt(t,e,n,r,i){var o=e/r,a=n/i;return t.map((function(t){for(var A=Wt(t,r,i),s=0;s<i;++s)for(var c=Math.min(Math.round(a*s),n-1),u=0;u<r;++u){var l=Math.min(Math.round(o*u),e-1),g=t[c*e+l];A[s*r+u]=g}return A}))}function Ht(t,e,n){return(1-n)*t+n*e}function Yt(t,e,n,r,i){var o=e/r,a=n/i;return t.map((function(t){for(var A=Wt(t,r,i),s=0;s<i;++s)for(var c=a*s,u=Math.floor(c),l=Math.min(Math.ceil(c),n-1),g=0;g<r;++g){var f=o*g,h=f%1,d=Math.floor(f),I=Math.min(Math.ceil(f),e-1),p=t[u*e+d],C=t[u*e+I],y=t[l*e+d],v=t[l*e+I],B=Ht(Ht(p,C,h),Ht(y,v,h),c%1);A[s*r+g]=B}return A}))}function Xt(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return Jt(t,e,n,r,i);case"bilinear":case"linear":return Yt(t,e,n,r,i);default:throw new Error("Unsupported resampling method: '".concat(o,"'"))}}function zt(t,e,n,r,i,o){for(var a=e/r,A=n/i,s=Wt(t,r,i,o),c=0;c<i;++c)for(var u=Math.min(Math.round(A*c),n-1),l=0;l<r;++l)for(var g=Math.min(Math.round(a*l),e-1),f=0;f<o;++f){var h=t[u*e*o+g*o+f];s[c*r*o+l*o+f]=h}return s}function Kt(t,e,n,r,i,o){for(var a=e/r,A=n/i,s=Wt(t,r,i,o),c=0;c<i;++c)for(var u=A*c,l=Math.floor(u),g=Math.min(Math.ceil(u),n-1),f=0;f<r;++f)for(var h=a*f,d=h%1,I=Math.floor(h),p=Math.min(Math.ceil(h),e-1),C=0;C<o;++C){var y=t[l*e*o+I*o+C],v=t[l*e*o+p*o+C],B=t[g*e*o+I*o+C],m=t[g*e*o+p*o+C],b=Ht(Ht(y,v,d),Ht(B,m,d),u%1);s[c*r*o+f*o+C]=b}return s}function qt(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(a.toLowerCase()){case"nearest":return zt(t,e,n,r,i,o);case"bilinear":case"linear":return Kt(t,e,n,r,i,o);default:throw new Error("Unsupported resampling method: '".concat(a,"'"))}}function $t(t,e,n){for(var r=0,i=e;i<n;++i)r+=t[i];return r}function te(t,e,n){switch(t){case 1:switch(e){case 8:return new Uint8Array(n);case 16:return new Uint16Array(n);case 32:return new Uint32Array(n)}break;case 2:switch(e){case 8:return new Int8Array(n);case 16:return new Int16Array(n);case 32:return new Int32Array(n)}break;case 3:switch(e){case 32:return new Float32Array(n);case 64:return new Float64Array(n)}}throw Error("Unsupported data format/bitsPerSample")}var ee,ne=function(){function t(e,n,r,i,o,a){Object(c.a)(this,t),this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!e.StripOffsets;var A=e.PlanarConfiguration;if(this.planarConfiguration="undefined"===typeof A?1:A,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=a}return Object(u.a)(t,[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return this.fileDirectory.SamplesPerPixel}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:"undefined"!==typeof this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBytesPerPixel",value:function(){for(var t=0,e=0;e<this.fileDirectory.BitsPerSample.length;++e){var n=this.fileDirectory.BitsPerSample[e];if(n%8!==0)throw new Error("Sample bit-width of ".concat(n," is not supported."));if(n!==this.fileDirectory.BitsPerSample[0])throw new Error("Differing size of samples in a pixel are not supported.");t+=n}return t/8}},{key:"getSampleByteSize",value:function(t){if(t>=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(t," is out of range."));var e=this.fileDirectory.BitsPerSample[t];if(e%8!==0)throw new Error("Sample bit-width of ".concat(e," is not supported."));return e/8}},{key:"getReaderForSample",value:function(t){var e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,n=this.fileDirectory.BitsPerSample[t];switch(e){case 1:switch(n){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(n){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(n){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getArrayForSample",value:function(t,e){return te(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,this.fileDirectory.BitsPerSample[t],e)}},{key:"getTileOrStrip",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n,r,i,a){var A,s,c,u,l,g,f,h;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return A=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight()),u=this.tiles,1===this.planarConfiguration?c=n*A+e:2===this.planarConfiguration&&(c=r*A*s+n*A+e),this.isTiled?(l=this.fileDirectory.TileOffsets[c],g=this.fileDirectory.TileByteCounts[c]):(l=this.fileDirectory.StripOffsets[c],g=this.fileDirectory.StripByteCounts[c]),t.next=7,this.source.fetch(l,g,!1,a);case 7:if(f=t.sent,!a||!a.aborted){t.next=10;break}return t.abrupt("return",{x:e,y:n,sample:r,data:[]});case 10:return null===u?h=i.decode(this.fileDirectory,f):u[c]||(h=i.decode(this.fileDirectory,f),u[c]=h),t.t0=e,t.t1=n,t.t2=r,t.next=16,h;case 16:return t.t3=t.sent,t.abrupt("return",{x:t.t0,y:t.t1,sample:t.t2,data:t.t3});case 18:case"end":return t.stop()}}),t,this)})));return function(e,n,r,i,o){return t.apply(this,arguments)}}()},{key:"_readRaster",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n,r,i,a,A,s,c,u){var l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F,w,S,R=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(l=this.getTileWidth(),g=this.getTileHeight(),f=Math.max(Math.floor(e[0]/l),0),h=Math.min(Math.ceil(e[2]/l),Math.ceil(this.getWidth()/this.getTileWidth())),d=Math.max(Math.floor(e[1]/g),0),I=Math.min(Math.ceil(e[3]/g),Math.ceil(this.getHeight()/this.getTileHeight())),p=e[2]-e[0],C=this.getBytesPerPixel(),y=[],v=[],B=0;B<n.length;++B)1===this.planarConfiguration?y.push($t(this.fileDirectory.BitsPerSample,0,n[B])/8):y.push(0),v.push(this.getReaderForSample(n[B]));for(m=[],b=this.littleEndian,E=d;E<I;++E)for(Q=f;Q<h;++Q)for(F=function(t){var o=t,A=n[t];2===R.planarConfiguration&&(C=R.getSampleByteSize(A));var s=R.getTileOrStrip(Q,E,A,a,u);m.push(s),s.then((function(t){if(!u||!u.aborted)for(var a=t.data,A=new DataView(a),s=t.y*g,c=t.x*l,f=(t.y+1)*g,h=(t.x+1)*l,d=v[o],I=Math.min(g,g-(f-e[3])),B=Math.min(l,l-(h-e[2])),m=Math.max(0,e[1]-s);m<I;++m)for(var E=Math.max(0,e[0]-c);E<B;++E){var Q=(m*l+E)*C,F=d.call(A,Q+y[o],b),w=void 0;i?(w=(m+s-e[1])*p*n.length+(E+c-e[0])*n.length+o,r[w]=F):(w=(m+s-e[1])*p+E+c-e[0],r[o][w]=F)}}))},w=0;w<n.length;++w)F(w);return t.next=16,Promise.all(m);case 16:if(!u||!u.aborted){t.next=18;break}return t.abrupt("return",new r.constructor(0));case 18:if(!(A&&e[2]-e[0]!==A||s&&e[3]-e[1]!==s)){t.next=23;break}return(S=i?qt(r,e[2]-e[0],e[3]-e[1],A,s,n.length,c):Xt(r,e[2]-e[0],e[3]-e[1],A,s,c)).width=A,S.height=s,t.abrupt("return",S);case 23:return r.width=A||e[2]-e[0],r.height=s||e[3]-e[1],t.abrupt("return",r);case 26:case"end":return t.stop()}}),t,this)})));return function(e,n,r,i,o,a,A,s,c){return t.apply(this,arguments)}}()},{key:"readRasters",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r,i,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F,w=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w.length>0&&void 0!==w[0]?w[0]:{},n=e.window,r=e.samples,i=void 0===r?[]:r,a=e.interleave,A=e.pool,s=void 0===A?null:A,c=e.width,u=e.height,l=e.resampleMethod,g=e.fillValue,f=e.signal,!((h=n||[0,0,this.getWidth(),this.getHeight()])[0]>h[2]||h[1]>h[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if(d=h[2]-h[0],I=h[3]-h[1],p=d*I,i&&i.length){t.next=11;break}for(C=0;C<this.fileDirectory.SamplesPerPixel;++C)i.push(C);t.next=18;break;case 11:y=0;case 12:if(!(y<i.length)){t.next=18;break}if(!(i[y]>=this.fileDirectory.SamplesPerPixel)){t.next=15;break}return t.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(i[y],"'."))));case 15:++y,t.next=12;break;case 18:if(a)B=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,m=Math.max.apply(null,this.fileDirectory.BitsPerSample),v=te(B,m,p*i.length),g&&v.fill(g);else for(v=[],b=0;b<i.length;++b)E=this.getArrayForSample(i[b],p),Array.isArray(g)&&b<g.length?E.fill(g[b]):g&&!Array.isArray(g)&&E.fill(g),v.push(E);return Q=s||Pt(this.fileDirectory),t.next=22,this._readRaster(h,i,v,a,Q,c,u,l,f);case 22:return F=t.sent,t.abrupt("return",F);case 24:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"readRGB",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r,i,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:{},n=e.window,r=e.pool,i=void 0===r?null:r,a=e.width,A=e.height,s=e.resampleMethod,c=e.enableAlpha,u=void 0!==c&&c,l=e.signal,!((g=n||[0,0,this.getWidth(),this.getHeight()])[0]>g[2]||g[1]>g[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if((f=this.fileDirectory.PhotometricInterpretation)!==$){t.next=9;break}if(h=[0,1,2],this.fileDirectory.ExtraSamples!==it&&u)for(h=[],d=0;d<this.fileDirectory.BitsPerSample.length;d+=1)h.push(d);return t.abrupt("return",this.readRasters({window:n,interleave:!0,samples:h,pool:i,width:a,height:A,signal:l}));case 9:t.t0=f,t.next=t.t0===K||t.t0===q||t.t0===tt?12:t.t0===et?14:t.t0===nt||t.t0===rt?16:18;break;case 12:return I=[0],t.abrupt("break",19);case 14:return I=[0,1,2,3],t.abrupt("break",19);case 16:return I=[0,1,2],t.abrupt("break",19);case 18:throw new Error("Invalid or unsupported photometric interpretation.");case 19:return p={window:g,interleave:!0,samples:I,pool:i,width:a,height:A,resampleMethod:s,signal:l},C=this.fileDirectory,t.next=23,this.readRasters(p);case 23:y=t.sent,v=Math.pow(2,this.fileDirectory.BitsPerSample[0]),t.t1=f,t.next=t.t1===K?28:t.t1===q?30:t.t1===tt?32:t.t1===et?34:t.t1===nt?36:t.t1===rt?38:40;break;case 28:return B=st(y,v),t.abrupt("break",41);case 30:return B=ct(y,v),t.abrupt("break",41);case 32:return B=ut(y,C.ColorMap),t.abrupt("break",41);case 34:return B=lt(y),t.abrupt("break",41);case 36:return B=gt(y),t.abrupt("break",41);case 38:return B=ft(y),t.abrupt("break",41);case 40:throw new Error("Unsupported photometric interpretation.");case 41:return B.width=y.width,B.height=y.height,t.abrupt("return",B);case 44:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getTiePoints",value:function(){if(!this.fileDirectory.ModelTiepoint)return[];for(var t=[],e=0;e<this.fileDirectory.ModelTiepoint.length;e+=6)t.push({i:this.fileDirectory.ModelTiepoint[e],j:this.fileDirectory.ModelTiepoint[e+1],k:this.fileDirectory.ModelTiepoint[e+2],x:this.fileDirectory.ModelTiepoint[e+3],y:this.fileDirectory.ModelTiepoint[e+4],z:this.fileDirectory.ModelTiepoint[e+5]});return t}},{key:"getGDALMetadata",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e={};if(!this.fileDirectory.GDAL_METADATA)return null;var n=this.fileDirectory.GDAL_METADATA,r=Z()(n.substring(0,n.length-1));if(!r[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");var i=r[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");var o=i.children.filter((function(t){return"Item"===t.tagName}));null!==t&&(o=o.filter((function(e){return Number(e.attributes.sample)===t})));for(var a=0;a<o.length;++a){var A=o[a];e[A.attributes.name]=A.children[0]}return e}},{key:"getGDALNoData",value:function(){if(!this.fileDirectory.GDAL_NODATA)return null;var t=this.fileDirectory.GDAL_NODATA;return Number(t.substring(0,t.length-1))}},{key:"getOrigin",value:function(){var t=this.fileDirectory.ModelTiepoint,e=this.fileDirectory.ModelTransformation;if(t&&6===t.length)return[t[3],t[4],t[5]];if(e)return[e[3],e[7],e[11]];throw new Error("The image does not have an affine transformation.")}},{key:"getResolution",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.fileDirectory.ModelPixelScale,n=this.fileDirectory.ModelTransformation;if(e)return[e[0],-e[1],e[2]];if(n)return[n[0],n[5],n[10]];if(t){var r=t.getResolution(),i=Object(s.a)(r,3),o=i[0],a=i[1],A=i[2];return[o*t.getWidth()/this.getWidth(),a*t.getHeight()/this.getHeight(),A*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var t=this.getOrigin(),e=this.getResolution(),n=t[0],r=t[1],i=n+e[0]*this.getWidth(),o=r+e[1]*this.getHeight();return[Math.min(n,i),Math.min(r,o),Math.max(n,i),Math.max(r,o)]}}]),t}(),re=function(){function t(e){Object(c.a)(this,t),this._dataView=new DataView(e)}return Object(u.a)(t,[{key:"getUint64",value:function(t,e){var n,r=this.getUint32(t,e),i=this.getUint32(t+4,e);if(e){if(n=r+Math.pow(2,32)*i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}if(n=Math.pow(2,32)*r+i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}},{key:"getInt64",value:function(t,e){for(var n=0,r=(128&this._dataView.getUint8(t+(e?7:0)))>0,i=!0,o=0;o<8;o++){var a=this._dataView.getUint8(t+(e?o:7-o));r&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),n+=a*Math.pow(256,o)}return r&&(n=-n),n}},{key:"getUint8",value:function(t,e){return this._dataView.getUint8(t,e)}},{key:"getInt8",value:function(t,e){return this._dataView.getInt8(t,e)}},{key:"getUint16",value:function(t,e){return this._dataView.getUint16(t,e)}},{key:"getInt16",value:function(t,e){return this._dataView.getInt16(t,e)}},{key:"getUint32",value:function(t,e){return this._dataView.getUint32(t,e)}},{key:"getInt32",value:function(t,e){return this._dataView.getInt32(t,e)}},{key:"getFloat32",value:function(t,e){return this._dataView.getFloat32(t,e)}},{key:"getFloat64",value:function(t,e){return this._dataView.getFloat64(t,e)}},{key:"buffer",get:function(){return this._dataView.buffer}}]),t}(),ie=function(){function t(e,n,r,i){Object(c.a)(this,t),this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=r,this._bigTiff=i}return Object(u.a)(t,[{key:"covers",value:function(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}},{key:"readUint8",value:function(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(t){var e,n=this.readUint32(t),r=this.readUint32(t+4);if(this._littleEndian){if(e=n+Math.pow(2,32)*r,!Number.isSafeInteger(e))throw new Error("".concat(e," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return e}if(e=Math.pow(2,32)*n+r,!Number.isSafeInteger(e))throw new Error("".concat(e," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return e}},{key:"readInt64",value:function(t){for(var e=0,n=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0,r=!0,i=0;i<8;i++){var o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));n&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),e+=o*Math.pow(256,i)}return n&&(e=-e),e}},{key:"readOffset",value:function(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}},{key:"sliceOffset",get:function(){return this._sliceOffset}},{key:"sliceTop",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:"littleEndian",get:function(){return this._littleEndian}},{key:"bigTiff",get:function(){return this._bigTiff}},{key:"buffer",get:function(){return this._dataView.buffer}}]),t}();function oe(){return ee||(ee=function(){try{throw new Error}catch(e){var t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return(""+t[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return"/"}()),ee}var ae,Ae="undefined"!==typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,se=function(t){return/^(file|https?:)?\/\//i.test(t)};function ce(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function ue(){return ae||(ae=function(){if("undefined"===typeof Worker)return function t(){throw Object(c.a)(this,t),Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")};var t=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t,r){return Object(c.a)(this,n),"string"===typeof t&&r&&r._baseURL?t=new URL(t,r._baseURL):"string"===typeof t&&!se(t)&&oe().match(/^file:\/\//i)&&(t=new URL(t,oe().replace(/\/[^\/]+$/,"/")),t=ce("importScripts(".concat(JSON.stringify(t),");"))),"string"===typeof t&&se(t)&&(t=ce("importScripts(".concat(JSON.stringify(t),");"))),e.call(this,t,r)}return n}(Object(L.a)(Worker));return{blob:function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t,r){Object(c.a)(this,n);var i=window.URL.createObjectURL(t);return e.call(this,i,r)}return Object(u.a)(n,null,[{key:"fromText",value:function(t,e){return new n(new window.Blob([t],{type:"text/javascript"}),e)}}]),n}(t),default:t}}()),ae}ue().blob,ue().default;var le,ge=n(162),fe=n.n(ge),he=n(467),de=n(934),Ie=n(245);function pe(t){return Promise.all(t.map((function(t){var e=Promise.resolve(t);try{return e.then((function(t){return{status:"fulfilled",value:t}}),(function(t){return{status:"rejected",reason:t}}))}catch(n){return Promise.reject(n)}})))}!function(t){t.initialized="initialized",t.taskCanceled="taskCanceled",t.taskCompleted="taskCompleted",t.taskFailed="taskFailed",t.taskQueued="taskQueued",t.taskQueueDrained="taskQueueDrained",t.taskStart="taskStart",t.terminated="terminated"}(le||(le={}));var Ce=n(104);function ye(t){throw Error(t)}var ve={errors:function(t){return t[Ce.a]||ye("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events:function(t){return t[Ce.b]||ye("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate:function(t){return t[Ce.c]()}},Be=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(e){o(e)}}function A(t){try{s(r.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,A)}s((r=r.apply(t,e||[])).next())}))},me=1;function be(t){return new Promise((function(e){return setTimeout(e,t)}))}function Ee(t,e){return t.reduce((function(t,n){return[].concat(Object(I.a)(t),Object(I.a)(e(n)))}),[])}var Qe=function(){function t(e,n){var r=this;Object(c.a)(this,t),this.eventSubject=new he.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];var i="number"===typeof n?{size:n}:n||{},o=i.size,a=void 0===o?Ae:o;this.debug=fe()("threads:pool:".concat((i.name||String(me++)).replace(/\W/g," ").trim().replace(/\s+/g,"-"))),this.options=i,this.workers=function(t,e){return function(t){for(var e=[],n=0;n<t;n++)e.push(n);return e}(e).map((function(){return{init:t(),runningTasks:[]}}))}(e,a),this.eventObservable=Object(de.a)(Ie.a.from(this.eventSubject)),Promise.all(this.workers.map((function(t){return t.init}))).then((function(){return r.eventSubject.next({type:le.initialized,size:r.workers.length})}),(function(t){r.debug("Error while initializing pool worker:",t),r.eventSubject.error(t),r.initErrors.push(t)}))}return Object(u.a)(t,[{key:"findIdlingWorker",value:function(){var t=this.options.concurrency,e=void 0===t?1:t;return this.workers.find((function(t){return t.runningTasks.length<e}))}},{key:"runPoolTask",value:function(t,e){return Be(this,void 0,void 0,o.a.mark((function n(){var r,i;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=this.workers.indexOf(t)+1,this.debug("Running task #".concat(e.id," on worker #").concat(r,"...")),this.eventSubject.next({type:le.taskStart,taskID:e.id,workerID:r}),n.prev=3,n.t0=e,n.next=7,t.init;case 7:return n.t1=n.sent,n.next=10,n.t0.run.call(n.t0,n.t1);case 10:i=n.sent,this.debug("Task #".concat(e.id," completed successfully")),this.eventSubject.next({type:le.taskCompleted,returnValue:i,taskID:e.id,workerID:r}),n.next=19;break;case 15:n.prev=15,n.t2=n.catch(3),this.debug("Task #".concat(e.id," failed")),this.eventSubject.next({type:le.taskFailed,taskID:e.id,error:n.t2,workerID:r});case 19:case"end":return n.stop()}}),n,this,[[3,15]])})))}},{key:"run",value:function(t,e){return Be(this,void 0,void 0,o.a.mark((function n(){var r,i=this;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=Be(i,void 0,void 0,o.a.mark((function n(){var i;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=function(){t.runningTasks=t.runningTasks.filter((function(t){return t!==r}))},n.next=3,be(0);case 3:return n.prev=3,n.next=6,this.runPoolTask(t,e);case 6:return n.prev=6,i(),this.isClosing||this.scheduleWork(),n.finish(6);case 10:case"end":return n.stop()}}),n,this,[[3,,6,10]])}))),t.runningTasks.push(r);case 2:case"end":return n.stop()}}),n)})))}},{key:"scheduleWork",value:function(){this.debug("Attempt de-queueing a task in order to run it...");var t=this.findIdlingWorker();if(t){var e=this.taskQueue.shift();if(!e)return this.debug("Task queue is empty"),void this.eventSubject.next({type:le.taskQueueDrained});this.run(t,e)}}},{key:"taskCompletion",value:function(t){var e=this;return new Promise((function(n,r){var i=e.events().subscribe((function(e){e.type===le.taskCompleted&&e.taskID===t?(i.unsubscribe(),n(e.returnValue)):e.type===le.taskFailed&&e.taskID===t?(i.unsubscribe(),r(e.error)):e.type===le.terminated&&(i.unsubscribe(),r(Error("Pool has been terminated before task was run.")))}))}))}},{key:"settled",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Be(this,void 0,void 0,o.a.mark((function e(){var n,r,i,a=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(){return Ee(a.workers,(function(t){return t.runningTasks}))},r=[],i=this.eventObservable.subscribe((function(t){t.type===le.taskFailed&&r.push(t.error)})),!(this.initErrors.length>0)){e.next=5;break}return e.abrupt("return",Promise.reject(this.initErrors[0]));case 5:if(!t||0!==this.taskQueue.length){e.next=9;break}return e.next=8,pe(n());case 8:return e.abrupt("return",r);case 9:return e.next=11,new Promise((function(t,e){var n=a.eventObservable.subscribe({next:function(e){e.type===le.taskQueueDrained&&(n.unsubscribe(),t())},error:e})}));case 11:return e.next=13,pe(n());case 13:return i.unsubscribe(),e.abrupt("return",r);case 15:case"end":return e.stop()}}),e,this)})))}},{key:"completed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Be(this,void 0,void 0,o.a.mark((function e(){var n,r,i,a=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.settled(t),r=new Promise((function(t,e){var r=a.eventObservable.subscribe({next:function(i){i.type===le.taskQueueDrained?(r.unsubscribe(),t(n)):i.type===le.taskFailed&&(r.unsubscribe(),e(i.error))},error:e})})),e.next=4,Promise.race([n,r]);case 4:if(!((i=e.sent).length>0)){e.next=7;break}throw i[0];case 7:case"end":return e.stop()}}),e,this)})))}},{key:"events",value:function(){return this.eventObservable}},{key:"queue",value:function(t){var e=this,n=this.options.maxQueuedJobs,r=void 0===n?1/0:n;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];var i=this.nextTaskID++,o=this.taskCompletion(i);o.catch((function(t){e.debug("Task #".concat(i," errored:"),t)}));var a={id:i,run:t,cancel:function(){-1!==e.taskQueue.indexOf(a)&&(e.taskQueue=e.taskQueue.filter((function(t){return t!==a})),e.eventSubject.next({type:le.taskCanceled,taskID:a.id}))},then:o.then.bind(o)};if(this.taskQueue.length>=r)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug("Queueing task #".concat(a.id,"...")),this.taskQueue.push(a),this.eventSubject.next({type:le.taskQueued,taskID:a.id}),this.scheduleWork(),a}},{key:"terminate",value:function(t){return Be(this,void 0,void 0,o.a.mark((function e(){var n=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isClosing=!0,t){e.next=4;break}return e.next=4,this.completed(!0);case 4:return this.eventSubject.next({type:le.terminated,remainingQueue:Object(I.a)(this.taskQueue)}),this.eventSubject.complete(),e.next=8,Promise.all(this.workers.map((function(t){return Be(n,void 0,void 0,o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ve,e.next=3,t.init;case 3:return e.t1=e.sent,e.abrupt("return",e.t0.terminate.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e)})))})));case 8:case"end":return e.stop()}}),e,this)})))}}]),t}();function Fe(t,e){return new Qe(t,e)}Qe.EventType=le,Fe.EventType=le;n(423),n(469),"undefined"!==typeof navigator&&navigator.hardwareConcurrency;var we=n(15),Se=n(96),Re=(n(299),n(290)),Ue=n.n(Re),xe=n(470),ke=n.n(xe),Oe=n(284),Ne=n.n(Oe);function De(t){if(t.every(Boolean)){var e=new AbortController;e.count=t.length;var n,r=Object(we.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.aborted?o():i.addEventListener("abort",o)}}catch(a){r.e(a)}finally{r.f()}return e.signal}function o(){if(e.count-=1,0===e.count){e.abort();var n,r=Object(we.a)(t);try{for(r.s();!(n=r.n()).done;){n.value.removeEventListener("abort",o)}}catch(a){r.e(a)}finally{r.f()}}}}function Ge(t,e,n){var r,i=e+n,o=new ArrayBuffer(n),a=new Uint8Array(o),A=Object(we.a)(t);try{for(A.s();!(r=A.n()).done;){var s=r.value,c=s.offset-e,u=s.top-i,l=0,g=0,f=void 0;c<0?l=-c:c>0&&(g=c),f=u<0?s.length-l:i-s.offset-l;var h=new Uint8Array(s.data,l,f);a.set(h,g)}}catch(d){A.e(d)}finally{A.f()}return o}function _e(t){if(0===t.length)return[];var e=[],n=[];e.push(n);for(var r=0;r<t.length;++r)0===r||t[r]===t[r-1]+1?n.push(t[r]):(n=[t[r]],e.push(n));return e}function Me(t){return Te.apply(this,arguments)}function Te(){return(Te=Object(a.a)(o.a.mark((function t(e){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,e)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var je=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.blockSize,i=void 0===r?65536:r,A=n.getFileSize,s=void 0===A?Object(a.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)}))):A;Object(c.a)(this,t),this.retrievalFunction=e,this.blockSize=i,this.blockRequests=new Map,this.blocks=new Map,this.signals=new Map,this.abortedBlockIds=new Set,this.blockIdsAwaitingRequest=null,this.fileSizePromise=s()}return Object(u.a)(t,[{key:"fetch",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n){var r,i,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F,w=this,S=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=S.length>2&&void 0!==S[2]&&S[2],i=S.length>3?S[3]:void 0,t.next=4,this.fileSizePromise;case 4:for(A=t.sent,s=A?Math.min(e+n,A):e+n,c=Math.floor(e/this.blockSize)*this.blockSize,u=[],l=[],g=[],f=c;f<s;f+=this.blockSize)h=Math.floor(f/this.blockSize),this.blocks.has(h)||this.blockRequests.has(h)||(l.push(h),this.signals.has(h)?this.signals.get(h).push(i):this.signals.set(h,[i])),this.blockRequests.has(h)&&g.push(this.blockRequests.get(h)),u.push(h);if(this.blockIdsAwaitingRequest)for(d=0;d<l.length;++d)this.blockIdsAwaitingRequest.add(l[d]);else this.blockIdsAwaitingRequest=new Set(l);if(r){t.next=15;break}return t.next=15,Me();case 15:if(this.blockIdsAwaitingRequest){I=_e(Array.from(this.blockIdsAwaitingRequest).sort()),p=Object(we.a)(I);try{for(y=function(){for(var t=C.value,e=Array.from(new Set(t.map((function(t){return w.signals.get(t)})).flat())),n=w.requestData(t[0]*w.blockSize,t.length*w.blockSize,De(e)),r=function(e){var r=t[e];w.blockRequests.set(r,Object(a.a)(o.a.mark((function t(){var i,a,A,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n;case 3:i=t.sent,a=e*w.blockSize,A=Math.min(a+w.blockSize,i.data.byteLength),s=i.data.slice(a,A),w.blockRequests.delete(r),w.signals.delete(r),w.abortedBlockIds.delete(r),w.blocks.set(r,{data:s,offset:i.offset+a,length:s.byteLength,top:i.offset+A}),t.next=23;break;case 13:if(t.prev=13,t.t0=t.catch(0),"AbortError"!==t.t0.name){t.next=22;break}w.blocks.delete(r),w.blockRequests.delete(r),w.signals.delete(r),w.abortedBlockIds.add(r),t.next=23;break;case 22:throw t.t0;case 23:case"end":return t.stop()}}),t,null,[[0,13]])})))())},i=0;i<t.length;++i)r(i)},p.s();!(C=p.n()).done;)y()}catch(R){p.e(R)}finally{p.f()}this.blockIdsAwaitingRequest=null}for(v=[],B=0,m=l;B<m.length;B++)b=m[B],this.blockRequests.has(b)&&v.push(this.blockRequests.get(b));return t.next=20,Promise.all(v);case 20:return t.next=22,Promise.all(g);case 22:if(E=u.map((function(t){return w.blocks.get(t)})),Q=[],!E.some((function(t){return!t}))){t.next=36;break}if(!i||i.aborted){t.next=29;break}u.forEach((function(t){if(w.abortedBlockIds.has(t)){var e=w.requestData(t*w.blockSize,w.blockSize);w.blockRequests.set(t,Object(a.a)(o.a.mark((function n(){var r,i,a;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e;case 2:r=n.sent,i=Math.min(w.blockSize,r.data.byteLength),a=r.data.slice(0,i),w.abortedBlockIds.delete(t),w.blocks.set(t,{data:a,offset:r.offset,length:a.byteLength,top:r.offset+i});case 7:case"end":return n.stop()}}),n)})))()),Q.push(w.blockRequests.get(t))}})),t.next=30;break;case 29:return t.abrupt("return",[]);case 30:return t.next=32,Promise.all(Q);case 32:return F=u.map((function(t){return w.blocks.get(t)})),t.abrupt("return",Ge(F,e,n));case 36:return t.abrupt("return",Ge(E,e,n));case 37:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"requestData",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n,r){var i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.retrievalFunction(e,n,r);case 2:return(i=t.sent).length?i.length!==i.data.byteLength&&(i.data=i.data.slice(0,i.length)):i.length=i.data.byteLength,i.top=i.offset+i.length,t.abrupt("return",i);case 6:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}()}]),t}();function Le(t,e){var n=e.forceXHR;if("function"===typeof fetch&&!n)return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,r=void 0===n?{}:n,i=e.blockSize;return new je(function(){var e=Object(a.a)(o.a.mark((function e(n,i,a){var A,s,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:Object(d.a)({},r,{Range:"bytes=".concat(n,"-").concat(n+i-1)}),signal:a});case 2:if((A=e.sent).ok){e.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==A.status){e.next=21;break}if(!A.arrayBuffer){e.next=14;break}return e.next=11,A.arrayBuffer();case 11:e.t0=e.sent,e.next=17;break;case 14:return e.next=16,A.buffer();case 16:e.t0=e.sent.buffer;case 17:return s=e.t0,e.abrupt("return",{data:s,offset:n,length:i});case 21:if(!A.arrayBuffer){e.next=27;break}return e.next=24,A.arrayBuffer();case 24:e.t1=e.sent,e.next=30;break;case 27:return e.next=29,A.buffer();case 29:e.t1=e.sent.buffer;case 30:return c=e.t1,e.abrupt("return",{data:c,offset:0,length:c.byteLength});case 32:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),{blockSize:i,getFileSize:function(){var e=Object(a.a)(o.a.mark((function e(){var n,i,a,A,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:Object(d.a)({},r,{Range:"bytes=0-1"})});case 2:if((n=e.sent).ok){e.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==n.status){e.next=13;break}if(i=n.headers.get("content-range")){e.next=11;break}return e.abrupt("return",null);case 11:return a=i.split("/").slice(-1),A=Object(s.a)(a,1),c=A[0],e.abrupt("return",Number(c));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()})}(t,e);if("undefined"!==typeof XMLHttpRequest)return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,r=void 0===n?{}:n,i=e.blockSize;return new je(function(){var e=Object(a.a)(o.a.mark((function e(n,i){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=new XMLHttpRequest;a.open("GET",t),a.responseType="arraybuffer";for(var A=Object(d.a)({},r,{Range:"bytes=".concat(n,"-").concat(n+i-1)}),c=0,u=Object.entries(A);c<u.length;c++){var l=Object(s.a)(u[c],2),g=l[0],f=l[1];a.setRequestHeader(g,f)}a.onload=function(){var t=a.response;206===a.status?e({data:t,offset:n,length:i}):e({data:t,offset:0,length:t.byteLength})},a.onerror=o,a.send()})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),{blockSize:i})}(t,e);if(Ue.a.get)return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.headers,r=void 0===n?{}:n,i=e.blockSize;return new je(function(){var e=Object(a.a)(o.a.mark((function e(n,i){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=Ne.a.parse(t);("http:"===a.protocol?Ue.a:ke.a).get(Object(d.a)({},a,{headers:Object(d.a)({},r,{Range:"bytes=".concat(n,"-").concat(n+i-1)})}),(function(t){var r=[];t.on("data",(function(t){r.push(t)})),t.on("end",(function(){var t=Se.Buffer.concat(r).buffer;e({data:t,offset:n,length:t.byteLength})}))})).on("error",o)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),{blockSize:i})}(t,e);throw new Error("No remote source available")}function Ve(t){return{fetch:function(e,n){return Object(a.a)(o.a.mark((function r(){return o.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,i){var o=t.slice(e,e+n),a=new FileReader;a.onload=function(t){return r(t.target.result)},a.onerror=i,a.readAsArrayBuffer(o)})));case 1:case"end":return r.stop()}}),r)})))()}}}function Ze(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function Pe(t){var e={};for(var n in t){if(t.hasOwnProperty(n))e[t[n]]=n}return e}function We(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n}var Je=Pe(P),He=Pe(ot),Ye={};Ze(Ye,Je),Ze(Ye,He);Pe(Y);var Xe={nextZero:function(t,e){for(var n=e;0!==t[n];)n++;return n},readUshort:function(t,e){return t[e]<<8|t[e+1]},readShort:function(t,e){var n=Xe.ui8;return n[0]=t[e+1],n[1]=t[e+0],Xe.i16[0]},readInt:function(t,e){var n=Xe.ui8;return n[0]=t[e+3],n[1]=t[e+2],n[2]=t[e+1],n[3]=t[e+0],Xe.i32[0]},readUint:function(t,e){var n=Xe.ui8;return n[0]=t[e+3],n[1]=t[e+2],n[2]=t[e+1],n[3]=t[e+0],Xe.ui32[0]},readASCII:function(t,e,n){return n.map((function(n){return String.fromCharCode(t[e+n])})).join("")},readFloat:function(t,e){var n=Xe.ui8;return We(4,(function(r){n[r]=t[e+3-r]})),Xe.fl32[0]},readDouble:function(t,e){var n=Xe.ui8;return We(8,(function(r){n[r]=t[e+7-r]})),Xe.fl64[0]},writeUshort:function(t,e,n){t[e]=n>>8&255,t[e+1]=255&n},writeUint:function(t,e,n){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=n>>0&255},writeASCII:function(t,e,n){We(n.length,(function(r){t[e+r]=n.charCodeAt(r)}))},ui8:new Uint8Array(8)};Xe.fl64=new Float64Array(Xe.ui8.buffer),Xe.writeDouble=function(t,e,n){Xe.fl64[0]=n,We(8,(function(n){t[e+n]=Xe.ui8[7-n]}))};var ze=function(){function t(){Object(c.a)(this,t)}return Object(u.a)(t,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}},{key:"time",value:function(){}},{key:"timeEnd",value:function(){}}]),t}();new ze;function Ke(t){switch(t){case X.BYTE:case X.ASCII:case X.SBYTE:case X.UNDEFINED:return 1;case X.SHORT:case X.SSHORT:return 2;case X.LONG:case X.SLONG:case X.FLOAT:case X.IFD:return 4;case X.RATIONAL:case X.SRATIONAL:case X.DOUBLE:case X.LONG8:case X.SLONG8:case X.IFD8:return 8;default:throw new RangeError("Invalid field type: ".concat(t))}}function qe(t){var e=t.GeoKeyDirectory;if(!e)return null;for(var n={},r=4;r<=4*e[3];r+=4){var i=ot[e[r]],o=e[r+1]?P[e[r+1]]:null,a=e[r+2],A=e[r+3],s=null;if(o){if("undefined"===typeof(s=t[o])||null===s)throw new Error("Could not get value of geoKey '".concat(i,"'."));"string"===typeof s?s=s.substring(A,A+a-1):s.subarray&&(s=s.subarray(A,A+a),1===a&&(s=s[0]))}else s=A;n[i]=s}return n}function $e(t,e,n,r){var i=null,o=null,a=Ke(e);switch(e){case X.BYTE:case X.ASCII:case X.UNDEFINED:i=new Uint8Array(n),o=t.readUint8;break;case X.SBYTE:i=new Int8Array(n),o=t.readInt8;break;case X.SHORT:i=new Uint16Array(n),o=t.readUint16;break;case X.SSHORT:i=new Int16Array(n),o=t.readInt16;break;case X.LONG:case X.IFD:i=new Uint32Array(n),o=t.readUint32;break;case X.SLONG:i=new Int32Array(n),o=t.readInt32;break;case X.LONG8:case X.IFD8:i=new Array(n),o=t.readUint64;break;case X.SLONG8:i=new Array(n),o=t.readInt64;break;case X.RATIONAL:i=new Uint32Array(2*n),o=t.readUint32;break;case X.SRATIONAL:i=new Int32Array(2*n),o=t.readInt32;break;case X.FLOAT:i=new Float32Array(n),o=t.readFloat32;break;case X.DOUBLE:i=new Float64Array(n),o=t.readFloat64;break;default:throw new RangeError("Invalid field type: ".concat(e))}if(e!==X.RATIONAL&&e!==X.SRATIONAL)for(var A=0;A<n;++A)i[A]=o.call(t,r+A*a);else for(var s=0;s<n;s+=2)i[s]=o.call(t,r+s*a),i[s+1]=o.call(t,r+(s*a+4));return e===X.ASCII?new TextDecoder("utf-8").decode(i):i}var tn=function t(e,n,r){Object(c.a)(this,t),this.fileDirectory=e,this.geoKeyDirectory=n,this.nextIFDByteOffset=r},en=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t){var r;return Object(c.a)(this,n),(r=e.call(this,"No image at index ".concat(t))).index=t,r}return n}(Object(L.a)(Error)),nn=function(){function t(){Object(c.a)(this,t)}return Object(u.a)(t,[{key:"readRasters",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r,i,a,A,c,u,l,g,f,h,I,p,C,y,v,B,m,b,E,Q,F,w,S,R,U,x,k,O,N,D,G,_,M,T,j,L,V,Z=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Z.length>0&&void 0!==Z[0]?Z[0]:{},n=e.window,r=e.width,i=e.height,a=e.resX,A=e.resY,c=e.bbox,t.next=5,this.getImage();case 5:return u=t.sent,l=u,t.next=9,this.getImageCount();case 9:if(g=t.sent,f=u.getBoundingBox(),!n||!c){t.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!r&&!i){t.next=24;break}if(n&&(h=u.getOrigin(),I=Object(s.a)(h,2),p=I[0],C=I[1],y=u.getResolution(),v=Object(s.a)(y,2),B=v[0],m=v[1],c=[p+n[0]*B,C+n[1]*m,p+n[2]*B,C+n[3]*m]),b=c||f,!r){t.next=20;break}if(!a){t.next=19;break}throw new Error("Both width and resX passed");case 19:a=(b[2]-b[0])/r;case 20:if(!i){t.next=24;break}if(!A){t.next=23;break}throw new Error("Both width and resY passed");case 23:A=(b[3]-b[1])/i;case 24:if(!a&&!A){t.next=48;break}E=[],Q=0;case 27:if(!(Q<g)){t.next=36;break}return t.next=30,this.getImage(Q);case 30:F=t.sent,w=F.fileDirectory,S=w.SubfileType,R=w.NewSubfileType,(0===Q||2===S||1&R)&&E.push(F);case 33:++Q,t.next=27;break;case 36:E.sort((function(t,e){return t.getWidth()-e.getWidth()})),U=0;case 38:if(!(U<E.length)){t.next=48;break}if(x=E[U],k=(f[2]-f[0])/x.getWidth(),O=(f[3]-f[1])/x.getHeight(),l=x,!(a&&a>k||A&&A>O)){t.next=45;break}return t.abrupt("break",48);case 45:++U,t.next=38;break;case 48:return N=n,c&&(D=u.getOrigin(),G=Object(s.a)(D,2),_=G[0],M=G[1],T=l.getResolution(u),j=Object(s.a)(T,2),L=j[0],V=j[1],N=[Math.round((c[0]-_)/L),Math.round((c[1]-M)/V),Math.round((c[2]-_)/L),Math.round((c[3]-M)/V)],N=[Math.min(N[0],N[2]),Math.min(N[1],N[3]),Math.max(N[0],N[2]),Math.max(N[1],N[3])]),t.abrupt("return",l.readRasters(Object(d.a)({},e,{window:N})));case 51:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),t}(),rn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(t,r,i,o){var a,A=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return Object(c.a)(this,n),(a=e.call(this)).source=t,a.littleEndian=r,a.bigTiff=i,a.firstIFDOffset=o,a.cache=A.cache||!1,a.ifdRequests=[],a.ghostValues=null,a}return Object(u.a)(n,[{key:"getSlice",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.bigTiff?4048:1024,t.t0=ie,t.next=4,this.source.fetch(e,"undefined"!==typeof n?n:r);case 4:return t.t1=t.sent,t.t2=e,t.t3=this.littleEndian,t.t4=this.bigTiff,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3,t.t4));case 9:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"parseFileDirectoryAt",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.bigTiff?20:12,r=this.bigTiff?8:2,t.next=4,this.getSlice(e);case 4:if(i=t.sent,a=this.bigTiff?i.readUint64(e):i.readUint16(e),A=a*n+(this.bigTiff?16:6),i.covers(e,A)){t.next=11;break}return t.next=10,this.getSlice(e,A);case 10:i=t.sent;case 11:s={},c=e+(this.bigTiff?8:2),u=0;case 14:if(!(u<a)){t.next=41;break}if(l=i.readUint16(c),g=i.readUint16(c+2),f=this.bigTiff?i.readUint64(c+4):i.readUint32(c+4),h=void 0,d=void 0,I=Ke(g),p=c+(this.bigTiff?12:8),!(I*f<=(this.bigTiff?8:4))){t.next=26;break}h=$e(i,g,f,p),t.next=36;break;case 26:if(C=i.readOffset(p),y=Ke(g)*f,!i.covers(C,y)){t.next=32;break}h=$e(i,g,f,C),t.next=36;break;case 32:return t.next=34,this.getSlice(C,y);case 34:v=t.sent,h=$e(v,g,f,C);case 36:d=1===f&&-1===H.indexOf(l)&&g!==X.RATIONAL&&g!==X.SRATIONAL?h[0]:h,s[P[l]]=d;case 38:c+=n,++u,t.next=14;break;case 41:return B=qe(s),m=i.readOffset(e+r+n*a),t.abrupt("return",new tn(s,B,m));case 44:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"requestIFD",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.ifdRequests[e]){t.next=4;break}return t.abrupt("return",this.ifdRequests[e]);case 4:if(0!==e){t.next=9;break}return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),t.abrupt("return",this.ifdRequests[e]);case 9:if(this.ifdRequests[e-1]){t.next=19;break}t.prev=10,this.ifdRequests[e-1]=this.requestIFD(e-1),t.next=19;break;case 14:if(t.prev=14,t.t0=t.catch(10),!(t.t0 instanceof en)){t.next=18;break}throw new en(e);case 18:throw t.t0;case 19:return this.ifdRequests[e]=Object(a.a)(o.a.mark((function t(){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.ifdRequests[e-1];case 2:if(0!==(r=t.sent).nextIFDByteOffset){t.next=5;break}throw new en(e);case 5:return t.abrupt("return",n.parseFileDirectoryAt(r.nextIFDByteOffset));case 6:case"end":return t.stop()}}),t)})))(),t.abrupt("return",this.ifdRequests[e]);case 21:case"end":return t.stop()}}),t,this,[[10,14]])})));return function(e){return t.apply(this,arguments)}}()},{key:"getImage",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:0,t.next=3,this.requestIFD(e);case 3:return n=t.sent,t.abrupt("return",new ne(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getImageCount",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0,n=!0;case 2:if(!n){t.next=18;break}return t.prev=3,t.next=6,this.requestIFD(e);case 6:++e,t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(3),!(t.t0 instanceof en)){t.next=15;break}n=!1,t.next=16;break;case 15:throw t.t0;case 16:t.next=2;break;case 18:return t.abrupt("return",e);case 19:case"end":return t.stop()}}),t,this,[[3,9]])})));return function(){return t.apply(this,arguments)}}()},{key:"getGhostValues",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r,i,a,A,c,u,l=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.bigTiff?16:8,!this.ghostValues){t.next=3;break}return t.abrupt("return",this.ghostValues);case 3:return r=(n="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,t.next=7,this.getSlice(e,r);case 7:if(i=t.sent,n!==$e(i,X.ASCII,n.length,e)){t.next=19;break}if(a=$e(i,X.ASCII,r,e),A=a.split("\n")[0],!((c=Number(A.split("=")[1].split(" ")[0])+A.length)>r)){t.next=16;break}return t.next=15,this.getSlice(e,c);case 15:i=t.sent;case 16:u=$e(i,X.ASCII,c,e),this.ghostValues={},u.split("\n").filter((function(t){return t.length>0})).map((function(t){return t.split("=")})).forEach((function(t){var e=Object(s.a)(t,2),n=e[0],r=e[1];l.ghostValues[n]=r}));case 19:return t.abrupt("return",this.ghostValues);case 20:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"close",value:function(){return"function"===typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:function(){var t=Object(a.a)(o.a.mark((function t(e,r){var i,a,A,s,c,u,l;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.fetch(0,1024);case 2:if(i=t.sent,a=new re(i),18761!==(A=a.getUint16(0,0))){t.next=9;break}s=!0,t.next=14;break;case 9:if(19789!==A){t.next=13;break}s=!1,t.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(c=a.getUint16(2,s))){t.next=19;break}u=!1,t.next=27;break;case 19:if(43!==c){t.next=26;break}if(u=!0,8===a.getUint16(4,s)){t.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:t.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return l=u?a.getUint64(8,s):a.getUint32(4,s),t.abrupt("return",new n(e,s,u,l,r));case 29:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}]),n}(nn);function on(t){return an.apply(this,arguments)}function an(){return(an=Object(a.a)(o.a.mark((function t(e){var n,r=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",rn.fromSource(Le(e,n)));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function An(t){return sn.apply(this,arguments)}function sn(){return(sn=Object(a.a)(o.a.mark((function t(e){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",rn.fromSource(Ve(e)));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function cn(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,A=n-r+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(A-a/2<0?-1:1),l=Math.max(r,Math.floor(n-A*c/a+u)),g=Math.min(i,Math.floor(n+(a-A)*c/a+u));t(e,n,l,g,o)}var f=e[n],h=r,d=i;for(un(e,r,n),o(e[i],f)>0&&un(e,r,i);h<d;){for(un(e,h,d),h++,d--;o(e[h],f)<0;)h++;for(;o(e[d],f)>0;)d--}0===o(e[r],f)?un(e,r,d):(d++,un(e,d,i)),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||ln)}function un(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ln(t,e){return t<e?-1:t>e?1:0}var gn=n(471),fn=n.n(gn);n.d(e,"a",(function(){return Cn})),n.d(e,"b",(function(){return Nn})),n.d(e,"c",(function(){return pn})),n.d(e,"d",(function(){return Dn})),n.d(e,"e",(function(){return jn})),n.d(e,"f",(function(){return Ar})),n.d(e,"g",(function(){return or})),n.d(e,"h",(function(){return Yn}));var hn={name:"channel-intensity-module",defines:{SAMPLER_TYPE:"usampler2D",COLORMAP_FUNCTION:""},fs:"#define GLSLIFY 1\nvec4 jet(float x_17){const float e0=0.0;const vec4 v0=vec4(0,0,0.5137254901960784,1);const float e1=0.125;const vec4 v1=vec4(0,0.23529411764705882,0.6666666666666666,1);const float e2=0.375;const vec4 v2=vec4(0.0196078431372549,1,1,1);const float e3=0.625;const vec4 v3=vec4(1,1,0,1);const float e4=0.875;const vec4 v4=vec4(0.9803921568627451,0,0,1);const float e5=1.0;const vec4 v5=vec4(0.5019607843137255,0,0,1);float a0=smoothstep(e0,e1,x_17);float a1=smoothstep(e1,e2,x_17);float a2=smoothstep(e2,e3,x_17);float a3=smoothstep(e3,e4,x_17);float a4=smoothstep(e4,e5,x_17);return max(mix(v0,v1,a0)*step(e0,x_17)*step(x_17,e1),max(mix(v1,v2,a1)*step(e1,x_17)*step(x_17,e2),max(mix(v2,v3,a2)*step(e2,x_17)*step(x_17,e3),max(mix(v3,v4,a3)*step(e3,x_17)*step(x_17,e4),mix(v4,v5,a4)*step(e4,x_17)*step(x_17,e5)))));}vec4 hsv_0(float x_18){const float e0=0.0;const vec4 v0=vec4(1,0,0,1);const float e1=0.169;const vec4 v1=vec4(0.9921568627450981,1,0.00784313725490196,1);const float e2=0.173;const vec4 v2=vec4(0.9686274509803922,1,0.00784313725490196,1);const float e3=0.337;const vec4 v3=vec4(0,0.9882352941176471,0.01568627450980392,1);const float e4=0.341;const vec4 v4=vec4(0,0.9882352941176471,0.0392156862745098,1);const float e5=0.506;const vec4 v5=vec4(0.00392156862745098,0.9764705882352941,1,1);const float e6=0.671;const vec4 v6=vec4(0.00784313725490196,0,0.9921568627450981,1);const float e7=0.675;const vec4 v7=vec4(0.03137254901960784,0,0.9921568627450981,1);const float e8=0.839;const vec4 v8=vec4(1,0,0.984313725490196,1);const float e9=0.843;const vec4 v9=vec4(1,0,0.9607843137254902,1);const float e10=1.0;const vec4 v10=vec4(1,0,0.023529411764705882,1);float a0=smoothstep(e0,e1,x_18);float a1=smoothstep(e1,e2,x_18);float a2=smoothstep(e2,e3,x_18);float a3=smoothstep(e3,e4,x_18);float a4=smoothstep(e4,e5,x_18);float a5=smoothstep(e5,e6,x_18);float a6=smoothstep(e6,e7,x_18);float a7=smoothstep(e7,e8,x_18);float a8=smoothstep(e8,e9,x_18);float a9=smoothstep(e9,e10,x_18);return max(mix(v0,v1,a0)*step(e0,x_18)*step(x_18,e1),max(mix(v1,v2,a1)*step(e1,x_18)*step(x_18,e2),max(mix(v2,v3,a2)*step(e2,x_18)*step(x_18,e3),max(mix(v3,v4,a3)*step(e3,x_18)*step(x_18,e4),max(mix(v4,v5,a4)*step(e4,x_18)*step(x_18,e5),max(mix(v5,v6,a5)*step(e5,x_18)*step(x_18,e6),max(mix(v6,v7,a6)*step(e6,x_18)*step(x_18,e7),max(mix(v7,v8,a7)*step(e7,x_18)*step(x_18,e8),max(mix(v8,v9,a8)*step(e8,x_18)*step(x_18,e9),mix(v9,v10,a9)*step(e9,x_18)*step(x_18,e10))))))))));}vec4 hot(float x_13){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.3;const vec4 v1=vec4(0.9019607843137255,0,0,1);const float e2=0.6;const vec4 v2=vec4(1,0.8235294117647058,0,1);const float e3=1.0;const vec4 v3=vec4(1,1,1,1);float a0=smoothstep(e0,e1,x_13);float a1=smoothstep(e1,e2,x_13);float a2=smoothstep(e2,e3,x_13);return max(mix(v0,v1,a0)*step(e0,x_13)*step(x_13,e1),max(mix(v1,v2,a1)*step(e1,x_13)*step(x_13,e2),mix(v2,v3,a2)*step(e2,x_13)*step(x_13,e3)));}vec4 cool(float x_24){const float e0=0.0;const vec4 v0=vec4(0.49019607843137253,0,0.7019607843137254,1);const float e1=0.13;const vec4 v1=vec4(0.4549019607843137,0,0.8549019607843137,1);const float e2=0.25;const vec4 v2=vec4(0.3843137254901961,0.2901960784313726,0.9294117647058824,1);const float e3=0.38;const vec4 v3=vec4(0.26666666666666666,0.5725490196078431,0.9058823529411765,1);const float e4=0.5;const vec4 v4=vec4(0,0.8,0.7725490196078432,1);const float e5=0.63;const vec4 v5=vec4(0,0.9686274509803922,0.5725490196078431,1);const float e6=0.75;const vec4 v6=vec4(0,1,0.34509803921568627,1);const float e7=0.88;const vec4 v7=vec4(0.1568627450980392,1,0.03137254901960784,1);const float e8=1.0;const vec4 v8=vec4(0.5764705882352941,1,0,1);float a0=smoothstep(e0,e1,x_24);float a1=smoothstep(e1,e2,x_24);float a2=smoothstep(e2,e3,x_24);float a3=smoothstep(e3,e4,x_24);float a4=smoothstep(e4,e5,x_24);float a5=smoothstep(e5,e6,x_24);float a6=smoothstep(e6,e7,x_24);float a7=smoothstep(e7,e8,x_24);return max(mix(v0,v1,a0)*step(e0,x_24)*step(x_24,e1),max(mix(v1,v2,a1)*step(e1,x_24)*step(x_24,e2),max(mix(v2,v3,a2)*step(e2,x_24)*step(x_24,e3),max(mix(v3,v4,a3)*step(e3,x_24)*step(x_24,e4),max(mix(v4,v5,a4)*step(e4,x_24)*step(x_24,e5),max(mix(v5,v6,a5)*step(e5,x_24)*step(x_24,e6),max(mix(v6,v7,a6)*step(e6,x_24)*step(x_24,e7),mix(v7,v8,a7)*step(e7,x_24)*step(x_24,e8))))))));}vec4 spring(float x_5){const float e0=0.0;const vec4 v0=vec4(1,0,1,1);const float e1=1.0;const vec4 v1=vec4(1,1,0,1);float a0=smoothstep(e0,e1,x_5);return mix(v0,v1,a0)*step(e0,x_5)*step(x_5,e1);}vec4 summer(float x_12){const float e0=0.0;const vec4 v0=vec4(0,0.5019607843137255,0.4,1);const float e1=1.0;const vec4 v1=vec4(1,1,0.4,1);float a0=smoothstep(e0,e1,x_12);return mix(v0,v1,a0)*step(e0,x_12)*step(x_12,e1);}vec4 autumn(float x_25){const float e0=0.0;const vec4 v0=vec4(1,0,0,1);const float e1=1.0;const vec4 v1=vec4(1,1,0,1);float a0=smoothstep(e0,e1,x_25);return mix(v0,v1,a0)*step(e0,x_25)*step(x_25,e1);}vec4 winter(float x_16){const float e0=0.0;const vec4 v0=vec4(0,0,1,1);const float e1=1.0;const vec4 v1=vec4(0,1,0.5019607843137255,1);float a0=smoothstep(e0,e1,x_16);return mix(v0,v1,a0)*step(e0,x_16)*step(x_16,e1);}vec4 bone(float x_15){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.376;const vec4 v1=vec4(0.32941176470588235,0.32941176470588235,0.4549019607843137,1);const float e2=0.753;const vec4 v2=vec4(0.6627450980392157,0.7843137254901961,0.7843137254901961,1);const float e3=1.0;const vec4 v3=vec4(1,1,1,1);float a0=smoothstep(e0,e1,x_15);float a1=smoothstep(e1,e2,x_15);float a2=smoothstep(e2,e3,x_15);return max(mix(v0,v1,a0)*step(e0,x_15)*step(x_15,e1),max(mix(v1,v2,a1)*step(e1,x_15)*step(x_15,e2),mix(v2,v3,a2)*step(e2,x_15)*step(x_15,e3)));}vec4 copper(float x_10){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.804;const vec4 v1=vec4(1,0.6274509803921569,0.4,1);const float e2=1.0;const vec4 v2=vec4(1,0.7803921568627451,0.4980392156862745,1);float a0=smoothstep(e0,e1,x_10);float a1=smoothstep(e1,e2,x_10);return max(mix(v0,v1,a0)*step(e0,x_10)*step(x_10,e1),mix(v1,v2,a1)*step(e1,x_10)*step(x_10,e2));}vec4 greys(float x_4){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=1.0;const vec4 v1=vec4(1,1,1,1);float a0=smoothstep(e0,e1,x_4);return mix(v0,v1,a0)*step(e0,x_4)*step(x_4,e1);}vec4 yignbu(float x_32){const float e0=0.0;const vec4 v0=vec4(0.03137254901960784,0.11372549019607843,0.34509803921568627,1);const float e1=0.125;const vec4 v1=vec4(0.1450980392156863,0.20392156862745098,0.5803921568627451,1);const float e2=0.25;const vec4 v2=vec4(0.13333333333333333,0.3686274509803922,0.6588235294117647,1);const float e3=0.375;const vec4 v3=vec4(0.11372549019607843,0.5686274509803921,0.7529411764705882,1);const float e4=0.5;const vec4 v4=vec4(0.2549019607843137,0.7137254901960784,0.7686274509803922,1);const float e5=0.625;const vec4 v5=vec4(0.4980392156862745,0.803921568627451,0.7333333333333333,1);const float e6=0.75;const vec4 v6=vec4(0.7803921568627451,0.9137254901960784,0.7058823529411765,1);const float e7=0.875;const vec4 v7=vec4(0.9294117647058824,0.9725490196078431,0.8509803921568627,1);const float e8=1.0;const vec4 v8=vec4(1,1,0.8509803921568627,1);float a0=smoothstep(e0,e1,x_32);float a1=smoothstep(e1,e2,x_32);float a2=smoothstep(e2,e3,x_32);float a3=smoothstep(e3,e4,x_32);float a4=smoothstep(e4,e5,x_32);float a5=smoothstep(e5,e6,x_32);float a6=smoothstep(e6,e7,x_32);float a7=smoothstep(e7,e8,x_32);return max(mix(v0,v1,a0)*step(e0,x_32)*step(x_32,e1),max(mix(v1,v2,a1)*step(e1,x_32)*step(x_32,e2),max(mix(v2,v3,a2)*step(e2,x_32)*step(x_32,e3),max(mix(v3,v4,a3)*step(e3,x_32)*step(x_32,e4),max(mix(v4,v5,a4)*step(e4,x_32)*step(x_32,e5),max(mix(v5,v6,a5)*step(e5,x_32)*step(x_32,e6),max(mix(v6,v7,a6)*step(e6,x_32)*step(x_32,e7),mix(v7,v8,a7)*step(e7,x_32)*step(x_32,e8))))))));}vec4 greens(float x_34){const float e0=0.0;const vec4 v0=vec4(0,0.26666666666666666,0.10588235294117647,1);const float e1=0.125;const vec4 v1=vec4(0,0.42745098039215684,0.17254901960784313,1);const float e2=0.25;const vec4 v2=vec4(0.13725490196078433,0.5450980392156862,0.27058823529411763,1);const float e3=0.375;const vec4 v3=vec4(0.2549019607843137,0.6705882352941176,0.36470588235294116,1);const float e4=0.5;const vec4 v4=vec4(0.4549019607843137,0.7686274509803922,0.4627450980392157,1);const float e5=0.625;const vec4 v5=vec4(0.6313725490196078,0.8509803921568627,0.6078431372549019,1);const float e6=0.75;const vec4 v6=vec4(0.7803921568627451,0.9137254901960784,0.7529411764705882,1);const float e7=0.875;const vec4 v7=vec4(0.8980392156862745,0.9607843137254902,0.8784313725490196,1);const float e8=1.0;const vec4 v8=vec4(0.9686274509803922,0.9882352941176471,0.9607843137254902,1);float a0=smoothstep(e0,e1,x_34);float a1=smoothstep(e1,e2,x_34);float a2=smoothstep(e2,e3,x_34);float a3=smoothstep(e3,e4,x_34);float a4=smoothstep(e4,e5,x_34);float a5=smoothstep(e5,e6,x_34);float a6=smoothstep(e6,e7,x_34);float a7=smoothstep(e7,e8,x_34);return max(mix(v0,v1,a0)*step(e0,x_34)*step(x_34,e1),max(mix(v1,v2,a1)*step(e1,x_34)*step(x_34,e2),max(mix(v2,v3,a2)*step(e2,x_34)*step(x_34,e3),max(mix(v3,v4,a3)*step(e3,x_34)*step(x_34,e4),max(mix(v4,v5,a4)*step(e4,x_34)*step(x_34,e5),max(mix(v5,v6,a5)*step(e5,x_34)*step(x_34,e6),max(mix(v6,v7,a6)*step(e6,x_34)*step(x_34,e7),mix(v7,v8,a7)*step(e7,x_34)*step(x_34,e8))))))));}vec4 yiorrd(float x_41){const float e0=0.0;const vec4 v0=vec4(0.5019607843137255,0,0.14901960784313725,1);const float e1=0.125;const vec4 v1=vec4(0.7411764705882353,0,0.14901960784313725,1);const float e2=0.25;const vec4 v2=vec4(0.8901960784313725,0.10196078431372549,0.10980392156862745,1);const float e3=0.375;const vec4 v3=vec4(0.9882352941176471,0.3058823529411765,0.16470588235294117,1);const float e4=0.5;const vec4 v4=vec4(0.9921568627450981,0.5529411764705883,0.23529411764705882,1);const float e5=0.625;const vec4 v5=vec4(0.996078431372549,0.6980392156862745,0.2980392156862745,1);const float e6=0.75;const vec4 v6=vec4(0.996078431372549,0.8509803921568627,0.4627450980392157,1);const float e7=0.875;const vec4 v7=vec4(1,0.9294117647058824,0.6274509803921569,1);const float e8=1.0;const vec4 v8=vec4(1,1,0.8,1);float a0=smoothstep(e0,e1,x_41);float a1=smoothstep(e1,e2,x_41);float a2=smoothstep(e2,e3,x_41);float a3=smoothstep(e3,e4,x_41);float a4=smoothstep(e4,e5,x_41);float a5=smoothstep(e5,e6,x_41);float a6=smoothstep(e6,e7,x_41);float a7=smoothstep(e7,e8,x_41);return max(mix(v0,v1,a0)*step(e0,x_41)*step(x_41,e1),max(mix(v1,v2,a1)*step(e1,x_41)*step(x_41,e2),max(mix(v2,v3,a2)*step(e2,x_41)*step(x_41,e3),max(mix(v3,v4,a3)*step(e3,x_41)*step(x_41,e4),max(mix(v4,v5,a4)*step(e4,x_41)*step(x_41,e5),max(mix(v5,v6,a5)*step(e5,x_41)*step(x_41,e6),max(mix(v6,v7,a6)*step(e6,x_41)*step(x_41,e7),mix(v7,v8,a7)*step(e7,x_41)*step(x_41,e8))))))));}vec4 bluered(float x_23){const float e0=0.0;const vec4 v0=vec4(0,0,1,1);const float e1=1.0;const vec4 v1=vec4(1,0,0,1);float a0=smoothstep(e0,e1,x_23);return mix(v0,v1,a0)*step(e0,x_23)*step(x_23,e1);}vec4 rdbu(float x_1){const float e0=0.0;const vec4 v0=vec4(0.0196078431372549,0.0392156862745098,0.6745098039215687,1);const float e1=0.35;const vec4 v1=vec4(0.41568627450980394,0.5372549019607843,0.9686274509803922,1);const float e2=0.5;const vec4 v2=vec4(0.7450980392156863,0.7450980392156863,0.7450980392156863,1);const float e3=0.6;const vec4 v3=vec4(0.8627450980392157,0.6666666666666666,0.5176470588235295,1);const float e4=0.7;const vec4 v4=vec4(0.9019607843137255,0.5686274509803921,0.35294117647058826,1);const float e5=1.0;const vec4 v5=vec4(0.6980392156862745,0.0392156862745098,0.10980392156862745,1);float a0=smoothstep(e0,e1,x_1);float a1=smoothstep(e1,e2,x_1);float a2=smoothstep(e2,e3,x_1);float a3=smoothstep(e3,e4,x_1);float a4=smoothstep(e4,e5,x_1);return max(mix(v0,v1,a0)*step(e0,x_1)*step(x_1,e1),max(mix(v1,v2,a1)*step(e1,x_1)*step(x_1,e2),max(mix(v2,v3,a2)*step(e2,x_1)*step(x_1,e3),max(mix(v3,v4,a3)*step(e3,x_1)*step(x_1,e4),mix(v4,v5,a4)*step(e4,x_1)*step(x_1,e5)))));}vec4 picnic(float x_42){const float e0=0.0;const vec4 v0=vec4(0,0,1,1);const float e1=0.1;const vec4 v1=vec4(0.2,0.6,1,1);const float e2=0.2;const vec4 v2=vec4(0.4,0.8,1,1);const float e3=0.3;const vec4 v3=vec4(0.6,0.8,1,1);const float e4=0.4;const vec4 v4=vec4(0.8,0.8,1,1);const float e5=0.5;const vec4 v5=vec4(1,1,1,1);const float e6=0.6;const vec4 v6=vec4(1,0.8,1,1);const float e7=0.7;const vec4 v7=vec4(1,0.6,1,1);const float e8=0.8;const vec4 v8=vec4(1,0.4,0.8,1);const float e9=0.9;const vec4 v9=vec4(1,0.4,0.4,1);const float e10=1.0;const vec4 v10=vec4(1,0,0,1);float a0=smoothstep(e0,e1,x_42);float a1=smoothstep(e1,e2,x_42);float a2=smoothstep(e2,e3,x_42);float a3=smoothstep(e3,e4,x_42);float a4=smoothstep(e4,e5,x_42);float a5=smoothstep(e5,e6,x_42);float a6=smoothstep(e6,e7,x_42);float a7=smoothstep(e7,e8,x_42);float a8=smoothstep(e8,e9,x_42);float a9=smoothstep(e9,e10,x_42);return max(mix(v0,v1,a0)*step(e0,x_42)*step(x_42,e1),max(mix(v1,v2,a1)*step(e1,x_42)*step(x_42,e2),max(mix(v2,v3,a2)*step(e2,x_42)*step(x_42,e3),max(mix(v3,v4,a3)*step(e3,x_42)*step(x_42,e4),max(mix(v4,v5,a4)*step(e4,x_42)*step(x_42,e5),max(mix(v5,v6,a5)*step(e5,x_42)*step(x_42,e6),max(mix(v6,v7,a6)*step(e6,x_42)*step(x_42,e7),max(mix(v7,v8,a7)*step(e7,x_42)*step(x_42,e8),max(mix(v8,v9,a8)*step(e8,x_42)*step(x_42,e9),mix(v9,v10,a9)*step(e9,x_42)*step(x_42,e10))))))))));}vec4 rainbow(float x_31){const float e0=0.0;const vec4 v0=vec4(0.5882352941176471,0,0.35294117647058826,1);const float e1=0.125;const vec4 v1=vec4(0,0,0.7843137254901961,1);const float e2=0.25;const vec4 v2=vec4(0,0.09803921568627451,1,1);const float e3=0.375;const vec4 v3=vec4(0,0.596078431372549,1,1);const float e4=0.5;const vec4 v4=vec4(0.17254901960784313,1,0.5882352941176471,1);const float e5=0.625;const vec4 v5=vec4(0.592156862745098,1,0,1);const float e6=0.75;const vec4 v6=vec4(1,0.9176470588235294,0,1);const float e7=0.875;const vec4 v7=vec4(1,0.43529411764705883,0,1);const float e8=1.0;const vec4 v8=vec4(1,0,0,1);float a0=smoothstep(e0,e1,x_31);float a1=smoothstep(e1,e2,x_31);float a2=smoothstep(e2,e3,x_31);float a3=smoothstep(e3,e4,x_31);float a4=smoothstep(e4,e5,x_31);float a5=smoothstep(e5,e6,x_31);float a6=smoothstep(e6,e7,x_31);float a7=smoothstep(e7,e8,x_31);return max(mix(v0,v1,a0)*step(e0,x_31)*step(x_31,e1),max(mix(v1,v2,a1)*step(e1,x_31)*step(x_31,e2),max(mix(v2,v3,a2)*step(e2,x_31)*step(x_31,e3),max(mix(v3,v4,a3)*step(e3,x_31)*step(x_31,e4),max(mix(v4,v5,a4)*step(e4,x_31)*step(x_31,e5),max(mix(v5,v6,a5)*step(e5,x_31)*step(x_31,e6),max(mix(v6,v7,a6)*step(e6,x_31)*step(x_31,e7),mix(v7,v8,a7)*step(e7,x_31)*step(x_31,e8))))))));}vec4 portland(float x_21){const float e0=0.0;const vec4 v0=vec4(0.047058823529411764,0.2,0.5137254901960784,1);const float e1=0.25;const vec4 v1=vec4(0.0392156862745098,0.5333333333333333,0.7294117647058823,1);const float e2=0.5;const vec4 v2=vec4(0.9490196078431372,0.8274509803921568,0.2196078431372549,1);const float e3=0.75;const vec4 v3=vec4(0.9490196078431372,0.5607843137254902,0.2196078431372549,1);const float e4=1.0;const vec4 v4=vec4(0.8509803921568627,0.11764705882352941,0.11764705882352941,1);float a0=smoothstep(e0,e1,x_21);float a1=smoothstep(e1,e2,x_21);float a2=smoothstep(e2,e3,x_21);float a3=smoothstep(e3,e4,x_21);return max(mix(v0,v1,a0)*step(e0,x_21)*step(x_21,e1),max(mix(v1,v2,a1)*step(e1,x_21)*step(x_21,e2),max(mix(v2,v3,a2)*step(e2,x_21)*step(x_21,e3),mix(v3,v4,a3)*step(e3,x_21)*step(x_21,e4))));}vec4 blackbody(float x_38){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.2;const vec4 v1=vec4(0.9019607843137255,0,0,1);const float e2=0.4;const vec4 v2=vec4(0.9019607843137255,0.8235294117647058,0,1);const float e3=0.7;const vec4 v3=vec4(1,1,1,1);const float e4=1.0;const vec4 v4=vec4(0.6274509803921569,0.7843137254901961,1,1);float a0=smoothstep(e0,e1,x_38);float a1=smoothstep(e1,e2,x_38);float a2=smoothstep(e2,e3,x_38);float a3=smoothstep(e3,e4,x_38);return max(mix(v0,v1,a0)*step(e0,x_38)*step(x_38,e1),max(mix(v1,v2,a1)*step(e1,x_38)*step(x_38,e2),max(mix(v2,v3,a2)*step(e2,x_38)*step(x_38,e3),mix(v3,v4,a3)*step(e3,x_38)*step(x_38,e4))));}vec4 earth(float x_29){const float e0=0.0;const vec4 v0=vec4(0,0,0.5098039215686274,1);const float e1=0.1;const vec4 v1=vec4(0,0.7058823529411765,0.7058823529411765,1);const float e2=0.2;const vec4 v2=vec4(0.1568627450980392,0.8235294117647058,0.1568627450980392,1);const float e3=0.4;const vec4 v3=vec4(0.9019607843137255,0.9019607843137255,0.19607843137254902,1);const float e4=0.6;const vec4 v4=vec4(0.47058823529411764,0.27450980392156865,0.0784313725490196,1);const float e5=1.0;const vec4 v5=vec4(1,1,1,1);float a0=smoothstep(e0,e1,x_29);float a1=smoothstep(e1,e2,x_29);float a2=smoothstep(e2,e3,x_29);float a3=smoothstep(e3,e4,x_29);float a4=smoothstep(e4,e5,x_29);return max(mix(v0,v1,a0)*step(e0,x_29)*step(x_29,e1),max(mix(v1,v2,a1)*step(e1,x_29)*step(x_29,e2),max(mix(v2,v3,a2)*step(e2,x_29)*step(x_29,e3),max(mix(v3,v4,a3)*step(e3,x_29)*step(x_29,e4),mix(v4,v5,a4)*step(e4,x_29)*step(x_29,e5)))));}vec4 electric(float x_9){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.15;const vec4 v1=vec4(0.11764705882352941,0,0.39215686274509803,1);const float e2=0.4;const vec4 v2=vec4(0.47058823529411764,0,0.39215686274509803,1);const float e3=0.6;const vec4 v3=vec4(0.6274509803921569,0.35294117647058826,0,1);const float e4=0.8;const vec4 v4=vec4(0.9019607843137255,0.7843137254901961,0,1);const float e5=1.0;const vec4 v5=vec4(1,0.9803921568627451,0.8627450980392157,1);float a0=smoothstep(e0,e1,x_9);float a1=smoothstep(e1,e2,x_9);float a2=smoothstep(e2,e3,x_9);float a3=smoothstep(e3,e4,x_9);float a4=smoothstep(e4,e5,x_9);return max(mix(v0,v1,a0)*step(e0,x_9)*step(x_9,e1),max(mix(v1,v2,a1)*step(e1,x_9)*step(x_9,e2),max(mix(v2,v3,a2)*step(e2,x_9)*step(x_9,e3),max(mix(v3,v4,a3)*step(e3,x_9)*step(x_9,e4),mix(v4,v5,a4)*step(e4,x_9)*step(x_9,e5)))));}vec4 alpha(float x_0){const float e0=0.0;const vec4 v0=vec4(1,1,1,0);const float e1=1.0;const vec4 v1=vec4(1,1,1,1);float a0=smoothstep(e0,e1,x_0);return mix(v0,v1,a0)*step(e0,x_0)*step(x_0,e1);}vec4 viridis(float x_22){const float e0=0.0;const vec4 v0=vec4(0.26666666666666666,0.00392156862745098,0.32941176470588235,1);const float e1=0.13;const vec4 v1=vec4(0.2784313725490196,0.17254901960784313,0.47843137254901963,1);const float e2=0.25;const vec4 v2=vec4(0.23137254901960785,0.3176470588235294,0.5450980392156862,1);const float e3=0.38;const vec4 v3=vec4(0.17254901960784313,0.44313725490196076,0.5568627450980392,1);const float e4=0.5;const vec4 v4=vec4(0.12941176470588237,0.5647058823529412,0.5529411764705883,1);const float e5=0.63;const vec4 v5=vec4(0.15294117647058825,0.6784313725490196,0.5058823529411764,1);const float e6=0.75;const vec4 v6=vec4(0.3607843137254902,0.7843137254901961,0.38823529411764707,1);const float e7=0.88;const vec4 v7=vec4(0.6666666666666666,0.8627450980392157,0.19607843137254902,1);const float e8=1.0;const vec4 v8=vec4(0.9921568627450981,0.9058823529411765,0.1450980392156863,1);float a0=smoothstep(e0,e1,x_22);float a1=smoothstep(e1,e2,x_22);float a2=smoothstep(e2,e3,x_22);float a3=smoothstep(e3,e4,x_22);float a4=smoothstep(e4,e5,x_22);float a5=smoothstep(e5,e6,x_22);float a6=smoothstep(e6,e7,x_22);float a7=smoothstep(e7,e8,x_22);return max(mix(v0,v1,a0)*step(e0,x_22)*step(x_22,e1),max(mix(v1,v2,a1)*step(e1,x_22)*step(x_22,e2),max(mix(v2,v3,a2)*step(e2,x_22)*step(x_22,e3),max(mix(v3,v4,a3)*step(e3,x_22)*step(x_22,e4),max(mix(v4,v5,a4)*step(e4,x_22)*step(x_22,e5),max(mix(v5,v6,a5)*step(e5,x_22)*step(x_22,e6),max(mix(v6,v7,a6)*step(e6,x_22)*step(x_22,e7),mix(v7,v8,a7)*step(e7,x_22)*step(x_22,e8))))))));}vec4 inferno(float x_30){const float e0=0.0;const vec4 v0=vec4(0,0,0.01568627450980392,1);const float e1=0.13;const vec4 v1=vec4(0.12156862745098039,0.047058823529411764,0.2823529411764706,1);const float e2=0.25;const vec4 v2=vec4(0.3333333333333333,0.058823529411764705,0.42745098039215684,1);const float e3=0.38;const vec4 v3=vec4(0.5333333333333333,0.13333333333333333,0.41568627450980394,1);const float e4=0.5;const vec4 v4=vec4(0.7294117647058823,0.21176470588235294,0.3333333333333333,1);const float e5=0.63;const vec4 v5=vec4(0.8901960784313725,0.34901960784313724,0.2,1);const float e6=0.75;const vec4 v6=vec4(0.9764705882352941,0.5490196078431373,0.0392156862745098,1);const float e7=0.88;const vec4 v7=vec4(0.9764705882352941,0.788235294117647,0.19607843137254902,1);const float e8=1.0;const vec4 v8=vec4(0.9882352941176471,1,0.6431372549019608,1);float a0=smoothstep(e0,e1,x_30);float a1=smoothstep(e1,e2,x_30);float a2=smoothstep(e2,e3,x_30);float a3=smoothstep(e3,e4,x_30);float a4=smoothstep(e4,e5,x_30);float a5=smoothstep(e5,e6,x_30);float a6=smoothstep(e6,e7,x_30);float a7=smoothstep(e7,e8,x_30);return max(mix(v0,v1,a0)*step(e0,x_30)*step(x_30,e1),max(mix(v1,v2,a1)*step(e1,x_30)*step(x_30,e2),max(mix(v2,v3,a2)*step(e2,x_30)*step(x_30,e3),max(mix(v3,v4,a3)*step(e3,x_30)*step(x_30,e4),max(mix(v4,v5,a4)*step(e4,x_30)*step(x_30,e5),max(mix(v5,v6,a5)*step(e5,x_30)*step(x_30,e6),max(mix(v6,v7,a6)*step(e6,x_30)*step(x_30,e7),mix(v7,v8,a7)*step(e7,x_30)*step(x_30,e8))))))));}vec4 magma(float x_33){const float e0=0.0;const vec4 v0=vec4(0,0,0.01568627450980392,1);const float e1=0.13;const vec4 v1=vec4(0.10980392156862745,0.06274509803921569,0.26666666666666666,1);const float e2=0.25;const vec4 v2=vec4(0.30980392156862746,0.07058823529411765,0.4823529411764706,1);const float e3=0.38;const vec4 v3=vec4(0.5058823529411764,0.1450980392156863,0.5058823529411764,1);const float e4=0.5;const vec4 v4=vec4(0.7098039215686275,0.21176470588235294,0.47843137254901963,1);const float e5=0.63;const vec4 v5=vec4(0.8980392156862745,0.3137254901960784,0.39215686274509803,1);const float e6=0.75;const vec4 v6=vec4(0.984313725490196,0.5294117647058824,0.3803921568627451,1);const float e7=0.88;const vec4 v7=vec4(0.996078431372549,0.7607843137254902,0.5294117647058824,1);const float e8=1.0;const vec4 v8=vec4(0.9882352941176471,0.9921568627450981,0.7490196078431373,1);float a0=smoothstep(e0,e1,x_33);float a1=smoothstep(e1,e2,x_33);float a2=smoothstep(e2,e3,x_33);float a3=smoothstep(e3,e4,x_33);float a4=smoothstep(e4,e5,x_33);float a5=smoothstep(e5,e6,x_33);float a6=smoothstep(e6,e7,x_33);float a7=smoothstep(e7,e8,x_33);return max(mix(v0,v1,a0)*step(e0,x_33)*step(x_33,e1),max(mix(v1,v2,a1)*step(e1,x_33)*step(x_33,e2),max(mix(v2,v3,a2)*step(e2,x_33)*step(x_33,e3),max(mix(v3,v4,a3)*step(e3,x_33)*step(x_33,e4),max(mix(v4,v5,a4)*step(e4,x_33)*step(x_33,e5),max(mix(v5,v6,a5)*step(e5,x_33)*step(x_33,e6),max(mix(v6,v7,a6)*step(e6,x_33)*step(x_33,e7),mix(v7,v8,a7)*step(e7,x_33)*step(x_33,e8))))))));}vec4 plasma(float x_3){const float e0=0.0;const vec4 v0=vec4(0.050980392156862744,0.03137254901960784,0.5294117647058824,1);const float e1=0.13;const vec4 v1=vec4(0.29411764705882354,0.011764705882352941,0.6313725490196078,1);const float e2=0.25;const vec4 v2=vec4(0.49019607843137253,0.011764705882352941,0.6588235294117647,1);const float e3=0.38;const vec4 v3=vec4(0.6588235294117647,0.13333333333333333,0.5882352941176471,1);const float e4=0.5;const vec4 v4=vec4(0.796078431372549,0.27450980392156865,0.4745098039215686,1);const float e5=0.63;const vec4 v5=vec4(0.8980392156862745,0.4196078431372549,0.36470588235294116,1);const float e6=0.75;const vec4 v6=vec4(0.9725490196078431,0.5803921568627451,0.2549019607843137,1);const float e7=0.88;const vec4 v7=vec4(0.9921568627450981,0.7647058823529411,0.1568627450980392,1);const float e8=1.0;const vec4 v8=vec4(0.9411764705882353,0.9764705882352941,0.12941176470588237,1);float a0=smoothstep(e0,e1,x_3);float a1=smoothstep(e1,e2,x_3);float a2=smoothstep(e2,e3,x_3);float a3=smoothstep(e3,e4,x_3);float a4=smoothstep(e4,e5,x_3);float a5=smoothstep(e5,e6,x_3);float a6=smoothstep(e6,e7,x_3);float a7=smoothstep(e7,e8,x_3);return max(mix(v0,v1,a0)*step(e0,x_3)*step(x_3,e1),max(mix(v1,v2,a1)*step(e1,x_3)*step(x_3,e2),max(mix(v2,v3,a2)*step(e2,x_3)*step(x_3,e3),max(mix(v3,v4,a3)*step(e3,x_3)*step(x_3,e4),max(mix(v4,v5,a4)*step(e4,x_3)*step(x_3,e5),max(mix(v5,v6,a5)*step(e5,x_3)*step(x_3,e6),max(mix(v6,v7,a6)*step(e6,x_3)*step(x_3,e7),mix(v7,v8,a7)*step(e7,x_3)*step(x_3,e8))))))));}vec4 warm(float x_43){const float e0=0.0;const vec4 v0=vec4(0.49019607843137253,0,0.7019607843137254,1);const float e1=0.13;const vec4 v1=vec4(0.6745098039215687,0,0.7333333333333333,1);const float e2=0.25;const vec4 v2=vec4(0.8588235294117647,0,0.6666666666666666,1);const float e3=0.38;const vec4 v3=vec4(1,0,0.5098039215686274,1);const float e4=0.5;const vec4 v4=vec4(1,0.24705882352941178,0.2901960784313726,1);const float e5=0.63;const vec4 v5=vec4(1,0.4823529411764706,0,1);const float e6=0.75;const vec4 v6=vec4(0.9176470588235294,0.6901960784313725,0,1);const float e7=0.88;const vec4 v7=vec4(0.7450980392156863,0.8941176470588236,0,1);const float e8=1.0;const vec4 v8=vec4(0.5764705882352941,1,0,1);float a0=smoothstep(e0,e1,x_43);float a1=smoothstep(e1,e2,x_43);float a2=smoothstep(e2,e3,x_43);float a3=smoothstep(e3,e4,x_43);float a4=smoothstep(e4,e5,x_43);float a5=smoothstep(e5,e6,x_43);float a6=smoothstep(e6,e7,x_43);float a7=smoothstep(e7,e8,x_43);return max(mix(v0,v1,a0)*step(e0,x_43)*step(x_43,e1),max(mix(v1,v2,a1)*step(e1,x_43)*step(x_43,e2),max(mix(v2,v3,a2)*step(e2,x_43)*step(x_43,e3),max(mix(v3,v4,a3)*step(e3,x_43)*step(x_43,e4),max(mix(v4,v5,a4)*step(e4,x_43)*step(x_43,e5),max(mix(v5,v6,a5)*step(e5,x_43)*step(x_43,e6),max(mix(v6,v7,a6)*step(e6,x_43)*step(x_43,e7),mix(v7,v8,a7)*step(e7,x_43)*step(x_43,e8))))))));}vec4 rainbow_soft_1310269270(float x_14){const float e0=0.0;const vec4 v0=vec4(0.49019607843137253,0,0.7019607843137254,1);const float e1=0.1;const vec4 v1=vec4(0.7803921568627451,0,0.7058823529411765,1);const float e2=0.2;const vec4 v2=vec4(1,0,0.4745098039215686,1);const float e3=0.3;const vec4 v3=vec4(1,0.4235294117647059,0,1);const float e4=0.4;const vec4 v4=vec4(0.8705882352941177,0.7607843137254902,0,1);const float e5=0.5;const vec4 v5=vec4(0.5882352941176471,1,0,1);const float e6=0.6;const vec4 v6=vec4(0,1,0.21568627450980393,1);const float e7=0.7;const vec4 v7=vec4(0,0.9647058823529412,0.5882352941176471,1);const float e8=0.8;const vec4 v8=vec4(0.19607843137254902,0.6549019607843137,0.8705882352941177,1);const float e9=0.9;const vec4 v9=vec4(0.403921568627451,0.2,0.9215686274509803,1);const float e10=1.0;const vec4 v10=vec4(0.48627450980392156,0,0.7294117647058823,1);float a0=smoothstep(e0,e1,x_14);float a1=smoothstep(e1,e2,x_14);float a2=smoothstep(e2,e3,x_14);float a3=smoothstep(e3,e4,x_14);float a4=smoothstep(e4,e5,x_14);float a5=smoothstep(e5,e6,x_14);float a6=smoothstep(e6,e7,x_14);float a7=smoothstep(e7,e8,x_14);float a8=smoothstep(e8,e9,x_14);float a9=smoothstep(e9,e10,x_14);return max(mix(v0,v1,a0)*step(e0,x_14)*step(x_14,e1),max(mix(v1,v2,a1)*step(e1,x_14)*step(x_14,e2),max(mix(v2,v3,a2)*step(e2,x_14)*step(x_14,e3),max(mix(v3,v4,a3)*step(e3,x_14)*step(x_14,e4),max(mix(v4,v5,a4)*step(e4,x_14)*step(x_14,e5),max(mix(v5,v6,a5)*step(e5,x_14)*step(x_14,e6),max(mix(v6,v7,a6)*step(e6,x_14)*step(x_14,e7),max(mix(v7,v8,a7)*step(e7,x_14)*step(x_14,e8),max(mix(v8,v9,a8)*step(e8,x_14)*step(x_14,e9),mix(v9,v10,a9)*step(e9,x_14)*step(x_14,e10))))))))));}vec4 bathymetry(float x_36){const float e0=0.0;const vec4 v0=vec4(0.1568627450980392,0.10196078431372549,0.17254901960784313,1);const float e1=0.13;const vec4 v1=vec4(0.23137254901960785,0.19215686274509805,0.35294117647058826,1);const float e2=0.25;const vec4 v2=vec4(0.25098039215686274,0.2980392156862745,0.5450980392156862,1);const float e3=0.38;const vec4 v3=vec4(0.24705882352941178,0.43137254901960786,0.592156862745098,1);const float e4=0.5;const vec4 v4=vec4(0.2823529411764706,0.5568627450980392,0.6196078431372549,1);const float e5=0.63;const vec4 v5=vec4(0.3333333333333333,0.6823529411764706,0.6392156862745098,1);const float e6=0.75;const vec4 v6=vec4(0.47058823529411764,0.807843137254902,0.6392156862745098,1);const float e7=0.88;const vec4 v7=vec4(0.7333333333333333,0.9019607843137255,0.6745098039215687,1);const float e8=1.0;const vec4 v8=vec4(0.9921568627450981,0.996078431372549,0.8,1);float a0=smoothstep(e0,e1,x_36);float a1=smoothstep(e1,e2,x_36);float a2=smoothstep(e2,e3,x_36);float a3=smoothstep(e3,e4,x_36);float a4=smoothstep(e4,e5,x_36);float a5=smoothstep(e5,e6,x_36);float a6=smoothstep(e6,e7,x_36);float a7=smoothstep(e7,e8,x_36);return max(mix(v0,v1,a0)*step(e0,x_36)*step(x_36,e1),max(mix(v1,v2,a1)*step(e1,x_36)*step(x_36,e2),max(mix(v2,v3,a2)*step(e2,x_36)*step(x_36,e3),max(mix(v3,v4,a3)*step(e3,x_36)*step(x_36,e4),max(mix(v4,v5,a4)*step(e4,x_36)*step(x_36,e5),max(mix(v5,v6,a5)*step(e5,x_36)*step(x_36,e6),max(mix(v6,v7,a6)*step(e6,x_36)*step(x_36,e7),mix(v7,v8,a7)*step(e7,x_36)*step(x_36,e8))))))));}vec4 cdom(float x_7){const float e0=0.0;const vec4 v0=vec4(0.1843137254901961,0.058823529411764705,0.24313725490196078,1);const float e1=0.13;const vec4 v1=vec4(0.3411764705882353,0.09019607843137255,0.33725490196078434,1);const float e2=0.25;const vec4 v2=vec4(0.5098039215686274,0.10980392156862745,0.38823529411764707,1);const float e3=0.38;const vec4 v3=vec4(0.6705882352941176,0.1607843137254902,0.3764705882352941,1);const float e4=0.5;const vec4 v4=vec4(0.807843137254902,0.2627450980392157,0.33725490196078434,1);const float e5=0.63;const vec4 v5=vec4(0.9019607843137255,0.41568627450980394,0.32941176470588235,1);const float e6=0.75;const vec4 v6=vec4(0.9490196078431372,0.5843137254901961,0.403921568627451,1);const float e7=0.88;const vec4 v7=vec4(0.9764705882352941,0.7568627450980392,0.5294117647058824,1);const float e8=1.0;const vec4 v8=vec4(0.996078431372549,0.9294117647058824,0.6901960784313725,1);float a0=smoothstep(e0,e1,x_7);float a1=smoothstep(e1,e2,x_7);float a2=smoothstep(e2,e3,x_7);float a3=smoothstep(e3,e4,x_7);float a4=smoothstep(e4,e5,x_7);float a5=smoothstep(e5,e6,x_7);float a6=smoothstep(e6,e7,x_7);float a7=smoothstep(e7,e8,x_7);return max(mix(v0,v1,a0)*step(e0,x_7)*step(x_7,e1),max(mix(v1,v2,a1)*step(e1,x_7)*step(x_7,e2),max(mix(v2,v3,a2)*step(e2,x_7)*step(x_7,e3),max(mix(v3,v4,a3)*step(e3,x_7)*step(x_7,e4),max(mix(v4,v5,a4)*step(e4,x_7)*step(x_7,e5),max(mix(v5,v6,a5)*step(e5,x_7)*step(x_7,e6),max(mix(v6,v7,a6)*step(e6,x_7)*step(x_7,e7),mix(v7,v8,a7)*step(e7,x_7)*step(x_7,e8))))))));}vec4 chlorophyll(float x_6){const float e0=0.0;const vec4 v0=vec4(0.07058823529411765,0.1411764705882353,0.0784313725490196,1);const float e1=0.13;const vec4 v1=vec4(0.09803921568627451,0.24705882352941178,0.1607843137254902,1);const float e2=0.25;const vec4 v2=vec4(0.09411764705882353,0.3568627450980392,0.23137254901960785,1);const float e3=0.38;const vec4 v3=vec4(0.050980392156862744,0.4666666666666667,0.2823529411764706,1);const float e4=0.5;const vec4 v4=vec4(0.07058823529411765,0.5803921568627451,0.3137254901960784,1);const float e5=0.63;const vec4 v5=vec4(0.3137254901960784,0.6784313725490196,0.34901960784313724,1);const float e6=0.75;const vec4 v6=vec4(0.5176470588235295,0.7686274509803922,0.47843137254901963,1);const float e7=0.88;const vec4 v7=vec4(0.6862745098039216,0.8666666666666667,0.6352941176470588,1);const float e8=1.0;const vec4 v8=vec4(0.8431372549019608,0.9764705882352941,0.8156862745098039,1);float a0=smoothstep(e0,e1,x_6);float a1=smoothstep(e1,e2,x_6);float a2=smoothstep(e2,e3,x_6);float a3=smoothstep(e3,e4,x_6);float a4=smoothstep(e4,e5,x_6);float a5=smoothstep(e5,e6,x_6);float a6=smoothstep(e6,e7,x_6);float a7=smoothstep(e7,e8,x_6);return max(mix(v0,v1,a0)*step(e0,x_6)*step(x_6,e1),max(mix(v1,v2,a1)*step(e1,x_6)*step(x_6,e2),max(mix(v2,v3,a2)*step(e2,x_6)*step(x_6,e3),max(mix(v3,v4,a3)*step(e3,x_6)*step(x_6,e4),max(mix(v4,v5,a4)*step(e4,x_6)*step(x_6,e5),max(mix(v5,v6,a5)*step(e5,x_6)*step(x_6,e6),max(mix(v6,v7,a6)*step(e6,x_6)*step(x_6,e7),mix(v7,v8,a7)*step(e7,x_6)*step(x_6,e8))))))));}vec4 density(float x_19){const float e0=0.0;const vec4 v0=vec4(0.21176470588235294,0.054901960784313725,0.1411764705882353,1);const float e1=0.13;const vec4 v1=vec4(0.34901960784313724,0.09019607843137255,0.3137254901960784,1);const float e2=0.25;const vec4 v2=vec4(0.43137254901960786,0.17647058823529413,0.5176470588235295,1);const float e3=0.38;const vec4 v3=vec4(0.47058823529411764,0.30196078431372547,0.6980392156862745,1);const float e4=0.5;const vec4 v4=vec4(0.47058823529411764,0.44313725490196076,0.8352941176470589,1);const float e5=0.63;const vec4 v5=vec4(0.45098039215686275,0.592156862745098,0.8941176470588236,1);const float e6=0.75;const vec4 v6=vec4(0.5254901960784314,0.7254901960784313,0.8901960784313725,1);const float e7=0.88;const vec4 v7=vec4(0.6941176470588235,0.8392156862745098,0.8901960784313725,1);const float e8=1.0;const vec4 v8=vec4(0.9019607843137255,0.9450980392156862,0.9450980392156862,1);float a0=smoothstep(e0,e1,x_19);float a1=smoothstep(e1,e2,x_19);float a2=smoothstep(e2,e3,x_19);float a3=smoothstep(e3,e4,x_19);float a4=smoothstep(e4,e5,x_19);float a5=smoothstep(e5,e6,x_19);float a6=smoothstep(e6,e7,x_19);float a7=smoothstep(e7,e8,x_19);return max(mix(v0,v1,a0)*step(e0,x_19)*step(x_19,e1),max(mix(v1,v2,a1)*step(e1,x_19)*step(x_19,e2),max(mix(v2,v3,a2)*step(e2,x_19)*step(x_19,e3),max(mix(v3,v4,a3)*step(e3,x_19)*step(x_19,e4),max(mix(v4,v5,a4)*step(e4,x_19)*step(x_19,e5),max(mix(v5,v6,a5)*step(e5,x_19)*step(x_19,e6),max(mix(v6,v7,a6)*step(e6,x_19)*step(x_19,e7),mix(v7,v8,a7)*step(e7,x_19)*step(x_19,e8))))))));}vec4 freesurface_blue_3154355989(float x_35){const float e0=0.0;const vec4 v0=vec4(0.11764705882352941,0.01568627450980392,0.43137254901960786,1);const float e1=0.13;const vec4 v1=vec4(0.1843137254901961,0.054901960784313725,0.6901960784313725,1);const float e2=0.25;const vec4 v2=vec4(0.1607843137254902,0.17647058823529413,0.9254901960784314,1);const float e3=0.38;const vec4 v3=vec4(0.09803921568627451,0.38823529411764707,0.8313725490196079,1);const float e4=0.5;const vec4 v4=vec4(0.26666666666666666,0.5137254901960784,0.7843137254901961,1);const float e5=0.63;const vec4 v5=vec4(0.4470588235294118,0.611764705882353,0.7725490196078432,1);const float e6=0.75;const vec4 v6=vec4(0.615686274509804,0.7098039215686275,0.796078431372549,1);const float e7=0.88;const vec4 v7=vec4(0.7843137254901961,0.8156862745098039,0.8470588235294118,1);const float e8=1.0;const vec4 v8=vec4(0.9450980392156862,0.9294117647058824,0.9254901960784314,1);float a0=smoothstep(e0,e1,x_35);float a1=smoothstep(e1,e2,x_35);float a2=smoothstep(e2,e3,x_35);float a3=smoothstep(e3,e4,x_35);float a4=smoothstep(e4,e5,x_35);float a5=smoothstep(e5,e6,x_35);float a6=smoothstep(e6,e7,x_35);float a7=smoothstep(e7,e8,x_35);return max(mix(v0,v1,a0)*step(e0,x_35)*step(x_35,e1),max(mix(v1,v2,a1)*step(e1,x_35)*step(x_35,e2),max(mix(v2,v3,a2)*step(e2,x_35)*step(x_35,e3),max(mix(v3,v4,a3)*step(e3,x_35)*step(x_35,e4),max(mix(v4,v5,a4)*step(e4,x_35)*step(x_35,e5),max(mix(v5,v6,a5)*step(e5,x_35)*step(x_35,e6),max(mix(v6,v7,a6)*step(e6,x_35)*step(x_35,e7),mix(v7,v8,a7)*step(e7,x_35)*step(x_35,e8))))))));}vec4 freesurface_red_1679163293(float x_20){const float e0=0.0;const vec4 v0=vec4(0.23529411764705882,0.03529411764705882,0.07058823529411765,1);const float e1=0.13;const vec4 v1=vec4(0.39215686274509803,0.06666666666666667,0.10588235294117647,1);const float e2=0.25;const vec4 v2=vec4(0.5568627450980392,0.0784313725490196,0.11372549019607843,1);const float e3=0.38;const vec4 v3=vec4(0.6941176470588235,0.16862745098039217,0.10588235294117647,1);const float e4=0.5;const vec4 v4=vec4(0.7529411764705882,0.3411764705882353,0.24705882352941178,1);const float e5=0.63;const vec4 v5=vec4(0.803921568627451,0.49019607843137253,0.4117647058823529,1);const float e6=0.75;const vec4 v6=vec4(0.8470588235294118,0.6352941176470588,0.5803921568627451,1);const float e7=0.88;const vec4 v7=vec4(0.8901960784313725,0.7803921568627451,0.7568627450980392,1);const float e8=1.0;const vec4 v8=vec4(0.9450980392156862,0.9294117647058824,0.9254901960784314,1);float a0=smoothstep(e0,e1,x_20);float a1=smoothstep(e1,e2,x_20);float a2=smoothstep(e2,e3,x_20);float a3=smoothstep(e3,e4,x_20);float a4=smoothstep(e4,e5,x_20);float a5=smoothstep(e5,e6,x_20);float a6=smoothstep(e6,e7,x_20);float a7=smoothstep(e7,e8,x_20);return max(mix(v0,v1,a0)*step(e0,x_20)*step(x_20,e1),max(mix(v1,v2,a1)*step(e1,x_20)*step(x_20,e2),max(mix(v2,v3,a2)*step(e2,x_20)*step(x_20,e3),max(mix(v3,v4,a3)*step(e3,x_20)*step(x_20,e4),max(mix(v4,v5,a4)*step(e4,x_20)*step(x_20,e5),max(mix(v5,v6,a5)*step(e5,x_20)*step(x_20,e6),max(mix(v6,v7,a6)*step(e6,x_20)*step(x_20,e7),mix(v7,v8,a7)*step(e7,x_20)*step(x_20,e8))))))));}vec4 oxygen(float x_11){const float e0=0.0;const vec4 v0=vec4(0.25098039215686274,0.0196078431372549,0.0196078431372549,1);const float e1=0.13;const vec4 v1=vec4(0.41568627450980394,0.023529411764705882,0.058823529411764705,1);const float e2=0.25;const vec4 v2=vec4(0.5647058823529412,0.10196078431372549,0.027450980392156862,1);const float e3=0.38;const vec4 v3=vec4(0.6588235294117647,0.25098039215686274,0.011764705882352941,1);const float e4=0.5;const vec4 v4=vec4(0.7372549019607844,0.39215686274509803,0.01568627450980392,1);const float e5=0.63;const vec4 v5=vec4(0.807843137254902,0.5333333333333333,0.043137254901960784,1);const float e6=0.75;const vec4 v6=vec4(0.8627450980392157,0.6823529411764706,0.09803921568627451,1);const float e7=0.88;const vec4 v7=vec4(0.9058823529411765,0.8431372549019608,0.17254901960784313,1);const float e8=1.0;const vec4 v8=vec4(0.9725490196078431,0.996078431372549,0.4117647058823529,1);float a0=smoothstep(e0,e1,x_11);float a1=smoothstep(e1,e2,x_11);float a2=smoothstep(e2,e3,x_11);float a3=smoothstep(e3,e4,x_11);float a4=smoothstep(e4,e5,x_11);float a5=smoothstep(e5,e6,x_11);float a6=smoothstep(e6,e7,x_11);float a7=smoothstep(e7,e8,x_11);return max(mix(v0,v1,a0)*step(e0,x_11)*step(x_11,e1),max(mix(v1,v2,a1)*step(e1,x_11)*step(x_11,e2),max(mix(v2,v3,a2)*step(e2,x_11)*step(x_11,e3),max(mix(v3,v4,a3)*step(e3,x_11)*step(x_11,e4),max(mix(v4,v5,a4)*step(e4,x_11)*step(x_11,e5),max(mix(v5,v6,a5)*step(e5,x_11)*step(x_11,e6),max(mix(v6,v7,a6)*step(e6,x_11)*step(x_11,e7),mix(v7,v8,a7)*step(e7,x_11)*step(x_11,e8))))))));}vec4 par(float x_28){const float e0=0.0;const vec4 v0=vec4(0.2,0.0784313725490196,0.09411764705882353,1);const float e1=0.13;const vec4 v1=vec4(0.35294117647058826,0.12549019607843137,0.13725490196078433,1);const float e2=0.25;const vec4 v2=vec4(0.5058823529411764,0.17254901960784313,0.13333333333333333,1);const float e3=0.38;const vec4 v3=vec4(0.6235294117647059,0.26666666666666666,0.09803921568627451,1);const float e4=0.5;const vec4 v4=vec4(0.7137254901960784,0.38823529411764707,0.07450980392156863,1);const float e5=0.63;const vec4 v5=vec4(0.7803921568627451,0.5254901960784314,0.08627450980392157,1);const float e6=0.75;const vec4 v6=vec4(0.8313725490196079,0.6705882352941176,0.13725490196078433,1);const float e7=0.88;const vec4 v7=vec4(0.8666666666666667,0.8235294117647058,0.21176470588235294,1);const float e8=1.0;const vec4 v8=vec4(0.8823529411764706,0.9921568627450981,0.29411764705882354,1);float a0=smoothstep(e0,e1,x_28);float a1=smoothstep(e1,e2,x_28);float a2=smoothstep(e2,e3,x_28);float a3=smoothstep(e3,e4,x_28);float a4=smoothstep(e4,e5,x_28);float a5=smoothstep(e5,e6,x_28);float a6=smoothstep(e6,e7,x_28);float a7=smoothstep(e7,e8,x_28);return max(mix(v0,v1,a0)*step(e0,x_28)*step(x_28,e1),max(mix(v1,v2,a1)*step(e1,x_28)*step(x_28,e2),max(mix(v2,v3,a2)*step(e2,x_28)*step(x_28,e3),max(mix(v3,v4,a3)*step(e3,x_28)*step(x_28,e4),max(mix(v4,v5,a4)*step(e4,x_28)*step(x_28,e5),max(mix(v5,v6,a5)*step(e5,x_28)*step(x_28,e6),max(mix(v6,v7,a6)*step(e6,x_28)*step(x_28,e7),mix(v7,v8,a7)*step(e7,x_28)*step(x_28,e8))))))));}vec4 phase(float x_39){const float e0=0.0;const vec4 v0=vec4(0.5686274509803921,0.4117647058823529,0.07058823529411765,1);const float e1=0.13;const vec4 v1=vec4(0.7215686274509804,0.2784313725490196,0.14901960784313725,1);const float e2=0.25;const vec4 v2=vec4(0.7294117647058823,0.22745098039215686,0.45098039215686275,1);const float e3=0.38;const vec4 v3=vec4(0.6274509803921569,0.2784313725490196,0.7254901960784313,1);const float e4=0.5;const vec4 v4=vec4(0.43137254901960786,0.3803921568627451,0.8549019607843137,1);const float e5=0.63;const vec4 v5=vec4(0.19607843137254902,0.4823529411764706,0.6431372549019608,1);const float e6=0.75;const vec4 v6=vec4(0.12156862745098039,0.5137254901960784,0.43137254901960786,1);const float e7=0.88;const vec4 v7=vec4(0.30196078431372547,0.5058823529411764,0.13333333333333333,1);const float e8=1.0;const vec4 v8=vec4(0.5686274509803921,0.4117647058823529,0.07058823529411765,1);float a0=smoothstep(e0,e1,x_39);float a1=smoothstep(e1,e2,x_39);float a2=smoothstep(e2,e3,x_39);float a3=smoothstep(e3,e4,x_39);float a4=smoothstep(e4,e5,x_39);float a5=smoothstep(e5,e6,x_39);float a6=smoothstep(e6,e7,x_39);float a7=smoothstep(e7,e8,x_39);return max(mix(v0,v1,a0)*step(e0,x_39)*step(x_39,e1),max(mix(v1,v2,a1)*step(e1,x_39)*step(x_39,e2),max(mix(v2,v3,a2)*step(e2,x_39)*step(x_39,e3),max(mix(v3,v4,a3)*step(e3,x_39)*step(x_39,e4),max(mix(v4,v5,a4)*step(e4,x_39)*step(x_39,e5),max(mix(v5,v6,a5)*step(e5,x_39)*step(x_39,e6),max(mix(v6,v7,a6)*step(e6,x_39)*step(x_39,e7),mix(v7,v8,a7)*step(e7,x_39)*step(x_39,e8))))))));}vec4 salinity(float x_26){const float e0=0.0;const vec4 v0=vec4(0.16470588235294117,0.09411764705882353,0.4235294117647059,1);const float e1=0.13;const vec4 v1=vec4(0.12941176470588237,0.19607843137254902,0.6352941176470588,1);const float e2=0.25;const vec4 v2=vec4(0.058823529411764705,0.35294117647058826,0.5686274509803921,1);const float e3=0.38;const vec4 v3=vec4(0.1568627450980392,0.4627450980392157,0.5372549019607843,1);const float e4=0.5;const vec4 v4=vec4(0.23137254901960785,0.5725490196078431,0.5294117647058824,1);const float e5=0.63;const vec4 v5=vec4(0.30980392156862746,0.6862745098039216,0.49411764705882355,1);const float e6=0.75;const vec4 v6=vec4(0.47058823529411764,0.796078431372549,0.40784313725490196,1);const float e7=0.88;const vec4 v7=vec4(0.7568627450980392,0.8666666666666667,0.39215686274509803,1);const float e8=1.0;const vec4 v8=vec4(0.9921568627450981,0.9372549019607843,0.6039215686274509,1);float a0=smoothstep(e0,e1,x_26);float a1=smoothstep(e1,e2,x_26);float a2=smoothstep(e2,e3,x_26);float a3=smoothstep(e3,e4,x_26);float a4=smoothstep(e4,e5,x_26);float a5=smoothstep(e5,e6,x_26);float a6=smoothstep(e6,e7,x_26);float a7=smoothstep(e7,e8,x_26);return max(mix(v0,v1,a0)*step(e0,x_26)*step(x_26,e1),max(mix(v1,v2,a1)*step(e1,x_26)*step(x_26,e2),max(mix(v2,v3,a2)*step(e2,x_26)*step(x_26,e3),max(mix(v3,v4,a3)*step(e3,x_26)*step(x_26,e4),max(mix(v4,v5,a4)*step(e4,x_26)*step(x_26,e5),max(mix(v5,v6,a5)*step(e5,x_26)*step(x_26,e6),max(mix(v6,v7,a6)*step(e6,x_26)*step(x_26,e7),mix(v7,v8,a7)*step(e7,x_26)*step(x_26,e8))))))));}vec4 temperature(float x_8){const float e0=0.0;const vec4 v0=vec4(0.01568627450980392,0.13725490196078433,0.2,1);const float e1=0.13;const vec4 v1=vec4(0.09019607843137255,0.2,0.47843137254901963,1);const float e2=0.25;const vec4 v2=vec4(0.3333333333333333,0.23137254901960785,0.615686274509804,1);const float e3=0.38;const vec4 v3=vec4(0.5058823529411764,0.30980392156862746,0.5607843137254902,1);const float e4=0.5;const vec4 v4=vec4(0.6862745098039216,0.37254901960784315,0.5098039215686274,1);const float e5=0.63;const vec4 v5=vec4(0.8705882352941177,0.4392156862745098,0.396078431372549,1);const float e6=0.75;const vec4 v6=vec4(0.9764705882352941,0.5725490196078431,0.25882352941176473,1);const float e7=0.88;const vec4 v7=vec4(0.9764705882352941,0.7686274509803922,0.2549019607843137,1);const float e8=1.0;const vec4 v8=vec4(0.9098039215686274,0.9803921568627451,0.3568627450980392,1);float a0=smoothstep(e0,e1,x_8);float a1=smoothstep(e1,e2,x_8);float a2=smoothstep(e2,e3,x_8);float a3=smoothstep(e3,e4,x_8);float a4=smoothstep(e4,e5,x_8);float a5=smoothstep(e5,e6,x_8);float a6=smoothstep(e6,e7,x_8);float a7=smoothstep(e7,e8,x_8);return max(mix(v0,v1,a0)*step(e0,x_8)*step(x_8,e1),max(mix(v1,v2,a1)*step(e1,x_8)*step(x_8,e2),max(mix(v2,v3,a2)*step(e2,x_8)*step(x_8,e3),max(mix(v3,v4,a3)*step(e3,x_8)*step(x_8,e4),max(mix(v4,v5,a4)*step(e4,x_8)*step(x_8,e5),max(mix(v5,v6,a5)*step(e5,x_8)*step(x_8,e6),max(mix(v6,v7,a6)*step(e6,x_8)*step(x_8,e7),mix(v7,v8,a7)*step(e7,x_8)*step(x_8,e8))))))));}vec4 turbidity(float x_40){const float e0=0.0;const vec4 v0=vec4(0.13333333333333333,0.12156862745098039,0.10588235294117647,1);const float e1=0.13;const vec4 v1=vec4(0.2549019607843137,0.19607843137254902,0.1607843137254902,1);const float e2=0.25;const vec4 v2=vec4(0.3843137254901961,0.27058823529411763,0.20392156862745098,1);const float e3=0.38;const vec4 v3=vec4(0.5137254901960784,0.34901960784313724,0.2235294117647059,1);const float e4=0.5;const vec4 v4=vec4(0.6313725490196078,0.4392156862745098,0.23137254901960785,1);const float e5=0.63;const vec4 v5=vec4(0.7254901960784313,0.5490196078431373,0.25882352941176473,1);const float e6=0.75;const vec4 v6=vec4(0.792156862745098,0.6823529411764706,0.34509803921568627,1);const float e7=0.88;const vec4 v7=vec4(0.8470588235294118,0.8196078431372549,0.49411764705882355,1);const float e8=1.0;const vec4 v8=vec4(0.9137254901960784,0.9647058823529412,0.6705882352941176,1);float a0=smoothstep(e0,e1,x_40);float a1=smoothstep(e1,e2,x_40);float a2=smoothstep(e2,e3,x_40);float a3=smoothstep(e3,e4,x_40);float a4=smoothstep(e4,e5,x_40);float a5=smoothstep(e5,e6,x_40);float a6=smoothstep(e6,e7,x_40);float a7=smoothstep(e7,e8,x_40);return max(mix(v0,v1,a0)*step(e0,x_40)*step(x_40,e1),max(mix(v1,v2,a1)*step(e1,x_40)*step(x_40,e2),max(mix(v2,v3,a2)*step(e2,x_40)*step(x_40,e3),max(mix(v3,v4,a3)*step(e3,x_40)*step(x_40,e4),max(mix(v4,v5,a4)*step(e4,x_40)*step(x_40,e5),max(mix(v5,v6,a5)*step(e5,x_40)*step(x_40,e6),max(mix(v6,v7,a6)*step(e6,x_40)*step(x_40,e7),mix(v7,v8,a7)*step(e7,x_40)*step(x_40,e8))))))));}vec4 velocity_blue_297387650(float x_2){const float e0=0.0;const vec4 v0=vec4(0.06666666666666667,0.12549019607843137,0.25098039215686274,1);const float e1=0.13;const vec4 v1=vec4(0.13725490196078433,0.20392156862745098,0.4549019607843137,1);const float e2=0.25;const vec4 v2=vec4(0.11372549019607843,0.3176470588235294,0.611764705882353,1);const float e3=0.38;const vec4 v3=vec4(0.12156862745098039,0.44313725490196076,0.6352941176470588,1);const float e4=0.5;const vec4 v4=vec4(0.19607843137254902,0.5647058823529412,0.6627450980392157,1);const float e5=0.63;const vec4 v5=vec4(0.3411764705882353,0.6784313725490196,0.6901960784313725,1);const float e6=0.75;const vec4 v6=vec4(0.5843137254901961,0.7686274509803922,0.7411764705882353,1);const float e7=0.88;const vec4 v7=vec4(0.796078431372549,0.8666666666666667,0.8274509803921568,1);const float e8=1.0;const vec4 v8=vec4(0.996078431372549,0.984313725490196,0.9019607843137255,1);float a0=smoothstep(e0,e1,x_2);float a1=smoothstep(e1,e2,x_2);float a2=smoothstep(e2,e3,x_2);float a3=smoothstep(e3,e4,x_2);float a4=smoothstep(e4,e5,x_2);float a5=smoothstep(e5,e6,x_2);float a6=smoothstep(e6,e7,x_2);float a7=smoothstep(e7,e8,x_2);return max(mix(v0,v1,a0)*step(e0,x_2)*step(x_2,e1),max(mix(v1,v2,a1)*step(e1,x_2)*step(x_2,e2),max(mix(v2,v3,a2)*step(e2,x_2)*step(x_2,e3),max(mix(v3,v4,a3)*step(e3,x_2)*step(x_2,e4),max(mix(v4,v5,a4)*step(e4,x_2)*step(x_2,e5),max(mix(v5,v6,a5)*step(e5,x_2)*step(x_2,e6),max(mix(v6,v7,a6)*step(e6,x_2)*step(x_2,e7),mix(v7,v8,a7)*step(e7,x_2)*step(x_2,e8))))))));}vec4 velocity_green_2558432129(float x_27){const float e0=0.0;const vec4 v0=vec4(0.09019607843137255,0.13725490196078433,0.07450980392156863,1);const float e1=0.13;const vec4 v1=vec4(0.09411764705882353,0.25098039215686274,0.14901960784313725,1);const float e2=0.25;const vec4 v2=vec4(0.043137254901960784,0.37254901960784315,0.17647058823529413,1);const float e3=0.38;const vec4 v3=vec4(0.15294117647058825,0.4823529411764706,0.13725490196078433,1);const float e4=0.5;const vec4 v4=vec4(0.37254901960784315,0.5725490196078431,0.047058823529411764,1);const float e5=0.63;const vec4 v5=vec4(0.596078431372549,0.6470588235294118,0.07058823529411765,1);const float e6=0.75;const vec4 v6=vec4(0.788235294117647,0.7294117647058823,0.27058823529411763,1);const float e7=0.88;const vec4 v7=vec4(0.9137254901960784,0.8470588235294118,0.5372549019607843,1);const float e8=1.0;const vec4 v8=vec4(1,0.9921568627450981,0.803921568627451,1);float a0=smoothstep(e0,e1,x_27);float a1=smoothstep(e1,e2,x_27);float a2=smoothstep(e2,e3,x_27);float a3=smoothstep(e3,e4,x_27);float a4=smoothstep(e4,e5,x_27);float a5=smoothstep(e5,e6,x_27);float a6=smoothstep(e6,e7,x_27);float a7=smoothstep(e7,e8,x_27);return max(mix(v0,v1,a0)*step(e0,x_27)*step(x_27,e1),max(mix(v1,v2,a1)*step(e1,x_27)*step(x_27,e2),max(mix(v2,v3,a2)*step(e2,x_27)*step(x_27,e3),max(mix(v3,v4,a3)*step(e3,x_27)*step(x_27,e4),max(mix(v4,v5,a4)*step(e4,x_27)*step(x_27,e5),max(mix(v5,v6,a5)*step(e5,x_27)*step(x_27,e6),max(mix(v6,v7,a6)*step(e6,x_27)*step(x_27,e7),mix(v7,v8,a7)*step(e7,x_27)*step(x_27,e8))))))));}vec4 cubehelix(float x_37){const float e0=0.0;const vec4 v0=vec4(0,0,0,1);const float e1=0.07;const vec4 v1=vec4(0.08627450980392157,0.0196078431372549,0.23137254901960785,1);const float e2=0.13;const vec4 v2=vec4(0.23529411764705882,0.01568627450980392,0.4117647058823529,1);const float e3=0.2;const vec4 v3=vec4(0.42745098039215684,0.00392156862745098,0.5294117647058824,1);const float e4=0.27;const vec4 v4=vec4(0.6313725490196078,0,0.5764705882352941,1);const float e5=0.33;const vec4 v5=vec4(0.8235294117647058,0.00784313725490196,0.5568627450980392,1);const float e6=0.4;const vec4 v6=vec4(0.984313725490196,0.043137254901960784,0.4823529411764706,1);const float e7=0.47;const vec4 v7=vec4(1,0.11372549019607843,0.3803921568627451,1);const float e8=0.53;const vec4 v8=vec4(1,0.21176470588235294,0.27058823529411763,1);const float e9=0.6;const vec4 v9=vec4(1,0.3333333333333333,0.1803921568627451,1);const float e10=0.67;const vec4 v10=vec4(1,0.47058823529411764,0.13333333333333333,1);const float e11=0.73;const vec4 v11=vec4(1,0.615686274509804,0.1450980392156863,1);const float e12=0.8;const vec4 v12=vec4(0.9450980392156862,0.7490196078431373,0.2235294117647059,1);const float e13=0.87;const vec4 v13=vec4(0.8784313725490196,0.8627450980392157,0.36470588235294116,1);const float e14=0.93;const vec4 v14=vec4(0.8549019607843137,0.9450980392156862,0.5568627450980392,1);const float e15=1.0;const vec4 v15=vec4(0.8901960784313725,0.9921568627450981,0.7764705882352941,1);float a0=smoothstep(e0,e1,x_37);float a1=smoothstep(e1,e2,x_37);float a2=smoothstep(e2,e3,x_37);float a3=smoothstep(e3,e4,x_37);float a4=smoothstep(e4,e5,x_37);float a5=smoothstep(e5,e6,x_37);float a6=smoothstep(e6,e7,x_37);float a7=smoothstep(e7,e8,x_37);float a8=smoothstep(e8,e9,x_37);float a9=smoothstep(e9,e10,x_37);float a10=smoothstep(e10,e11,x_37);float a11=smoothstep(e11,e12,x_37);float a12=smoothstep(e12,e13,x_37);float a13=smoothstep(e13,e14,x_37);float a14=smoothstep(e14,e15,x_37);return max(mix(v0,v1,a0)*step(e0,x_37)*step(x_37,e1),max(mix(v1,v2,a1)*step(e1,x_37)*step(x_37,e2),max(mix(v2,v3,a2)*step(e2,x_37)*step(x_37,e3),max(mix(v3,v4,a3)*step(e3,x_37)*step(x_37,e4),max(mix(v4,v5,a4)*step(e4,x_37)*step(x_37,e5),max(mix(v5,v6,a5)*step(e5,x_37)*step(x_37,e6),max(mix(v6,v7,a6)*step(e6,x_37)*step(x_37,e7),max(mix(v7,v8,a7)*step(e7,x_37)*step(x_37,e8),max(mix(v8,v9,a8)*step(e8,x_37)*step(x_37,e9),max(mix(v9,v10,a9)*step(e9,x_37)*step(x_37,e10),max(mix(v10,v11,a10)*step(e10,x_37)*step(x_37,e11),max(mix(v11,v12,a11)*step(e11,x_37)*step(x_37,e12),max(mix(v12,v13,a12)*step(e12,x_37)*step(x_37,e13),max(mix(v13,v14,a13)*step(e13,x_37)*step(x_37,e14),mix(v14,v15,a14)*step(e14,x_37)*step(x_37,e15)))))))))))))));}vec3 hsv_to_rgb(vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}vec3 rgb_to_hsv(vec3 rgb){float Cmax=max(rgb.r,max(rgb.g,rgb.b));float Cmin=min(rgb.r,min(rgb.g,rgb.b));float delta=Cmax-Cmin;vec3 hsv=vec3(0.,0.,Cmax);if(Cmax>Cmin){hsv.y=delta/Cmax;if(rgb.r==Cmax){hsv.x=(rgb.g-rgb.b)/delta;}else{if(rgb.g==Cmax){hsv.x=2.+(rgb.b-rgb.r)/delta;}else{hsv.x=4.+(rgb.r-rgb.g)/delta;}}hsv.x=fract(hsv.x/6.);}return hsv;}float sample_and_apply_sliders(SAMPLER_TYPE channel,vec2 vTexCoord,vec2 sliderValues){float fragIntensity=float(texture(channel,vTexCoord).r);float slidersAppliedToIntensity=(fragIntensity-sliderValues[0])/max(0.0005,(sliderValues[1]-sliderValues[0]));return max(0.0,slidersAppliedToIntensity);}vec3 process_channel_intensity(float intensity,vec3 colorValues,int channelIndex,bool inLensAndUseLens,int lensSelection){float useColorValue=float(int((inLensAndUseLens&&channelIndex==lensSelection)||(!inLensAndUseLens)));vec3 hsvCombo=rgb_to_hsv(max(vec3(colorValues),(1.0-useColorValue)*vec3(255,255,255)));hsvCombo=vec3(hsvCombo.xy,max(0.0,intensity));return hsv_to_rgb(hsvCombo);}vec4 apply_opacity(vec3 color,bool useTransparentColor,vec3 transparentColor,float opacity){return vec4(color,(color==transparentColor&&useTransparentColor)? 0.0 : opacity);}vec4 colormap(float intensity,float opacity,bool useTransparentColor){return apply_opacity(COLORMAP_FUNCTION(min(1.0,intensity)).xyz,useTransparentColor,COLORMAP_FUNCTION(0.0).xyz,opacity);}"},dn={name:"lens-module",defines:{SAMPLER_TYPE:"usampler2D"},fs:"#define GLSLIFY 1\nbool frag_in_lens_bounds(vec2 lensCenter,vec2 vTexCoord,float majorLensAxis,float minorLensAxis,float lensBorderRadius){return pow((lensCenter.x-vTexCoord.x)/majorLensAxis,2.0)+pow((lensCenter.y-vTexCoord.y)/minorLensAxis,2.0)<(1.0-lensBorderRadius);}bool frag_on_lens_bounds(vec2 lensCenter,vec2 vTexCoord,float majorLensAxis,float minorLensAxis,float lensBorderRadius){float ellipseDistance=pow((lensCenter.x-vTexCoord.x)/majorLensAxis,2.0)+pow((lensCenter.y-vTexCoord.y)/minorLensAxis,2.0);return ellipseDistance<=1.0&&ellipseDistance>=(1.0-lensBorderRadius);}"},In=[0,0,0],pn=6,Cn={"<u1":{format:R.default.R8UI,dataFormat:R.default.RED_INTEGER,type:R.default.UNSIGNED_BYTE,max:Math.pow(2,8)-1,TypedArray:Uint8Array},"<u2":{format:R.default.R16UI,dataFormat:R.default.RED_INTEGER,type:R.default.UNSIGNED_SHORT,max:Math.pow(2,16)-1,TypedArray:Uint16Array},"<u4":{format:R.default.R32UI,dataFormat:R.default.RED_INTEGER,type:R.default.UNSIGNED_INT,max:Math.pow(2,32)-1,TypedArray:Uint32Array},"<f4":{format:R.default.R32F,dataFormat:R.default.RED,type:R.default.FLOAT,max:3.4*Math.pow(10,38),TypedArray:Float32Array}};function yn(t){return Object(I.a)(Array(t).keys())}function vn(t,e,n){for(var r=0;r<n;r+=1)t.push(e);return t}function Bn(t){return t.map((function(t){return new Float32Array(t)}))}function mn(t){var e=t.props,n=e.viewportId,r=e.lensRadius;if(n){var i=t.context.mousePosition,o=t.context.deck.viewManager.views.filter((function(t){return t.id===n}))[0],a=t.context.deck.viewManager.viewState[n],A=o.makeViewport(Object(d.a)({},a,{viewState:a}));if(i&&A.containsPixel(i)){var s={x:i.x-A.x,y:i.y-A.y},c=[[s.x-r,s.y],[s.x,s.y+r],[s.x+r,s.y],[s.x,s.y-r]].map((function(t,e){return A.unproject(t)[e%2]}));t.setState({unprojectLensBounds:c})}else t.setState({unprojectLensBounds:[0,0,0,0]})}else t.setState({unprojectLensBounds:[0,0,0,0]})}function bn(t){for(var e=void 0,n=t[0],r=1;r<t.length;){var i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=n).call.apply(t,[e].concat(i))})),e=void 0)}return n}var En=[{fs:"#define SHADER_NAME xr-layer-fragment-shader\nprecision highp float;\n#define GLSLIFY 1\nuniform sampler2D channel0;uniform sampler2D channel1;uniform sampler2D channel2;uniform sampler2D channel3;uniform sampler2D channel4;uniform sampler2D channel5;uniform vec2 sliderValues[6];uniform vec3 colorValues[6];uniform float intensityArray[6];uniform float opacity;uniform float majorLensAxis;uniform float minorLensAxis;uniform vec2 lensCenter;uniform bool isLensOn;uniform int lensSelection;uniform vec3 lensBorderColor;uniform float lensBorderRadius;uniform vec3 transparentColor;uniform bool useTransparentColor;varying vec2 vTexCoord;void main(){float intensityValue0=sample_and_apply_sliders(channel0,vTexCoord,sliderValues[0]);float intensityValue1=sample_and_apply_sliders(channel1,vTexCoord,sliderValues[1]);float intensityValue2=sample_and_apply_sliders(channel2,vTexCoord,sliderValues[2]);float intensityValue3=sample_and_apply_sliders(channel3,vTexCoord,sliderValues[3]);float intensityValue4=sample_and_apply_sliders(channel4,vTexCoord,sliderValues[4]);float intensityValue5=sample_and_apply_sliders(channel5,vTexCoord,sliderValues[5]);bool isFragInLensBounds=frag_in_lens_bounds(lensCenter,vTexCoord,majorLensAxis,minorLensAxis,lensBorderRadius);bool isFragOnLensBounds=frag_on_lens_bounds(lensCenter,vTexCoord,majorLensAxis,minorLensAxis,lensBorderRadius);bool inLensAndUseLens=isLensOn&&isFragInLensBounds;vec3 rgbCombo=process_channel_intensity(intensityValue0,colorValues[0],0,inLensAndUseLens,lensSelection);rgbCombo+=process_channel_intensity(intensityValue1,colorValues[1],1,inLensAndUseLens,lensSelection);rgbCombo+=process_channel_intensity(intensityValue2,colorValues[2],2,inLensAndUseLens,lensSelection);rgbCombo+=process_channel_intensity(intensityValue3,colorValues[3],3,inLensAndUseLens,lensSelection);rgbCombo+=process_channel_intensity(intensityValue4,colorValues[4],4,inLensAndUseLens,lensSelection);rgbCombo+=process_channel_intensity(intensityValue5,colorValues[5],5,inLensAndUseLens,lensSelection);rgbCombo=(isLensOn&&isFragOnLensBounds)? lensBorderColor : rgbCombo;gl_FragColor=apply_opacity(rgbCombo,useTransparentColor,transparentColor,opacity);geometry.uv=vTexCoord;DECKGL_FILTER_COLOR(gl_FragColor,geometry);}",fscmap:"#define SHADER_NAME xr-layer-fragment-shader-colormap\nprecision highp float;\n#define GLSLIFY 1\nuniform sampler2D channel0;uniform sampler2D channel1;uniform sampler2D channel2;uniform sampler2D channel3;uniform sampler2D channel4;uniform sampler2D channel5;uniform vec2 sliderValues[6];uniform float opacity;uniform float divisor;uniform bool useTransparentColor;varying vec2 vTexCoord;void main(){float intensityValue0=sample_and_apply_sliders(channel0,vTexCoord,sliderValues[0]);float intensityValue1=sample_and_apply_sliders(channel1,vTexCoord,sliderValues[1]);float intensityValue2=sample_and_apply_sliders(channel2,vTexCoord,sliderValues[2]);float intensityValue3=sample_and_apply_sliders(channel3,vTexCoord,sliderValues[3]);float intensityValue4=sample_and_apply_sliders(channel4,vTexCoord,sliderValues[4]);float intensityValue5=sample_and_apply_sliders(channel5,vTexCoord,sliderValues[5]);float intensityCombo=0.0;intensityCombo+=max(0.0,intensityValue0);intensityCombo+=max(0.0,intensityValue1);intensityCombo+=max(0.0,intensityValue2);intensityCombo+=max(0.0,intensityValue3);intensityCombo+=max(0.0,intensityValue4);intensityCombo+=max(0.0,intensityValue5);gl_FragColor=colormap(intensityCombo,opacity,useTransparentColor);geometry.uv=vTexCoord;DECKGL_FILTER_COLOR(gl_FragColor,geometry);}",vs:"#define GLSLIFY 1\n#define SHADER_NAME xr-layer-vertex-shader\nattribute vec2 texCoords;attribute vec3 positions;attribute vec3 positions64Low;attribute vec3 instancePickingColors;varying vec2 vTexCoord;void main(void){geometry.worldPosition=positions;geometry.uv=texCoords;geometry.pickingColor=instancePickingColors;gl_Position=project_position_to_clipspace(positions,positions64Low,vec3(0.0),geometry.position);DECKGL_FILTER_GL_POSITION(gl_Position,geometry);vTexCoord=texCoords;vec4 color=vec4(0.0);DECKGL_FILTER_COLOR(color,geometry);}"},{fs:"#version 300 es\n#define SHADER_NAME xr-layer-fragment-shader\nprecision highp float;precision highp int;precision highp SAMPLER_TYPE;\n#define GLSLIFY 1\nuniform SAMPLER_TYPE channel0;uniform SAMPLER_TYPE channel1;uniform SAMPLER_TYPE channel2;uniform SAMPLER_TYPE channel3;uniform SAMPLER_TYPE channel4;uniform SAMPLER_TYPE channel5;uniform vec2 sliderValues[6];uniform vec3 colorValues[6];uniform float opacity;uniform float majorLensAxis;uniform float minorLensAxis;uniform vec2 lensCenter;uniform bool isLensOn;uniform int lensSelection;uniform vec3 lensBorderColor;uniform float lensBorderRadius;uniform vec3 transparentColor;uniform bool useTransparentColor;in vec2 vTexCoord;out vec4 color;void main(){float intensityValue0=sample_and_apply_sliders(channel0,vTexCoord,sliderValues[0]);float intensityValue1=sample_and_apply_sliders(channel1,vTexCoord,sliderValues[1]);float intensityValue2=sample_and_apply_sliders(channel2,vTexCoord,sliderValues[2]);float intensityValue3=sample_and_apply_sliders(channel3,vTexCoord,sliderValues[3]);float intensityValue4=sample_and_apply_sliders(channel4,vTexCoord,sliderValues[4]);float intensityValue5=sample_and_apply_sliders(channel5,vTexCoord,sliderValues[5]);float intensityArray[6]=float[6](intensityValue0,intensityValue1,intensityValue2,intensityValue3,intensityValue4,intensityValue5);bool isFragInLensBounds=frag_in_lens_bounds(lensCenter,vTexCoord,majorLensAxis,minorLensAxis,lensBorderRadius);bool isFragOnLensBounds=frag_on_lens_bounds(lensCenter,vTexCoord,majorLensAxis,minorLensAxis,lensBorderRadius);bool inLensAndUseLens=isLensOn&&isFragInLensBounds;vec3 rgbCombo=vec3(0.0);for(int i=0;i<6;i++){rgbCombo+=process_channel_intensity(intensityArray[i],colorValues[i],i,inLensAndUseLens,lensSelection);}rgbCombo=(isLensOn&&isFragOnLensBounds)? lensBorderColor : rgbCombo;color=apply_opacity(rgbCombo,useTransparentColor,transparentColor,opacity);geometry.uv=vTexCoord;DECKGL_FILTER_COLOR(color,geometry);}",fscmap:"#version 300 es\n#define SHADER_NAME xr-layer-fragment-shader\nprecision highp float;precision highp int;precision highp SAMPLER_TYPE;\n#define GLSLIFY 1\nuniform SAMPLER_TYPE channel0;uniform SAMPLER_TYPE channel1;uniform SAMPLER_TYPE channel2;uniform SAMPLER_TYPE channel3;uniform SAMPLER_TYPE channel4;uniform SAMPLER_TYPE channel5;uniform vec2 sliderValues[6];uniform float opacity;uniform bool useTransparentColor;in vec2 vTexCoord;out vec4 color;void main(){float intensityValue0=sample_and_apply_sliders(channel0,vTexCoord,sliderValues[0]);float intensityValue1=sample_and_apply_sliders(channel1,vTexCoord,sliderValues[1]);float intensityValue2=sample_and_apply_sliders(channel2,vTexCoord,sliderValues[2]);float intensityValue3=sample_and_apply_sliders(channel3,vTexCoord,sliderValues[3]);float intensityValue4=sample_and_apply_sliders(channel4,vTexCoord,sliderValues[4]);float intensityValue5=sample_and_apply_sliders(channel5,vTexCoord,sliderValues[5]);float intensityArray[6]=float[6](intensityValue0,intensityValue1,intensityValue2,intensityValue3,intensityValue4,intensityValue5);float intensityCombo=0.0;for(int i=0;i<6;i++){intensityCombo+=max(0.0,intensityArray[i]);}color=colormap(intensityCombo,opacity,useTransparentColor);geometry.uv=vTexCoord;DECKGL_FILTER_COLOR(color,geometry);}",vs:"#version 300 es\n#define GLSLIFY 1\n#define SHADER_NAME xr-layer-vertex-shader\nin vec2 texCoords;in vec3 positions;in vec3 positions64Low;in vec3 instancePickingColors;out vec2 vTexCoord;void main(void){geometry.worldPosition=positions;geometry.uv=texCoords;geometry.pickingColor=instancePickingColors;gl_Position=project_position_to_clipspace(positions,positions64Low,vec3(0.0),geometry.position);DECKGL_FILTER_GL_POSITION(gl_Position,geometry);vTexCoord=texCoords;vec4 color=vec4(0.0);DECKGL_FILTER_COLOR(color,geometry);}"}];var Qn={pickable:!0,coordinateSystem:y.a.CARTESIAN,channelData:{type:"object",value:{},compare:!0},bounds:{type:"array",value:[0,0,1,1],compare:!0},colorValues:{type:"array",value:[],compare:!0},sliderValues:{type:"array",value:[],compare:!0},channelIsOn:{type:"array",value:[],compare:!0},opacity:{type:"number",value:1,compare:!0},dtype:{type:"string",value:"<u2",compare:!0},colormap:{type:"string",value:"",compare:!0},isLensOn:{type:"boolean",value:!1,compare:!0},lensSelection:{type:"number",value:0,compare:!0},lensBorderColor:{type:"array",value:[255,255,255],compare:!0},lensBorderRadius:{type:"number",value:.02,compare:!0},unprojectLensBounds:{type:"array",value:[0,0,0,0],compare:!0},transparentColor:{type:"array",value:null,compare:!0}},Fn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"getShaders",value:function(){var t=function(t,e){var n=t.colormap,r=t.dtype,i=!Object(E.g)(e),o=i?En[0]:En[1];return{fs:n?o.fscmap:o.fs,vs:o.vs,defines:{SAMPLER_TYPE:"<f4"===r||i?"sampler2D":"usampler2D",COLORMAP_FUNCTION:n||"viridis"},modules:[p.a,C.a,hn,dn]}}(this.props,this.context.gl);return Object(g.a)(Object(l.a)(n.prototype),"getShaders",this).call(this,t)}},{key:"initializeState",value:function(){var t=this.context.gl;t.pixelStorei(R.default.UNPACK_ALIGNMENT,1),t.pixelStorei(R.default.PACK_ALIGNMENT,1),this.getAttributeManager().add({positions:{size:3,type:R.default.DOUBLE,fp64:this.use64bitPositions(),update:this.calculatePositions,noAlloc:!0}}),this.setState({numInstances:1,positions:new Float64Array(12)})}},{key:"finalizeState",value:function(){Object(g.a)(Object(l.a)(n.prototype),"finalizeState",this).call(this),this.state.textures&&Object.values(this.state.textures).forEach((function(t){return t&&t.delete()}))}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps;if(t.changeFlags.extensionsChanged||e.colormap!==n.colormap){var r=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(r)}),this.getAttributeManager().invalidateAll()}e.channelData!==n.channelData&&bn([e,"access",function(t){return t.channelData},"optionalAccess",function(t){return t.data}])!==bn([n,"access",function(t){return t.channelData},"optionalAccess",function(t){return t.data}])&&this.loadChannelTextures(e.channelData);var i=this.getAttributeManager();e.bounds!==n.bounds&&i.invalidate("positions")}},{key:"_getModel",value:function(t){return t?new Q.a(t,Object(d.a)({},this.getShaders(),{id:this.props.id,geometry:new F.a({drawMode:R.default.TRIANGLE_FAN,vertexCount:4,attributes:{texCoords:new Float32Array([0,1,0,0,1,0,1,1])}}),isInstanced:!1})):null}},{key:"calculatePositions",value:function(t){var e=this.state.positions,n=this.props.bounds;e[0]=n[0],e[1]=n[1],e[2]=0,e[3]=n[0],e[4]=n[3],e[5]=0,e[6]=n[2],e[7]=n[3],e[8]=0,e[9]=n[2],e[10]=n[1],e[11]=0,t.value=e}},{key:"draw",value:function(t){var e=t.uniforms,n=this.state,r=n.textures,i=n.model;if(r&&i){var o=this.props,a=o.sliderValues,A=o.colorValues,c=o.opacity,u=o.domain,l=o.dtype,g=o.channelIsOn,f=o.unprojectLensBounds,h=o.bounds,I=o.isLensOn,p=o.lensSelection,C=o.lensBorderColor,y=o.lensBorderRadius,v=o.transparentColor,B=Object.values(r).filter((function(t){return t})).length,m=function(t){var e=t.sliderValues,n=t.colorValues,r=t.channelIsOn,i=t.domain,o=t.dtype,a=[e.length,n.length];if(a.every((function(t){return t!==a[0]})))throw Error("Inconsistent number of slider values and colors provided");var A=n.map((function(t,e){return r[e]?t.map((function(t){return t/255})):In})),s=i&&i[1]||Cn[o].max,c=e.map((function(t,e){return r[e]?t:[s,s]})),u=pn-A.length;if(u<0)throw Error("".concat(a," channels passed in, but only 6 are allowed."));var l=vn(A,In,u);return{paddedSliderValues:vn(c,[s,s],u).reduce((function(t,e){return t.concat(e)}),[]),paddedColorValues:l.reduce((function(t,e){return t.concat(e)}),[])}}({sliderValues:a.slice(0,B),colorValues:A.slice(0,B),channelIsOn:g.slice(0,B),domain:u,dtype:l}),b=m.paddedSliderValues,E=m.paddedColorValues,Q=Object(s.a)(f,4),F=Q[0],w=Q[1],S=Q[2],R=Q[3],U=Object(s.a)(h,4),x=U[0],k=U[1],O=U[2],N=U[3],D=(F-x)/(O-x),G=(w-N)/(k-N),_=(S-x)/(O-x),M=(R-N)/(k-N);i.setUniforms(Object(d.a)({},e,{colorValues:E,sliderValues:b,opacity:c,majorLensAxis:(_-D)/2,minorLensAxis:(G-M)/2,lensCenter:[(_+D)/2,(G+M)/2],isLensOn:I,lensSelection:p,lensBorderColor:C,lensBorderRadius:y,transparentColor:(v||[0,0,0]).map((function(t){return t/255})),useTransparentColor:Boolean(v)},r)).draw()}}},{key:"loadChannelTextures",value:function(t){var e=this,n={channel0:null,channel1:null,channel2:null,channel3:null,channel4:null,channel5:null};this.state.textures&&Object.values(this.state.textures).forEach((function(t){return t&&t.delete()})),t&&Object.keys(t).length>0&&t.data&&(t.data.forEach((function(r,i){n["channel".concat(i)]=e.dataToTexture(r,t.width,t.height)}),this),this.setState({textures:n}))}},{key:"dataToTexture",value:function(t,e,n){var r,i=this.context.gl,o=!Object(E.g)(i),a=this.props.dtype,s=Cn[a],c=s.format,u=s.dataFormat,l=s.type;return new w.a(this.context.gl,{width:e,height:n,data:t,mipmaps:!1,parameters:(r={},Object(A.a)(r,R.default.TEXTURE_MIN_FILTER,R.default.NEAREST),Object(A.a)(r,R.default.TEXTURE_MAG_FILTER,R.default.NEAREST),Object(A.a)(r,R.default.TEXTURE_WRAP_S,R.default.CLAMP_TO_EDGE),Object(A.a)(r,R.default.TEXTURE_WRAP_T,R.default.CLAMP_TO_EDGE),r),format:o?R.default.LUMINANCE:c,dataFormat:o?R.default.LUMINANCE:u,type:o?R.default.FLOAT:l})}}]),n}(v.a);Fn.layerName="XRLayer",Fn.defaultProps=Qn;var wn={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},Sn=Object(d.a)({},x.a.defaultProps,{pickable:!0,coordinateSystem:y.a.CARTESIAN,bounds:{type:"array",value:[0,0,1,1],compare:!0},opacity:{type:"number",value:1,compare:!0}}),Rn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"_getModel",value:function(t){var e=this.props,n=function(t,e){var n=e?"true":"false",r="vec3(".concat((e||[0,0,0]).map((function(t){return String(t/255)})).join(","),")");switch(t){case wn.RGB:return"color[3] = (".concat(n," && (color.rgb == ").concat(r,")) ? 0.0 : color.a;");case wn.WhiteIsZero:return"          float value = 1.0 - (color.r / 256.0);\n          color = vec4(value, value, value, (".concat(n," && vec3(value, value, value) == ").concat(r,") ? 0.0 : color.a);\n        ");case wn.BlackIsZero:return"          float value = (color.r / 256.0);\n          color = vec4(value, value, value, (".concat(n," && vec3(value, value, value) == ").concat(r,") ? 0.0 : color.a);\n        ");case wn.YCbCr:return"          float y = color[0];\n          float cb = color[1];\n          float cr = color[2];\n          color[0] = (y + (1.40200 * (cr - .5)));\n          color[1] = (y - (0.34414 * (cb - .5)) - (0.71414 * (cr - .5)));\n          color[2] = (y + (1.77200 * (cb - .5)));\n          color[3] = (".concat(n," && distance(color.rgb, ").concat(r,") < 0.01) ? 0.0 : color.a;\n        ");default:return console.error("Unsupported photometric interpretation or none provided.  No transformation will be done to image data"),""}}(e.photometricInterpretation,e.tansparentColorInHook);return t?new Q.a(t,Object(d.a)({},this.getShaders(),{id:this.props.id,geometry:new F.a({drawMode:R.default.TRIANGLES,vertexCount:6}),isInstanced:!1,inject:{"fs:DECKGL_FILTER_COLOR":n}})):null}}]),n}(x.a),Un=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"initializeState",value:function(t){var e=this.context.gl;e.pixelStorei(R.default.UNPACK_ALIGNMENT,1),e.pixelStorei(R.default.PACK_ALIGNMENT,1),Object(g.a)(Object(l.a)(n.prototype),"initializeState",this).call(this,t)}},{key:"renderLayers",value:function(){var t=this.props,e=t.photometricInterpretation,n=t.transparentColor,r=function(t){switch(t){case wn.RGB:return[0,0,0,0];case wn.WhiteIsZero:return[255,255,255,0];case wn.BlackIsZero:return[0,0,0,0];case wn.YCbCr:return[16,128,128,0];default:return console.error("Unsupported photometric interpretation or none provided.  No transformation will be done to image data"),[0,0,0,0]}}(e);return new Rn(this.props,{transparentColor:r,tansparentColorInHook:n,id:"".concat(this.props.id,"-wrapped")})}}]),n}(B.a);Un.layerName="BitmapLayer",Un.PHOTOMETRIC_INTERPRETATIONS=wn,Un.defaultProps=Object(d.a)({},Sn,{image:{type:"object",value:{},compare:!0}}),Rn.defaultProps=Sn,Rn.layerName="BitmapLayerWrapper";var xn={pickable:!0,coordinateSystem:y.a.CARTESIAN,sliderValues:{type:"array",value:[],compare:!0},colorValues:{type:"array",value:[],compare:!0},channelIsOn:{type:"array",value:[],compare:!0},minZoom:{type:"number",value:0,compare:!0},maxZoom:{type:"number",value:0,compare:!0},renderSubLayers:{type:"function",value:function(t){var e=t.tile,n=e.bbox,r=n.left,i=n.top,o=n.right,a=n.bottom,A=e.x,s=e.y,c=e.z,u=t.colorValues,l=t.sliderValues,g=t.channelIsOn,f=t.visible,h=t.opacity,d=t.data,I=t.colormap,p=t.dtype,C=t.id,y=t.onHover,v=t.pickable,B=t.unprojectLensBounds,m=t.isLensOn,b=t.lensSelection,E=t.onClick,Q=t.loader,F=t.modelMatrix;if([r,a,o,i].some((function(t){return t<0}))||!d)return null;var w=Q.getRasterSize({z:0}),S=w.height,R=w.width,U=[r,d.height<Q.tileSize?S:a,d.width<Q.tileSize?R:o,i],x=Q.isRgb,k=Q.isInterleaved,O=Q.photometricInterpretation;return x&&k?new Un(t,{image:d,photometricInterpretation:O,bounds:U,id:"tile-sub-layer-".concat(U,"-").concat(C),tileId:{x:A,y:s,z:c},onHover:y,pickable:v,onClick:E,modelMatrix:F,opacity:h,visible:f}):new Fn(t,{channelData:d,data:null,sliderValues:l,colorValues:u,channelIsOn:g,dtype:p,colormap:I,unprojectLensBounds:B,isLensOn:m,lensSelection:b,bounds:U,id:"tile-sub-layer-".concat(U,"-").concat(C),tileId:{x:A,y:s,z:c},onHover:y,pickable:v,onClick:E,modelMatrix:F,opacity:h,visible:f})},compare:!1},opacity:{type:"number",value:1,compare:!0},colormap:{type:"string",value:"",compare:!0},dtype:{type:"string",value:"<u2",compare:!0},domain:{type:"array",value:[],compare:!0},viewportId:{type:"string",value:"",compare:!0},unprojectLensBounds:{type:"array",value:[0,0,0,0],compare:!0},isLensOn:{type:"boolean",value:!1,compare:!0},lensSelection:{type:"number",value:0,compare:!0},lensRadius:{type:"number",value:100,compare:!0},lensBorderColor:{type:"array",value:[255,255,255],compare:!0},lensBorderRadius:{type:"number",value:.02,compare:!0},transparentColor:{type:"array",value:null,compare:!0}},kn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"_updateTileset",value:function(){this.props.viewportId||Object(g.a)(Object(l.a)(n.prototype),"_updateTileset",this).call(this),(this.props.viewportId&&this.context.viewport.id===this.props.viewportId||!this.state.tileset._viewport)&&Object(g.a)(Object(l.a)(n.prototype),"_updateTileset",this).call(this)}}]),n}(U.a);kn.layerName="MultiscaleImageLayerBase",kn.defaultProps=xn;var On={pickable:!0,coordinateSystem:y.a.CARTESIAN,sliderValues:{type:"array",value:[],compare:!0},channelIsOn:{type:"array",value:[],compare:!0},colorValues:{type:"array",value:[],compare:!0},loaderSelection:{type:"array",value:[],compare:!0},colormap:{type:"string",value:"",compare:!0},domain:{type:"array",value:[],compare:!0},viewportId:{type:"string",value:"",compare:!0},loader:{type:"object",value:{getRaster:function(){var t=Object(a.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:[],height:0,width:0});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),dtype:"<u2"},compare:!0},z:{type:"number",value:0,compare:!0},isLensOn:{type:"boolean",value:!1,compare:!0},lensSelection:{type:"number",value:0,compare:!0},lensRadius:{type:"number",value:100,compare:!0},lensBorderColor:{type:"array",value:[255,255,255],compare:!0},lensBorderRadius:{type:"number",value:.02,compare:!0},onClick:{type:"function",value:null,compare:!0},transparentColor:{type:"array",value:null,compare:!0}},Nn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"initializeState",value:function(){var t=this;this.state={unprojectLensBounds:[0,0,0,0],width:0,height:0,data:[]},this.context.deck&&this.context.deck.eventManager.on({pointermove:function(){return mn(t)},pointerleave:function(){return mn(t)},wheel:function(){return mn(t)}})}},{key:"updateState",value:function(t){var e=this,n=t.changeFlags,r=t.props,i=t.oldProps,o=n.propsChanged,a="string"===typeof o&&o.includes("props.loader"),A=r.loaderSelection!==i.loaderSelection;if(a||A){var s=this.props,c=s.loader,u=s.z,l=s.loaderSelection;c.getRaster({z:u,loaderSelection:l}).then((function(t){c.isInterleaved&&c.isRgb?(t.data=t.data[0],t.data.length===t.width*t.height*3&&(t.format=R.default.RGB,t.dataFormat=R.default.RGB)):Object(E.g)(e.context.gl)||(t.data=Bn(t.data)),e.setState(Object(d.a)({},t))}))}}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.sourceLayer;return e.sourceLayer=n,e.tile=n.props.tile,e}},{key:"renderLayers",value:function(){var t=this.props,e=t.loader,n=t.visible,r=t.opacity,i=t.colormap,o=t.sliderValues,a=t.colorValues,A=t.channelIsOn,s=t.z,c=t.domain,u=t.pickable,l=t.isLensOn,g=t.lensSelection,f=t.lensBorderColor,h=t.lensRadius,d=t.id,I=t.onClick,p=t.onHover,C=t.modelMatrix,y=t.transparentColor,v=e.dtype,B=this.state,m=B.width,b=B.height,E=B.data,Q=B.unprojectLensBounds;if(!m||!b)return null;var F=[0,b,m,0],w=e.isRgb,S=e.isInterleaved,R=e.photometricInterpretation;return w&&S?new Un(this.props,{image:this.state,photometricInterpretation:R,bounds:F,id:"image-sub-layer-".concat(F,"-").concat(d,"-").concat(s),onHover:p,pickable:u,onClick:I,modelMatrix:C,opacity:r,visible:n}):new Fn(this.props,{channelData:{data:E,height:b,width:m},sliderValues:o,colorValues:a,channelIsOn:A,domain:c,dtype:v,colormap:i,unprojectLensBounds:Q,isLensOn:l,lensSelection:g,lensBorderColor:f,lensRadius:h,bounds:F,id:"image-sub-layer-".concat(F,"-").concat(d,"-").concat(s),onHover:p,pickable:u,onClick:I,modelMatrix:C,opacity:r,visible:n,transparentColor:y})}}]),n}(B.a);Nn.layerName="ImageLayer",Nn.defaultProps=On;var Dn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"initializeState",value:function(){var t=this;this.state={unprojectLensBounds:[0,0,0,0]},this.context.deck&&this.context.deck.eventManager.on({pointermove:function(){return mn(t)},pointerleave:function(){return mn(t)},wheel:function(){return mn(t)}})}},{key:"renderLayers",value:function(){var t=this.props,e=t.loader,n=t.sliderValues,r=t.colorValues,i=t.channelIsOn,A=t.loaderSelection,s=t.domain,c=t.opacity,u=t.colormap,l=t.viewportId,g=t.onTileError,f=t.onHover,h=t.pickable,d=t.id,I=t.isLensOn,p=t.lensSelection,C=t.lensBorderColor,y=t.lensBorderRadius,v=t.maxRequests,B=t.onClick,m=t.modelMatrix,b=t.transparentColor,Q=t.excludeBackground,F=t.onViewportLoad,w=t.refinementStrategy,U=e.tileSize,x=e.numLevels,k=e.dtype,O=e.isInterleaved,N=e.isRgb,D=this.state.unprojectLensBounds,G=Math.log2(512/U),_=!Object(E.g)(this.context.gl),M=function(){var t=Object(a.a)(o.a.mark((function t(n){var r,i,a,s,c;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.x,i=n.y,a=n.z,s=n.signal,t.next=3,e.getTile({x:r,y:i,z:Math.round(-a+G),loaderSelection:A,signal:s});case 3:if(c=t.sent,!O||!N){t.next=8;break}return c.data=c.data[0],c.data.length===c.width*c.height*3&&(c.format=R.default.RGB,c.dataFormat=R.default.RGB),t.abrupt("return",c);case 8:return _&&(c.data=Bn(c.data)),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),T=e.getRasterSize({z:0}),j=T.height,L=T.width,V=new kn(this.props,{id:"Tiled-Image-".concat(d),getTileData:M,dtype:k,tileSize:m?U*(1/m.getScale()[0]):U,onClick:B,extent:[0,0,L,j],minZoom:Math.round(-(x-1)+G),maxZoom:Math.round(G),colorValues:r,sliderValues:n,channelIsOn:i,maxRequests:v,domain:s,refinementStrategy:w||(1===c?"best-available":"no-overlap"),updateTriggers:{getTileData:[e,A]},onTileError:g||e.onTileError,opacity:c,colormap:u,viewportId:l,onHover:f,pickable:h,unprojectLensBounds:D,isLensOn:I,lensSelection:p,lensBorderColor:C,lensBorderRadius:y,modelMatrix:m,transparentColor:b,onViewportLoad:F}),Z="function"===typeof e.getRaster,P=m?m.clone():new S.a;return[Z&&!Q&&new Nn(this.props,{id:"Background-Image-".concat(d),modelMatrix:P.scale(Math.pow(2,x-1)),visible:1===c&&(!l||this.context.viewport.id===l)&&!b,z:x-1,pickable:!0,onHover:f,onClick:B}),V]}}]),n}(B.a);Dn.layerName="MultiscaleImageLayer",Dn.defaultProps={pickable:!0,onHover:{type:"function",value:null,compare:!1},sliderValues:{type:"array",value:[],compare:!0},colorValues:{type:"array",value:[],compare:!0},channelIsOn:{type:"array",value:[],compare:!0},opacity:{type:"number",value:1,compare:!0},colormap:{type:"string",value:"",compare:!0},domain:{type:"array",value:[],compare:!0},viewportId:{type:"string",value:"",compare:!0},isLensOn:{type:"boolean",value:!1,compare:!0},lensSelection:{type:"number",value:0,compare:!0},lensRadius:{type:"number",value:100,compare:!0},lensBorderColor:{type:"array",value:[255,255,255],compare:!0},lensBorderRadius:{type:"number",value:.02,compare:!0},maxRequests:{type:"number",value:10,compare:!0},onClick:{type:"function",value:null,compare:!0},transparentColor:{type:"array",value:null,compare:!0},refinementStrategy:{type:"string",value:null,compare:!0},excludeBackground:{type:"boolean",value:!1,compare:!0}};var Gn={pickable:!0,loader:{type:"object",value:{getRaster:function(){var t=Object(a.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:[],height:0,width:0});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),getRasterSize:function(){return{height:0,width:0}},dtype:"<u2"},compare:!0},id:{type:"string",value:"",compare:!0},boundingBox:{type:"array",value:[[0,0],[0,1],[1,1],[1,0]],compare:!0},boundingBoxColor:{type:"array",value:[255,0,0],compare:!0},boundingBoxOutlineWidth:{type:"number",value:1,compare:!0},viewportOutlineColor:{type:"array",value:[255,190,0],compare:!0},viewportOutlineWidth:{type:"number",value:2,compare:!0},overviewScale:{type:"number",value:1,compare:!0},zoom:{type:"number",value:1,compare:!0}},_n=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"renderLayers",value:function(){var t=this.props,e=t.loader,n=t.id,r=t.zoom,i=t.boundingBox,o=t.boundingBoxColor,a=t.boundingBoxOutlineWidth,A=t.viewportOutlineColor,s=t.viewportOutlineWidth,c=t.overviewScale,u=e.numLevels,l=e.getRasterSize({z:0}),g=l.width,f=l.height;return[new Nn(this.props,{id:"viewport-".concat(n),modelMatrix:(new S.a).scale(Math.pow(2,u-1)*c),z:u-1}),new k.a({id:"bounding-box-overview-".concat(n),coordinateSystem:y.a.CARTESIAN,data:[i],getPolygon:function(t){return t},filled:!1,stroked:!0,getLineColor:o,getLineWidth:a*Math.pow(2,r)}),new k.a({id:"viewport-outline-".concat(n),coordinateSystem:y.a.CARTESIAN,data:[[[0,0],[g*c,0],[g*c,f*c],[0,f*c]]],getPolygon:function(t){return t},filled:!1,stroked:!0,getLineColor:A,getLineWidth:s*Math.pow(2,r)})]}}]),n}(B.a);function Mn(t){return"-#".concat(t,"#")}function Tn(t){var e=(new m.a).makeViewport({viewState:t,height:t.height,width:t.width});return[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])]}_n.layerName="OverviewLayer",_n.defaultProps=Gn;var jn=function(t){Object(f.a)(n,t);var e=Object(h.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"renderLayers",value:function(){var t=this.props,e=t.id,n=t.unit,r=t.size,i=t.position,o=t.viewState,a=t.length,A=Tn(o),c=o.zoom,u=.05*(A[2][0]-A[0][0]),l=Math.max(Math.pow(2,1.5-c),.007*(A[2][1]-A[0][1])),g=u*r,f=function(t,e,n){var r=t[2][0]-t[0][0];switch(e){case"bottom-right":return[t[2][1]-(t[2][1]-t[0][1])*n,t[2][0]-r*n];case"top-right":return[(t[2][1]-t[0][1])*n,t[2][0]-r*n];case"top-left":return[(t[2][1]-t[0][1])*n,r*n];case"bottom-left":return[t[2][1]-(t[2][1]-t[0][1])*n,r*n];default:throw new Error("Position ".concat(e," not found"))}}(A,i,a),h=Object(s.a)(f,2),d=h[0],p=h[1];return[new O.a({id:"scale-bar-length-".concat(e),coordinateSystem:y.a.CARTESIAN,data:[[[p,d],[p+u,d]]],getSourcePosition:function(t){return t[0]},getTargetPosition:function(t){return t[1]},getWidth:2,getColor:[220,220,220]}),new O.a({id:"scale-bar-height-left-".concat(e),coordinateSystem:y.a.CARTESIAN,data:[[[p,d-l],[p,d+l]]],getSourcePosition:function(t){return t[0]},getTargetPosition:function(t){return t[1]},getWidth:2,getColor:[220,220,220]}),new O.a({id:"scale-bar-height-right-".concat(e),coordinateSystem:y.a.CARTESIAN,data:[[[p+u,d-l],[p+u,d+l]]],getSourcePosition:function(t){return t[0]},getTargetPosition:function(t){return t[1]},getWidth:2,getColor:[220,220,220]}),new N.a({id:"units-label-layer-".concat(e),coordinateSystem:y.a.CARTESIAN,data:[{text:String(g).slice(0,5).replace(/\.$/,"")+n,position:[p+.5*u,d+4*l]}],getColor:[220,220,220,255],getSize:12,fontFamily:"-apple-system, 'Helvetica Neue', Arial, sans-serif",sizeUnits:"meters",sizeScale:Math.pow(2,-c),characterSet:[].concat(Object(I.a)(n.split("")),Object(I.a)(yn(10).map((function(t){return String(t)}))),["."])})]}}]),n}(B.a);function Ln(t){for(var e=void 0,n=t[0],r=1;r<t.length;){var i=t[r],o=t[r+1];if(2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(n,o(n)):"call"!==i&&"optionalCall"!==i||(o((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n.call.apply(t,[e].concat(i))})),void 0)}return n}jn.layerName="ScaleBarLayer",jn.defaultProps={pickable:!0,viewState:{type:"object",value:{zoom:0,target:[0,0,0]},compare:!0},unit:{type:"string",value:"",compare:!0},size:{type:"number",value:1,compare:!0},position:{type:"string",value:"bottom-right",compare:!0},length:{type:"number",value:.085,compare:!0}};D.PureComponent;var Vn=function t(){Object(c.a)(this,t)};b.a;function Zn(t,e,n){var r=void 0===e?null:e,i=function(t,e){var n=atob(t);if(e){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(t,void 0!==n&&n),o=i.indexOf("\n",10)+1,a=i.substring(o)+(r?"//# sourceMappingURL="+r:""),A=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(A)}var Pn=function(t,e,n){var r;return function(i){return r=r||Zn(t,e,n),new Worker(r,i)}}(" ","data:application/json;charset=utf-8;base64, ",!1),Wn="undefined"!==typeof navigator?navigator.hardwareConcurrency||4:null,Jn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wn;Object(c.a)(this,t),this.workers=[],this.idleWorkers=[],this.waitQueue=[],this.decoder=null;for(var n=0;n<e;++n){var r=new Pn;this.workers.push(r),this.idleWorkers.push(r)}}return Object(u.a)(t,[{key:"decode",value:function(){var t=Object(a.a)(o.a.mark((function t(e,n){var r,i=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.waitForWorker();case 2:return r=t.sent,t.abrupt("return",new Promise((function(t,o){r.onmessage=function(e){i.finishTask(r),t(e.data[0])},r.onerror=function(t){i.finishTask(r),o(t)},r.postMessage(["decode",e,n],[n])})));case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"waitForWorker",value:function(){var t=Object(a.a)(o.a.mark((function t(){var e,n,r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.idleWorkers.pop())){t.next=3;break}return t.abrupt("return",e);case 3:return n={},r=new Promise((function(t){n.resolve=t})),this.waitQueue.push(n),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"finishTask",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(n=this.waitQueue.pop())?n.resolve(e):this.idleWorkers.push(e);case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"destroy",value:function(){for(var t=0;t<this.workers.length;++t)this.workers[t].terminate()}}]),t}();function Hn(t){for(var e=t.BYTES_PER_ELEMENT,n=new Uint8Array(t.buffer,t.byteOffset,t.length*e),r=e/2,i=e-1,o=0,a=0;a<n.length;a+=e)for(var A=0;A<r;A+=1)o=n[a+A],n[a+A]=n[a+i-A],n[a+i-A]=o}function Yn(t){return Xn.apply(this,arguments)}function Xn(){return(Xn=Object(a.a)(o.a.mark((function t(e){var n,r,i,a,A,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.loader,r=e.loaderSelection,i=n.isPyramid?n.numLevels-1:0,t.next=4,n.getRaster({z:i,loaderSelection:r});case 4:return a=t.sent,A=a.data,s=A.map((function(t){for(var e=t.length,n=1/0,r=-1/0,i=0;e--;)t[e]<n&&(n=t[e]),t[e]>r&&(r=t[e]),i+=t[e];var o=i/t.length;e=t.length;for(var a=0;e--;)a+=Math.pow(t[e]-o,2);var A=Math.pow(a/t.length,.5),s=Math.floor(t.length/2),c=Math.floor(t.length/4),u=3*Math.floor(t.length/4);cn(t,s);var l=t[s];cn(t,c,0,s);var g=t[c];cn(t,u,s,t.length-1);var f=t[u],h=t.filter((function(t){return t>=1})),d=Math.floor(.9995*h.length),I=Math.floor(5e-4*h.length);return cn(h,d),cn(h,I,0,d),{mean:o,sd:A,q1:g,q3:f,median:l,data:t,domain:[n,r],autoSliders:[h[I],h[d]]}})),t.abrupt("return",s);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function zn(t){var e=t.SizeZ,n=t.SizeT;return t.DimensionOrder.toLowerCase().split("").slice().reverse().map((function(r){if("x"===r||"y"===r)return{field:r,type:"quantitative",values:null};if("c"===r)return{field:"channel",type:"nominal",values:t.getChannelNames()};return"t"===r?{field:"time",type:"ordinal",values:yn(n)}:{field:r,type:"ordinal",values:yn(e)}}))}function Kn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.map((function(t,e){return 0===e?t.trim().replace(/[/]*$/g,""):t.trim().replace(/(^[/]*|[/]*$)/g,"")})).filter((function(t){return t.length})).join("/")}var qn=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c.a)(this,t),this.url=e,this.options=n}return Object(u.a)(t,[{key:"getItem",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,a=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},r=Kn(this.url,e),t.next=4,fetch(r,Object(d.a)({},this.options,{},n));case 4:if(404!==(i=t.sent).status){t.next=9;break}throw new j.d(e);case 9:if(200===i.status){t.next=11;break}throw new j.b(String(i.status));case 11:return t.abrupt("return",i.arrayBuffer());case 12:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"containsItem",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,a=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},r=Kn(this.url,e),t.next=4,fetch(r,Object(d.a)({},this.options,{},n));case 4:return i=t.sent,t.abrupt("return",200===i.status);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),t}();function $n(t){for(var e=void 0,n=t[0],r=1;r<t.length;){var i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=n).call.apply(t,[e].concat(i))})),e=void 0)}return n}var tr=function(){function t(e){var n,r=this,i=e.data,o=e.dimensions,a=e.isRgb,A=e.scale,u=void 0===A?1:A,l=e.translate,g=void 0===l?{x:0,y:0}:l;(Object(c.a)(this,t),Array.isArray(i))?(n=Object(s.a)(i,1)[0],this.numLevels=i.length):(n=i,this.numLevels=1);this.type="zarr",this.scale=u,this.translate=g,this.isRgb=a||function(t){var e=t[t.length-1];return t.length>2&&(3===e||4===e)}(n.shape),this.dimensions=o,this._data=i,this._dimIndices=new Map,o.forEach((function(t,e){var n=t.field;return r._dimIndices.set(n,e)}));var f=n,h=f.dtype,d=f.chunks;this.dtype="<".concat(h.slice(1)),this.tileSize=d[this._dimIndices.get("x")]}return Object(u.a)(t,[{key:"getTile",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,A,c,u,l,g,f,h,d,I,p,C,y,v,B=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.x,r=e.y,i=e.z,A=e.loaderSelection,c=void 0===A?[]:A,u=e.signal,l=Cn[this.dtype].TypedArray,g=this._getSource(i),f=["x","y"].map((function(t){return B._dimIndices.get(t)})),h=Object(s.a)(f,2),d=h[0],I=h[1],p=c.map(function(){var t=Object(a.a)(o.a.mark((function t(e){var i,a,A,s,c;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=B._serializeSelection(e))[I]=r,i[d]=n,a=g.keyPrefix+i.join("."),t.prev=4,t.next=7,g.store.getItem(a,{signal:u});case 7:A=t.sent,t.next=15;break;case 10:if(t.prev=10,t.t0=t.catch(4),"AbortError"===t.t0.name){t.next=14;break}throw t.t0;case 14:return t.abrupt("return",null);case 15:if(s=new Uint8Array(A),!g.compressor){t.next=20;break}return t.next=19,g.compressor.decode(s);case 19:s=t.sent;case 20:return c=new l(s.buffer),">"===g.dtype[0]&&Hn(c),t.abrupt("return",c);case 23:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(e){return t.apply(this,arguments)}}()),t.next=7,Promise.all(p);case 7:if(C=t.sent,!(g.store instanceof qn&&$n([u,"optionalAccess",function(t){return t.aborted}]))){t.next=10;break}return t.abrupt("return",null);case 10:return y=g.chunks[d],v=g.chunks[I],t.abrupt("return",{data:C,width:y,height:v});case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getRaster",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,A,c,u,l,g,f,h,d,I,p,C=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.z,r=e.loaderSelection,i=void 0===r?[]:r,A=this._getSource(n),c=["x","y"].map((function(t){return C._dimIndices.get(t)})),u=Object(s.a)(c,2),l=u[0],g=u[1],f=i.map(function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=C._serializeSelection(e))[g]=null,n[l]=null,C.isRgb&&(n[n.length-1]=null),t.next=6,A.getRaw(n);case 6:return r=t.sent,i=r.data,t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.next=6,Promise.all(f);case 6:return h=t.sent,d=A.shape,I=d[l],p=d[g],t.abrupt("return",{data:h,width:I,height:p});case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"onTileError",value:function(t){if(!(t instanceof j.a))throw t}},{key:"getRasterSize",value:function(t){var e=this,n=t.z,r=this._getSource(n).shape,i=["y","x"].map((function(t){return r[e._dimIndices.get(t)]})),o=Object(s.a)(i,2);return{height:o[0],width:o[1]}}},{key:"getMetadata",value:function(){return{}}},{key:"_getSource",value:function(t){return"number"===typeof t&&this.isPyramid?this._data[t]:this._data}},{key:"_serializeSelection",value:function(t){var e=this;if(Array.isArray(t))return Object(I.a)(t);var n=Array(this.dimensions.length).fill(0);return Object.entries(t).forEach((function(t){var r=Object(s.a)(t,2),i=r[0],o=r[1];if(!e._dimIndices.has(i))throw Error('Dimension "'.concat(i,'" does not exist on loader.\n           Must be one of "').concat(e.dimensions.map((function(t){return t.field})),'."'));var a=e._dimIndices.get(i);switch(typeof o){case"number":n[a]=o;break;case"string":var A=e.dimensions[a],c=A.values,u=A.type;if("nominal"===u||"ordinal"===u){n[a]=c.indexOf(o);break}throw Error('Cannot use selection "'.concat(o,'" for dimension "').concat(i,'" with type "').concat(u,'".'));default:throw Error("Named selection must be a string or number. Got ".concat(o," for ").concat(i,"."))}})),n}},{key:"isPyramid",get:function(){return Array.isArray(this._data)}},{key:"base",get:function(){return this.isPyramid?this._data[0]:this._data}}]),t}(),er=function(){function t(e){Object(c.a)(this,t);this.metadataOMEXML=fn.a.parse(e,{ignoreAttributes:!1,attributeNamePrefix:"@_",trimValues:!0,allowBooleanAttributes:!0}).OME;var n=(this.metadataOMEXML.Image.length?this.metadataOMEXML.Image[0]:this.metadataOMEXML.Image).Pixels;this._Pixels=n,this.SizeZ=Number.parseInt(n["@_SizeZ"]),this.SizeT=Number.parseInt(n["@_SizeT"]),this.SizeC=Number.parseInt(n["@_SizeC"]),this.SizeX=Number.parseInt(n["@_SizeX"]),this.SizeY=Number.parseInt(n["@_SizeY"]),this.Interleaved="true"===n["@_Interleaved"],this.DimensionOrder=n["@_DimensionOrder"],this.Type=n["@_Type"];var r=n["@_PhysicalSizeYUnit"];this.PhysicalSizeYUnit=r&&r.includes("\xb5m")?"\xb5m":r;var i=n["@_PhysicalSizeXUnit"];this.PhysicalSizeXUnit=i&&i.includes("\xb5m")?"\xb5m":i,this.PhysicalSizeY=n["@_PhysicalSizeY"],this.PhysicalSizeX=n["@_PhysicalSizeX"]}return Object(u.a)(t,[{key:"getChannelNames",value:function(){var t=this._Pixels.Channel;return Array.isArray(t)?t.map((function(t,e){return t["@_Name"]||"Channel ".concat(e)})):[t["@_Name"]||"Channel ".concat(0)]}},{key:"getNumberOfImages",value:function(){return this.metadataOMEXML.Image.length||0}},{key:"SamplesPerPixel",get:function(){var t=this._Pixels.Channel;return Array.isArray(t)?t.map((function(t){return t["@_SamplesPerPixel"]}))[0]:[t["@_SamplesPerPixel"]]}}]),t}();function nr(t){for(var e=void 0,n=t[0],r=1;r<t.length;){var i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=n).call.apply(t,[e].concat(i))})),e=void 0)}return n}var rr={uint8:"<u1",uint16:"<u2",uint32:"<u4",float:"<f4",int8:"<u1",int16:"<u2",int32:"<u4"},ir=function(){function t(e){var n=e.tiff,r=e.pool,i=e.firstImage,o=e.omexmlString,a=e.offsets;Object(c.a)(this,t),this.pool=r,this.tiff=n,this.type="ome-tiff",this.omexml=new er(o),this.physicalSizes={x:{value:this.omexml.PhysicalSizeX,unit:this.omexml.PhysicalSizeXUnit},y:{value:this.omexml.PhysicalSizeY,unit:this.omexml.PhysicalSizeYUnit}},this.software=i.fileDirectory.Software,this.photometricInterpretation=i.fileDirectory.PhotometricInterpretation,this.offsets=a||[],this.channelNames=this.omexml.getChannelNames(),this.width=this.omexml.SizeX,this.height=this.omexml.SizeY,this.tileSize=i.getTileWidth();var A=i.fileDirectory.SubIFDs;this.numLevels=nr([A,"optionalAccess",function(t){return t.length}])?A.length+1:this.omexml.getNumberOfImages(),this.isBioFormats6Pyramid=A,this.isPyramid=this.numLevels>1,this.dimensions=zn(this.omexml),this.dtype=rr[this.omexml.Type],this.isRgb=3===this.omexml.SamplesPerPixel||3===this.channelNames.length&&"uint8"===this.omexml.Type||3===this.omexml.SizeC&&1===this.channelNames.length&&this.omexml.Interleaved,this.isInterleaved=this.omexml.Interleaved}return Object(u.a)(t,[{key:"_getIFDIndex",value:function(t){var e,n=t.z,r=void 0===n?0:n,i=t.channel,o=t.time,a=void 0===o?0:o;if(this.channelNames.every((function(t){return!t})))console.warn("No channel names found in OMEXML.  Please be sure to use numeric indexing."),e=i;else if("string"===typeof i)e=this.channelNames.indexOf(i);else{if("number"!==typeof i)throw new Error("Channel selection must be numeric index or string");e=i}var A=this.omexml,s=A.SizeZ,c=A.SizeT,u=A.SizeC;switch(A.DimensionOrder){case"XYZCT":return a*s*u+e*s+r;case"XYZTC":return e*s*c+a*s+r;case"XYCTZ":return r*u*c+a*u+e;case"XYCZT":return a*u*s+r*u+e;case"XYTCZ":return r*c*u+e*c+a;case"XYTZC":return e*c*s+r*c+a;default:throw new Error("Dimension order is required for OMETIFF")}}},{key:"onTileError",value:function(t){console.error(t)}},{key:"getTile",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.x,r=e.y,i=e.z,A=e.loaderSelection,s=void 0===A?[]:A,c=e.signal,this._tileInBounds({x:n,y:r,z:i})){t.next=3;break}return t.abrupt("return",null);case 3:return u=this.tiff,l=this.isBioFormats6Pyramid,g=this.omexml,f=g.SizeZ,h=g.SizeT,d=g.SizeC,I=i*f*h*d,C=s.map(function(){var t=Object(a.a)(o.a.mark((function t(e){var a,A,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=b._getIFDIndex(e),A=I+a,l){t.next=6;break}b._parseIFD(A),t.next=11;break;case 6:return b._parseIFD(a),t.next=9,u.getImage(a);case 9:s=t.sent,0!==i&&(u.ifdRequests[A]=u.parseFileDirectoryAt(s.fileDirectory.SubIFDs[i-1]));case 11:return t.next=13,u.getImage(A);case 13:return p=t.sent,t.abrupt("return",b._getChannel({image:p,x:n,y:r,z:i,signal:c}));case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.next=9,Promise.all(C);case 9:if(y=t.sent,v=this._getTileExtent({x:n,y:r,z:i}),B=v.height,m=v.width,!nr([c,"optionalAccess",function(t){return t.aborted}])){t.next=13;break}return t.abrupt("return",null);case 13:return t.abrupt("return",{data:y,height:B,width:m});case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getRaster",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,A,s,c,u,l,g,f,h,I,p,C,y,v,B,m=this;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.z,r=e.loaderSelection,i=this.tiff,A=this.omexml,s=this.isBioFormats6Pyramid,c=this.pool,u=this.isInterleaved,l=A.SizeZ,g=A.SizeT,f=A.SizeC,t.next=5,Promise.all(r.map(function(){var t=Object(a.a)(o.a.mark((function t(e){var r,a,A,h,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=m._getIFDIndex(e),a=n*l*g*f+r,s){t.next=6;break}m._parseIFD(a),t.next=11;break;case 6:return m._parseIFD(r),t.next=9,i.getImage(r);case 9:A=t.sent,0!==n&&(i.ifdRequests[a]=i.parseFileDirectoryAt(A.fileDirectory.SubIFDs[n-1]));case 11:return t.next=13,i.getImage(a);case 13:return h=t.sent,t.next=16,h.readRasters({pool:c,interleave:u});case 16:return d=t.sent,t.abrupt("return",u?d:d[0]);case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 5:if(h=t.sent,r&&0!==r.length){t.next=8;break}return t.abrupt("return",Object(d.a)({data:[]},this.getRasterSize({z:n})));case 8:return t.next=10,i.getImage(n*l*g*f+this._getIFDIndex(r[0]));case 10:return I=t.sent,p=I.getWidth(),C=I.getHeight(),"<f4"===this.dtype?y=h.map((function(t){return new Float32Array(t.buffer)})):this.omexml.Type.startsWith("int")?(v=h[0].BYTES_PER_ELEMENT,B=1===v?Uint8Array:2===v?Uint16Array:Uint32Array,y=h.map((function(t){return new B(t)}))):y=h,t.abrupt("return",{data:y,width:p,height:C});case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getRasterSize",value:function(t){var e=t.z,n=this.width;return{height:this.height>>e,width:n>>e}}},{key:"getMetadata",value:function(){var t,e=this.omexml,n=e.metadataOMEXML,r=n.Image.AcquisitionDate,i=n.StructuredAnnotations,o=e.SizeX,a=e.SizeY,A=e.SizeZ,s=e.SizeT,c=e.SizeC,u=e.Type,l=e.PhysicalSizeX,g=e.PhysicalSizeXUnit,f=e.PhysicalSizeY,h=e.PhysicalSizeYUnit,d=e.PhysicalSizeZ,I=e.PhysicalSizeZUnit,p=l&&g?"".concat(l," (").concat(g,")"):"-",C=f&&h?"".concat(f," (").concat(h,")"):"-",y=d&&I?"".concat(d," (").concat(I,")"):"-";if(i){var v=i.MapAnnotation;t=v&&v.Value?Object.entries(v.Value).length:0}return{"Acquisition Date":r,"Dimensions (XY)":"".concat(o," x ").concat(a),"Pixels Type":u,"Pixels Size (XYZ)":"".concat(p," x ").concat(C," x ").concat(y),"Z-sections/Timepoints":"".concat(A," x ").concat(s),Channels:c,"ROI Count":t}}},{key:"_getChannel",value:function(){var t=Object(a.a)(o.a.mark((function t(e){var n,r,i,a,A,s,c,u,l,g,f,h,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.image,r=e.x,i=e.y,a=e.z,A=e.signal,s=this.tileSize,c=this.pool,u=this.isInterleaved,l=this._getTileExtent({x:r,y:i,z:a}),g=l.height,f=l.width,t.next=5,n.readRasters({window:[r*s,i*s,r*s+f,i*s+g],pool:c,signal:A,width:f,height:g,interleave:u});case 5:if(h=t.sent,d=u?h:h[0],!nr([A,"optionalAccess",function(t){return t.aborted}])){t.next=9;break}return t.abrupt("return",null);case 9:if(!this.omexml.Type.startsWith("int")){t.next=15;break}if(1!==d.BYTES_PER_ELEMENT){t.next=12;break}return t.abrupt("return",new Uint8Array(new Int8Array(d.buffer)));case 12:if(2!==d.BYTES_PER_ELEMENT){t.next=14;break}return t.abrupt("return",new Uint16Array(new Int16Array(d.buffer)));case 14:return t.abrupt("return",new Uint32Array(new Int32Array(d.buffer)));case 15:return t.abrupt("return",d);case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_tileInBounds",value:function(t){return function(t){var e=t.x,n=t.y,r=t.z,i=t.width,o=t.height,a=t.tileSize,A=t.numLevels,s=e<Math.ceil(i/(a*Math.pow(2,r)))&&e>=0,c=n<Math.ceil(o/(a*Math.pow(2,r)))&&n>=0;return s&&c&&(r>=0&&r<A)}({x:t.x,y:t.y,z:t.z,width:this.width,height:this.height,tileSize:this.tileSize,numLevels:this.numLevels})}},{key:"_parseIFD",value:function(t){var e=this.tiff,n=this.offsets;n.length>0&&(e.ifdRequests[t]=e.parseFileDirectoryAt(n[t]))}},{key:"_getTileExtent",value:function(t){var e=t.x,n=t.y,r=t.z,i=this.tileSize,o=i,a=i,A=this.getRasterSize({z:r}),s=A.height,c=A.width;return e===Math.floor(c/i)&&(a=c%i),n===Math.floor(s/i)&&(o=s%i),{height:o,width:a}}}]),t}();function or(t){return ar.apply(this,arguments)}function ar(){return(ar=Object(a.a)(o.a.mark((function t(e){var n,r,i,a,A,s,c,u,l,g,f,h;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.url,r=e.dimensions,i=e.isPyramid,a=e.isRgb,A=e.scale,s=e.translate,!i){t.next=14;break}return u="".concat(n).concat("/"===n.slice(-1)?"":"/",".zmetadata"),t.next=5,fetch(u);case 5:return l=t.sent,t.next=8,l.json();case 8:g=t.sent,f=g.metadata,h=Object.keys(f).filter((function(t){return t.includes(".zarray")})).map((function(t){return t.slice(0,-7)})),c=Promise.all(h.map((function(t){return Object(j.e)({store:n,path:t})}))),t.next=15;break;case 14:c=Object(j.e)({store:n});case 15:return t.t0=tr,t.next=18,c;case 18:return t.t1=t.sent,t.t2=r,t.t3=A,t.t4=s,t.t5=a,t.t6={data:t.t1,dimensions:t.t2,scale:t.t3,translate:t.t4,isRgb:t.t5},t.abrupt("return",new t.t0(t.t6));case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ar(t){return sr.apply(this,arguments)}function sr(){return(sr=Object(a.a)(o.a.mark((function t(e){var n,r,i,a,A,s,c,u,l;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.urlOrFile,r=e.offsets,i=void 0===r?[]:r,a=e.headers,A=void 0===a?{}:a,!(n instanceof File)){t.next=7;break}return t.next=4,An(n);case 4:s=t.sent,t.next=10;break;case 7:return t.next=9,on(n,A);case 9:s=t.sent;case 10:return t.next=12,s.getImage(0);case 12:return c=t.sent,u=new Jn,l=c.fileDirectory.ImageDescription,t.abrupt("return",new ir({tiff:s,pool:u,firstImage:c,omexmlString:l,offsets:i}));case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},function(t,e,n){"use strict";var r,i=n(3),o=n(8),a=n(6),A=n(54),s=n(2),c=n(7),u=n(82),l=n(1),g="EXT_color_buffer_float",f=(r={},Object(l.a)(r,33189,{bpp:2}),Object(l.a)(r,33190,{gl2:!0,bpp:3}),Object(l.a)(r,36012,{gl2:!0,bpp:4}),Object(l.a)(r,36168,{bpp:1}),Object(l.a)(r,34041,{bpp:4}),Object(l.a)(r,35056,{gl2:!0,bpp:4}),Object(l.a)(r,36013,{gl2:!0,bpp:5}),Object(l.a)(r,32854,{bpp:2}),Object(l.a)(r,36194,{bpp:2}),Object(l.a)(r,32855,{bpp:2}),Object(l.a)(r,33321,{gl2:!0,bpp:1}),Object(l.a)(r,33330,{gl2:!0,bpp:1}),Object(l.a)(r,33329,{gl2:!0,bpp:1}),Object(l.a)(r,33332,{gl2:!0,bpp:2}),Object(l.a)(r,33331,{gl2:!0,bpp:2}),Object(l.a)(r,33334,{gl2:!0,bpp:4}),Object(l.a)(r,33333,{gl2:!0,bpp:4}),Object(l.a)(r,33323,{gl2:!0,bpp:2}),Object(l.a)(r,33336,{gl2:!0,bpp:2}),Object(l.a)(r,33335,{gl2:!0,bpp:2}),Object(l.a)(r,33338,{gl2:!0,bpp:4}),Object(l.a)(r,33337,{gl2:!0,bpp:4}),Object(l.a)(r,33340,{gl2:!0,bpp:8}),Object(l.a)(r,33339,{gl2:!0,bpp:8}),Object(l.a)(r,32849,{gl2:!0,bpp:3}),Object(l.a)(r,32856,{gl2:!0,bpp:4}),Object(l.a)(r,32857,{gl2:!0,bpp:4}),Object(l.a)(r,36220,{gl2:!0,bpp:4}),Object(l.a)(r,36238,{gl2:!0,bpp:4}),Object(l.a)(r,36975,{gl2:!0,bpp:4}),Object(l.a)(r,36214,{gl2:!0,bpp:8}),Object(l.a)(r,36232,{gl2:!0,bpp:8}),Object(l.a)(r,36226,{gl2:!0,bpp:16}),Object(l.a)(r,36208,{gl2:!0,bpp:16}),Object(l.a)(r,33325,{gl2:g,bpp:2}),Object(l.a)(r,33327,{gl2:g,bpp:4}),Object(l.a)(r,34842,{gl2:g,bpp:8}),Object(l.a)(r,33326,{gl2:g,bpp:4}),Object(l.a)(r,33328,{gl2:g,bpp:8}),Object(l.a)(r,34836,{gl2:g,bpp:16}),Object(l.a)(r,35898,{gl2:g,bpp:4}),r),h=n(19),d=n(47);function I(t,e,n){var r=n[e];if(!r)return!1;var i=Object(h.g)(t)&&r.gl2||r.gl1;return"string"===typeof i?t.getExtension(i):i}n.d(e,"a",(function(){return p}));var p=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,e),(n=Object(o.a)(this,Object(a.a)(e).call(this,t,r))).initialize(r),Object.seal(Object(A.a)(n)),n}return Object(c.a)(e,t),Object(s.a)(e,null,[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},n=e.format;return!n||I(t,n,f)}},{key:"getSamplesForFormat",value:function(t,e){var n=e.format;return t.getInternalformatParameter(36161,n,32937)}}]),Object(s.a)(e,[{key:"initialize",value:function(t){var e=t.format,n=t.width,r=void 0===n?1:n,i=t.height,o=void 0===i?1:i,a=t.samples,A=void 0===a?0:a;return Object(d.a)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==A&&Object(h.g)(this.gl)?this.gl.renderbufferStorageMultisample(36161,A,e,r,o):this.gl.renderbufferStorage(36161,e,r,o),this.format=e,this.width=r,this.height=o,this.samples=A,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*f[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,n=t.height;return e!==this.width||n!==this.height?this.initialize({width:e,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}]),e}(u.a)},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var r="undefined"!==typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i="undefined"!==typeof window?window:t,o=("undefined"!==typeof t||window,"undefined"!==typeof document&&document,!1);try{var a={get passive(){return o=!0,!0}};i.addEventListener("test",a,a),i.removeEventListener("test",a,a)}catch(A){}}).call(this,n(56))},function(t,e,n){var r;!function(n){"use strict";var i={s:1,n:0,d:1};function o(t){function e(){var e=Error.apply(this,arguments);e.name=this.name=t,this.stack=e.stack,this.message=e.message}function n(){}return n.prototype=Error.prototype,e.prototype=new n,e}var a=g.DivisionByZero=o("DivisionByZero"),A=g.InvalidParameter=o("InvalidParameter");function s(t,e){return isNaN(t=parseInt(t,10))&&c(),t*e}function c(){throw new A}var u=function(t,e){var n,r=0,o=1,A=1,u=0,l=0,g=0,f=1,h=1,d=0,I=1,p=1,C=1,y=1e7;if(void 0===t||null===t);else if(void 0!==e)A=(r=t)*(o=e);else switch(typeof t){case"object":"d"in t&&"n"in t?(r=t.n,o=t.d,"s"in t&&(r*=t.s)):0 in t?(r=t[0],1 in t&&(o=t[1])):c(),A=r*o;break;case"number":if(t<0&&(A=t,t=-t),t%1===0)r=t;else if(t>0){for(t>=1&&(t/=h=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)));I<=y&&C<=y;){if(t===(n=(d+p)/(I+C))){I+C<=y?(r=d+p,o=I+C):C>I?(r=p,o=C):(r=d,o=I);break}t>n?(d+=p,I+=C):(p+=d,C+=I),I>y?(r=p,o=C):(r=d,o=I)}r*=h}else(isNaN(t)||isNaN(e))&&(o=r=NaN);break;case"string":if(null===(I=t.match(/\d+|./g))&&c(),"-"===I[d]?(A=-1,d++):"+"===I[d]&&d++,I.length===d+1?l=s(I[d++],A):"."===I[d+1]||"."===I[d]?("."!==I[d]&&(u=s(I[d++],A)),(++d+1===I.length||"("===I[d+1]&&")"===I[d+3]||"'"===I[d+1]&&"'"===I[d+3])&&(l=s(I[d],A),f=Math.pow(10,I[d].length),d++),("("===I[d]&&")"===I[d+2]||"'"===I[d]&&"'"===I[d+2])&&(g=s(I[d+1],A),h=Math.pow(10,I[d+1].length)-1,d+=3)):"/"===I[d+1]||":"===I[d+1]?(l=s(I[d],A),f=s(I[d+2],1),d+=3):"/"===I[d+3]&&" "===I[d+1]&&(u=s(I[d],A),l=s(I[d+2],A),f=s(I[d+4],1),d+=5),I.length<=d){A=r=g+(o=f*h)*u+h*l;break}default:c()}if(0===o)throw new a;i.s=A<0?-1:1,i.n=Math.abs(r),i.d=Math.abs(o)};function l(t,e){if(!t)return e;if(!e)return t;for(;;){if(!(t%=e))return e;if(!(e%=t))return t}}function g(t,e){if(!(this instanceof g))return new g(t,e);u(t,e),t=g.REDUCE?l(i.d,i.n):1,this.s=i.s,this.n=i.n/t,this.d=i.d/t}g.REDUCE=1,g.prototype={s:1,n:0,d:1,abs:function(){return new g(this.n,this.d)},neg:function(){return new g(-this.s*this.n,this.d)},add:function(t,e){return u(t,e),new g(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(t,e){return u(t,e),new g(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(t,e){return u(t,e),new g(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(t,e){return u(t,e),new g(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return new g(this)},mod:function(t,e){return isNaN(this.n)||isNaN(this.d)?new g(NaN):void 0===t?new g(this.s*this.n%this.d,1):(u(t,e),0===i.n&&0===this.d&&g(0,0),new g(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d))},gcd:function(t,e){return u(t,e),new g(l(i.n,this.n)*l(i.d,this.d),i.d*this.d)},lcm:function(t,e){return u(t,e),0===i.n&&0===this.n?new g:new g(i.n*this.n,l(i.n,this.n)*l(i.d,this.d))},ceil:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):new g(Math.ceil(t*this.s*this.n/this.d),t)},floor:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):new g(Math.floor(t*this.s*this.n/this.d),t)},round:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):new g(Math.round(t*this.s*this.n/this.d),t)},inverse:function(){return new g(this.s*this.d,this.n)},pow:function(t){return t<0?new g(Math.pow(this.s*this.d,-t),Math.pow(this.n,-t)):new g(Math.pow(this.s*this.n,t),Math.pow(this.d,t))},equals:function(t,e){return u(t,e),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(t,e){u(t,e);var n=this.s*this.n*i.d-i.s*i.n*this.d;return(0<n)-(n<0)},simplify:function(t){if(isNaN(this.n)||isNaN(this.d))return this;var e=this.abs().toContinued();function n(t){return 1===t.length?new g(t[0]):n(t.slice(1)).inverse().add(t[0])}t=t||.001;for(var r=0;r<e.length;r++){var i=n(e.slice(0,r+1));if(i.sub(this.abs()).abs().valueOf()<t)return i.mul(this.s)}return this},divisible:function(t,e){return u(t,e),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(t){var e,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(t&&(e=Math.floor(r/i))>0&&(n+=e,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(t){var e,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(t&&(e=Math.floor(r/i))>0&&(n+=e,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var t,e=this.n,n=this.d,r=[];if(isNaN(e)||isNaN(n))return r;do{r.push(Math.floor(e/n)),t=e%n,e=n,n=t}while(1!==e);return r},toString:function(t){var e,n=this.n,r=this.d;if(isNaN(n)||isNaN(r))return"NaN";g.REDUCE||(n/=e=l(n,r),r/=e),t=t||15;var i=function(t,e){for(;e%2===0;e/=2);for(;e%5===0;e/=5);if(1===e)return 0;for(var n=10%e,r=1;1!==n;r++)if(n=10*n%e,r>2e3)return 0;return r}(0,r),o=function(t,e,n){for(var r=1,i=function(t,e,n){for(var r=1;e>0;t=t*t%n,e>>=1)1&e&&(r=r*t%n);return r}(10,n,e),o=0;o<300;o++){if(r===i)return o;r=10*r%e,i=10*i%e}return 0}(0,r,i),a=-1===this.s?"-":"";if(a+=n/r|0,n%=r,(n*=10)&&(a+="."),i){for(var A=o;A--;)a+=n/r|0,n%=r,n*=10;a+="(";for(A=i;A--;)a+=n/r|0,n%=r,n*=10;a+=")"}else for(A=t;n&&A--;)a+=n/r|0,n%=r,n*=10;return a}},void 0===(r=function(){return g}.apply(e,[]))||(t.exports=r)}()},function(t,e){t.exports=function t(e,n){"use strict";var r,i,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,A=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,u=function(e){return t.insensitive&&(""+e).toLowerCase()||""+e},l=u(e).replace(a,"")||"",g=u(n).replace(a,"")||"",f=l.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=g.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(l.match(s),16)||1!==f.length&&l.match(A)&&Date.parse(l),I=parseInt(g.match(s),16)||d&&g.match(A)&&Date.parse(g)||null;if(I){if(d<I)return-1;if(d>I)return 1}for(var p=0,C=Math.max(f.length,h.length);p<C;p++){if(r=!(f[p]||"").match(c)&&parseFloat(f[p])||f[p]||0,i=!(h[p]||"").match(c)&&parseFloat(h[p])||h[p]||0,isNaN(r)!==isNaN(i))return isNaN(r)?1:-1;if(typeof r!==typeof i&&(r+="",i+=""),r<i)return-1;if(r>i)return 1}return 0}},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return A})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return u}));var i=n(27),o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t,document:"undefined"!==typeof document&&document},a=o.global||o.self||o.window,A="object"!==("undefined"===typeof r?"undefined":Object(i.a)(r))||"[object process]"!==String(r)||r.browser,s="function"===typeof importScripts,c="undefined"!==typeof r&&r.version&&r.version.match(/v([0-9]*)/),u=c&&parseFloat(c[1])||0}).call(this,n(56),n(68))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(378),c=n(19),u=n(301),l=n(44);function g(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var d=function(t){Object(o.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"render",value:function(t){var e=this.gl;return Object(c.k)(e,{framebuffer:t.target}),this._drawLayers(t)}},{key:"_drawLayers",value:function(t){var e=t.viewports,n=t.views,r=t.onViewportActive,i=t.clearCanvas,o=void 0===i||i,a=this.gl;o&&function(t){var e=t.drawingBufferWidth,n=t.drawingBufferHeight;Object(c.k)(t,{viewport:[0,0,e,n]}),t.clear(16640)}(a);var A,s=[],u=g(e);try{for(u.s();!(A=u.n()).done;){var l=A.value,f=l.viewport||l,h=n&&n[f.id];r(f);var d=this._getDrawLayerParams(f,t);t.view=h;var I,p=g(f.subViewports||[f]);try{for(p.s();!(I=p.n()).done;){var C=I.value;t.viewport=C;var y=this._drawLayersInViewport(a,t,d);s.push(y)}}catch(v){p.e(v)}finally{p.f()}}}catch(v){u.e(v)}finally{u.f()}return s}},{key:"_getDrawLayerParams",value:function(t,e){for(var n=e.layers,r=e.pass,i=void 0===r?"unknown":r,o=e.layerFilter,a=e.effects,A=e.moduleParameters,s=[],c=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=function i(o,a){var A,s=o.props._offset,c=o.id,u=o.parent&&o.parent.id;if(u&&!(u in n)&&i(o.parent,!1),u in r){var l=r[u]=r[u]||t(n[u],n);A=l(o,a),r[c]=l}else Number.isFinite(s)?(A=s+(n[u]||0),r[c]=null):A=e;return a&&A>=e&&(e=A+1),n[c]=A,A};return i}(),u=0;u<n.length;u++){var l=n[u],g=this._shouldDrawLayer(l,t,i,o),f={shouldDrawLayer:g,layerRenderIndex:c(l,g)};g&&(f.moduleParameters=this._getModuleParameters(l,a,i,A),f.layerParameters=this.getLayerParameters(l,u)),s[u]=f}return s}},{key:"_drawLayersInViewport",value:function(t,e,n){var r=e.layers,i=e.onError,o=e.viewport,a=e.view,A=function(t,e){var n=e.viewport,r=t.canvas?t.canvas.clientHeight||t.canvas.height:100,i=n,o=Object(c.c)(t);return[i.x*o,(r-i.y-i.height)*o,i.width*o,i.height*o]}(t,{viewport:o});if(a&&a.props.clear){var s=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(c.l)(t,{scissorTest:!0,scissor:A},(function(){return Object(u.a)(t,s)}))}var g={totalCount:r.length,visibleCount:0,compositeCount:0,pickableCount:0};Object(c.k)(t,{viewport:A});for(var f=0;f<r.length;f++){var h=r[f],d=n[f],I=d.shouldDrawLayer,p=d.layerRenderIndex,C=d.moduleParameters,y=d.layerParameters;if(I&&h.props.pickable&&g.pickableCount++,h.isComposite)g.compositeCount++;else if(I){g.visibleCount++,C.viewport=o;try{h.drawLayer({moduleParameters:C,uniforms:{layerIndex:p},parameters:y})}catch(v){i?i(v,h):l.a.error("error during drawing of ".concat(h),v)()}}}return g}},{key:"shouldDrawLayer",value:function(t){return!0}},{key:"getModuleParameters",value:function(t,e){return null}},{key:"getLayerParameters",value:function(t,e){return t.props.parameters}},{key:"_shouldDrawLayer",value:function(t,e,n,r){var i=this.shouldDrawLayer(t)&&t.props.visible;return i&&r&&(i=r({layer:t,viewport:e,isPicking:n.startsWith("picking"),renderPass:n})),i&&t.activateViewport(e),i}},{key:"_getModuleParameters",value:function(t,e,n,r){var i=Object.assign(Object.create(t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:Object(c.c)(this.gl)});if(e){var o,a=g(e);try{for(a.s();!(o=a.n()).done;){var A=o.value;Object.assign(i,A.getModuleParameters(t))}}catch(s){a.e(s)}finally{a.f()}}return Object.assign(i,this.getModuleParameters(t,e),r)}}]),n}(s.a)},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(653),i=n(656);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((function(t,e){return null==e?t:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r),e.apply(this,r)}}),(function(){}))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return A}));var r=n(47),i={};function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";i[t]=i[t]||1;var e=i[t]++;return"".concat(t,"-").concat(e)}function a(t){return Object(r.a)("number"===typeof t,"Input must be a number"),t&&0===(t&t-1)}function A(t){var e=!0;for(var n in t){e=!1;break}return e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(94);function r(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}},,function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";var r=n(12),i=n(0),o=n.n(i),a=n(387),A=n(398),s=n.n(A),c=n(902),u=n(868),l=n(9),g=n(28),f=(n(20),n(32)),h=n(64),d=n(43),I=n(224),p=n(60),C=n(782),y=i.forwardRef((function(t,e){var n=t.classes,r=t.className,o=t.color,a=void 0===o?"primary":o,A=t.component,s=void 0===A?"a":A,c=t.onBlur,u=t.onFocus,d=t.TypographyClasses,y=t.underline,v=void 0===y?"hover":y,B=t.variant,m=void 0===B?"inherit":B,b=Object(g.a)(t,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),E=Object(I.a)(),Q=E.isFocusVisible,F=E.onBlurVisible,w=E.ref,S=i.useState(!1),R=S[0],U=S[1],x=Object(p.a)(e,w);return i.createElement(C.a,Object(l.a)({className:Object(f.a)(n.root,n["underline".concat(Object(h.a)(v))],r,R&&n.focusVisible,"button"===s&&n.button),classes:d,color:a,component:s,onBlur:function(t){R&&(F(),U(!1)),c&&c(t)},onFocus:function(t){Q(t)&&U(!0),u&&u(t)},ref:x,variant:m},b))})),v=Object(d.a)({root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}},{name:"MuiLink"})(y),B=n(324),m=n.n(B),b=n(323),E=n.n(b),Q=n(397),F=n.n(Q),w=n(399),S=n.n(w),R=n(174);function U(t){var e,n,r;return e=t,n=0,r=1,t=(Math.min(Math.max(n,e),r)-n)/(r-n),t=(t-=1)*t*t+1}var x=i.forwardRef((function(t,e){var n,r=t.classes,o=t.className,a=t.color,A=void 0===a?"primary":a,s=t.disableShrink,c=void 0!==s&&s,u=t.size,d=void 0===u?40:u,I=t.style,p=t.thickness,C=void 0===p?3.6:p,y=t.value,v=void 0===y?0:y,B=t.variant,m=void 0===B?"indeterminate":B,b=Object(g.a)(t,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),E={},Q={},F={};if("determinate"===m||"static"===m){var w=2*Math.PI*((44-C)/2);E.strokeDasharray=w.toFixed(3),F["aria-valuenow"]=Math.round(v),"static"===m?(E.strokeDashoffset="".concat(((100-v)/100*w).toFixed(3),"px"),Q.transform="rotate(-90deg)"):(E.strokeDashoffset="".concat((n=(100-v)/100,n*n*w).toFixed(3),"px"),Q.transform="rotate(".concat((270*U(v/70)).toFixed(3),"deg)"))}return i.createElement("div",Object(l.a)({className:Object(f.a)(r.root,o,"inherit"!==A&&r["color".concat(Object(h.a)(A))],{indeterminate:r.indeterminate,static:r.static}[m]),style:Object(l.a)({width:d,height:d},Q,{},I),ref:e,role:"progressbar"},F,b),i.createElement("svg",{className:r.svg,viewBox:"".concat(22," ").concat(22," ").concat(44," ").concat(44)},i.createElement("circle",{className:Object(f.a)(r.circle,c&&r.circleDisableShrink,{indeterminate:r.circleIndeterminate,static:r.circleStatic}[m]),style:E,cx:44,cy:44,r:(44-C)/2,fill:"none",strokeWidth:C})))})),k=Object(d.a)((function(t){return{root:{display:"inline-block"},static:{transition:t.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},colorPrimary:{color:t.palette.primary.main},colorSecondary:{color:t.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:t.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},"@keyframes circular-rotate":{"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(x);function O(){return o.a.createElement("div",{className:"loading-indicator-backdrop"},o.a.createElement("div",{className:"loading-indicator-container"},o.a.createElement(k,null)))}var N=n(234);n.d(e,"a",(function(){return L}));var D=Object(a.a)((function(t){return{iconButton:{border:"none",marginLeft:0,background:"none",color:t.palette.primaryForeground,paddingLeft:"0.25em",paddingRight:"0.25em",borderRadius:"2px","&:hover":{backgroundColor:t.palette.primaryBackgroundLight},"&:first-child":{marginLeft:"0.75em"},"&:last-child":{marginRight:"0.25em"},"& svg":{width:"0.7em",height:"0.7em",verticalAlign:"middle"}},downloadLink:{color:t.palette.primaryForeground}}}));function G(t){var e=t.open;return o.a.createElement(o.a.Fragment,null,o.a.createElement(F.a,null),e?o.a.createElement(E.a,null):o.a.createElement(m.a,null))}function _(t){var e=t.options,n=Object(i.useReducer)((function(t){return!t}),!1),a=Object(r.a)(n,2),A=a[0],s=a[1],c=D();return o.a.createElement(N.b,{open:A,toggle:s,buttonIcon:o.a.createElement(G,{open:A}),buttonClassName:c.iconButton,placement:"bottom-end"},e)}function M(t){var e=t.open;return o.a.createElement(o.a.Fragment,null,o.a.createElement(s.a,null),e?o.a.createElement(E.a,null):o.a.createElement(m.a,null))}function T(t){var e=t.urls,n=Object(i.useReducer)((function(t){return!t}),!1),a=Object(r.a)(n,2),A=a[0],s=a[1],u=D();return o.a.createElement(N.b,{open:A,toggle:s,buttonIcon:o.a.createElement(M,{open:A}),buttonClassName:u.iconButton,placement:"bottom-end"},e.map((function(t){var e=t.url,n=t.name;return o.a.createElement(c.a,{dense:!0,key:e},o.a.createElement(v,{underline:"none",href:e,target:"_blank",rel:"noopener",className:u.downloadLink},"Download ",n))})))}function j(t){var e=t.removeGridComponent,n=D();return o.a.createElement(u.a,{onClick:e,size:"small",className:n.iconButton,title:"close"},o.a.createElement(S.a,null))}function L(t){var e=t.title,n=t.info,r=t.children,i=t.isScroll,a=t.isSpatial,A=t.removeGridComponent,s=t.urls,c=t.isReady,u=t.options,l=i?R.c:a?R.a:R.d;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"title d-flex justify-content-between align-items-baseline"},o.a.createElement("div",{className:"justify-content-between d-flex align-items-end"},o.a.createElement("span",null,e)),o.a.createElement("span",{className:"details pl-2 align-items-end"},o.a.createElement("span",{className:"d-flex justify-content-between"},n,u&&o.a.createElement(_,{options:u}),s&&s.length>0&&o.a.createElement(T,{urls:s}),o.a.createElement(j,{removeGridComponent:A})))),o.a.createElement("div",{className:l},!c&&o.a.createElement(O,null),r))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return A}));var r=n(387),i=n(261),o=n(145),a=Object(r.a)((function(){return{paper:{maxHeight:200,overflow:"auto",zIndex:1500},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},popper:{zIndex:4}}})),A={dark:Object(i.a)({palette:{type:"dark",primary:o.a,secondary:o.a,primaryBackground:"#222222",primaryBackgroundHighlight:"#000000",primaryBackgroundInput:"#D3D3D3",primaryBackgroundDim:"#333333",primaryBackgroundLight:"#757575",primaryForeground:"#D3D3D3",primaryForegroundDim:"#000000",primaryForegroundActive:"#9bb7d6",secondaryBackground:"#000000",secondaryBackgroundDim:"#444444",secondaryForeground:"#D3D3D3"},props:{MuiButtonBase:{disableRipple:!0}}}),light:Object(i.a)({palette:{type:"light",primary:o.a,secondary:o.a,primaryBackground:"#F1F1F1",primaryBackgroundHighlight:"#FFFFFF",primaryBackgroundInput:"#FFFFFF",primaryBackgroundDim:"#8A8A8A",primaryBackgroundLight:"#e0e0e0",primaryForeground:"#333333",primaryForegroundDim:"#808080",primaryForegroundActive:"#0074D9",secondaryBackground:"#F1F1F1",secondaryBackgroundDim:"#C0C0C0",secondaryForeground:"#222222"},props:{MuiButtonBase:{disableRipple:!0}}})}},function(t,e,n){"use strict";var r={};function i(t,e,n){n||(n=Error);var i=function(t){var n,r;function i(n,r,i){return t.call(this,function(t,n,r){return"string"===typeof e?e:e(t,n,r)}(n,r,i))||this}return r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function o(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var r,i,a,A,s;if("string"===typeof e&&function(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(r="must not be",e=e.replace(/^not /,"")):r="must be",a=t,A=" argument",(void 0===s||s>a.length)&&(s=a.length),a.substring(s-A.length,s)===A)i="The ".concat(t," ").concat(r," ").concat(o(e,"type"));else{var c=function(t,e,n){return"number"!==typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(c," ").concat(r," ").concat(o(e,"type"))}return i+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var i=n(415),o=n(419);n(101)(c,i);for(var a=r(o.prototype),A=0;A<a.length;A++){var s=a[A];c.prototype[s]||(c.prototype[s]=o.prototype[s])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||e.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,n(68))},function(t,e,n){"use strict";var r=n(278),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=l;var o=Object.create(n(237));o.inherits=n(101);var a=n(427),A=n(430);o.inherits(l,a);for(var s=i(A.prototype),c=0;c<s.length;c++){var u=s[c];l.prototype[u]||(l.prototype[u]=A.prototype[u])}function l(t){if(!(this instanceof l))return new l(t);a.call(this,t),A.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",g)}function g(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(109),i=n(69);e.default=function(t,e,n){void 0===n&&(n={});var o=r.getCoord(t),a=r.getCoord(e),A=i.degreesToRadians(a[1]-o[1]),s=i.degreesToRadians(a[0]-o[0]),c=i.degreesToRadians(o[1]),u=i.degreesToRadians(a[1]),l=Math.pow(Math.sin(A/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(u);return i.radiansToLength(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e;if("undefined"!==typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(161),c=n(35),u=n(135),l=function(t){function e(){return Object(r.a)(this,e),Object(o.a)(this,Object(a.a)(e).apply(this,arguments))}return Object(A.a)(e,t),Object(i.a)(e,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(c.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(c.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(c.a)(this[t])}},{key:"setComponent",value:function(t,e){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){return this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){return this[1]=Object(c.a)(t)}}]),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(17),i=n(3),o=n(8),a=n(6),A=n(2),s=n(7),c=n(35),u=n(293),l=n(103),g=n(10),f=n(36),h=n(22),d=n(45),I=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),C=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}),y={},v=function(t){function e(t){var n;return Object(i.a)(this,e),n=Object(o.a)(this,Object(a.a)(e).call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0)),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Object(s.a)(e,t),Object(A.a)(e,[{key:"INDICES",get:function(){return C}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return y.IDENTITY=y.IDENTITY||Object.freeze(new e(I)),y.IDENTITY}},{key:"ZERO",get:function(){return y.ZERO=y.ZERO||Object.freeze(new e(p)),y.ZERO}}]),Object(A.a)(e,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(I)}},{key:"fromQuaternion",value:function(t){return g.c(this,t),this.check()}},{key:"frustum",value:function(t){var n=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?e._computeInfinitePerspectiveOffCenter(this,n,r,i,o,a):g.d(this,n,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],g.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return g.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var n=t.fovy,r=void 0===n?45*Math.PI/180:n,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new e).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=t.fov,r=void 0===n?45*Math.PI/180:n,i=t.aspect,o=void 0===i?1:i,a=t.near,A=void 0===a?.1:a,s=t.far,c=void 0===s?500:s;if((e=e||r)>2*Math.PI)throw Error("radians");return g.j(this,e,o,A,c),this.check()}},{key:"determinant",value:function(){return g.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return g.q(this,this),this.check()}},{key:"invert",value:function(){return g.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return g.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return g.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return g.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return g.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return g.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];return this.rotateX(n).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return g.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?g.o(this,this,t):g.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return g.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=d.n(e||[-0,-0,-0,-0],t,this),Object(c.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=f.j(e||[-0,-0],t,this);break;case 3:e=h.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=Object(l.a)(e||[-0,-0],t,this);break;case 3:e=Object(l.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(c.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(c.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),e}(u.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(17),i=n(3),o=n(8),a=n(6),A=n(2),s=n(7),c=n(161),u=n(31),l=n(35),g=n(240),f="Unknown Euler angle order";var h=function(t){function e(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;(Object(i.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,-0,-0,-0,-0)),arguments.length>0&&Array.isArray(arguments[0]))?(n=t).fromVector3.apply(n,arguments):t.set(r,A,s,c);return t}return Object(s.a)(e,t),Object(A.a)(e,[{key:"ELEMENTS",get:function(){return 4}}],[{key:"rotationOrder",value:function(t){return e.RotationOrders[t]}},{key:"ZYX",get:function(){return 0}},{key:"YXZ",get:function(){return 1}},{key:"XZY",get:function(){return 2}},{key:"ZXY",get:function(){return 3}},{key:"YZX",get:function(){return 4}},{key:"XYZ",get:function(){return 5}},{key:"RollPitchYaw",get:function(){return 0}},{key:"DefaultOrder",get:function(){return e.ZYX}},{key:"RotationOrders",get:function(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}}]),Object(A.a)(e,[{key:"fromQuaternion",value:function(t){var n=Object(r.a)(t,4),i=n[0],o=n[1],a=n[2],A=n[3],s=o*o,c=-2*(s+a*a)+1,u=2*(i*o+A*a),l=-2*(i*a-A*o),g=2*(o*a+A*i),f=-2*(i*i+s)+1;return l=(l=l>1?1:l)<-1?-1:l,new e(Math.atan2(g,f),Math.asin(l),Math.atan2(u,c),e.RollPitchYaw)}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=Number.isFinite(t[3])||this.order,this.check()}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;return this[0]=t,this[1]=e,this[2]=n,this[3]=Number.isFinite(r)?r:this[3],this.check()}},{key:"validate",value:function(){return(t=this[3])>=0&&t<6&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2]);var t}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}},{key:"toArray4",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}},{key:"toVector3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[0],t[1]=this[1],t[2]=this[2],t}},{key:"fromVector3",value:function(t,e){return this.set(t[0],t[1],t[2],Number.isFinite(e)?e:this[3])}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this[0]=t[0+e],this[1]=t[1+e],this[2]=t[2+e],void 0!==t[3]&&(this[3]=t[3]),this.check()}},{key:"fromRollPitchYaw",value:function(t,n,r){return this.set(t,n,r,e.ZYX)}},{key:"fromRotationMatrix",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder;return this._fromRotationMatrix(t,n),this.check()}},{key:"getRotationMatrix",value:function(t){return this._getRotationMatrix(t)}},{key:"getQuaternion",value:function(){var t=new g.a;switch(this[4]){case e.XYZ:return t.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case e.YXZ:return t.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case e.ZXY:return t.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case e.ZYX:return t.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case e.YZX:return t.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case e.XZY:return t.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(f)}}},{key:"_fromRotationMatrix",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder,r=t.elements,i=r[0],o=r[4],a=r[8],A=r[1],s=r[5],c=r[9],l=r[2],g=r[6],h=r[10];switch(n=n||this[3]){case e.XYZ:this[1]=Math.asin(Object(u.d)(a,-1,1)),Math.abs(a)<.99999?(this[0]=Math.atan2(-c,h),this[2]=Math.atan2(-o,i)):(this[0]=Math.atan2(g,s),this[2]=0);break;case e.YXZ:this[0]=Math.asin(-Object(u.d)(c,-1,1)),Math.abs(c)<.99999?(this[1]=Math.atan2(a,h),this[2]=Math.atan2(A,s)):(this[1]=Math.atan2(-l,i),this[2]=0);break;case e.ZXY:this[0]=Math.asin(Object(u.d)(g,-1,1)),Math.abs(g)<.99999?(this[1]=Math.atan2(-l,h),this[2]=Math.atan2(-o,s)):(this[1]=0,this[2]=Math.atan2(A,i));break;case e.ZYX:this[1]=Math.asin(-Object(u.d)(l,-1,1)),Math.abs(l)<.99999?(this[0]=Math.atan2(g,h),this[2]=Math.atan2(A,i)):(this[0]=0,this[2]=Math.atan2(-o,s));break;case e.YZX:this[2]=Math.asin(Object(u.d)(A,-1,1)),Math.abs(A)<.99999?(this[0]=Math.atan2(-c,s),this[1]=Math.atan2(-l,i)):(this[0]=0,this[1]=Math.atan2(a,h));break;case e.XZY:this[2]=Math.asin(-Object(u.d)(o,-1,1)),Math.abs(o)<.99999?(this[0]=Math.atan2(g,s),this[1]=Math.atan2(a,i)):(this[0]=Math.atan2(-c,h),this[1]=0);break;default:throw new Error(f)}return this[3]=n,this}},{key:"_getRotationMatrix",value:function(t){var n=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=this.x,i=this.y,o=this.z,a=Math.cos(r),A=Math.cos(i),s=Math.cos(o),c=Math.sin(r),u=Math.sin(i),l=Math.sin(o);switch(this[3]){case e.XYZ:var g=a*s,h=a*l,d=c*s,I=c*l;n[0]=A*s,n[4]=-A*l,n[8]=u,n[1]=h+d*u,n[5]=g-I*u,n[9]=-c*A,n[2]=I-g*u,n[6]=d+h*u,n[10]=a*A;break;case e.YXZ:var p=A*s,C=A*l,y=u*s,v=u*l;n[0]=p+v*c,n[4]=y*c-C,n[8]=a*u,n[1]=a*l,n[5]=a*s,n[9]=-c,n[2]=C*c-y,n[6]=v+p*c,n[10]=a*A;break;case e.ZXY:var B=A*s,m=A*l,b=u*s,E=u*l;n[0]=B-E*c,n[4]=-a*l,n[8]=b+m*c,n[1]=m+b*c,n[5]=a*s,n[9]=E-B*c,n[2]=-a*u,n[6]=c,n[10]=a*A;break;case e.ZYX:var Q=a*s,F=a*l,w=c*s,S=c*l;n[0]=A*s,n[4]=w*u-F,n[8]=Q*u+S,n[1]=A*l,n[5]=S*u+Q,n[9]=F*u-w,n[2]=-u,n[6]=c*A,n[10]=a*A;break;case e.YZX:var R=a*A,U=a*u,x=c*A,k=c*u;n[0]=A*s,n[4]=k-R*l,n[8]=x*l+U,n[1]=l,n[5]=a*s,n[9]=-c*s,n[2]=-u*s,n[6]=U*l+x,n[10]=R-k*l;break;case e.XZY:var O=a*A,N=a*u,D=c*A,G=c*u;n[0]=A*s,n[4]=-l,n[8]=u*s,n[1]=O*l+G,n[5]=a*s,n[9]=N*l-D,n[2]=D*l-N,n[6]=c*s,n[10]=G*l+O;break;default:throw new Error(f)}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}},{key:"toQuaternion",value:function(){var t=Math.cos(.5*this.yaw),e=Math.sin(.5*this.yaw),n=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),i=Math.cos(.5*this.pitch),o=Math.sin(.5*this.pitch),a=t*n*i+e*r*o,A=t*r*i-e*n*o,s=t*n*o+e*r*i,c=e*n*i-t*r*o;return new g.a(A,s,c,a)}},{key:"x",get:function(){return this[0]},set:function(t){return this[0]=Object(l.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){return this[1]=Object(l.a)(t)}},{key:"z",get:function(){return this[2]},set:function(t){return this[2]=Object(l.a)(t)}},{key:"alpha",get:function(){return this[0]},set:function(t){return this[0]=Object(l.a)(t)}},{key:"beta",get:function(){return this[1]},set:function(t){return this[1]=Object(l.a)(t)}},{key:"gamma",get:function(){return this[2]},set:function(t){return this[2]=Object(l.a)(t)}},{key:"phi",get:function(){return this[0]},set:function(t){return this[0]=Object(l.a)(t)}},{key:"theta",get:function(){return this[1]},set:function(t){return this[1]=Object(l.a)(t)}},{key:"psi",get:function(){return this[2]},set:function(t){return this[2]=Object(l.a)(t)}},{key:"roll",get:function(){return this[0]},set:function(t){return this[0]=Object(l.a)(t)}},{key:"pitch",get:function(){return this[1]},set:function(t){return this[1]=Object(l.a)(t)}},{key:"yaw",get:function(){return this[2]},set:function(t){return this[2]=Object(l.a)(t)}},{key:"order",get:function(){return this[3]},set:function(t){return this[3]=function(t){if(t<0&&t>=6)throw new Error(f);return t}(t)}}]),e}(c.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(105),c=n(49),u=n(95);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(c.d)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(c.a)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(c.c)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(c.b)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(c.a.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(u.a)(!1),0}},{key:"RANK",get:function(){return Object(u.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(s.a)(Array))},function(t,e,n){"use strict";var r=n(23),i=n(17),o=n(40),a=n(179),A=n(37),s=n(169),c=n(67);function u(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var g=Object(s.a)((function(t){var e=t.viewport,n=t.center;return new A.a(e.viewProjectionMatrix).invert().transform(n)})),f=Object(s.a)((function(t){var e,n=t.viewport,o=t.shadowMatrices,a=[],s=n.pixelUnprojectionMatrix,l=n.isGeospatial?void 0:1,g=[[0,0,l],[n.width,0,l],[0,n.height,l],[n.width,n.height,l],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map((function(t){return function(t,e){var n=Object(i.a)(t,3),r=n[0],o=n[1],a=n[2],A=Object(c.l)([r,o,a],e);if(Number.isFinite(a))return A;return[A[0],A[1],0]}(t,s)})),f=u(o);try{var h=function(){var t=e.value,i=t.clone().translate(new A.c(n.center).negate()),o=g.map((function(t){return i.transform(t)})),s=(new A.a).ortho({left:Math.min.apply(Math,Object(r.a)(o.map((function(t){return t[0]})))),right:Math.max.apply(Math,Object(r.a)(o.map((function(t){return t[0]})))),bottom:Math.min.apply(Math,Object(r.a)(o.map((function(t){return t[1]})))),top:Math.max.apply(Math,Object(r.a)(o.map((function(t){return t[1]})))),near:Math.min.apply(Math,Object(r.a)(o.map((function(t){return-t[2]})))),far:Math.max.apply(Math,Object(r.a)(o.map((function(t){return-t[2]}))))});a.push(s.multiplyRight(t))};for(f.s();!(e=f.n()).done;)h()}catch(d){f.e(d)}finally{f.f()}return a})),h=[0,0,0,1],d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function I(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||h,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},r=g({viewport:t.viewport,center:e.project_uCenter}),i=[],a=f({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice(),s=0;s<t.shadowMatrices.length;s++){var c=a[s],u=c.clone().translate(new A.c(t.viewport.center).negate());e.project_uCoordinateSystem===o.a.LNGLAT&&e.project_uProjectionMode===o.c.WEB_MERCATOR?(a[s]=u,i[s]=r):(a[s]=c.clone().multiplyRight(d),i[s]=u.transform(r))}for(var l=0;l<a.length;l++)n["shadow_uViewProjectionMatrices[".concat(l,"]")]=a[l],n["shadow_uProjectCenters[".concat(l,"]")]=i[l],t.shadowMaps&&t.shadowMaps.length>0?n["shadow_uShadowMap".concat(l)]=t.shadowMaps[l]:n["shadow_uShadowMap".concat(l)]=t.dummyShadowMap;return n}e.a={name:"shadow",dependencies:[a.a],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n  if (shadow_uDrawShadowMap) {\n    return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n  }\n  if (shadow_uUseShadowMap) {\n    for (int i = 0; i < max_lights; i++) {\n      if(i < int(shadow_uLightCount)) {\n        vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n        shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n      }\n    }\n  }\n  return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0,  0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n  vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n  float z = dot(rgbaDepth, bitUnpackShift);\n  return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n  if (shadow_uDrawShadowMap) {\n    vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n    rgbaDepth -= rgbaDepth.gbaa * bitMask;\n    return rgbaDepth;\n  }\n  if (shadow_uUseShadowMap) {\n    float shadowAlpha = 0.0;\n    shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n    if(shadow_uLightCount > 1.0) {\n      shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n    }\n    shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n    float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n    return vec4(\n      mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n      blendedAlpha\n    );\n  }\n  return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n    position = shadow_setVertexPosition(geometry.position);\n    ","fs:DECKGL_FILTER_COLOR":"\n    color = shadow_filterShadowColor(color);\n    "},getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){var n={},r=t.shadowEnabled,i=void 0===r||r;return i&&t.shadowMatrices&&t.shadowMatrices.length>0?Object.assign(n,I(t,e)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(t,e,n){var r;!function(i){"use strict";var o,a,A,s=9e15,c="0123456789abcdef",u="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",l="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",g={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-s,maxE:s,crypto:!1},f=!0,h="[DecimalError] Invalid argument: ",d=Math.floor,I=Math.pow,p=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,C=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,y=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,v=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,B=1e7,m=u.length-1,b=l.length-1,E={name:"[object Decimal]"};function Q(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;e<i;e++)(n=7-(r=t[e]+"").length)&&(o+=G(n)),o+=r;(n=7-(r=(a=t[e])+"").length)&&(o+=G(n))}else if(0===a)return"0";for(;a%10===0;)a/=10;return o+a}function F(t,e,n){if(t!==~~t||t<e||t>n)throw Error(h+t)}function w(t,e,n,r){var i,o,a,A;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=I(10,7-e),A=t[i]%o|0,null==r?e<3?(0==e?A=A/100|0:1==e&&(A=A/10|0),a=n<4&&99999==A||n>3&&49999==A||5e4==A||0==A):a=(n<4&&A+1==o||n>3&&A+1==o/2)&&(t[i+1]/o/100|0)==I(10,e-2)-1||(A==o/2||0==A)&&0==(t[i+1]/o/100|0):e<4?(0==e?A=A/1e3|0:1==e?A=A/100|0:2==e&&(A=A/10|0),a=(r||n<4)&&9999==A||!r&&n>3&&4999==A):a=((r||n<4)&&A+1==o||!r&&n>3&&A+1==o/2)&&(t[i+1]/o/1e3|0)==I(10,e-3)-1,a}function S(t,e,n){for(var r,i,o=[0],a=0,A=t.length;a<A;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=c.indexOf(t.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}E.absoluteValue=E.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),U(t)},E.ceil=function(){return U(new this.constructor(this),this.e+1,2)},E.comparedTo=E.cmp=function(t){var e,n,r,i,o=this,a=o.d,A=(t=new o.constructor(t)).d,s=o.s,c=t.s;if(!a||!A)return s&&c?s!==c?s:a===A?0:!a^s<0?1:-1:NaN;if(!a[0]||!A[0])return a[0]?s:A[0]?-c:0;if(s!==c)return s;if(o.e!==t.e)return o.e>t.e^s<0?1:-1;for(e=0,n=(r=a.length)<(i=A.length)?r:i;e<n;++e)if(a[e]!==A[e])return a[e]>A[e]^s<0?1:-1;return r===i?0:r>i^s<0?1:-1},E.cosine=E.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i=e.d.length;i<32?(n=Math.ceil(i/3),r=(1/J(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");t.precision+=n,e=W(t,1,e.times(r),new t(1));for(var o=n;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=n,e}(r,H(r,n)),r.precision=t,r.rounding=e,U(2==A||3==A?n.neg():n,t,e,!0)):new r(1):new r(NaN)},E.cubeRoot=E.cbrt=function(){var t,e,n,r,i,o,a,A,s,c,u=this,l=u.constructor;if(!u.isFinite()||u.isZero())return new l(u);for(f=!1,(o=u.s*I(u.s*u,1/3))&&Math.abs(o)!=1/0?r=new l(o.toString()):(n=Q(u.d),(o=((t=u.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=I(n,1/3),t=d((t+1)/3)-(t%3==(t<0?-1:2)),(r=new l(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=u.s),a=(t=l.precision)+3;;)if(c=(s=(A=r).times(A).times(A)).plus(u),r=R(c.plus(u).times(A),c.plus(s),a+2,1),Q(A.d).slice(0,a)===(n=Q(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(U(r,t+1,1),e=!r.times(r).times(r).eq(u));break}if(!i&&(U(A,t+1,0),A.times(A).times(A).eq(u))){r=A;break}a+=4,i=1}return f=!0,U(r,t,l.rounding,e)},E.decimalPlaces=E.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-d(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},E.dividedBy=E.div=function(t){return R(this,new this.constructor(t))},E.dividedToIntegerBy=E.divToInt=function(t){var e=this.constructor;return U(R(this,new e(t),0,1,1),e.precision,e.rounding)},E.equals=E.eq=function(t){return 0===this.cmp(t)},E.floor=function(){return U(new this.constructor(this),this.e+1,3)},E.greaterThan=E.gt=function(t){return this.cmp(t)>0},E.greaterThanOrEqualTo=E.gte=function(t){var e=this.cmp(t);return 1==e||0===e},E.hyperbolicCosine=E.cosh=function(){var t,e,n,r,i,o=this,a=o.constructor,A=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return A;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/J(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=W(a,1,o.times(e),new a(1),!0);for(var s,c=t,u=new a(8);c--;)s=o.times(o),o=A.minus(s.times(u.minus(s.times(u))));return U(o,a.precision=n,a.rounding=r,!0)},E.hyperbolicSine=E.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=W(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=W(o,2,i=i.times(1/J(5,t)),i,!0);for(var a,A=new o(5),s=new o(16),c=new o(20);t--;)a=i.times(i),i=i.times(A.plus(a.times(s.times(a).plus(c))))}return o.precision=e,o.rounding=n,U(i,e,n,!0)},E.hyperbolicTangent=E.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,R(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},E.inverseCosine=E.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?N(n,i,o):new n(0):new n(NaN):e.isZero()?N(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=N(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},E.inverseHyperbolicCosine=E.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f=!1,n=n.times(n).minus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},E.inverseHyperbolicSine=E.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f=!1,n=n.times(n).plus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln())},E.inverseHyperbolicTangent=E.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?U(new o(i),t,e,!0):(o.precision=n=r-i.e,i=R(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},E.inverseSine=E.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=N(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},E.inverseTangent=E.atan=function(){var t,e,n,r,i,o,a,A,s,c=this,u=c.constructor,l=u.precision,g=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&l+4<=b)return(a=N(u,l+4,g).times(.25)).s=c.s,a}else{if(!c.s)return new u(NaN);if(l+4<=b)return(a=N(u,l+4,g).times(.5)).s=c.s,a}for(u.precision=A=l+10,u.rounding=1,t=n=Math.min(28,A/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(f=!1,e=Math.ceil(A/7),r=1,s=c.times(c),a=new u(c),i=c;-1!==t;)if(i=i.times(s),o=a.minus(i.div(r+=2)),i=i.times(s),void 0!==(a=o.plus(i.div(r+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return n&&(a=a.times(2<<n-1)),f=!0,U(a,u.precision=l,u.rounding=g,!0)},E.isFinite=function(){return!!this.d},E.isInteger=E.isInt=function(){return!!this.d&&d(this.e/7)>this.d.length-2},E.isNaN=function(){return!this.s},E.isNegative=E.isNeg=function(){return this.s<0},E.isPositive=E.isPos=function(){return this.s>0},E.isZero=function(){return!!this.d&&0===this.d[0]},E.lessThan=E.lt=function(t){return this.cmp(t)<0},E.lessThanOrEqualTo=E.lte=function(t){return this.cmp(t)<1},E.logarithm=E.log=function(t){var e,n,r,i,o,a,A,s,c=this.constructor,u=c.precision,l=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new c(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=1!==i}if(f=!1,a=L(this,A=u+5),r=e?O(c,A+10):L(t,A),w((s=R(a,r,A,1)).d,i=u,l))do{if(a=L(this,A+=10),r=e?O(c,A+10):L(t,A),s=R(a,r,A,1),!o){+Q(s.d).slice(i+1,i+15)+1==1e14&&(s=U(s,u+1,0));break}}while(w(s.d,i+=10,l));return f=!0,U(s,u,l)},E.minus=E.sub=function(t){var e,n,r,i,o,a,A,s,c,u,l,g,h=this,I=h.constructor;if(t=new I(t),!h.d||!t.d)return h.s&&t.s?h.d?t.s=-t.s:t=new I(t.d||h.s!==t.s?h:NaN):t=new I(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.plus(t);if(c=h.d,g=t.d,A=I.precision,s=I.rounding,!c[0]||!g[0]){if(g[0])t.s=-t.s;else{if(!c[0])return new I(3===s?-0:0);t=new I(h)}return f?U(t,A,s):t}if(n=d(t.e/7),u=d(h.e/7),c=c.slice(),o=u-n){for((l=o<0)?(e=c,o=-o,a=g.length):(e=g,n=u,a=c.length),o>(r=Math.max(Math.ceil(A/7),a)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((l=(r=c.length)<(a=g.length))&&(a=r),r=0;r<a;r++)if(c[r]!=g[r]){l=c[r]<g[r];break}o=0}for(l&&(e=c,c=g,g=e,t.s=-t.s),a=c.length,r=g.length-a;r>0;--r)c[a++]=0;for(r=g.length;r>o;){if(c[--r]<g[r]){for(i=r;i&&0===c[--i];)c[i]=B-1;--c[i],c[r]+=B}c[r]-=g[r]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(t.d=c,t.e=k(c,n),f?U(t,A,s):t):new I(3===s?-0:0)},E.modulo=E.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?U(new r(n),r.precision,r.rounding):(f=!1,9==r.modulo?(e=R(n,t.abs(),0,3,1)).s*=t.s:e=R(n,t,0,r.modulo,1),e=e.times(t),f=!0,n.minus(e))},E.naturalExponential=E.exp=function(){return j(this)},E.naturalLogarithm=E.ln=function(){return L(this)},E.negated=E.neg=function(){var t=new this.constructor(this);return t.s=-t.s,U(t)},E.plus=E.add=function(t){var e,n,r,i,o,a,A,s,c,u,l=this,g=l.constructor;if(t=new g(t),!l.d||!t.d)return l.s&&t.s?l.d||(t=new g(t.d||l.s===t.s?l:NaN)):t=new g(NaN),t;if(l.s!=t.s)return t.s=-t.s,l.minus(t);if(c=l.d,u=t.d,A=g.precision,s=g.rounding,!c[0]||!u[0])return u[0]||(t=new g(l)),f?U(t,A,s):t;if(o=d(l.e/7),r=d(t.e/7),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,a=u.length):(n=u,r=o,a=c.length),i>(a=(o=Math.ceil(A/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=u.length)<0&&(i=a,n=u,u=c,c=n),e=0;i;)e=(c[--i]=c[i]+u[i]+e)/B|0,c[i]%=B;for(e&&(c.unshift(e),++r),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=k(c,r),f?U(t,A,s):t},E.precision=E.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(h+t);return n.d?(e=D(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},E.round=function(){var t=this,e=t.constructor;return U(new e(t),t.e+1,e.rounding)},E.sine=E.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return W(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/J(5,n)),e=W(t,2,e,e);for(var i,o=new t(5),a=new t(16),A=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(A))));return e}(r,H(r,n)),r.precision=t,r.rounding=e,U(A>2?n.neg():n,t,e,!0)):new r(NaN)},E.squareRoot=E.sqrt=function(){var t,e,n,r,i,o,a=this,A=a.d,s=a.e,c=a.s,u=a.constructor;if(1!==c||!A||!A[0])return new u(!c||c<0&&(!A||A[0])?NaN:A?a:1/0);for(f=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=Q(A)).length+s)%2==0&&(e+="0"),c=Math.sqrt(e),s=d((s+1)/2)-(s<0||s%2),r=new u(e=c==1/0?"5e"+s:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+s)):r=new u(c.toString()),n=(s=u.precision)+3;;)if(r=(o=r).plus(R(a,o,n+2,1)).times(.5),Q(o.d).slice(0,n)===(e=Q(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(U(r,s+1,1),t=!r.times(r).eq(a));break}if(!i&&(U(o,s+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return f=!0,U(r,s,u.rounding,t)},E.tangent=E.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=R(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,U(2==A||4==A?n.neg():n,t,e,!0)):new r(NaN)},E.times=E.mul=function(t){var e,n,r,i,o,a,A,s,c,u=this,l=u.constructor,g=u.d,h=(t=new l(t)).d;if(t.s*=u.s,!g||!g[0]||!h||!h[0])return new l(!t.s||g&&!g[0]&&!h||h&&!h[0]&&!g?NaN:g&&h?0*t.s:t.s/0);for(n=d(u.e/7)+d(t.e/7),(s=g.length)<(c=h.length)&&(o=g,g=h,h=o,a=s,s=c,c=a),o=[],r=a=s+c;r--;)o.push(0);for(r=c;--r>=0;){for(e=0,i=s+r;i>r;)A=o[i]+h[r]*g[i-r-1]+e,o[i--]=A%B|0,e=A/B|0;o[i]=(o[i]+e)%B|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=k(o,n),f?U(t,l.precision,l.rounding):t},E.toBinary=function(t,e){return Y(this,2,t,e)},E.toDecimalPlaces=E.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(F(t,0,1e9),void 0===e?e=r.rounding:F(e,0,8),U(n,t+n.e+1,e))},E.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=x(r,!0):(F(t,0,1e9),void 0===e?e=i.rounding:F(e,0,8),n=x(r=U(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},E.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=x(i):(F(t,0,1e9),void 0===e?e=o.rounding:F(e,0,8),n=x(r=U(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},E.toFraction=function(t){var e,n,r,i,o,a,A,s,c,u,l,g,d=this,p=d.d,C=d.constructor;if(!p)return new C(d);if(c=n=new C(1),r=s=new C(0),a=(o=(e=new C(r)).e=D(p)-d.e-1)%7,e.d[0]=I(10,a<0?7+a:a),null==t)t=o>0?e:c;else{if(!(A=new C(t)).isInt()||A.lt(c))throw Error(h+A);t=A.gt(e)?o>0?e:c:A}for(f=!1,A=new C(Q(p)),u=C.precision,C.precision=o=7*p.length*2;l=R(A,e,0,1,1),1!=(i=n.plus(l.times(r))).cmp(t);)n=r,r=i,i=c,c=s.plus(l.times(i)),s=i,i=e,e=A.minus(l.times(i)),A=i;return i=R(t.minus(n),r,0,1,1),s=s.plus(i.times(c)),n=n.plus(i.times(r)),s.s=c.s=d.s,g=R(c,r,o,1).minus(d).abs().cmp(R(s,n,o,1).minus(d).abs())<1?[c,r]:[s,n],C.precision=u,f=!0,g},E.toHexadecimal=E.toHex=function(t,e){return Y(this,16,t,e)},E.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:F(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(f=!1,n=R(n,t,0,e,1).times(t),f=!0,U(n)):(t.s=n.s,n=t),n},E.toNumber=function(){return+this},E.toOctal=function(t,e){return Y(this,8,t,e)},E.toPower=E.pow=function(t){var e,n,r,i,o,a,A=this,s=A.constructor,c=+(t=new s(t));if(!A.d||!t.d||!A.d[0]||!t.d[0])return new s(I(+A,c));if((A=new s(A)).eq(1))return A;if(r=s.precision,o=s.rounding,t.eq(1))return U(A,r,o);if((e=d(t.e/7))>=t.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=_(s,A,n,r),t.s<0?new s(1).div(i):U(i,r,o);if((a=A.s)<0){if(e<t.d.length-1)return new s(NaN);if(0==(1&t.d[e])&&(a=1),0==A.e&&1==A.d[0]&&1==A.d.length)return A.s=a,A}return(e=0!=(n=I(+A,c))&&isFinite(n)?new s(n+"").e:d(c*(Math.log("0."+Q(A.d))/Math.LN10+A.e+1)))>s.maxE+1||e<s.minE-1?new s(e>0?a/0:0):(f=!1,s.rounding=A.s=1,n=Math.min(12,(e+"").length),(i=j(t.times(L(A,r+n)),r)).d&&w((i=U(i,r+5,1)).d,r,o)&&(e=r+10,+Q((i=U(j(t.times(L(A,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=U(i,r+1,0))),i.s=a,f=!0,s.rounding=o,U(i,r,o))},E.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=x(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(F(t,1,1e9),void 0===e?e=i.rounding:F(e,0,8),n=x(r=U(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},E.toSignificantDigits=E.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(F(t,1,1e9),void 0===e?e=n.rounding:F(e,0,8)),U(new n(this),t,e)},E.toString=function(){var t=this,e=t.constructor,n=x(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},E.truncated=E.trunc=function(){return U(new this.constructor(this),this.e+1,1)},E.valueOf=E.toJSON=function(){var t=this,e=t.constructor,n=x(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var R=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,o,A,s,c){var u,l,g,f,h,I,p,C,y,v,m,b,E,Q,F,w,S,R,x,k,O=r.constructor,N=r.s==i.s?1:-1,D=r.d,G=i.d;if(!D||!D[0]||!G||!G[0])return new O(r.s&&i.s&&(D?!G||D[0]!=G[0]:G)?D&&0==D[0]||!G?0*N:N/0:NaN);for(c?(h=1,l=r.e-i.e):(c=B,h=7,l=d(r.e/h)-d(i.e/h)),x=G.length,S=D.length,v=(y=new O(N)).d=[],g=0;G[g]==(D[g]||0);g++);if(G[g]>(D[g]||0)&&l--,null==o?(Q=o=O.precision,A=O.rounding):Q=s?o+(r.e-i.e)+1:o,Q<0)v.push(1),I=!0;else{if(Q=Q/h+2|0,g=0,1==x){for(f=0,G=G[0],Q++;(g<S||f)&&Q--;g++)F=f*c+(D[g]||0),v[g]=F/G|0,f=F%G|0;I=f||g<S}else{for((f=c/(G[0]+1)|0)>1&&(G=t(G,f,c),D=t(D,f,c),x=G.length,S=D.length),w=x,b=(m=D.slice(0,x)).length;b<x;)m[b++]=0;(k=G.slice()).unshift(0),R=G[0],G[1]>=c/2&&++R;do{f=0,(u=e(G,m,x,b))<0?(E=m[0],x!=b&&(E=E*c+(m[1]||0)),(f=E/R|0)>1?(f>=c&&(f=c-1),1==(u=e(p=t(G,f,c),m,C=p.length,b=m.length))&&(f--,n(p,x<C?k:G,C,c))):(0==f&&(u=f=1),p=G.slice()),(C=p.length)<b&&p.unshift(0),n(m,p,b,c),-1==u&&(u=e(G,m,x,b=m.length))<1&&(f++,n(m,x<b?k:G,b,c)),b=m.length):0===u&&(f++,m=[0]),v[g++]=f,u&&m[0]?m[b++]=D[w]||0:(m=[D[w]],b=1)}while((w++<S||void 0!==m[0])&&Q--);I=void 0!==m[0]}v[0]||v.shift()}if(1==h)y.e=l,a=I;else{for(g=1,f=v[0];f>=10;f/=10)g++;y.e=g+l*h-1,U(y,s?o+y.e+1:o,A,I)}return y}}();function U(t,e,n,r){var i,o,a,A,s,c,u,l,g,h=t.constructor;t:if(null!=e){if(!(l=t.d))return t;for(i=1,A=l[0];A>=10;A/=10)i++;if((o=e-i)<0)o+=7,a=e,s=(u=l[g=0])/I(10,i-a-1)%10|0;else if((g=Math.ceil((o+1)/7))>=(A=l.length)){if(!r)break t;for(;A++<=g;)l.push(0);u=s=0,i=1,a=(o%=7)-7+1}else{for(u=A=l[g],i=1;A>=10;A/=10)i++;s=(a=(o%=7)-7+i)<0?0:u/I(10,i-a-1)%10|0}if(r=r||e<0||void 0!==l[g+1]||(a<0?u:u%I(10,i-a-1)),c=n<4?(s||r)&&(0==n||n==(t.s<0?3:2)):s>5||5==s&&(4==n||r||6==n&&(o>0?a>0?u/I(10,i-a):0:l[g-1])%10&1||n==(t.s<0?8:7)),e<1||!l[0])return l.length=0,c?(e-=t.e+1,l[0]=I(10,(7-e%7)%7),t.e=-e||0):l[0]=t.e=0,t;if(0==o?(l.length=g,A=1,g--):(l.length=g+1,A=I(10,7-o),l[g]=a>0?(u/I(10,i-a)%I(10,a)|0)*A:0),c)for(;;){if(0==g){for(o=1,a=l[0];a>=10;a/=10)o++;for(a=l[0]+=A,A=1;a>=10;a/=10)A++;o!=A&&(t.e++,l[0]==B&&(l[0]=1));break}if(l[g]+=A,l[g]!=B)break;l[g--]=0,A=1}for(o=l.length;0===l[--o];)l.pop()}return f&&(t.e>h.maxE?(t.d=null,t.e=NaN):t.e<h.minE&&(t.e=0,t.d=[0])),t}function x(t,e,n){if(!t.isFinite())return V(t);var r,i=t.e,o=Q(t.d),a=o.length;return e?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+G(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+G(-i-1)+o,n&&(r=n-a)>0&&(o+=G(r))):i>=a?(o+=G(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+G(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=G(r))),o}function k(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function O(t,e,n){if(e>m)throw f=!0,n&&(t.precision=n),Error("[DecimalError] Precision limit exceeded");return U(new t(u),e,1,!0)}function N(t,e,n){if(e>b)throw Error("[DecimalError] Precision limit exceeded");return U(new t(l),e,n,!0)}function D(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function G(t){for(var e="";t--;)e+="0";return e}function _(t,e,n,r){var i,o=new t(1),a=Math.ceil(r/7+4);for(f=!1;;){if(n%2&&X((o=o.times(e)).d,a)&&(i=!0),0===(n=d(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}X((e=e.times(e)).d,a)}return f=!0,o}function M(t){return 1&t.d[t.d.length-1]}function T(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function j(t,e){var n,r,i,o,a,A,s,c=0,u=0,l=0,g=t.constructor,h=g.rounding,d=g.precision;if(!t.d||!t.d[0]||t.e>17)return new g(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(f=!1,s=d):s=e,A=new g(.03125);t.e>-2;)t=t.times(A),l+=5;for(s+=r=Math.log(I(2,l))/Math.LN10*2+5|0,n=o=a=new g(1),g.precision=s;;){if(o=U(o.times(t),s,1),n=n.times(++u),Q((A=a.plus(R(o,n,s,1))).d).slice(0,s)===Q(a.d).slice(0,s)){for(i=l;i--;)a=U(a.times(a),s,1);if(null!=e)return g.precision=d,a;if(!(c<3&&w(a.d,s-r,h,c)))return U(a,g.precision=d,h,f=!0);g.precision=s+=10,n=o=A=new g(1),u=0,c++}a=A}}function L(t,e){var n,r,i,o,a,A,s,c,u,l,g,h=1,d=t,I=d.d,p=d.constructor,C=p.rounding,y=p.precision;if(d.s<0||!I||!I[0]||!d.e&&1==I[0]&&1==I.length)return new p(I&&!I[0]?-1/0:1!=d.s?NaN:I?0:d);if(null==e?(f=!1,u=y):u=e,p.precision=u+=10,r=(n=Q(I)).charAt(0),!(Math.abs(o=d.e)<15e14))return c=O(p,u+2,y).times(o+""),d=L(new p(r+"."+n.slice(1)),u-10).plus(c),p.precision=y,null==e?U(d,y,C,f=!0):d;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=Q((d=d.times(t)).d)).charAt(0),h++;for(o=d.e,r>1?(d=new p("0."+n),o++):d=new p(r+"."+n.slice(1)),l=d,s=a=d=R(d.minus(1),d.plus(1),u,1),g=U(d.times(d),u,1),i=3;;){if(a=U(a.times(g),u,1),Q((c=s.plus(R(a,new p(i),u,1))).d).slice(0,u)===Q(s.d).slice(0,u)){if(s=s.times(2),0!==o&&(s=s.plus(O(p,u+2,y).times(o+""))),s=R(s,new p(h),u,1),null!=e)return p.precision=y,s;if(!w(s.d,u-10,C,A))return U(s,p.precision=y,C,f=!0);p.precision=u+=10,c=a=d=R(l.minus(1),l.plus(1),u,1),g=U(d.times(d),u,1),i=A=1}s=c,i+=2}}function V(t){return String(t.s*t.s/0)}function Z(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=7;r<i;)t.d.push(+e.slice(r,r+=7));r=7-(e=e.slice(r)).length}else r-=i;for(;r--;)e+="0";t.d.push(+e),f&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function P(t,e){var n,r,i,a,A,s,c,u,l;if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(C.test(e))n=16,e=e.toLowerCase();else if(p.test(e))n=2;else{if(!y.test(e))throw Error(h+e);n=8}for((a=e.search(/p/i))>0?(c=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),A=(a=e.indexOf("."))>=0,r=t.constructor,A&&(a=(s=(e=e.replace(".","")).length)-a,i=_(r,new r(n),a,2*a)),a=l=(u=S(e,n,B)).length-1;0===u[a];--a)u.pop();return a<0?new r(0*t.s):(t.e=k(u,l),t.d=u,f=!1,A&&(t=R(t,i,4*s)),c&&(t=t.times(Math.abs(c)<54?I(2,c):o.pow(2,c))),f=!0,t)}function W(t,e,n,r,i){var o,a,A,s,c=t.precision,u=Math.ceil(c/7);for(f=!1,s=n.times(n),A=new t(r);;){if(a=R(A.times(s),new t(e++*e++),c,1),A=i?r.plus(a):r.minus(a),r=R(a.times(s),new t(e++*e++),c,1),void 0!==(a=A.plus(r)).d[u]){for(o=u;a.d[o]===A.d[o]&&o--;);if(-1==o)break}o=A,A=r,r=a,a=o}return f=!0,a.d.length=u+1,a}function J(t,e){for(var n=t;--e;)n*=t;return n}function H(t,e){var n,r=e.s<0,i=N(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return A=r?4:1,e;if((n=e.divToInt(i)).isZero())A=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return A=M(n)?r?2:3:r?4:1,e;A=M(n)?r?1:4:r?3:2}return e.minus(i).abs()}function Y(t,e,n,r){var i,o,A,s,u,l,g,f,h,d=t.constructor,I=void 0!==n;if(I?(F(n,1,1e9),void 0===r?r=d.rounding:F(r,0,8)):(n=d.precision,r=d.rounding),t.isFinite()){for(I?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(A=(g=x(t)).indexOf("."))>=0&&(g=g.replace(".",""),(h=new d(1)).e=g.length-A,h.d=S(x(h),10,i),h.e=h.d.length),o=u=(f=S(g,10,i)).length;0==f[--u];)f.pop();if(f[0]){if(A<0?o--:((t=new d(t)).d=f,t.e=o,f=(t=R(t,h,n,r,0,i)).d,o=t.e,l=a),A=f[n],s=i/2,l=l||void 0!==f[n+1],l=r<4?(void 0!==A||l)&&(0===r||r===(t.s<0?3:2)):A>s||A===s&&(4===r||l||6===r&&1&f[n-1]||r===(t.s<0?8:7)),f.length=n,l)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(u=f.length;!f[u-1];--u);for(A=0,g="";A<u;A++)g+=c.charAt(f[A]);if(I){if(u>1)if(16==e||8==e){for(A=16==e?4:3,--u;u%A;u++)g+="0";for(u=(f=S(g,i,e)).length;!f[u-1];--u);for(A=1,g="1.";A<u;A++)g+=c.charAt(f[A])}else g=g.charAt(0)+"."+g.slice(1);g=g+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)g="0"+g;g="0."+g}else if(++o>u)for(o-=u;o--;)g+="0";else o<u&&(g=g.slice(0,o)+"."+g.slice(o))}else g=I?"0p+0":"0";g=(16==e?"0x":2==e?"0b":8==e?"0o":"")+g}else g=V(t);return t.s<0?"-"+g:g}function X(t,e){if(t.length>e)return t.length=e,!0}function z(t){return new this(t).abs()}function K(t){return new this(t).acos()}function q(t){return new this(t).acosh()}function $(t,e){return new this(t).plus(e)}function tt(t){return new this(t).asin()}function et(t){return new this(t).asinh()}function nt(t){return new this(t).atan()}function rt(t){return new this(t).atanh()}function it(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?N(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=N(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(R(t,e,o,1)),e=N(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(R(t,e,o,1)):(n=N(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function ot(t){return new this(t).cbrt()}function at(t){return U(t=new this(t),t.e+1,2)}function At(t){if(!t||"object"!==typeof t)throw Error("[DecimalError] Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-s,0,"toExpPos",0,s,"maxE",0,s,"minE",-s,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=g[n]),void 0!==(r=t[n])){if(!(d(r)===r&&r>=o[e+1]&&r<=o[e+2]))throw Error(h+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=g[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(h+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[n]=!0}else this[n]=!1}return this}function st(t){return new this(t).cos()}function ct(t){return new this(t).cosh()}function ut(t,e){return new this(t).div(e)}function lt(t){return new this(t).exp()}function gt(t){return U(t=new this(t),t.e+1,3)}function ft(){var t,e,n=new this(0);for(f=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return f=!0,new this(1/0);n=e}return f=!0,n.sqrt()}function ht(t){return t instanceof o||t&&"[object Decimal]"===t.name||!1}function dt(t){return new this(t).ln()}function It(t,e){return new this(t).log(e)}function pt(t){return new this(t).log(2)}function Ct(t){return new this(t).log(10)}function yt(){return T(this,arguments,"lt")}function vt(){return T(this,arguments,"gt")}function Bt(t,e){return new this(t).mod(e)}function mt(t,e){return new this(t).mul(e)}function bt(t,e){return new this(t).pow(e)}function Et(t){var e,n,r,i,o=0,a=new this(1),A=[];if(void 0===t?t=this.precision:F(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:A[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(r*=4);o<r;)(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(A.push(i%1e7),o+=4);o=r/4}else for(;o<r;)A[o++]=1e7*Math.random()|0;for(t%=7,(r=A[--o])&&t&&(i=I(10,7-t),A[o]=(r/i|0)*i);0===A[o];o--)A.pop();if(o<0)n=0,A=[0];else{for(n=-1;0===A[0];n-=7)A.shift();for(r=1,i=A[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=A,a}function Qt(t){return U(t=new this(t),t.e+1,this.rounding)}function Ft(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function wt(t){return new this(t).sin()}function St(t){return new this(t).sinh()}function Rt(t){return new this(t).sqrt()}function Ut(t,e){return new this(t).sub(e)}function xt(t){return new this(t).tan()}function kt(t){return new this(t).tanh()}function Ot(t){return U(t=new this(t),t.e+1,1)}(o=function t(e){var n,r,i;function o(t){var e,n,r,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(f?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e<o.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(e=0,n=t;n>=10;n/=10)e++;return void(f?e>o.maxE?(i.e=NaN,i.d=null):e<o.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[t]):(i.e=e,i.d=[t]))}return 0*t!==0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):Z(i,t.toString())}if("string"!==r)throw Error(h+t);return 45===(n=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===n&&(t=t.slice(1)),i.s=1),v.test(t)?Z(i,t):P(i,t)}if(o.prototype=E,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=At,o.clone=t,o.isDecimal=ht,o.abs=z,o.acos=K,o.acosh=q,o.add=$,o.asin=tt,o.asinh=et,o.atan=nt,o.atanh=rt,o.atan2=it,o.cbrt=ot,o.ceil=at,o.cos=st,o.cosh=ct,o.div=ut,o.exp=lt,o.floor=gt,o.hypot=ft,o.ln=dt,o.log=It,o.log10=Ct,o.log2=pt,o.max=yt,o.min=vt,o.mod=Bt,o.mul=mt,o.pow=bt,o.random=Et,o.round=Qt,o.sign=Ft,o.sin=wt,o.sinh=St,o.sqrt=Rt,o.sub=Ut,o.tan=xt,o.tanh=kt,o.trunc=Ot,void 0===e&&(e={}),e&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)e.hasOwnProperty(r=i[n++])||(e[r]=this[r]);return o.config(e),o}(g)).default=o.Decimal=o,u=new o(u),l=new o(l),void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},function(t,e,n){"use strict";var r=n(3),i=n(8),o=n(6),a=n(54),A=n(2),s=n(7),c=n(102),u=n(127),l=n(47),g="";function f(t,e){return Object(l.a)("string"===typeof t),t=g+t,new Promise((function(n,r){try{var i=new Image;i.onload=function(){return n(i)},i.onerror=function(){return r(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(o){r(o)}}))}n.d(e,"a",(function(){return h}));var h=function(t){function e(t){var n,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,e),Object(u.b)(t),(A instanceof Promise||"string"===typeof A)&&(A={data:A}),"string"===typeof A.data&&(A=Object.assign({},A,{data:f(A.data)})),(n=Object(i.a)(this,Object(o.a)(e).call(this,t,Object.assign({},A,{target:3553})))).initialize(A),Object.seal(Object(a.a)(n)),n}return Object(s.a)(e,t),Object(A.a)(e,null,[{key:"isSupported",value:function(t,e){return c.a.isSupported(t,e)}}]),e}(c.a)},function(t,e,n){"use strict";var r=n(3),i=n(2);n(27),n(79),n(23);Math.PI,Math.PI;var o={};function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}o.EPSILON=1e-12,o.debug=!1,o.precision=4,o.printTypes=!1,o.printDegrees=!1,o.printRowMajor=!0;!function(){function t(e){Object(r.a)(this,t),this.points=e,this.isClosed=function t(e,n,r){var i=o.EPSILON;r&&(o.EPSILON=r);try{if(e===n)return!0;if(a(e)&&a(n)){if(e.length!==n.length)return!1;for(var A=0;A<e.length;++A)if(!t(e[A],n[A]))return!1;return!0}return e&&e.equals?e.equals(n):n&&n.equals?n.equals(e):!(!Number.isFinite(e)||!Number.isFinite(n))&&Math.abs(e-n)<=o.EPSILON*Math.max(1,Math.abs(e),Math.abs(n))}finally{o.EPSILON=i}}(this.points[this.points.length-1],this.points[0]),Object.freeze(this)}Object(i.a)(t,[{key:"getSignedArea",value:function(){var t=0;return this.forEachSegment((function(e,n){t+=(e[0]+n[0])*(e[1]-n[1])})),t/2}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(t){for(var e=this.points.length,n=0;n<e-1;n++)t(this.points[n],this.points[n+1],n,n+1);this.isClosed||t(this.points[e-1],this.points[0],e-1,0)}}])}();function A(t,e){var n=e.length,r=t.length;if(r>0){for(var i=!0,o=0;o<n;o++)if(t[r-n+o]!==e[o]){i=!1;break}if(i)return!1}for(var a=0;a<n;a++)t[r+a]=e[a];return!0}function s(t,e){for(var n=e.length,r=0;r<n;r++)t[r]=e[r]}function c(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=r+e*n,a=0;a<n;a++)i[a]=t[o+a];return i}function u(t,e,n,r){var i,o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(8&n)i=(r[3]-t[1])/(e[1]-t[1]),o=3;else if(4&n)i=(r[1]-t[1])/(e[1]-t[1]),o=1;else if(2&n)i=(r[2]-t[0])/(e[0]-t[0]),o=2;else{if(!(1&n))return null;i=(r[0]-t[0])/(e[0]-t[0]),o=0}for(var A=0;A<t.length;A++)a[A]=(1&o)===A?r[o]:i*(e[A]-t[A])+t[A];return a}function l(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function g(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?2:i,a=r.broken,g=void 0!==a&&a,f=r.gridResolution,h=void 0===f?10:f,d=r.gridOffset,C=void 0===d?[0,0]:d,y=r.startIndex,v=void 0===y?0:y,B=r.endIndex,m=void 0===B?t.length:B,b=(m-v)/o,E=[],Q=[E],F=c(t,0,o,v),w=I(F,h,C,[]),S=[];A(E,F);for(var R=1;R<b;R++){for(n=l(e=c(t,R,o,v,e),w);n;){u(F,e,n,w,S);var U=l(S,w);U&&(u(F,S,U,w,S),n=U),A(E,S),s(F,S),p(w,h,n),g&&E.length>o&&(E=[],Q.push(E),A(E,F)),n=l(e,w)}A(E,e),s(F,e)}return g?Q:Q[0]}function f(t,e){for(var n=0;n<e.length;n++)t.push(e[n]);return t}function h(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.length)return[];for(var r=n.size,i=void 0===r?2:r,o=n.gridResolution,a=void 0===o?10:o,A=n.gridOffset,s=void 0===A?[0,0]:A,c=n.edgeTypes,u=void 0!==c&&c,g=[],h=[{pos:t,types:u&&new Array(t.length/i).fill(1),holes:e||[]}],p=[[],[]],y=[];h.length;){var v=h.shift(),B=v.pos,m=v.types,b=v.holes;C(B,i,b[0]||B.length,p),y=I(p[0],a,s,y);var E=l(p[1],y);if(E){var Q=d(B,m,i,0,b[0]||B.length,y,E),F={pos:Q[0].pos,types:Q[0].types,holes:[]},w={pos:Q[1].pos,types:Q[1].types,holes:[]};h.push(F,w);for(var S=0;S<b.length;S++)(Q=d(B,m,i,b[S],b[S+1]||B.length,y,E))[0]&&(F.holes.push(F.pos.length),F.pos=f(F.pos,Q[0].pos),u&&(F.types=f(F.types,Q[0].types))),Q[1]&&(w.holes.push(w.pos.length),w.pos=f(w.pos,Q[1].pos),u&&(w.types=f(w.types,Q[1].types)))}else{var R={positions:B};u&&(R.edgeTypes=m),b.length&&(R.holeIndices=b),g.push(R)}}return g}function d(t,e,n,r,i,o,a){for(var l,g,f,h=(i-r)/n,d=[],I=[],p=[],C=[],y=[],v=c(t,h-1,n,r),B=Math.sign(8&a?v[1]-o[3]:v[0]-o[2]),m=e&&e[h-1],b=0,E=0,Q=0;Q<h;Q++)l=c(t,Q,n,r,l),g=Math.sign(8&a?l[1]-o[3]:l[0]-o[2]),f=e&&e[r/n+Q],g&&B&&B!==g&&(u(v,l,a,o,y),A(d,y)&&p.push(m),A(I,y)&&C.push(m)),g<=0?(A(d,l)&&p.push(f),b-=g):p.length&&(p[p.length-1]=0),g>=0?(A(I,l)&&C.push(f),E+=g):C.length&&(C[C.length-1]=0),s(v,l),B=g,m=f;return[b?{pos:d,types:e&&p}:null,E?{pos:I,types:e&&C}:null]}function I(t,e,n,r){var i=Math.floor((t[0]-n[0])/e)*e+n[0],o=Math.floor((t[1]-n[1])/e)*e+n[1];return r[0]=i,r[1]=o,r[2]=i+e,r[3]=o+e,r}function p(t,e,n){8&n?(t[1]+=e,t[3]+=e):4&n?(t[1]-=e,t[3]-=e):2&n?(t[0]+=e,t[2]+=e):1&n&&(t[0]-=e,t[2]-=e)}function C(t,e,n,r){for(var i=1/0,o=-1/0,a=1/0,A=-1/0,s=0;s<n;s+=e){var c=t[s],u=t[s+1];i=c<i?c:i,o=c>o?c:o,a=u<a?u:a,A=u>A?u:A}return r[0][0]=i,r[0][1]=a,r[1][0]=o,r[1][1]=A,r}function y(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.size,r=void 0===n?2:n,i=e.startIndex,o=void 0===i?0:i,a=e.endIndex,A=void 0===a?t.length:a,s=e.normalize,c=void 0===s||s,u=t.slice(o,A);Q(u,r,0,A-o);var l=g(u,{size:r,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(c){var f,h=y(l);try{for(h.s();!(f=h.n()).done;){var d=f.value;F(d,r)}}catch(I){h.e(I)}finally{h.f()}}return l}function m(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.size,i=void 0===r?2:r,o=n.normalize,a=void 0===o||o,A=n.edgeTypes,s=void 0!==A&&A;e=e||[];for(var c=[],u=[],l=0,g=0,f=0;f<=e.length;f++){for(var d=e[f]||t.length,I=g,p=b(t,i,l,d),C=p;C<d;C++)c[g++]=t[C];for(var v=l;v<p;v++)c[g++]=t[v];Q(c,i,I,g),E(c,i,I,g,n.maxLatitude),l=d,u[f]=g}u.pop();var B=h(c,u,{size:i,gridResolution:360,gridOffset:[-180,-180],edgeTypes:s});if(a){var m,w=y(B);try{for(w.s();!(m=w.n()).done;){var S=m.value;F(S.positions,i)}}catch(R){w.e(R)}finally{w.f()}}return B}function b(t,e,n,r){for(var i=-1,o=-1,a=n+1;a<r;a+=e){var A=Math.abs(t[a]);A>i&&(i=A,o=a-1)}return o}function E(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:85.051129,o=t[n],a=t[r-e];if(Math.abs(o-a)>180){var s=c(t,0,e,n);s[0]+=360*Math.round((a-o)/360),A(t,s),s[1]=Math.sign(s[1])*i,A(t,s),s[0]=o,A(t,s)}}function Q(t,e,n,r){for(var i,o=t[0],a=n;a<r;a+=e){var A=(i=t[a])-o;(A>180||A<-180)&&(i-=360*Math.round(A/360)),t[a]=o=i}}function F(t,e){for(var n,r=t.length/e,i=0;i<r&&((n=t[i*e])+180)%360===0;i++);var o=360*-Math.round(n/360);if(0!==o)for(var a=0;a<r;a++)t[a*e]+=o}n.d(e,"a",(function(){return h})),n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return B})),n.d(e,"b",(function(){return m}))},function(t,e,n){"use strict";var r,i;n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),function(t){t.cancel="cancel",t.run="run"}(r||(r={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(i||(i={}))},function(t,e,n){"use strict";var r,i,o=n(1),a=n(41),A=function(t){return Object(a.h)(t)?void 0:0},s=(r={},Object(o.a)(r,3074,(function(t){return Object(a.h)(t)?void 0:36064})),Object(o.a)(r,35723,(function(t){return Object(a.h)(t)?void 0:4352})),Object(o.a)(r,35977,A),Object(o.a)(r,32937,A),Object(o.a)(r,36795,(function(t,e){var n=Object(a.h)(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0})),Object(o.a)(r,37445,(function(t,e){var n=t.getExtension("WEBGL_debug_renderer_info");return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)})),Object(o.a)(r,37446,(function(t,e){var n=t.getExtension("WEBGL_debug_renderer_info");return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)})),Object(o.a)(r,34047,(function(t,e){var n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),Object(o.a)(r,32883,A),Object(o.a)(r,35071,A),Object(o.a)(r,37447,A),Object(o.a)(r,36063,(function(t,e){if(!Object(a.h)(t)){var n=t.getExtension("WEBGL_draw_buffers");return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),Object(o.a)(r,35379,A),Object(o.a)(r,35374,A),Object(o.a)(r,35377,A),Object(o.a)(r,34852,(function(t){if(!Object(a.h)(t)){var e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),Object(o.a)(r,36203,(function(t){return t.getExtension("OES_element_index")?2147483647:65535})),Object(o.a)(r,33001,(function(t){return t.getExtension("OES_element_index")?16777216:65535})),Object(o.a)(r,33e3,(function(t){return 16777216})),Object(o.a)(r,37157,A),Object(o.a)(r,35373,A),Object(o.a)(r,35657,A),Object(o.a)(r,36183,A),Object(o.a)(r,37137,A),Object(o.a)(r,34045,A),Object(o.a)(r,35978,A),Object(o.a)(r,35979,A),Object(o.a)(r,35968,A),Object(o.a)(r,35376,A),Object(o.a)(r,35375,A),Object(o.a)(r,35659,A),Object(o.a)(r,37154,A),Object(o.a)(r,35371,A),Object(o.a)(r,35658,A),Object(o.a)(r,35076,A),Object(o.a)(r,35077,A),Object(o.a)(r,35380,A),r);n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}));var c=(i={},Object(o.a)(i,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(a.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(o.a)(i,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){Object(a.a)(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(o.a)(i,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(a.a)(!1)}}),Object(o.a)(i,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(a.a)(!1)},deleteQuery:function(){Object(a.a)(!1)},beginQuery:function(){Object(a.a)(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),i),u={readBuffer:function(t,e,n){Object(a.h)(t)&&e(n)},getVertexAttrib:function(t,e,n,r){var i,o=function(t,e){return{webgl2:Object(a.h)(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays"),A=o.webgl2,s=o.ext;switch(r){case 35069:i=!!A&&void 0;break;case 35070:i=A||s?void 0:0}return void 0!==i?i:e(n,r)},getProgramParameter:function(t,e,n,r){if(!Object(a.h)(t))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,r)},getInternalformatParameter:function(t,e,n,r,i){if(!Object(a.h)(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,r,i)},getTexParameter:function(t,e,n,r){switch(r){case 34046:var i=t.luma.extensions.EXT_texture_filter_anisotropic;r=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,r)},getParameter:function(t,e,n){var r=s[n],i="function"===typeof r?r(t,e,n):r;return void 0!==i?i:e(n)},hint:function(t,e,n,r){return e(n,r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1275);Object.defineProperty(e,"Alpha",{enumerable:!0,get:function(){return l(r).default}});var i=n(891);Object.defineProperty(e,"Checkboard",{enumerable:!0,get:function(){return l(i).default}});var o=n(1278);Object.defineProperty(e,"EditableInput",{enumerable:!0,get:function(){return l(o).default}});var a=n(1279);Object.defineProperty(e,"Hue",{enumerable:!0,get:function(){return l(a).default}});var A=n(1281);Object.defineProperty(e,"Raised",{enumerable:!0,get:function(){return l(A).default}});var s=n(1286);Object.defineProperty(e,"Saturation",{enumerable:!0,get:function(){return l(s).default}});var c=n(1079);Object.defineProperty(e,"ColorWrap",{enumerable:!0,get:function(){return l(c).default}});var u=n(1291);function l(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"Swatch",{enumerable:!0,get:function(){return l(u).default}})},function(t,e,n){"use strict";e.a=function(t,e){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(0),i=n(65),o=!0,a=!1,A=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(t){t.metaKey||t.altKey||t.ctrlKey||(o=!0)}function u(){o=!1}function l(){"hidden"===this.visibilityState&&a&&(o=!0)}function g(t){var e=t.target;try{return e.matches(":focus-visible")}catch(n){}return o||function(t){var e=t.type,n=t.tagName;return!("INPUT"!==n||!s[e]||t.readOnly)||("TEXTAREA"===n&&!t.readOnly||!!t.isContentEditable)}(e)}function f(){a=!0,window.clearTimeout(A),A=window.setTimeout((function(){a=!1}),100)}function h(){return{isFocusVisible:g,onBlurVisible:f,ref:r.useCallback((function(t){var e,n=i.findDOMNode(t);null!=n&&((e=n.ownerDocument).addEventListener("keydown",c,!0),e.addEventListener("mousedown",u,!0),e.addEventListener("pointerdown",u,!0),e.addEventListener("touchstart",u,!0),e.addEventListener("visibilitychange",l,!0))}),[])}}},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(436),l=n(44),g=n(252),f=n(379),h=n(235),d=n(1),I=n(706),p=n(219);function C(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){Object(d.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var b=function(t){Object(a.a)(n,t);var e=m(n);function n(t){return Object(r.a)(this,n),e.call(this,B(B({},t),{},{attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}}))}return Object(i.a)(n,[{key:"getGeometryFromBuffer",value:function(t){return this.normalize?Object(o.a)(Object(s.a)(n.prototype),"getGeometryFromBuffer",this).call(this,t):function(){return null}}},{key:"normalizeGeometry",value:function(t){return this.normalize?function(t,e,n,r){var i=t;if(Array.isArray(t[0])){var o=t.length*e;i=new Array(o);for(var a=0;a<t.length;a++)for(var A=0;A<e;A++)i[a*e+A]=t[a][A]||0}return n?Object(p.c)(i,{size:e,gridResolution:n}):r?Object(p.d)(i,{size:e}):i}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}},{key:"get",value:function(t){return this.attributes[t]}},{key:"getGeometrySize",value:function(t){if(Array.isArray(t[0])){var e,n=0,r=C(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(a){r.e(a)}finally{r.f()}return n}var o=this.getPathLength(t);return o<2?0:this.isClosed(t)?o<3?0:o+2:o}},{key:"updateGeometryAttributes",value:function(t,e){if(0!==e.geometrySize)if(t&&Array.isArray(t[0])){var n,r=C(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o}}catch(a){r.e(a)}finally{r.f()}}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}},{key:"_updateSegmentTypes",value:function(t,e){var n=this.attributes.segmentTypes,r=this.isClosed(t),i=e.vertexStart,o=e.geometrySize;n.fill(0,i,i+o),r?(n[i]=4,n[i+o-2]=4):(n[i]+=1,n[i+o-2]+=2),n[i+o-1]=4}},{key:"_updatePositions",value:function(t,e){var n=this.attributes.positions;if(n)for(var r=e.vertexStart,i=e.geometrySize,o=new Array(3),a=r,A=0;A<i;a++,A++)this.getPointOnPath(t,A,o),n[3*a]=o[0],n[3*a+1]=o[1],n[3*a+2]=o[2]}},{key:"getPathLength",value:function(t){return t.length/this.positionSize}},{key:"getPointOnPath",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.positionSize;e*r>=t.length&&(e+=1-t.length/r);var i=e*r;return n[0]=t[i],n[1]=t[i+1],n[2]=3===r&&t[i+2]||0,n}},{key:"isClosed",value:function(t){if(!this.normalize)return this.opts.loop;var e=this.positionSize,n=t.length-e;return t[0]===t[n]&&t[1]===t[n+1]&&(2===e||t[2]===t[n+2])}}]),n}(I.a);function E(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return S}));var Q=[0,0,0,255],F={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},rounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:function(t){return t.path}},getColor:{type:"accessor",value:Q},getWidth:{type:"accessor",value:1}},w={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},S=function(t){Object(a.a)(n,t);var e=E(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n  return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n  vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n  vec2 width\n) {\n  bool isEnd = positions.x > 0.0;\n  float sideOfPath = positions.y;\n  float isJoint = float(sideOfPath == 0.0);\n\n  vec3 deltaA3 = (currPoint - prevPoint);\n  vec3 deltaB3 = (nextPoint - currPoint);\n\n  mat3 rotationMatrix;\n  bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n  if (needsRotation) {\n    deltaA3 = deltaA3 * rotationMatrix;\n    deltaB3 = deltaB3 * rotationMatrix;\n  }\n  vec2 deltaA = deltaA3.xy / width;\n  vec2 deltaB = deltaB3.xy / width;\n\n  float lenA = length(deltaA);\n  float lenB = length(deltaB);\n\n  vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n  vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n  vec2 perpA = vec2(-dirA.y, dirA.x);\n  vec2 perpB = vec2(-dirB.y, dirB.x);\n  vec2 tangent = dirA + dirB;\n  tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n  vec2 miterVec = vec2(-tangent.y, tangent.x);\n  vec2 dir = isEnd ? dirA : dirB;\n  vec2 perp = isEnd ? perpA : perpB;\n  float L = isEnd ? lenA : lenB;\n  float sinHalfA = abs(dot(miterVec, perp));\n  float cosHalfA = abs(dot(dirA, miterVec));\n  float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n  float cornerPosition = sideOfPath * turnDirection;\n\n  float miterSize = 1.0 / max(sinHalfA, EPSILON);\n  miterSize = mix(\n    min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n    miterSize,\n    step(0.0, cornerPosition)\n  );\n\n  vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n    * (sideOfPath + isJoint * turnDirection);\n  bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n  bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n  bool isCap = isStartCap || isEndCap;\n  if (isCap) {\n    offsetVec = mix(perp * sideOfPath, dir * jointType * 4.0 * flipIfTrue(isStartCap), isJoint);\n  }\n  vPathLength = L;\n  vCornerOffset = offsetVec;\n  vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n  vMiterLength = isCap ? isJoint : vMiterLength;\n\n  vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n  vPathPosition = vec2(\n    dot(offsetFromStartOfPath, perp),\n    dot(offsetFromStartOfPath, dir)\n  );\n  geometry.uv = vPathPosition;\n\n  float isValid = step(instanceTypes, 3.5);\n  vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n  if (needsRotation) {\n    offset = rotationMatrix * offset;\n  }\n  return currPoint + offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n  if (position.w < EPSILON) {\n    float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n    position = refPosition + (position - refPosition) * r;\n  }\n}\n\nvoid main() {\n  geometry.worldPosition = instanceStartPositions;\n  geometry.worldPositionAlt = instanceEndPositions;\n  geometry.pickingColor = instancePickingColors;\n\n  vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n    widthMinPixels, widthMaxPixels) / 2.0);\n  vec3 width;\n\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n  float isEnd = positions.x;\n\n  vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n  vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n  vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n  vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n  vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n  vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n  if (billboard) {\n    vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n    vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n    vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n    clipLine(prevPositionScreen, currPositionScreen);\n    clipLine(nextPositionScreen, currPositionScreen);\n    clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n    width = vec3(widthPixels, 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec3 pos = lineJoin(\n      prevPositionScreen.xyz / prevPositionScreen.w,\n      currPositionScreen.xyz / currPositionScreen.w,\n      nextPositionScreen.xyz / nextPositionScreen.w,\n      project_pixel_size_to_clipspace(width.xy)\n    );\n\n    gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n  } else {\n    prevPosition = project_position(prevPosition, prevPosition64Low);\n    currPosition = project_position(currPosition, currPosition64Low);\n    nextPosition = project_position(nextPosition, nextPosition64Low);\n\n    width = vec3(project_pixel_size(widthPixels), 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec4 pos = vec4(\n      lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n      1.0);\n    geometry.position = pos;\n    gl_Position = project_common_position_to_clipspace(pos);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nvoid main(void) {\n  geometry.uv = vPathPosition;\n\n  if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n    if (jointType > 0.0 && length(vCornerOffset) > 1.0) {\n      discard;\n    }\n    if (jointType == 0.0 && vMiterLength > miterLimit + 1.0) {\n      discard;\n    }\n  }\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a]})}},{key:"initializeState",value:function(){var t=this;this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:w,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:w,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:w,defaultValue:Q},instancePickingColors:{size:3,type:5121,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(e&&e.__source?e.__source.index:r,i)}}}),this.setState({pathTesselator:new b({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&l.a.removed("getDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=t.oldProps,r=t.props,i=t.changeFlags;Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:r,oldProps:e,changeFlags:i});var a=this.getAttributeManager();if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPath)){var A=this.state.pathTesselator,c=r.data.attributes||{};A.updateGeometry({data:r.data,geometryBuffer:c.getPath,buffers:c,normalize:!r._pathType,loop:"loop"===r._pathType,getGeometry:r.getPath,positionFormat:r.positionFormat,wrapLongitude:r.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:i.dataChanged}),this.setState({numInstances:A.instanceCount,startIndices:A.vertexStarts}),i.dataChanged||a.invalidateAll()}if(i.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),a.invalidateAll()}}},{key:"getPickingInfo",value:function(t){var e=Object(o.a)(Object(s.a)(n.prototype),"getPickingInfo",this).call(this,t),r=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===r}))),e}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.rounded,o=r.billboard,a=r.miterLimit,A=r.widthUnits,s=r.widthScale,c=r.widthMinPixels,u=r.widthMaxPixels,l="pixels"===A?n.metersPerPixel:1;this.state.model.setUniforms(Object.assign({},e,{jointType:Number(i),billboard:o,widthScale:s*l,miterLimit:a,widthMinPixels:c,widthMaxPixels:u})).draw()}},{key:"_getModel",value:function(t){return new f.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new h.a({drawMode:4,attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0}))}},{key:"calculatePositions",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateSegmentTypes",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}},{key:"wrapLongitude",get:function(){return!1}}]),n}(g.a);S.layerName="PathLayer",S.defaultProps=F},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(2),o=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,e)}return Object(i.a)(t,[{key:"preRender",value:function(){}},{key:"getModuleParameters",value:function(){}},{key:"cleanup",value:function(){}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));function r(t){var e=i(t);return function(t){var e=i(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){var e=i(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;var n=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:n}}(),r=n.tableMarkers,o=n.sofMarkers,a=2;for(;a+9<e.byteLength;){var A=e.getUint16(a,!1);if(o.has(A))return{mimeType:"image/jpeg",height:e.getUint16(a+5,!1),width:e.getUint16(a+7,!1)};if(!r.has(A))return null;a+=2,a+=e.getUint16(a,!1)}return null}(e)||function(t){var e=i(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){var e=i(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function i(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}},function(t,e,n){var r=n(303),i=n(579),o=n(580),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toDeckColor=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[255,0,0,255];if(!Array.isArray(t))return e;return[255*t[0],255*t[1],255*t[2],255*t[3]]},e.recursivelyTraverseNestedArrays=function t(e,n,r){if(!Array.isArray(e[0]))return!0;for(var i=0;i<e.length;i++)if(t(e[i],[].concat(u(n),[i]),r)){r(e,n);break}return!1},e.generatePointsParallelToLinePoints=function(t,e,n){var A={type:"LineString",coordinates:[t,e]},s=(0,a.point)(n),c=(0,o.default)(s,A),u=(0,i.default)(t,e),l=(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])<0?u-90:u-270,g=(0,r.default)(e,c,l),f=(0,r.default)(t,c,l);return[g.geometry.coordinates,f.geometry.coordinates]},e.distance2d=f,e.mix=h,e.nearestPointOnProjectedLine=function(t,e,n){var r=new A.default(n),i=t.geometry.coordinates.map((function(t){var e=c(t,3),n=e[0],i=e[1],o=e[2],a=void 0===o?0:o;return r.project([n,i,a])})),o=c(r.project(e.geometry.coordinates),2),a=o[0],s=o[1],u=1/0,l={};i.forEach((function(t,e){var n=c(t,2),r=n[0],o=n[1];if(0!==e){var A=c(i[e-1],2),g=A[0],f=A[1],h=f-o,d=r-g,I=g*o-r*f,p=h*h+d*d,C=Math.abs(h*a+d*s+I)/Math.sqrt(p);C<u&&(u=C,l={index:e,x0:(d*(d*a-h*s)-h*I)/p,y0:(h*(-d*a+h*s)-d*I)/p})}}));var g=l,d=g.index,I=g.x0,p=g.y0,C=c(i[d-1],3),y=C[0],v=C[1],B=C[2],m=void 0===B?0:B,b=c(i[d],3),E=b[0],Q=b[1],F=b[2],w=void 0===F?0:F,S=f(y,v,E,Q),R=f(y,v,I,p),U=h(m,w,R/S);return{type:"Feature",geometry:{type:"Point",coordinates:r.unproject([I,p,U])},properties:{dist:u,index:d-1}}},e.getPickedEditHandle=function(t){var e=d(t);return e.length?e[0]:null},e.getPickedSnapSourceEditHandle=function(t){return d(t).find((function(t){return"snap-source"===t.properties.editHandleType}))},e.getNonGuidePicks=function(t){return t&&t.filter((function(t){return!t.isGuide}))},e.getPickedExistingEditHandle=function(t){return d(t).find((function(t){var e=t.properties;return e.featureIndex>=0&&"existing"===e.editHandleType}))},e.getPickedIntermediateEditHandle=function(t){return d(t).find((function(t){var e=t.properties;return e.featureIndex>=0&&"intermediate"===e.editHandleType}))},e.getPickedEditHandles=d,e.getEditHandlesForGeometry=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"existing",r=[];switch(t.type){case"Point":r=[{type:"Feature",properties:{guideType:"editHandle",editHandleType:n,positionIndexes:[],featureIndex:e},geometry:{type:"Point",coordinates:t.coordinates}}];break;case"MultiPoint":case"LineString":r=r.concat(I(t.coordinates,[],e,n));break;case"Polygon":case"MultiLineString":for(var i=0;i<t.coordinates.length;i++)r=r.concat(I(t.coordinates[i],[i],e,n)),"Polygon"===t.type&&(r=r.slice(0,-1));break;case"MultiPolygon":for(var o=0;o<t.coordinates.length;o++)for(var a=0;a<t.coordinates[o].length;a++)r=(r=r.concat(I(t.coordinates[o][a],[o,a],e,n))).slice(0,-1);break;default:throw Error("Unhandled geometry type: ".concat(t.type))}return r};var r=s(n(455)),i=s(n(268)),o=s(n(807)),a=n(69),A=s(n(808));function s(t){return t&&t.__esModule?t:{default:t}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function h(t,e,n){return e*n+t*(1-n)}function d(t){return t&&t.filter((function(t){return t.isGuide&&"editHandle"===t.object.properties.guideType})).map((function(t){return t.object}))||[]}function I(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"existing",i=[],o=0;o<t.length;o++){var a=t[o];i.push({type:"Feature",properties:{guideType:"editHandle",positionIndexes:[].concat(u(e),[o]),featureIndex:n,editHandleType:r},geometry:{type:"Point",coordinates:a}})}return i}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.r(e),n.d(e,"UNITS",(function(){return f})),n.d(e,"h3IsValid",(function(){return k})),n.d(e,"h3IsPentagon",(function(){return O})),n.d(e,"h3IsResClassIII",(function(){return N})),n.d(e,"h3GetBaseCell",(function(){return D})),n.d(e,"h3GetFaces",(function(){return G})),n.d(e,"h3GetResolution",(function(){return _})),n.d(e,"geoToH3",(function(){return M})),n.d(e,"h3ToGeo",(function(){return T})),n.d(e,"h3ToGeoBoundary",(function(){return j})),n.d(e,"h3ToParent",(function(){return L})),n.d(e,"h3ToChildren",(function(){return V})),n.d(e,"h3ToCenterChild",(function(){return Z})),n.d(e,"kRing",(function(){return P})),n.d(e,"kRingDistances",(function(){return W})),n.d(e,"hexRing",(function(){return J})),n.d(e,"polyfill",(function(){return H})),n.d(e,"h3SetToMultiPolygon",(function(){return Y})),n.d(e,"compact",(function(){return X})),n.d(e,"uncompact",(function(){return z})),n.d(e,"h3IndexesAreNeighbors",(function(){return K})),n.d(e,"getH3UnidirectionalEdge",(function(){return q})),n.d(e,"getOriginH3IndexFromUnidirectionalEdge",(function(){return $})),n.d(e,"getDestinationH3IndexFromUnidirectionalEdge",(function(){return tt})),n.d(e,"h3UnidirectionalEdgeIsValid",(function(){return et})),n.d(e,"getH3IndexesFromUnidirectionalEdge",(function(){return nt})),n.d(e,"getH3UnidirectionalEdgesFromHexagon",(function(){return rt})),n.d(e,"getH3UnidirectionalEdgeBoundary",(function(){return it})),n.d(e,"h3Distance",(function(){return ot})),n.d(e,"h3Line",(function(){return at})),n.d(e,"experimentalH3ToLocalIj",(function(){return At})),n.d(e,"experimentalLocalIjToH3",(function(){return st})),n.d(e,"pointDist",(function(){return ct})),n.d(e,"cellArea",(function(){return ut})),n.d(e,"exactEdgeLength",(function(){return lt})),n.d(e,"hexArea",(function(){return gt})),n.d(e,"edgeLength",(function(){return ft})),n.d(e,"numHexagons",(function(){return ht})),n.d(e,"getRes0Indexes",(function(){return dt})),n.d(e,"getPentagonIndexes",(function(){return It})),n.d(e,"degsToRads",(function(){return pt})),n.d(e,"radsToDegs",(function(){return Ct}));var r=function(t){var e,n="undefined"!==typeof(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,o=[],a="";document.currentScript&&(a=document.currentScript.src),a=0!==a.indexOf("blob:")?a.substr(0,a.lastIndexOf("/")+1):"",i=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=X(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)};var A=n.print||console.log.bind(console),s=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&(o=n.arguments);var c=0,u=function(){return c};var l=!1;function g(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||st("Assertion failed: "+e),r}function f(t,e,n,r,i){var o={string:function(t){var e=0;if(null!==t&&void 0!==t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,a=0;a<t.length;++a){var A=t.charCodeAt(a);if(A>=55296&&A<=57343){var s=t.charCodeAt(++a);A=65536+((1023&A)<<10)|1023&s}if(A<=127){if(n>=o)break;e[n++]=A}else if(A<=2047){if(n+1>=o)break;e[n++]=192|A>>6,e[n++]=128|63&A}else if(A<=65535){if(n+2>=o)break;e[n++]=224|A>>12,e[n++]=128|A>>6&63,e[n++]=128|63&A}else{if(n+3>=o)break;e[n++]=240|A>>18,e[n++]=128|A>>12&63,e[n++]=128|A>>6&63,e[n++]=128|63&A}}e[n]=0})(t,C,e,n)})(t,e=tt(n),n)}return e},array:function(t){var e=tt(t.length);return function(t,e){p.set(t,e)}(t,e),e}};var a=g(t),A=[],s=0;if(r)for(var c=0;c<r.length;c++){var u=o[n[c]];u?(0===s&&(s=nt()),A[c]=u(r[c])):A[c]=r[c]}var l=a.apply(null,A);return l=function(t){return"string"===e?d(t):"boolean"===e?Boolean(t):t}(l),0!==s&&et(s),l}var h="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function d(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&h)return h.decode(t.subarray(e,i));for(var o="";e<i;){var a=t[e++];if(128&a){var A=63&t[e++];if(192!=(224&a)){var s=63&t[e++];if((a=224==(240&a)?(15&a)<<12|A<<6|s:(7&a)<<18|A<<12|s<<6|63&t[e++])<65536)o+=String.fromCharCode(a);else{var c=a-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|A)}else o+=String.fromCharCode(a)}return o}(C,t,e):""}var I,p,C,y,v,B,m;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function b(t,e){return t%e>0&&(t+=e-t%e),t}function E(t){I=t,n.HEAP8=p=new Int8Array(t),n.HEAP16=y=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=C=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=B=new Float32Array(t),n.HEAPF64=m=new Float64Array(t)}var Q=n.TOTAL_MEMORY||33554432;function F(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"===typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}Q=(I=n.buffer?n.buffer:new ArrayBuffer(Q)).byteLength,E(I),v[6004]=5266928;var w=[],S=[],R=[],U=[];var x=Math.abs,k=Math.ceil,O=Math.floor,N=Math.min,D=0,G=null,_=null;n.preloadedImages={},n.preloadedAudios={};var M,T,j=null,L="data:application/octet-stream;base64,";function V(t){return String.prototype.startsWith?t.startsWith(L):0===t.indexOf(L)}j="data:application/octet-stream;base64, ";function Z(t){return t}function P(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function W(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return p.length}function H(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(p),$(e),E(e),1}catch(n){}}var Y="function"===typeof atob?atob:function(t){var e,n,r,i,o,a,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=A.indexOf(t.charAt(c++))<<2|(i=A.indexOf(t.charAt(c++)))>>4,n=(15&i)<<4|(o=A.indexOf(t.charAt(c++)))>>2,r=(3&o)<<6|(a=A.indexOf(t.charAt(c++))),s+=String.fromCharCode(e),64!==o&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(r))}while(c<t.length);return s};function X(t){if(V(t))return function(t){try{for(var e=Y(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(i){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(L.length))}var z,K,q=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n),o=(new t.Uint8Array(n),new t.Float32Array(n),new t.Float64Array(n)),a=0|e.p,A=t.Math.floor,s=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,l=t.Math.cos,g=t.Math.sin,f=t.Math.tan,h=t.Math.acos,d=t.Math.asin,I=t.Math.atan,p=t.Math.atan2,C=t.Math.ceil,y=t.Math.imul,v=t.Math.min,B=t.Math.clz32,m=e.b,b=e.c,E=e.d,Q=e.e,F=e.f,w=e.g,S=e.h,R=e.i,U=24048;function x(t,e,n,r){var i,o;0|k(t|=0,e|=0,n|=0,r|=0,0)&&(Re(0|r,0,(o=1+(0|y(3*n|0,n+1|0))|0)<<3|0),(i=0|ye(o,4))&&(O(t,e,n,r,i,o,0),Ce(i)))}function k(t,e,n,r,o){t|=0,e|=0,n|=0,o|=0;var a,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0;if(a=U,U=U+16|0,h=a,i[(A=r|=0)>>2]=t,i[A+4>>2]=e,(A=0!=(0|o))&&(i[o>>2]=0),0|Nt(t,e))return U=a,0|(h=1);i[h>>2]=0;t:do{if((0|n)>=1)if(A)for(l=0,g=1,f=1,s=0,A=t;;){if(!(s|l)){if(0==(0|(A=0|N(A,e,4,h)))&0==(0|(e=0|b()))){A=2;break t}if(0|Nt(A,e)){A=1;break t}}if(0==(0|(A=0|N(A,e,0|i[16+(l<<2)>>2],h)))&0==(0|(e=0|b()))){A=2;break t}if(i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,i[o+(f<<2)>>2]=g,t=(0|(s=s+1|0))==(0|g),u=6==(0|(c=l+1|0)),0|Nt(A,e)){A=1;break t}if((0|(g=g+(u&t&1)|0))>(0|n)){A=0;break}l=t?u?0:c:l,f=f+1|0,s=t?0:s}else for(l=0,g=1,f=1,s=0,A=t;;){if(!(s|l)){if(0==(0|(A=0|N(A,e,4,h)))&0==(0|(e=0|b()))){A=2;break t}if(0|Nt(A,e)){A=1;break t}}if(0==(0|(A=0|N(A,e,0|i[16+(l<<2)>>2],h)))&0==(0|(e=0|b()))){A=2;break t}if(i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,t=(0|(s=s+1|0))==(0|g),u=6==(0|(c=l+1|0)),0|Nt(A,e)){A=1;break t}if((0|(g=g+(u&t&1)|0))>(0|n)){A=0;break}l=t?u?0:c:l,f=f+1|0,s=t?0:s}else A=0}while(0);return U=a,0|(h=A)}function O(t,e,n,r,o,a,A){n|=0,r|=0,o|=0,a|=0,A|=0;var s,c,u=0,l=0,g=0,f=0,h=0;if(c=U,U=U+16|0,s=c,0==(0|(t|=0))&0==(0|(e|=0)))U=c;else{if(u=0|be(0|t,0|e,0|a,((0|a)<0)<<31>>31|0),b(),!(0==(0|(h=0|i[(f=l=r+(u<<3)|0)>>2]))&0==(0|(f=0|i[f+4>>2]))|(g=(0|h)==(0|t)&(0|f)==(0|e))))do{g=(0|(f=0|i[(h=l=r+((u=(u+1|0)%(0|a)|0)<<3)|0)>>2]))==(0|t)&(0|(h=0|i[h+4>>2]))==(0|e)}while(!(0==(0|f)&0==(0|h)|g));u=o+(u<<2)|0,g&&(0|i[u>>2])<=(0|A)||(i[(h=l)>>2]=t,i[h+4>>2]=e,i[u>>2]=A,(0|A)>=(0|n)||(h=A+1|0,i[s>>2]=0,O(f=0|N(t,e,2,s),0|b(),n,r,o,a,h),i[s>>2]=0,O(f=0|N(t,e,3,s),0|b(),n,r,o,a,h),i[s>>2]=0,O(f=0|N(t,e,1,s),0|b(),n,r,o,a,h),i[s>>2]=0,O(f=0|N(t,e,5,s),0|b(),n,r,o,a,h),i[s>>2]=0,O(f=0|N(t,e,4,s),0|b(),n,r,o,a,h),i[s>>2]=0,O(f=0|N(t,e,6,s),0|b(),n,r,o,a,h))),U=c}}function N(t,e,n,r){t|=0,e|=0,n|=0;var o,a,A=0,s=0,c=0,u=0,l=0,g=0,f=0;if((0|i[(r|=0)>>2])>0){A=0;do{n=0|st(n),A=A+1|0}while((0|A)<(0|i[r>>2]))}o=0|Ee(0|t,0|e,45),b(),a=127&o,s=0|Dt(t,e),A=0|Ee(0|t,0|e,52),b(),A&=15;t:do{if(A)for(;;){if(g=0|Ee(0|t,0|e,0|(l=3*(15-A|0)|0)),b(),g&=7,f=0==(0|jt(A)),A=A+-1|0,u=0|Qe(7,0,0|l),e&=~(0|b()),t=(l=0|Qe(0|i[(f?464:48)+(28*g|0)+(n<<2)>>2],0,0|l))|t&~u,e|=0|b(),!(n=0|i[(f?672:256)+(28*g|0)+(n<<2)>>2])){n=0;break t}if(!A){c=6;break}}else c=6}while(0);6==(0|c)&&(t|=g=0|Qe(0|(f=0|i[880+(28*a|0)+(n<<2)>>2]),0,45),e=0|b()|-1040385&e,n=0|i[4304+(28*a|0)+(n<<2)>>2],127==(127&f|0)&&(f=0|Qe(0|i[880+(28*a|0)+20>>2],0,45),e=0|b()|-1040385&e,n=0|i[4304+(28*a|0)+20>>2],t=0|_t(f|t,e),e=0|b(),i[r>>2]=1+(0|i[r>>2]))),c=0|Ee(0|t,0|e,45),b(),c&=127;t:do{if(0|G(c)){e:do{if(1==(0|Dt(t,e))){if((0|a)!=(0|c)){if(0|j(c,0|i[7728+(28*a|0)>>2])){t=0|Tt(t,e),s=1,e=0|b();break}t=0|_t(t,e),s=1,e=0|b();break}switch(0|s){case 5:t=0|Tt(t,e),e=0|b(),i[r>>2]=5+(0|i[r>>2]),s=0;break e;case 3:t=0|_t(t,e),e=0|b(),i[r>>2]=1+(0|i[r>>2]),s=0;break e;default:return f=0,m(0|(g=0)),0|f}}else s=0}while(0);if((0|n)>0){A=0;do{t=0|Gt(t,e),e=0|b(),A=A+1|0}while((0|A)!=(0|n))}if((0|a)!=(0|c)){if(!(0|_(c))){if(0!=(0|s)|5!=(0|Dt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|Dt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){A=0;do{t=0|_t(t,e),e=0|b(),A=A+1|0}while((0|A)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,f=t,m(0|(g=e)),0|f}function D(t,e,n,r,a,A){e|=0,n|=0,r|=0,a|=0,A|=0;var s,c,u,l,g,f,h,d,I,p=0,C=0,y=0,v=0,B=0,m=0,E=0,Q=0,F=0,w=0,S=0,R=0,x=0,k=0;if(I=U,U=U+48|0,f=I+32|0,h=I+16|0,d=I,(0|(p=0|i[(t|=0)>>2]))<=0)return U=I,0|(R=0);s=t+4|0,c=f+8|0,u=h+8|0,l=d+8|0,g=((0|e)<0)<<31>>31,S=0;t:for(;;){F=(C=0|i[s>>2])+(S<<4)|0,i[f>>2]=i[F>>2],i[f+4>>2]=i[F+4>>2],i[f+8>>2]=i[F+8>>2],i[f+12>>2]=i[F+12>>2],(0|S)==(p+-1|0)?(i[h>>2]=i[C>>2],i[h+4>>2]=i[C+4>>2],i[h+8>>2]=i[C+8>>2],i[h+12>>2]=i[C+12>>2]):(F=C+(S+1<<4)|0,i[h>>2]=i[F>>2],i[h+4>>2]=i[F+4>>2],i[h+8>>2]=i[F+8>>2],i[h+12>>2]=i[F+12>>2]),F=0|J(f,h,n);e:do{if((0|F)>0){w=+(0|F),Q=0;n:for(;;){k=+(F-Q|0),x=+(0|Q),o[d>>3]=+o[f>>3]*k/w+ +o[h>>3]*x/w,o[l>>3]=+o[c>>3]*k/w+ +o[u>>3]*x/w,C=0|be(0|(m=0|Lt(d,n)),0|(E=0|b()),0|e,0|g),b(),v=0|i[(y=p=A+(C<<3)|0)>>2],y=0|i[y+4>>2];r:do{if(0==(0|v)&0==(0|y))R=14;else for(B=0;;){if((0|B)>(0|e)){p=1;break r}if((0|v)==(0|m)&(0|y)==(0|E)){p=7;break r}if(0==(0|(v=0|i[(y=p=A+((C=(C+1|0)%(0|e)|0)<<3)|0)>>2]))&0==(0|(y=0|i[y+4>>2]))){R=14;break}B=B+1|0}}while(0);switch(14==(0|R)&&(R=0,0==(0|m)&0==(0|E)?p=7:(i[p>>2]=m,i[p+4>>2]=E,p=0|i[r>>2],i[(B=a+(p<<3)|0)>>2]=m,i[B+4>>2]=E,i[r>>2]=p+1,p=0)),7&p){case 7:case 0:break;default:break n}if((0|F)<=(0|(Q=Q+1|0))){R=8;break e}}if(0|p){p=-1,R=20;break t}}else R=8}while(0);if(8==(0|R)&&(R=0),(0|(S=S+1|0))>=(0|(p=0|i[t>>2]))){p=0,R=20;break}}return 20==(0|R)?(U=I,0|p):0}function G(t){return 0|i[7728+(28*(t|=0)|0)+16>>2]}function _(t){return 4==(0|(t|=0))|117==(0|t)|0}function M(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function T(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7728+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7728+(28*t|0)+24>>2])==(0|e))}function L(t,e){return 0|i[880+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function V(t,e){return e|=0,(0|i[880+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[880+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[880+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[880+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[880+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[880+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[880+(28*t|0)+24>>2])==(0|e)?6:7)}function Z(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function P(t,e){t|=0;var n,r,i=0;return(i=+o[(e|=0)>>3])>=+o[t+8>>3]&&i<=+o[t>>3]?(n=+o[t+16>>3],i=+o[t+24>>3],e=(r=+o[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function W(t,e){t|=0,e|=0;var n,r,a,A,c,u,l=0,g=0;A=U,U=U+288|0,n=A+264|0,r=A+96|0,g=(l=a=A)+96|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|g));return Jt(e,a),Pt(g=0|i[(l=a)>>2],l=0|i[l+4>>2],n),Wt(g,l,r),c=+St(n,r+8|0),o[n>>3]=+o[t>>3],o[(l=n+8|0)>>3]=+o[t+16>>3],o[r>>3]=+o[t+8>>3],o[(g=r+8|0)>>3]=+o[t+24>>3],u=+St(n,r),g=~~+C(+u*u/+Fe(+ +s(+(+o[l>>3]-+o[g>>3])/(+o[n>>3]-+o[r>>3])),3)/(c*(2.59807621135*c)*.8)),U=A,0|(0==(0|g)?1:g)}function J(t,e,n){t|=0,e|=0,n|=0;var r,o,a,A,s,c=0,u=0;A=U,U=U+288|0,r=A+264|0,o=A+96|0,u=(c=a=A)+96|0;do{i[c>>2]=0,c=c+4|0}while((0|c)<(0|u));return Jt(n,a),Pt(c=0|i[(u=a)>>2],u=0|i[u+4>>2],r),Wt(c,u,o),s=+St(r,o+8|0),u=~~+C(+ +St(t,e)/(2*s)),U=A,0|(0==(0|u)?1:u)}function H(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function Y(t,e){t|=0;var n,r,a,A,c=0,u=0,l=0,g=0,f=0,h=0,d=0;i[(A=(e|=0)+8|0)>>2]=0,r=+o[t>>3],g=+s(+r),a=+o[t+8>>3],g+=.5*(f=+s(+a)/.8660254037844386),g-=+(0|(c=~~g)),f-=+(0|(t=~~f));do{if(g<.5){if(g<.3333333333333333){if(i[e>>2]=c,f<.5*(g+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(f<(d=1-g)))+t|0,i[e+4>>2]=t,d<=f&f<2*g){c=c+1|0,i[e>>2]=c;break}i[e>>2]=c;break}if(!(g<.6666666666666666)){if(c=c+1|0,i[e>>2]=c,f<.5*g){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(f<1-g){if(i[e+4>>2]=t,2*g-1<f){i[e>>2]=c;break}}else t=t+1|0,i[e+4>>2]=t;c=c+1|0,i[e>>2]=c}while(0);do{if(r<0){if(1&t){c=~~(+(0|c)-(2*(+((h=0|ve(0|c,((0|c)<0)<<31>>31|0,0|(h=(t+1|0)/2|0),((0|h)<0)<<31>>31|0))>>>0)+4294967296*+(0|b()))+1)),i[e>>2]=c;break}c=~~(+(0|c)-2*(+((h=0|ve(0|c,((0|c)<0)<<31>>31|0,0|(h=(0|t)/2|0),((0|h)<0)<<31>>31|0))>>>0)+4294967296*+(0|b()))),i[e>>2]=c;break}}while(0);h=e+4|0,a<0&&(c=c-((1|t<<1)/2|0)|0,i[e>>2]=c,t=0-t|0,i[h>>2]=t),u=t-c|0,(0|c)<0?(l=0-c|0,i[h>>2]=u,i[A>>2]=l,i[e>>2]=0,t=u,c=0):l=0,(0|t)<0&&(c=c-t|0,i[e>>2]=c,l=l-t|0,i[A>>2]=l,i[h>>2]=0,t=0),n=c-l|0,u=t-l|0,(0|l)<0&&(i[e>>2]=n,i[h>>2]=u,i[A>>2]=0,t=u,c=n,l=0),(0|(u=(0|l)<(0|(u=(0|t)<(0|c)?t:c))?l:u))<=0||(i[e>>2]=c-u,i[h>>2]=t-u,i[A>>2]=l-u)}function X(t){var e,n=0,r=0,o=0,a=0,A=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(A=t+8|0)>>2]=(0|i[A>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,a=(0|i[(A=t+8|0)>>2])-r|0,i[A>>2]=a,i[e>>2]=0,r=0):(A=a=t+8|0,a=0|i[a>>2]),(0|a)<0&&(n=n-a|0,i[t>>2]=n,r=r-a|0,i[e>>2]=r,i[A>>2]=0,a=0),(0|(o=(0|a)<(0|(o=(0|r)<(0|n)?r:n))?a:o))<=0||(i[t>>2]=n-o,i[e>>2]=r-o,i[A>>2]=a-o)}function z(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),o[e>>3]=+((0|i[t>>2])-r|0)-.5*n,o[e+8>>3]=.8660254037844386*n}function K(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function q(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function $(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function tt(t){var e,n,r=0,o=0,a=0,A=0,s=0;s=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(o=(0|(A=((e=(0|(a=(0|i[t+4>>2])-(s?n:0)|0))<0)?0-a|0:0)+((0|i[t+8>>2])-(s?n:0))|0))<0)?0:A)-((a=(0|(o=(0|t)<(0|(o=(0|(r=(e?0:a)-(o?A:0)|0))<(0|(A=(s?0:n)-(e?a:0)-(o?A:0)|0))?r:A))?t:o))>0)?o:0)|0,r=r-(a?o:0)|0;t:do{switch(A-(a?o:0)|0){case 0:switch(0|r){case 0:return 0|(s=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(s=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|r){case 0:return 0|(s=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(s=7)}function et(t){var e,n,r=0,o=0,a=0,A=0,s=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|Ie(+((3*(r=(0|i[t>>2])-o|0)|0)-(o=(0|i[(n=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,r=0|Ie(+((o<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,o=r-a|0,(0|a)<0?(s=0-a|0,i[n>>2]=o,i[e>>2]=s,i[t>>2]=0,r=o,a=0,o=s):o=0,(0|r)<0&&(a=a-r|0,i[t>>2]=a,o=o-r|0,i[e>>2]=o,i[n>>2]=0,r=0),s=a-o|0,A=r-o|0,(0|o)<0?(i[t>>2]=s,i[n>>2]=A,i[e>>2]=0,r=A,A=s,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|A)?r:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=r-a,i[e>>2]=o-a)}function nt(t){var e,n,r=0,o=0,a=0,A=0,s=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|Ie(+(((r=(0|i[t>>2])-o|0)<<1)+(o=(0|i[(n=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,r=0|Ie(+((3*o|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,o=r-a|0,(0|a)<0?(s=0-a|0,i[n>>2]=o,i[e>>2]=s,i[t>>2]=0,r=o,a=0,o=s):o=0,(0|r)<0&&(a=a-r|0,i[t>>2]=a,o=o-r|0,i[e>>2]=o,i[n>>2]=0,r=0),s=a-o|0,A=r-o|0,(0|o)<0?(i[t>>2]=s,i[n>>2]=A,i[e>>2]=0,r=A,A=s,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|A)?r:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=r-a,i[e>>2]=o-a)}function rt(t){var e,n,r,o=0,a=0,A=0,s=0;o=0|i[(t|=0)>>2],a=0|i[(n=t+4|0)>>2],A=0|i[(r=t+8|0)>>2],s=a+(3*o|0)|0,i[t>>2]=s,a=A+(3*a|0)|0,i[n>>2]=a,o=(3*A|0)+o|0,i[r>>2]=o,A=a-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=A,i[r>>2]=o,i[t>>2]=0,a=A,A=0):A=s,(0|a)<0&&(A=A-a|0,i[t>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=A-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function it(t){var e,n,r,o=0,a=0,A=0,s=0;s=0|i[(t|=0)>>2],A=(3*(o=0|i[(n=t+4|0)>>2])|0)+s|0,s=(a=0|i[(r=t+8|0)>>2])+(3*s|0)|0,i[t>>2]=s,i[n>>2]=A,o=(3*a|0)+o|0,i[r>>2]=o,a=A-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,s=0):a=A,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,A=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function ot(t,e){t|=0;var n,r,o,a=0,A=0,s=0;((e|=0)+-1|0)>>>0>=6||(s=(0|i[15472+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=s,o=t+4|0,A=(0|i[15472+(12*e|0)+4>>2])+(0|i[o>>2])|0,i[o>>2]=A,r=t+8|0,e=(0|i[15472+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,a=A-s|0,(0|s)<0?(e=e-s|0,i[o>>2]=a,i[r>>2]=e,i[t>>2]=0,A=0):(a=A,A=s),(0|a)<0&&(A=A-a|0,i[t>>2]=A,e=e-a|0,i[r>>2]=e,i[o>>2]=0,a=0),n=A-e|0,s=a-e|0,(0|e)<0?(i[t>>2]=n,i[o>>2]=s,i[r>>2]=0,A=n,e=0):s=a,(0|(a=(0|e)<(0|(a=(0|s)<(0|A)?s:A))?e:a))<=0||(i[t>>2]=A-a,i[o>>2]=s-a,i[r>>2]=e-a))}function at(t){var e,n,r,o=0,a=0,A=0,s=0;s=0|i[(t|=0)>>2],A=(o=0|i[(n=t+4|0)>>2])+s|0,s=(a=0|i[(r=t+8|0)>>2])+s|0,i[t>>2]=s,i[n>>2]=A,o=a+o|0,i[r>>2]=o,a=A-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,A=0):(a=A,A=s),(0|a)<0&&(A=A-a|0,i[t>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=A-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function At(t){var e,n,r,o=0,a=0,A=0,s=0;o=0|i[(t|=0)>>2],A=0|i[(n=t+4|0)>>2],a=0|i[(r=t+8|0)>>2],s=A+o|0,i[t>>2]=s,A=a+A|0,i[n>>2]=A,o=a+o|0,i[r>>2]=o,a=A-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,A=0):(a=A,A=s),(0|a)<0&&(A=A-a|0,i[t>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=A-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function st(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function ct(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function ut(t){var e,n,r,o=0,a=0,A=0,s=0;o=0|i[(t|=0)>>2],a=0|i[(n=t+4|0)>>2],A=0|i[(r=t+8|0)>>2],s=a+(o<<1)|0,i[t>>2]=s,a=A+(a<<1)|0,i[n>>2]=a,o=(A<<1)+o|0,i[r>>2]=o,A=a-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=A,i[r>>2]=o,i[t>>2]=0,a=A,A=0):A=s,(0|a)<0&&(A=A-a|0,i[t>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=A-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[t>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function lt(t){var e,n,r,o=0,a=0,A=0,s=0;s=0|i[(t|=0)>>2],A=((o=0|i[(n=t+4|0)>>2])<<1)+s|0,s=(a=0|i[(r=t+8|0)>>2])+(s<<1)|0,i[t>>2]=s,i[n>>2]=A,o=(a<<1)+o|0,i[r>>2]=o,a=A-s|0,(0|s)<0?(o=o-s|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,s=0):a=A,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,A=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function gt(t,e){e|=0;var n,r,o,a=0,A=0,s=0;return o=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(A=(0|i[t+4>>2])-(0|i[e+4>>2])-(o?r:0)|0))<0,e=(e=(t=(0|(s=(o?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-A|0:0)|0))<0)?0:s)-((A=(0|(t=(0|e)<(0|(t=(0|(a=(n?0:A)-(t?s:0)|0))<(0|(s=(o?0:r)-(n?A:0)-(t?s:0)|0))?a:s))?e:t))>0)?t:0)|0,a=a-(A?t:0)|0,0|((0|(t=(0|(t=s-(A?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(a=(0|a)>-1?a:0-a|0))>(0|(e=(0|e)>-1?e:0-e|0))?a:e))?t:e)}function ft(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function ht(t,e){e|=0;var n,r,o,a=0,A=0,s=0;A=0|i[(t|=0)>>2],i[e>>2]=A,t=0|i[t+4>>2],i[(r=e+4|0)>>2]=t,i[(o=e+8|0)>>2]=0,a=t-A|0,(0|A)<0?(t=0-A|0,i[r>>2]=a,i[o>>2]=t,i[e>>2]=0,A=0):(a=t,t=0),(0|a)<0&&(A=A-a|0,i[e>>2]=A,t=t-a|0,i[o>>2]=t,i[r>>2]=0,a=0),n=A-t|0,s=a-t|0,(0|t)<0?(i[e>>2]=n,i[r>>2]=s,i[o>>2]=0,a=s,s=n,t=0):s=A,(0|(A=(0|t)<(0|(A=(0|a)<(0|s)?a:s))?t:A))<=0||(i[e>>2]=s-A,i[r>>2]=a-A,i[o>>2]=t-A)}function dt(t){var e,n,r,o;n=(o=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-o|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function It(t){var e,n,r=0,o=0,a=0,A=0,s=0;r=0-(o=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,A=(a=0|i[(n=t+4|0)>>2])+o|0,(0|o)>0?(i[n>>2]=A,i[e>>2]=o,i[t>>2]=0,r=0,a=A):o=0,(0|a)<0?(s=r-a|0,i[t>>2]=s,o=o-a|0,i[e>>2]=o,i[n>>2]=0,A=s-o|0,r=0-o|0,(0|o)<0?(i[t>>2]=A,i[n>>2]=r,i[e>>2]=0,a=r,o=0):(a=0,A=s)):A=r,(0|(r=(0|o)<(0|(r=(0|a)<(0|A)?a:A))?o:r))<=0||(i[t>>2]=A-r,i[n>>2]=a-r,i[e>>2]=o-r)}function pt(t,e,n,r){e|=0,n|=0,r|=0;var a,A=0,s=0,c=0,u=0;if(a=U,U=U+32|0,function(t,e){e|=0;var n,r,i=0;i=+o[(t=t|0)>>3],n=+l(+i),i=+g(+i),o[e+16>>3]=i,i=+o[t+8>>3],r=n*+l(+i),o[e>>3]=r,i=n*+g(+i),o[e+8>>3]=i}(t|=0,s=a),i[n>>2]=0,A=+se(15888,s),(c=+se(15912,s))<A&&(i[n>>2]=1,A=c),(c=+se(15936,s))<A&&(i[n>>2]=2,A=c),(c=+se(15960,s))<A&&(i[n>>2]=3,A=c),(c=+se(15984,s))<A&&(i[n>>2]=4,A=c),(c=+se(16008,s))<A&&(i[n>>2]=5,A=c),(c=+se(16032,s))<A&&(i[n>>2]=6,A=c),(c=+se(16056,s))<A&&(i[n>>2]=7,A=c),(c=+se(16080,s))<A&&(i[n>>2]=8,A=c),(c=+se(16104,s))<A&&(i[n>>2]=9,A=c),(c=+se(16128,s))<A&&(i[n>>2]=10,A=c),(c=+se(16152,s))<A&&(i[n>>2]=11,A=c),(c=+se(16176,s))<A&&(i[n>>2]=12,A=c),(c=+se(16200,s))<A&&(i[n>>2]=13,A=c),(c=+se(16224,s))<A&&(i[n>>2]=14,A=c),(c=+se(16248,s))<A&&(i[n>>2]=15,A=c),(c=+se(16272,s))<A&&(i[n>>2]=16,A=c),(c=+se(16296,s))<A&&(i[n>>2]=17,A=c),(c=+se(16320,s))<A&&(i[n>>2]=18,A=c),(c=+se(16344,s))<A&&(i[n>>2]=19,A=c),(c=+h(+(1-.5*A)))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(U=a);if(n=0|i[n>>2],A=+Ft((A=+o[16368+(24*n|0)>>3])-+Ft(+function(t,e){t|=0;var n,r,i,a,A;return a=+o[(e=e|0)>>3],r=+l(+a),i=+o[e+8>>3]-+o[t+8>>3],A=r*+g(+i),n=+o[t>>3],+ +p(+A,+(+g(+a)*+l(+n)-+l(+i)*(r*+g(+n))))}(15568+(n<<4)|0,t))),u=0|jt(e)?+Ft(A+-.3334731722518321):A,A=+f(+c)/.381966011250105,(0|e)>0){s=0;do{A*=2.6457513110645907,s=s+1|0}while((0|s)!=(0|e))}c=+l(+u)*A,o[r>>3]=c,u=+g(+u)*A,o[r+8>>3]=u,U=a}function Ct(t,e,n,r,a){e|=0,n|=0,r|=0,a|=0;var A=0,u=0;if((A=+function(t){var e,n;return n=+o[(t=t|0)>>3],e=+o[t+8>>3],+ +c(+(n*n+e*e))}(t|=0))<1e-16)return e=15568+(e<<4)|0,i[a>>2]=i[e>>2],i[a+4>>2]=i[e+4>>2],i[a+8>>2]=i[e+8>>2],void(i[a+12>>2]=i[e+12>>2]);if(u=+p(+ +o[t+8>>3],+ +o[t>>3]),(0|n)>0){t=0;do{A/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(A/=3,n=0==(0|jt(n)),A=+I(.381966011250105*(n?A:A/2.6457513110645907))):(A=+I(.381966011250105*A),0|jt(n)&&(u=+Ft(u+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,r|=0;var a=0,A=0,c=0,u=0;if((n=+n)<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);A=e<0?e+6.283185307179586:e,A=e>=6.283185307179586?A+-6.283185307179586:A;do{if(!(A<1e-16)){if(a=+s(+(A+-3.141592653589793))<1e-16,e=+o[t>>3],a){e-=n,o[r>>3]=e,a=r;break}if(c=+l(+n),n=+g(+n),e=c*+g(+e)+ +l(+A)*(n*+l(+e)),e=+d(+((e=e>1?1:e)<-1?-1:e)),o[r>>3]=e,+s(+(e+-1.5707963267948966))<1e-16)return o[r>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+s(+(e+1.5707963267948966))<1e-16)return o[r>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if(u=+l(+e),A=n*+g(+A)/u,n=+o[t>>3],e=(c-+g(+e)*+g(+n))/+l(+n)/u,c=A>1?1:A,e=e>1?1:e,(e=+o[t+8>>3]+ +p(+(c<-1?-1:c),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[r+8>>3]=e)}e=+o[t>>3]+n,o[r>>3]=e,a=r}while(0);if(+s(+(e+-1.5707963267948966))<1e-16)return o[a>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+s(+(e+1.5707963267948966))<1e-16)return o[a>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if((e=+o[t+8>>3])>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[r+8>>3]=e}(15568+(e<<4)|0,+Ft(+o[16368+(24*e|0)>>3]-u),A,a)}function yt(t,e,n){e|=0,n|=0;var r,o;r=U,U=U+16|0,z((t|=0)+4|0,o=r),Ct(o,0|i[t>>2],e,0,n),U=r}function vt(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,Q,F,w,S,R,x=0,k=0,O=0,N=0,D=0,G=0;if(R=U,U=U+272|0,N=R+240|0,F=R,w=R+224|0,S=R+208|0,p=R+176|0,C=R+160|0,y=R+192|0,v=R+144|0,B=R+128|0,m=R+112|0,b=R+96|0,Q=R+80|0,i[(x=R+256|0)>>2]=e,i[N>>2]=i[t>>2],i[N+4>>2]=i[t+4>>2],i[N+8>>2]=i[t+8>>2],i[N+12>>2]=i[t+12>>2],Bt(N,x,F),i[a>>2]=0,(0|(N=r+n+(5==(0|r)&1)|0))<=(0|n))U=R;else{s=w+4|0,c=p+4|0,u=n+5|0,l=16848+((A=0|i[x>>2])<<2)|0,g=16928+(A<<2)|0,f=B+8|0,h=m+8|0,d=b+8|0,I=S+4|0,O=n;t:for(;;){k=F+(((0|O)%5|0)<<4)|0,i[S>>2]=i[k>>2],i[S+4>>2]=i[k+4>>2],i[S+8>>2]=i[k+8>>2],i[S+12>>2]=i[k+12>>2];do{}while(2==(0|mt(S,A,0,1)));if((0|O)>(0|n)&0!=(0|jt(e))){if(i[p>>2]=i[S>>2],i[p+4>>2]=i[S+4>>2],i[p+8>>2]=i[S+8>>2],i[p+12>>2]=i[S+12>>2],z(s,C),r=0|i[p>>2],x=0|i[17008+(80*r|0)+(i[w>>2]<<2)>>2],i[p>>2]=i[18608+(80*r|0)+(20*x|0)>>2],(0|(k=0|i[18608+(80*r|0)+(20*x|0)+16>>2]))>0){t=0;do{at(c),t=t+1|0}while((0|t)<(0|k))}switch(k=18608+(80*r|0)+(20*x|0)+4|0,i[y>>2]=i[k>>2],i[y+4>>2]=i[k+4>>2],i[y+8>>2]=i[k+8>>2],$(y,3*(0|i[l>>2])|0),K(c,y,c),X(c),z(c,v),D=+(0|i[g>>2]),o[B>>3]=3*D,o[f>>3]=0,G=-1.5*D,o[m>>3]=G,o[h>>3]=2.598076211353316*D,o[b>>3]=G,o[d>>3]=-2.598076211353316*D,0|i[17008+(80*(0|i[p>>2])|0)+(i[S>>2]<<2)>>2]){case 1:t=m,r=B;break;case 3:t=b,r=m;break;case 2:t=B,r=b;break;default:t=12;break t}ae(C,v,r,t,Q),Ct(Q,0|i[p>>2],A,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|O)<(0|u)&&(z(I,p),Ct(p,0|i[S>>2],A,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[w>>2]=i[S>>2],i[w+4>>2]=i[S+4>>2],i[w+8>>2]=i[S+8>>2],i[w+12>>2]=i[S+12>>2],(0|(O=O+1|0))>=(0|N)){t=3;break}}3!=(0|t)?12==(0|t)&&E(22474,22521,581,22531):U=R}}function Bt(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,A=0,s=0,c=0;r=U,U=U+128|0,a=r,s=20208,c=(A=o=r+64|0)+60|0;do{i[A>>2]=i[s>>2],A=A+4|0,s=s+4|0}while((0|A)<(0|c));s=20272,c=(A=a)+60|0;do{i[A>>2]=i[s>>2],A=A+4|0,s=s+4|0}while((0|A)<(0|c));o=(c=0==(0|jt(0|i[e>>2])))?o:a,ut(a=t+4|0),lt(a),0|jt(0|i[e>>2])&&(it(a),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],K(a,o,e=n+4|0),X(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),X(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),X(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),X(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,n=n+68|0),X(n),U=r}function mt(t,e,n,r){n|=0,r|=0;var o,a,A,s,c,u,l=0,g=0,f=0,h=0,d=0;if(u=U,U=U+32|0,c=u+12|0,a=u,d=(t|=0)+4|0,h=0|i[16928+((e|=0)<<2)>>2],h=(s=0!=(0|r))?3*h|0:h,l=0|i[d>>2],o=0|i[(A=t+8|0)>>2],s){if((0|(l=o+l+(r=0|i[(g=t+12|0)>>2])|0))==(0|h))return U=u,0|(d=1);f=g}else l=o+l+(r=0|i[(f=t+12|0)>>2])|0;if((0|l)<=(0|h))return U=u,0|(d=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|o)>0){g=18608+(80*r|0)+60|0,r=t;break}r=18608+(80*r|0)+40|0,n?(H(c,h,0,0),q(d,c,a),At(a),K(a,c,d),g=r,r=t):(g=r,r=t)}else g=18608+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[g>>2],(0|i[(l=g+16|0)>>2])>0){r=0;do{at(d),r=r+1|0}while((0|r)<(0|i[l>>2]))}return t=g+4|0,i[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],e=0|i[16848+(e<<2)>>2],$(c,s?3*e|0:e),K(d,c,d),X(d),r=s&&((0|i[A>>2])+(0|i[d>>2])+(0|i[f>>2])|0)==(0|h)?1:2,U=u,0|(d=r)}function bt(t,e){t|=0,e|=0;var n=0;do{n=0|mt(t,e,0,1)}while(2==(0|n));return 0|n}function Et(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,Q,F=0,w=0,S=0,R=0,x=0;if(Q=U,U=U+240|0,v=Q+208|0,B=Q,m=Q+192|0,b=Q+176|0,d=Q+160|0,I=Q+144|0,p=Q+128|0,C=Q+112|0,y=Q+96|0,i[(F=Q+224|0)>>2]=e,i[v>>2]=i[t>>2],i[v+4>>2]=i[t+4>>2],i[v+8>>2]=i[t+8>>2],i[v+12>>2]=i[t+12>>2],Qt(v,F,B),i[a>>2]=0,(0|(h=r+n+(6==(0|r)&1)|0))<=(0|n))U=Q;else{s=n+6|0,c=16928+((A=0|i[F>>2])<<2)|0,u=I+8|0,l=p+8|0,g=C+8|0,f=m+4|0,w=0,S=n,r=-1;t:for(;;){if(t=B+((F=(0|S)%6|0)<<4)|0,i[m>>2]=i[t>>2],i[m+4>>2]=i[t+4>>2],i[m+8>>2]=i[t+8>>2],i[m+12>>2]=i[t+12>>2],t=w,w=0|mt(m,A,0,1),(0|S)>(0|n)&0!=(0|jt(e))&&(1!=(0|t)&&(0|i[m>>2])!=(0|r))){switch(z(B+(((F+5|0)%6|0)<<4)+4|0,b),z(B+(F<<4)+4|0,d),R=+(0|i[c>>2]),o[I>>3]=3*R,o[u>>3]=0,x=-1.5*R,o[p>>3]=x,o[l>>3]=2.598076211353316*R,o[C>>3]=x,o[g>>3]=-2.598076211353316*R,F=0|i[v>>2],0|i[17008+(80*F|0)+(((0|r)==(0|F)?0|i[m>>2]:r)<<2)>>2]){case 1:t=p,r=I;break;case 3:t=C,r=p;break;case 2:t=I,r=C;break;default:t=8;break t}ae(b,d,r,t,y),0|Ae(b,y)||0|Ae(d,y)||(Ct(y,0|i[v>>2],A,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|S)<(0|s)&&(z(f,b),Ct(b,0|i[m>>2],A,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(S=S+1|0))>=(0|h)){t=3;break}r=0|i[m>>2]}3!=(0|t)?8==(0|t)&&E(22557,22521,746,22602):U=Q}}function Qt(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,A=0,s=0,c=0;r=U,U=U+160|0,a=r,s=20336,c=(A=o=r+80|0)+72|0;do{i[A>>2]=i[s>>2],A=A+4|0,s=s+4|0}while((0|A)<(0|c));s=20416,c=(A=a)+72|0;do{i[A>>2]=i[s>>2],A=A+4|0,s=s+4|0}while((0|A)<(0|c));o=(c=0==(0|jt(0|i[e>>2])))?o:a,ut(a=t+4|0),lt(a),0|jt(0|i[e>>2])&&(it(a),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],K(a,o,e=n+4|0),X(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),X(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),X(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),X(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,e=n+68|0),X(e),i[n+80>>2]=i[t>>2],K(a,o+60|0,n=n+84|0),X(n),U=r}function Ft(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function wt(t,e){return e|=0,+s(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+s(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function St(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+g(.5*(r-n)))*i+(a=+g(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+l(+r)*+l(+n)*a),2*+p(+ +c(+a),+ +c(+(1-a)))*6371.007180918475}function Rt(t,e,n){t|=0,n|=0;var r,i,a,A,s=0,u=0,h=0,d=0,C=0,y=0;return y=+o[(e|=0)>>3],a=+o[t>>3],C=+g(.5*(y-a)),h=+o[e+8>>3],i=+o[t+8>>3],d=+g(.5*(h-i)),r=+l(+a),A=+l(+y),d=2*+p(+ +c(+(d=C*C+d*(A*r*d))),+ +c(+(1-d))),C=+o[n>>3],y=+g(.5*(C-y)),s=+o[n+8>>3],h=+g(.5*(s-h)),u=+l(+C),h=2*+p(+ +c(+(h=y*y+h*(A*u*h))),+ +c(+(1-h))),C=+g(.5*(a-C)),s=+g(.5*(i-s)),s=2*+p(+ +c(+(s=C*C+s*(r*u*s))),+ +c(+(1-s))),4*+I(+ +c(+ +f(.5*(u=.5*(d+h+s)))*+f(.5*(u-d))*+f(.5*(u-h))*+f(.5*(u-s))))}function Ut(t,e){return e=0|Ee(0|(t|=0),0|(e|=0),45),b(),127&e|0}function xt(t,e){var n=0,r=0,i=0,o=0,a=0,A=0;if(!(!0&134217728==(-16777216&(e|=0)|0)))return 0|(e=0);if(a=0|Ee(0|(t|=0),0|e,45),b(),(a&=127)>>>0>121)return 0|(e=0);n=0|Ee(0|t,0|e,52),b(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|Ee(0|t,0|e,3*(15-i|0)|0),b(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|G(a))){A=0,r=13;break}r=1}if(7==(0|o)){A=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(A=1)}if(13==(0|r))return 0|A}}while(0);for(;;){if(A=0|Ee(0|t,0|e,3*(14-n|0)|0),b(),!(7==(7&A|0)&!0)){A=0,r=13;break}if(!(n>>>0<14)){A=1,r=13;break}n=n+1|0}return 13==(0|r)?0|A:0}function kt(t,e,n){n|=0;var r=0,i=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),b(),(0|(r&=15))>=(0|n)){if((0|r)!=(0|n))if(n>>>0<=15){if(t|=i=0|Qe(0|n,0,52),e=0|b()|-15728641&e,(0|r)>(0|n))do{i=0|Qe(7,0,3*(14-n|0)|0),n=n+1|0,t|=i,e=0|b()|e}while((0|n)<(0|r))}else e=0,t=0}else e=0,t=0;return m(0|e),0|t}function Ot(t,e,n,r){n|=0,r|=0;var o,a=0,A=0,s=0,c=0,u=0,l=0;if(s=0|Ee(0|(t|=0),0|(e|=0),52),b(),(0|n)<16&(0|(s&=15))<=(0|n)){if((0|s)==(0|n))return i[(n=r)>>2]=t,void(i[n+4>>2]=e);if(o=(0|(u=0|ee(7,n-s|0)))/7|0,c=0|Ee(0|t,0|e,45),b(),0|G(127&c)){t:do{if(s)for(A=1;;){if(a=0|Ee(0|t,0|e,3*(15-A|0)|0),b(),0|(a&=7))break t;if(!(A>>>0<s>>>0)){a=0;break}A=A+1|0}else a=0}while(0);A=0==(0|a)}else A=0;if(l=0|Qe(s+1|0,0,52),a=0|b()|-15728641&e,Ot(e=(l|t)&~(e=0|Qe(7,0,0|(c=3*(14-s|0)|0))),s=a&~(0|b()),n,r),a=r+(o<<3)|0,!A)return Ot((l=0|Qe(1,0,0|c))|e,0|b()|s,n,a),l=a+(o<<3)|0,Ot((u=0|Qe(2,0,0|c))|e,0|b()|s,n,l),l=l+(o<<3)|0,Ot((u=0|Qe(3,0,0|c))|e,0|b()|s,n,l),l=l+(o<<3)|0,Ot((u=0|Qe(4,0,0|c))|e,0|b()|s,n,l),l=l+(o<<3)|0,Ot((u=0|Qe(5,0,0|c))|e,0|b()|s,n,l),void Ot((u=0|Qe(6,0,0|c))|e,0|b()|s,n,l+(o<<3)|0);A=a+(o<<3)|0,(0|u)>6&&(Re(0|a,0,(l=(A>>>0>(u=a+8|0)>>>0?A:u)+-1+(0-a)|0)+8&-8|0),a=u+(l>>>3<<3)|0),Ot((l=0|Qe(2,0,0|c))|e,0|b()|s,n,a),l=a+(o<<3)|0,Ot((u=0|Qe(3,0,0|c))|e,0|b()|s,n,l),l=l+(o<<3)|0,Ot((u=0|Qe(4,0,0|c))|e,0|b()|s,n,l),l=l+(o<<3)|0,Ot((u=0|Qe(5,0,0|c))|e,0|b()|s,n,l),Ot((u=0|Qe(6,0,0|c))|e,0|b()|s,n,l+(o<<3)|0)}}function Nt(t,e){var n=0,r=0,i=0;if(i=0|Ee(0|(t|=0),0|(e|=0),45),b(),!(0|G(127&i)))return 0|(i=0);i=0|Ee(0|t,0|e,52),b(),i&=15;t:do{if(i)for(r=1;;){if(n=0|Ee(0|t,0|e,3*(15-r|0)|0),b(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Dt(t,e){var n=0,r=0,i=0;if(i=0|Ee(0|(t|=0),0|(e|=0),52),b(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|Ee(0|t,0|e,3*(15-r|0)|0),b(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Gt(t,e){var n=0,r=0,i=0,o=0,a=0,A=0,s=0;if(s=0|Ee(0|(t|=0),0|(e|=0),52),b(),!(s&=15))return s=t,m(0|(A=e)),0|s;for(A=1,n=0;;){r=0|Qe(7,0,0|(o=3*(15-A|0)|0)),i=0|b(),a=0|Ee(0|t,0|e,0|o),b(),t=(o=0|Qe(0|st(7&a),0,0|o))|t&~r,e=(a=0|b())|e&~i;t:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Ee(0|t,0|e,52),b(),r&=15){n=1;e:for(;;){switch(a=0|Ee(0|t,0|e,3*(15-n|0)|0),b(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|Ee(0|t,0|e,0|(a=3*(15-n|0)|0)),b(),o=0|Qe(7,0,0|a),e&=~(0|b()),t=t&~o|(a=0|Qe(0|st(7&i),0,0|a)),e=0|e|b(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(A>>>0<s>>>0))break;A=A+1|0}return m(0|e),0|t}function _t(t,e){var n=0,r=0,i=0,o=0,a=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),b(),!(r&=15))return r=t,m(0|(n=e)),0|r;for(n=1;a=0|Ee(0|t,0|e,0|(o=3*(15-n|0)|0)),b(),i=0|Qe(7,0,0|o),e&=~(0|b()),t=(o=0|Qe(0|st(7&a),0,0|o))|t&~i,e=0|b()|e,n>>>0<r>>>0;)n=n+1|0;return m(0|e),0|t}function Mt(t,e){var n=0,r=0,i=0,o=0,a=0,A=0,s=0;if(s=0|Ee(0|(t|=0),0|(e|=0),52),b(),!(s&=15))return s=t,m(0|(A=e)),0|s;for(A=1,n=0;;){r=0|Qe(7,0,0|(o=3*(15-A|0)|0)),i=0|b(),a=0|Ee(0|t,0|e,0|o),b(),t=(o=0|Qe(0|ct(7&a),0,0|o))|t&~r,e=(a=0|b())|e&~i;t:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Ee(0|t,0|e,52),b(),r&=15){n=1;e:for(;;){switch(a=0|Ee(0|t,0|e,3*(15-n|0)|0),b(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(o=0|Qe(7,0,0|(i=3*(15-n|0)|0)),a=e&~(0|b()),e=0|Ee(0|t,0|e,0|i),b(),t=t&~o|(e=0|Qe(0|ct(7&e),0,0|i)),e=0|a|b(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(A>>>0<s>>>0))break;A=A+1|0}return m(0|e),0|t}function Tt(t,e){var n=0,r=0,i=0,o=0,a=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),b(),!(r&=15))return r=t,m(0|(n=e)),0|r;for(n=1;o=0|Qe(7,0,0|(a=3*(15-n|0)|0)),i=e&~(0|b()),e=0|Ee(0|t,0|e,0|a),b(),t=(e=0|Qe(0|ct(7&e),0,0|a))|t&~o,e=0|b()|i,n>>>0<r>>>0;)n=n+1|0;return m(0|e),0|t}function jt(t){return 0|(0|(t|=0))%2}function Lt(t,e){t|=0;var n,r;return r=U,U=U+16|0,n=r,(e|=0)>>>0<=15&&2146435072!=(2146435072&i[t+4>>2]|0)&&2146435072!=(2146435072&i[t+8+4>>2]|0)?(!function(t,e,n){var r,i;r=U,U=U+16|0,pt(t|=0,e|=0,n|=0,i=r),Y(i,n+4|0),U=r}(t,e,n),e=0|function(t,e){t|=0;var n,r=0,o=0,a=0,A=0,s=0,c=0,u=0,l=0;if(n=U,U=U+64|0,c=n+40|0,o=n+24|0,a=n+12|0,A=n,Qe(0|(e|=0),0,52),r=134225919|b(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(c=0,m(0|(s=0)),U=n,0|c):(Qe(0|M(t),0,45),s=0|b()|r,c=-1,m(0|s),U=n,0|c);if(i[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],i[c+12>>2]=i[t+12>>2],s=c+4|0,(0|e)>0)for(t=-1;i[o>>2]=i[s>>2],i[o+4>>2]=i[s+4>>2],i[o+8>>2]=i[s+8>>2],1&e?(et(s),i[a>>2]=i[s>>2],i[a+4>>2]=i[s+4>>2],i[a+8>>2]=i[s+8>>2],rt(a)):(nt(s),i[a>>2]=i[s>>2],i[a+4>>2]=i[s+4>>2],i[a+8>>2]=i[s+8>>2],it(a)),q(o,a,A),X(A),u=0|Qe(7,0,0|(l=3*(15-e|0)|0)),r&=~(0|b()),t=(l=0|Qe(0|tt(A),0,0|l))|t&~u,r=0|b()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[s>>2])<=2&&(0|i[c+8>>2])<=2&&(0|i[c+12>>2])<=2){if(e=0|Qe(0|(o=0|M(c)),0,45),e|=t,t=0|b()|-1040385&r,A=0|T(c),!(0|G(o))){if((0|A)<=0)break;for(a=0;;){if(o=0|Ee(0|e,0|t,52),b(),o&=15)for(r=1;c=0|Ee(0|e,0|t,0|(l=3*(15-r|0)|0)),b(),u=0|Qe(7,0,0|l),t&=~(0|b()),e=e&~u|(l=0|Qe(0|st(7&c),0,0|l)),t=0|t|b(),r>>>0<o>>>0;)r=r+1|0;if((0|(a=a+1|0))==(0|A))break t}}a=0|Ee(0|e,0|t,52),b(),a&=15;e:do{if(a){r=1;n:for(;;){switch(l=0|Ee(0|e,0|t,3*(15-r|0)|0),b(),7&l){case 1:break n;case 0:break;default:break e}if(!(r>>>0<a>>>0))break e;r=r+1|0}if(0|j(o,0|i[c>>2]))for(r=1;u=0|Qe(7,0,0|(c=3*(15-r|0)|0)),l=t&~(0|b()),t=0|Ee(0|e,0|t,0|c),b(),e=e&~u|(t=0|Qe(0|ct(7&t),0,0|c)),t=0|l|b(),r>>>0<a>>>0;)r=r+1|0;else for(r=1;c=0|Ee(0|e,0|t,0|(l=3*(15-r|0)|0)),b(),u=0|Qe(7,0,0|l),t&=~(0|b()),e=e&~u|(l=0|Qe(0|st(7&c),0,0|l)),t=0|t|b(),r>>>0<a>>>0;)r=r+1|0}}while(0);if((0|A)>0){r=0;do{e=0|Gt(e,t),t=0|b(),r=r+1|0}while((0|r)!=(0|A))}}else e=0,t=0}while(0);return l=e,m(0|(u=t)),U=n,0|l}(n,e),t=0|b()):(t=0,e=0),m(0|t),U=r,0|e}function Vt(t,e,n){var r,o=0,a=0,A=0;if(r=(n|=0)+4|0,a=0|Ee(0|(t|=0),0|(e|=0),52),b(),a&=15,A=0|Ee(0|t,0|e,45),b(),o=0==(0|a),0|G(127&A)){if(o)return 0|(A=1);o=1}else{if(o)return 0|(A=0);o=0==(0|i[r>>2])&&0==(0|i[n+8>>2])?0!=(0|i[n+12>>2])&1:1}for(n=1;1&n?rt(r):it(r),A=0|Ee(0|t,0|e,3*(15-n|0)|0),b(),ot(r,7&A),n>>>0<a>>>0;)n=n+1|0;return 0|o}function Zt(t,e,n){n|=0;var r,o,a=0,A=0,s=0,c=0,u=0,l=0;o=U,U=U+16|0,r=o,l=0|Ee(0|(t|=0),0|(e|=0),45),b(),l&=127;t:do{if(0!=(0|G(l))&&(s=0|Ee(0|t,0|e,52),b(),0!=(0|(s&=15)))){a=1;e:for(;;){switch(u=0|Ee(0|t,0|e,3*(15-a|0)|0),b(),7&u){case 5:break e;case 0:break;default:a=e;break t}if(!(a>>>0<s>>>0)){a=e;break t}a=a+1|0}for(A=1,a=e;c=0|Qe(7,0,0|(e=3*(15-A|0)|0)),u=a&~(0|b()),a=0|Ee(0|t,0|a,0|e),b(),t=t&~c|(a=0|Qe(0|ct(7&a),0,0|e)),a=0|u|b(),A>>>0<s>>>0;)A=A+1|0}else a=e}while(0);if(u=7728+(28*l|0)|0,i[n>>2]=i[u>>2],i[n+4>>2]=i[u+4>>2],i[n+8>>2]=i[u+8>>2],i[n+12>>2]=i[u+12>>2],0|Vt(t,a,n)){if(c=n+4|0,i[r>>2]=i[c>>2],i[r+4>>2]=i[c+4>>2],i[r+8>>2]=i[c+8>>2],s=0|Ee(0|t,0|a,52),b(),u=15&s,1&s?(it(c),s=u+1|0):s=u,0|G(l)){t:do{if(u)for(e=1;;){if(A=0|Ee(0|t,0|a,3*(15-e|0)|0),b(),0|(A&=7)){a=A;break t}if(!(e>>>0<u>>>0)){a=0;break}e=e+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|mt(n,s,a,0)){if(0|G(l))do{}while(0!=(0|mt(n,s,0,0)));(0|s)!=(0|u)&&nt(c)}else(0|s)!=(0|u)&&(i[c>>2]=i[r>>2],i[c+4>>2]=i[r+4>>2],i[c+8>>2]=i[r+8>>2]);U=o}else U=o}function Pt(t,e,n){n|=0;var r,i;r=U,U=U+16|0,Zt(t|=0,e|=0,i=r),e=0|Ee(0|t,0|e,52),b(),yt(i,15&e,n),U=r}function Wt(t,e,n){n|=0;var r,i,o=0,a=0;i=U,U=U+16|0,Zt(t|=0,e|=0,r=i),o=0|Ee(0|t,0|e,45),b(),o=0==(0|G(127&o)),a=0|Ee(0|t,0|e,52),b(),a&=15;t:do{if(!o){if(0|a)for(o=1;;){if(!(0==((0|Qe(7,0,3*(15-o|0)|0))&t|0)&0==((0|b())&e|0)))break t;if(!(o>>>0<a>>>0))break;o=o+1|0}return vt(r,a,0,5,n),void(U=i)}}while(0);Et(r,a,0,6,n),U=i}function Jt(t,e){e|=0;var n,r=0,o=0,a=0,A=0,s=0,c=0;if(Qe(0|(t|=0),0,52),n=134225919|b(),(0|t)<1){o=0,r=0;do{0|G(o)&&(Qe(0|o,0,45),s=0|n|b(),i[(t=e+(r<<3)|0)>>2]=-1,i[t+4>>2]=s,r=r+1|0),o=o+1|0}while(122!=(0|o))}else{s=0,r=0;do{if(0|G(s)){for(Qe(0|s,0,45),o=1,a=-1,A=0|n|b();a&=~(c=0|Qe(7,0,3*(15-o|0)|0)),A&=~(0|b()),(0|o)!=(0|t);)o=o+1|0;i[(c=e+(r<<3)|0)>>2]=a,i[c+4>>2]=A,r=r+1|0}s=s+1|0}while(122!=(0|s))}}function Ht(t,e,n,r){var o,a=0,A=0,s=0,c=0,u=0;if(o=U,U=U+64|0,s=o,(0|(t|=0))==(0|(n|=0))&(0|(e|=0))==(0|(r|=0))|!1|134217728!=(2013265920&e|0)|!1|134217728!=(2013265920&r|0))return U=o,0|(s=0);if(a=0|Ee(0|t,0|e,52),b(),a&=15,A=0|Ee(0|n,0|r,52),b(),(0|a)!=(15&A|0))return U=o,0|(s=0);if(A=a+-1|0,a>>>0>1&&(u=0|kt(t,e,A),c=0|b(),(0|u)==(0|(A=0|kt(n,r,A)))&(0|c)==(0|b()))){if(a=0|Ee(0|t,0|e,0|(A=3*(15^a)|0)),b(),a&=7,A=0|Ee(0|n,0|r,0|A),b(),0==(0|a)|0==(0|(A&=7)))return U=o,0|(u=1);if((0|i[21136+(a<<2)>>2])==(0|A))return U=o,0|(u=1);if((0|i[21168+(a<<2)>>2])==(0|A))return U=o,0|(u=1)}A=(a=s)+56|0;do{i[a>>2]=0,a=a+4|0}while((0|a)<(0|A));return x(t,e,1,s),a=(0|i[(u=s)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)||(0|i[(u=s+8|0)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)||(0|i[(u=s+16|0)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)||(0|i[(u=s+24|0)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)||(0|i[(u=s+32|0)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)||(0|i[(u=s+40|0)>>2])==(0|n)&&(0|i[u+4>>2])==(0|r)?1:1&((0|i[(a=s+48|0)>>2])==(0|n)?(0|i[a+4>>2])==(0|r):0),U=o,0|(u=a)}function Yt(t,e,n){n|=0;var r,o,a,A,s=0;if(a=U,U=U+16|0,o=a,s=0|Ee(0|(t|=0),0|(e|=0),56),b(),-1==(0|(e=0|function(t,e,n){n|=0;var r,o=0;if(o=0|Nt(t=t|0,e=e|0),(n+-1|0)>>>0>5)return 0|(n=-1);if(1==(0|n)&(r=0!=(0|o)))return 0|(n=-1);return o=0|function(t,e){var n,r,o,a=0,A=0,s=0,c=0,u=0;if(o=U,U=U+32|0,r=o,Zt(t=t|0,e=e|0,n=o+16|0),s=0|Ut(t,e),u=0|Dt(t,e),function(t,e){t=7728+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(s,r),e=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return 0|(e=-1);do{if((0|i[11152+(216*e|0)>>2])!=(0|t))if((0|i[11152+(216*e|0)+8>>2])!=(0|t))if((0|i[11152+(216*e|0)+16>>2])!=(0|t))if((0|i[11152+(216*e|0)+24>>2])!=(0|t))if((0|i[11152+(216*e|0)+32>>2])!=(0|t))if((0|i[11152+(216*e|0)+40>>2])!=(0|t))if((0|i[11152+(216*e|0)+48>>2])!=(0|t))if((0|i[11152+(216*e|0)+56>>2])!=(0|t))if((0|i[11152+(216*e|0)+64>>2])!=(0|t))if((0|i[11152+(216*e|0)+72>>2])!=(0|t))if((0|i[11152+(216*e|0)+80>>2])!=(0|t))if((0|i[11152+(216*e|0)+88>>2])!=(0|t))if((0|i[11152+(216*e|0)+96>>2])!=(0|t))if((0|i[11152+(216*e|0)+104>>2])!=(0|t))if((0|i[11152+(216*e|0)+112>>2])!=(0|t))if((0|i[11152+(216*e|0)+120>>2])!=(0|t))if((0|i[11152+(216*e|0)+128>>2])!=(0|t)){if((0|i[11152+(216*e|0)+136>>2])!=(0|t)){if((0|i[11152+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11152+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11152+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11152+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11152+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11152+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11152+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11152+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11152+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return 0|(t=-1)}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|(e=0|i[11152+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2])}(s,0|i[n>>2]),!(0|G(s)))return U=o,0|(u=e);switch(0|s){case 4:t=0,a=14;break;case 14:t=1,a=14;break;case 24:t=2,a=14;break;case 38:t=3,a=14;break;case 49:t=4,a=14;break;case 58:t=5,a=14;break;case 63:t=6,a=14;break;case 72:t=7,a=14;break;case 83:t=8,a=14;break;case 97:t=9,a=14;break;case 107:t=10,a=14;break;case 117:t=11,a=14;break;default:c=0,A=0}14==(0|a)&&(c=0|i[22096+(24*t|0)+8>>2],A=0|i[22096+(24*t|0)+16>>2]);(0|(t=0|i[n>>2]))!=(0|i[r>>2])&&(s=0|_(s),t=0|i[n>>2],s|(0|t)==(0|A)&&(e=(e+1|0)%6|0));if(3==(0|u)&(0|t)==(0|A))return U=o,0|(u=(e+5|0)%6|0);if(!(5==(0|u)&(0|t)==(0|c)))return U=o,0|(u=e);return U=o,0|(u=(e+1|0)%6|0)}(t,e),r?0|(n=(5-o+(0|i[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-o+(0|i[22416+(n<<2)>>2])|0)%6|0)}(r=(A=!0&268435456==(2013265920&e|0))?t:0,t=A?-2130706433&e|134217728:0,7&s))))return i[n>>2]=0,void(U=a);Zt(r,t,o),s=0|Ee(0|r,0|t,52),b(),s&=15,0|Nt(r,t)?vt(o,s,e,2,n):Et(o,s,e,2,n),U=a}function Xt(t){t|=0;var e,n,r=0;return(e=0|ye(1,12))||E(22691,22646,49,22704),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&E(22721,22646,61,22744),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function zt(t,e){t|=0,e|=0;var n,r;return(r=0|pe(24))||E(22758,22646,78,22772),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&E(22787,22646,82,22772),i[t>>2]=r,i[e>>2]=r,0|r)}function Kt(t){var e,n,r=0,a=0,A=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0,b=0,Q=0,F=0,w=0,S=0,R=0,U=0,x=0,k=0,O=0,N=0,D=0,G=0;if(0|i[(c=(t|=0)+8|0)>>2])return 0|(G=1);if(!(A=0|i[t>>2]))return 0|(G=0);r=A,a=0;do{a=a+1|0,r=0|i[r+8>>2]}while(0!=(0|r));if(a>>>0<2)return 0|(G=0);(n=0|pe(a<<2))||E(22807,22646,317,22826),(e=0|pe(a<<5))||E(22848,22646,321,22826),i[t>>2]=0,i[(S=t+4|0)>>2]=0,i[c>>2]=0,a=0,N=0,w=0,I=0;t:for(;;){if(d=0|i[A>>2]){u=0,l=d;do{if(f=+o[l+8>>3],r=l,l=0|i[l+16>>2],g=+o[(c=(h=0==(0|l))?d:l)+8>>3],+s(+(f-g))>3.141592653589793){G=14;break}u+=(g-f)*(+o[r>>3]+ +o[c>>3])}while(!h);if(14==(0|G)){G=0,u=0,r=d;do{F=+o[r+8>>3],k=0|i[(O=r+16|0)>>2],Q=+o[(k=0==(0|k)?d:k)+8>>3],u+=(+o[r>>3]+ +o[k>>3])*((Q<0?Q+6.283185307179586:Q)-(F<0?F+6.283185307179586:F)),r=0|i[(0==(0|r)?A:O)>>2]}while(0!=(0|r))}u>0?(i[n+(N<<2)>>2]=A,N=N+1|0,c=w,r=I):G=19}else G=19;if(19==(0|G)){G=0;do{if(!a){if(I){c=S,l=I+8|0,r=A,a=t;break}if(0|i[t>>2]){G=27;break t}c=S,l=t,r=A,a=t;break}if(0|i[(r=a+8|0)>>2]){G=21;break t}if(!(a=0|ye(1,12))){G=23;break t}i[r>>2]=a,c=a+4|0,l=a,r=I}while(0);if(i[l>>2]=A,i[c>>2]=A,l=e+(w<<5)|0,h=0|i[A>>2]){for(o[(d=e+(w<<5)+8|0)>>3]=17976931348623157e292,o[(I=e+(w<<5)+24|0)>>3]=17976931348623157e292,o[l>>3]=-17976931348623157e292,o[(p=e+(w<<5)+16|0)>>3]=-17976931348623157e292,m=17976931348623157e292,b=-17976931348623157e292,c=0,C=h,f=17976931348623157e292,v=17976931348623157e292,B=-17976931348623157e292,g=-17976931348623157e292;u=+o[C>>3],F=+o[C+8>>3],C=0|i[C+16>>2],Q=+o[((y=0==(0|C))?h:C)+8>>3],u<f&&(o[d>>3]=u,f=u),F<v&&(o[I>>3]=F,v=F),u>B?o[l>>3]=u:u=B,F>g&&(o[p>>3]=F,g=F),m=F>0&F<m?F:m,b=F<0&F>b?F:b,c|=+s(+(F-Q))>3.141592653589793,!y;)B=u;c&&(o[p>>3]=b,o[I>>3]=m)}else i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,i[l+12>>2]=0,i[l+16>>2]=0,i[l+20>>2]=0,i[l+24>>2]=0,i[l+28>>2]=0;c=w+1|0}if(A=0|i[(O=A+8|0)>>2],i[O>>2]=0,!A){G=45;break}w=c,I=r}if(21==(0|G))E(22624,22646,35,22658);else if(23==(0|G))E(22678,22646,37,22658);else if(27==(0|G))E(22721,22646,61,22744);else if(45==(0|G)){t:do{if((0|N)>0){for(O=0==(0|c),x=c<<2,k=0==(0|t),U=0,r=0;;){if(R=0|i[n+(U<<2)>>2],O)G=73;else{if(!(w=0|pe(x))){G=50;break}if(!(S=0|pe(x))){G=52;break}e:do{if(k)a=0;else{for(c=0,a=0,l=t;A=e+(c<<5)|0,0|qt(0|i[l>>2],A,0|i[R>>2])?(i[w+(a<<2)>>2]=l,i[S+(a<<2)>>2]=A,y=a+1|0):y=a,l=0|i[l+8>>2];)c=c+1|0,a=y;if((0|y)>0)if(A=0|i[w>>2],1==(0|y))a=A;else for(p=0,C=-1,a=A,I=A;;){for(h=0|i[I>>2],A=0,l=0;d=(0|(c=0|i[i[w+(l<<2)>>2]>>2]))==(0|h)?A:A+(1&(0|qt(c,0|i[S+(l<<2)>>2],0|i[h>>2])))|0,(0|(l=l+1|0))!=(0|y);)A=d;if(a=(c=(0|d)>(0|C))?I:a,(0|(A=p+1|0))==(0|y))break e;p=A,C=c?d:C,I=0|i[w+(A<<2)>>2]}else a=0}}while(0);if(Ce(w),Ce(S),a){if(A=0|i[(c=a+4|0)>>2])a=A+8|0;else if(0|i[a>>2]){G=70;break}i[a>>2]=R,i[c>>2]=R}else G=73}if(73==(0|G)){if(G=0,0|(r=0|i[R>>2]))do{S=r,r=0|i[r+16>>2],Ce(S)}while(0!=(0|r));Ce(R),r=2}if((0|(U=U+1|0))>=(0|N)){D=r;break t}}50==(0|G)?E(22863,22646,249,22882):52==(0|G)?E(22901,22646,252,22882):70==(0|G)&&E(22721,22646,61,22744)}else D=0}while(0);return Ce(n),Ce(e),0|(G=D)}return 0}function qt(t,e,n){t|=0;var r,a=0,A=0,s=0,c=0,u=0,l=0,g=0;if(!(0|P(e|=0,n|=0)))return 0|(t=0);if(e=0|Z(e),r=+o[n>>3],a=e&(a=+o[n+8>>3])<0?a+6.283185307179586:a,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,n=t;t:for(;;){for(;c=+o[n>>3],l=+o[n+8>>3],g=0|i[(n=n+16|0)>>2],s=+o[(g=0==(0|g)?t:g)>>3],A=+o[g+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=A,A=l),r<s|r>u;)if(!(n=0|i[n>>2])){n=22;break t}if(a=(c=c<0?c+6.283185307179586:c)==a|(l=A<0?A+6.283185307179586:A)==a?a+-2220446049250313e-31:a,((l+=(r-s)/(u-s)*(c-l))<0?l+6.283185307179586:l)>a&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,n=t;t:for(;;){for(;c=+o[n>>3],l=+o[n+8>>3],g=0|i[(n=n+16|0)>>2],s=+o[(g=0==(0|g)?t:g)>>3],A=+o[g+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=A,A=l),r<s|r>u;)if(!(n=0|i[n>>2])){n=22;break t}if(A+(r-s)/(u-s)*(c-A)>(a=c==a|A==a?a+-2220446049250313e-31:a)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function $t(t,e,n,o,a){n|=0,o|=0,a|=0;var A,s,c,u,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0;if(u=U,U=U+32|0,v=u+16|0,c=u,l=0|Ee(0|(t|=0),0|(e|=0),52),b(),l&=15,p=0|Ee(0|n,0|o,52),b(),(0|l)!=(15&p|0))return U=u,0|(v=1);if(d=0|Ee(0|t,0|e,45),b(),d&=127,I=0|Ee(0|n,0|o,45),b(),p=(0|d)!=(0|(I&=127))){if(7==(0|(f=0|V(d,I))))return U=u,0|(v=2);7==(0|(h=0|V(I,d)))?E(22925,22949,151,22959):(C=f,g=h)}else C=0,g=0;A=0|G(d),s=0|G(I),i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0;do{if(C){if(f=(0|(I=0|i[4304+(28*d|0)+(C<<2)>>2]))>0,s)if(f){d=0,h=n,f=o;do{h=0|Mt(h,f),f=0|b(),1==(0|(g=0|ct(g)))&&(g=0|ct(1)),d=d+1|0}while((0|d)!=(0|I));I=g,d=h,h=f}else I=g,d=n,h=o;else if(f){d=0,h=n,f=o;do{h=0|Tt(h,f),f=0|b(),g=0|ct(g),d=d+1|0}while((0|d)!=(0|I));I=g,d=h,h=f}else I=g,d=n,h=o;if(Vt(d,h,v),p||E(22972,22949,181,22959),(f=0!=(0|A))&(g=0!=(0|s))&&E(22999,22949,182,22959),f){if(g=0|Dt(t,e),0|r[22032+(7*g|0)+C>>0]){l=3;break}d=h=0|i[21200+(28*g|0)+(C<<2)>>2],y=26}else if(g){if(g=0|Dt(d,h),0|r[22032+(7*g|0)+I>>0]){l=4;break}d=0,h=0|i[21200+(28*I|0)+(g<<2)>>2],y=26}else g=0;if(26==(0|y))if((0|h)<=-1&&E(23030,22949,212,22959),(0|d)<=-1&&E(23053,22949,213,22959),(0|h)>0){f=v+4|0,g=0;do{At(f),g=g+1|0}while((0|g)!=(0|h));g=d}else g=d;if(i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,ot(c,C),0|l)for(;0|jt(l)?rt(c):it(c),(0|l)>1;)l=l+-1|0;if((0|g)>0){l=0;do{At(c),l=l+1|0}while((0|l)!=(0|g))}K(y=v+4|0,c,y),X(y),y=50}else if(Vt(n,o,v),0!=(0|A)&0!=(0|s))if((0|I)!=(0|d)&&E(23077,22949,243,22959),g=0|Dt(t,e),l=0|Dt(n,o),0|r[22032+(7*g|0)+l>>0])l=5;else if((0|(g=0|i[21200+(28*g|0)+(l<<2)>>2]))>0){f=v+4|0,l=0;do{At(f),l=l+1|0}while((0|l)!=(0|g));y=50}else y=50;else y=50}while(0);return 50==(0|y)&&(l=v+4|0,i[a>>2]=i[l>>2],i[a+4>>2]=i[l+4>>2],i[a+8>>2]=i[l+8>>2],l=0),U=u,0|(v=l)}function te(t,e,n,r){n|=0,r|=0;var o,a,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0;if(a=U,U=U+48|0,c=a+36|0,u=a+24|0,l=a+12|0,g=a,s=0|Ee(0|(t|=0),0|(e|=0),52),b(),s&=15,h=0|Ee(0|t,0|e,45),b(),o=0|G(h&=127),Qe(0|s,0,52),p=134225919|b(),i[(I=r)>>2]=-1,i[I+4>>2]=p,!s)return(0|i[n>>2])>1||(0|i[n+4>>2])>1||(0|i[n+8>>2])>1||127==(0|(A=0|L(h,0|tt(n))))?(U=a,0|(p=1)):(d=0|Qe(0|A,0,45),I=0|b(),I=-1040385&i[(h=r)+4>>2]|I,i[(p=r)>>2]=i[h>>2]|d,i[p+4>>2]=I,U=a,0|(p=0));for(i[c>>2]=i[n>>2],i[c+4>>2]=i[n+4>>2],i[c+8>>2]=i[n+8>>2];i[u>>2]=i[c>>2],i[u+4>>2]=i[c+4>>2],i[u+8>>2]=i[c+8>>2],0|jt(s)?(et(c),i[l>>2]=i[c>>2],i[l+4>>2]=i[c+4>>2],i[l+8>>2]=i[c+8>>2],rt(l)):(nt(c),i[l>>2]=i[c>>2],i[l+4>>2]=i[c+4>>2],i[l+8>>2]=i[c+8>>2],it(l)),q(u,l,g),X(g),C=0|i[(I=r)>>2],I=0|i[I+4>>2],n=0|Qe(7,0,0|(y=3*(15-s|0)|0)),I&=~(0|b()),y=0|Qe(0|tt(g),0,0|y),I=0|b()|I,i[(p=r)>>2]=y|C&~n,i[p+4>>2]=I,(0|s)>1;)s=s+-1|0;t:do{if((0|i[c>>2])<=1&&(0|i[c+4>>2])<=1&&(0|i[c+8>>2])<=1){g=127==(0|(u=0|L(h,s=0|tt(c))))?0:0|G(u);e:do{if(s){if(o){if(c=21408+(28*(0|Dt(t,e))|0)+(s<<2)|0,(0|(c=0|i[c>>2]))>0){n=0;do{s=0|st(s),n=n+1|0}while((0|n)!=(0|c))}if(1==(0|s)){A=3;break t}127==(0|(n=0|L(h,s)))&&E(23104,22949,376,23134),0|G(n)?E(23147,22949,377,23134):(d=c,f=s,A=n)}else d=0,f=s,A=u;if((0|(l=0|i[4304+(28*h|0)+(f<<2)>>2]))<=-1&&E(23178,22949,384,23134),!g){if((0|d)<=-1&&E(23030,22949,417,23134),0|d){s=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];do{n=0|_t(n,c),c=0|b(),i[(y=r)>>2]=n,i[y+4>>2]=c,s=s+1|0}while((0|s)<(0|d))}if((0|l)<=0){s=54;break}for(s=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];;)if(n=0|_t(n,c),c=0|b(),i[(y=r)>>2]=n,i[y+4>>2]=c,(0|(s=s+1|0))==(0|l)){s=54;break e}}if(7==(0|(u=0|V(A,h)))&&E(22925,22949,393,23134),n=0|i[(s=r)>>2],s=0|i[s+4>>2],(0|l)>0){c=0;do{n=0|_t(n,s),s=0|b(),i[(y=r)>>2]=n,i[y+4>>2]=s,c=c+1|0}while((0|c)!=(0|l))}if(n=0|Dt(n,s),y=0|_(A),(0|(n=0|i[(y?21824:21616)+(28*u|0)+(n<<2)>>2]))<=-1&&E(23030,22949,412,23134),n){s=0,c=0|i[(u=r)>>2],u=0|i[u+4>>2];do{c=0|Gt(c,u),u=0|b(),i[(y=r)>>2]=c,i[y+4>>2]=u,s=s+1|0}while((0|s)<(0|n));s=54}else s=54}else if(0!=(0|o)&0!=(0|g))if(s=21408+(28*(y=0|Dt(t,e))|0)+((0|Dt(0|i[(s=r)>>2],0|i[s+4>>2]))<<2)|0,(0|(s=0|i[s>>2]))<=-1&&E(23201,22949,433,23134),s){A=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];do{n=0|_t(n,c),c=0|b(),i[(y=r)>>2]=n,i[y+4>>2]=c,A=A+1|0}while((0|A)<(0|s));A=u,s=54}else A=u,s=55;else A=u,s=54}while(0);if(54==(0|s)&&g&&(s=55),55==(0|s)&&1==(0|Dt(0|i[(y=r)>>2],0|i[y+4>>2]))){A=4;break}p=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],C=0|Qe(0|A,0,45),y=0|y|b(),i[(A=r)>>2]=p|C,i[A+4>>2]=y,A=0}else A=2}while(0);return U=a,0|(y=A)}function ee(t,e){var n=0;if(!(e|=0))return 0|(n=1);n=t|=0,t=1;do{t=0|y(0==(1&e|0)?1:n,t),e>>=1,n=0|y(n,n)}while(0!=(0|e));return 0|t}function ne(t,e,n){t|=0;var r,a,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0;if(!(0|P(e|=0,n|=0)))return 0|(h=0);if(e=0|Z(e),a=+o[n>>3],A=e&(A=+o[n+8>>3])<0?A+6.283185307179586:A,(0|(h=0|i[t>>2]))<=0)return 0|(h=0);if(r=0|i[t+4>>2],e){e=0,n=-1,t=0;t:for(;;){for(f=t;u=+o[r+(f<<4)>>3],g=+o[r+(f<<4)+8>>3],c=+o[r+((t=(n+2|0)%(0|h)|0)<<4)>>3],s=+o[r+(t<<4)+8>>3],u>c?(l=u,u=g):(l=c,c=u,u=s,s=g),a<c|a>l;){if(!((0|(n=f+1|0))<(0|h))){n=22;break t}t=f,f=n,n=t}if(A=(u=u<0?u+6.283185307179586:u)==A|(g=s<0?s+6.283185307179586:s)==A?A+-2220446049250313e-31:A,((g+=(a-c)/(l-c)*(u-g))<0?g+6.283185307179586:g)>A&&(e^=1),(0|(t=f+1|0))>=(0|h)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,n=-1,t=0;t:for(;;){for(f=t;u=+o[r+(f<<4)>>3],g=+o[r+(f<<4)+8>>3],c=+o[r+((t=(n+2|0)%(0|h)|0)<<4)>>3],s=+o[r+(t<<4)+8>>3],u>c?(l=u,u=g):(l=c,c=u,u=s,s=g),a<c|a>l;){if(!((0|(n=f+1|0))<(0|h))){n=22;break t}t=f,f=n,n=t}if(s+(a-c)/(l-c)*(u-s)>(A=u==A|s==A?A+-2220446049250313e-31:A)&&(e^=1),(0|(t=f+1|0))>=(0|h)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function re(t,e){e|=0;var n,r,a,A,c,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(o[(a=e+8|0)>>3]=17976931348623157e292,o[(A=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(c=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],p=17976931348623157e292,C=-17976931348623157e292,y=0,t=-1,f=17976931348623157e292,h=17976931348623157e292,I=-17976931348623157e292,l=-17976931348623157e292,v=0;u=+o[n+(v<<4)>>3],d=+o[n+(v<<4)+8>>3],g=+o[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],u<f&&(o[a>>3]=u,f=u),d<h&&(o[A>>3]=d,h=d),u>I?o[e>>3]=u:u=I,d>l&&(o[c>>3]=d,l=d),p=d>0&d<p?d:p,C=d<0&d>C?d:C,y|=+s(+(d-g))>3.141592653589793,(0|(t=v+1|0))!=(0|r);)B=v,I=u,v=t,t=B;y&&(o[c>>3]=C,o[A>>3]=p)}}function ie(t,e){e|=0;var n,r=0,a=0,A=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0,b=0,E=0,Q=0,F=0;if(C=0|i[(t|=0)>>2]){if(o[(y=e+8|0)>>3]=17976931348623157e292,o[(v=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(B=e+16|0)>>3]=-17976931348623157e292,(0|C)>0){for(A=0|i[t+4>>2],I=17976931348623157e292,p=-17976931348623157e292,a=0,r=-1,g=17976931348623157e292,f=17976931348623157e292,d=-17976931348623157e292,u=-17976931348623157e292,m=0;c=+o[A+(m<<4)>>3],h=+o[A+(m<<4)+8>>3],l=+o[A+(((0|(Q=r+2|0))==(0|C)?0:Q)<<4)+8>>3],c<g&&(o[y>>3]=c,g=c),h<f&&(o[v>>3]=h,f=h),c>d?o[e>>3]=c:c=d,h>u&&(o[B>>3]=h,u=h),I=h>0&h<I?h:I,p=h<0&h>p?h:p,a|=+s(+(h-l))>3.141592653589793,(0|(r=m+1|0))!=(0|C);)Q=m,d=c,m=r,r=Q;a&&(o[B>>3]=p,o[v>>3]=I)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(Q=t+8|0)>>2]))<=0)){n=t+12|0,E=0;do{if(A=0|i[n>>2],a=E,v=e+((E=E+1|0)<<5)|0,B=0|i[A+(a<<3)>>2]){if(o[(m=e+(E<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(E<<5)+24|0)>>3]=17976931348623157e292,o[v>>3]=-17976931348623157e292,o[(b=e+(E<<5)+16|0)>>3]=-17976931348623157e292,(0|B)>0){for(C=0|i[A+(a<<3)+4>>2],I=17976931348623157e292,p=-17976931348623157e292,A=0,a=-1,y=0,g=17976931348623157e292,f=17976931348623157e292,h=-17976931348623157e292,u=-17976931348623157e292;c=+o[C+(y<<4)>>3],d=+o[C+(y<<4)+8>>3],l=+o[C+(((0|(a=a+2|0))==(0|B)?0:a)<<4)+8>>3],c<g&&(o[m>>3]=c,g=c),d<f&&(o[t>>3]=d,f=d),c>h?o[v>>3]=c:c=h,d>u&&(o[b>>3]=d,u=d),I=d>0&d<I?d:I,p=d<0&d>p?d:p,A|=+s(+(d-l))>3.141592653589793,(0|(a=y+1|0))!=(0|B);)F=y,y=a,h=c,a=F;A&&(o[b>>3]=p,o[t>>3]=I)}}else i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0,i[v+16>>2]=0,i[v+20>>2]=0,i[v+24>>2]=0,i[v+28>>2]=0,r=0|i[Q>>2]}while((0|E)<(0|r))}}function oe(t,e,n){var r=0,o=0,a=0;if(!(0|ne(t|=0,e|=0,n|=0)))return 0|(o=0);if((0|i[(o=t+8|0)>>2])<=0)return 0|(o=1);for(r=t+12|0,t=0;;){if(a=t,t=t+1|0,0|ne((0|i[r>>2])+(a<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[o>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ae(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var a,A,s,c,u,l,g,f=0;c=+o[(t|=0)>>3],s=+o[e>>3]-c,A=+o[t+8>>3],a=+o[e+8>>3]-A,l=+o[n>>3],f=((f=+o[r>>3]-l)*(A-(g=+o[n+8>>3]))-(c-l)*(u=+o[r+8>>3]-g))/(s*u-a*f),o[i>>3]=c+s*f,o[i+8>>3]=A+a*f}function Ae(t,e){return e|=0,+o[(t|=0)>>3]!=+o[e>>3]?0|(e=0):0|(e=+o[t+8>>3]==+o[e+8>>3])}function se(t,e){e|=0;var n,r,i;return+((i=+o[(t|=0)>>3]-+o[e>>3])*i+(r=+o[t+8>>3]-+o[e+8>>3])*r+(n=+o[t+16>>3]-+o[e+16>>3])*n)}function ce(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|ye(e,4),i[t>>2]=r,r||E(23230,23253,40,23267)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function ue(t){var e,n,r,a=0,A=0,c=0,l=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(A=0|i[e>>2],a=0;;){if((0|a)>=(0|A))break t;if(c=0|i[t>>2],l=0|i[c+(a<<2)>>2])break;a=a+1|0}a=c+(~~(+s(+ +u(10,+ +(15-(0|i[n>>2])|0))*(+o[l>>3]+ +o[l+8>>3]))%+(0|A))>>>0<<2)|0,A=0|i[a>>2];e:do{if(0|A){if(c=l+32|0,(0|A)==(0|l))i[a>>2]=i[c>>2];else{if(!(a=0|i[(A=A+32|0)>>2]))break;for(;(0|a)!=(0|l);)if(!(a=0|i[(A=a+32|0)>>2]))break e;i[A>>2]=i[c>>2]}Ce(l),i[r>>2]=(0|i[r>>2])-1}}while(0)}Ce(0|i[t>>2])}function le(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function ge(t,e){e|=0;var n=0,r=0,a=0,A=0;if(n=~~(+s(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(A=1);A=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(A=1);for(a=n;;){if((0|a)==(0|e)){a=8;break}if(!(n=0|i[a+32>>2])){n=1,a=10;break}r=a,a=n}if(8==(0|a)){i[r+32>>2]=i[A>>2];break}if(10==(0|a))return 0|n}else i[n>>2]=i[A>>2]}while(0);return Ce(e),i[(A=t+8|0)>>2]=(0|i[A>>2])-1,0|(A=0)}function fe(t,e,n){t|=0,e|=0,n|=0;var r,a=0,A=0,c=0;(r=0|pe(40))||E(23283,23253,98,23296),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(A=r+16|0)>>2]=i[n>>2],i[A+4>>2]=i[n+4>>2],i[A+8>>2]=i[n+8>>2],i[A+12>>2]=i[n+12>>2],i[r+32>>2]=0,A=~~(+s(+ +u(10,+ +(15-(0|i[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,A=(0|i[t>>2])+(A<<2)|0,a=0|i[A>>2];do{if(a){for(;!(0|wt(a,e)&&0|wt(a+16|0,n));)if(A=0|i[a+32>>2],!(0|i[(a=0==(0|A)?a:A)+32>>2])){c=10;break}if(10==(0|c)){i[a+32>>2]=r;break}return Ce(r),0|(c=a)}i[A>>2]=r}while(0);return i[(c=t+8|0)>>2]=1+(0|i[c>>2]),0|(c=r)}function he(t,e,n){e|=0,n|=0;var r=0,a=0;if(a=~~(+s(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(a=0|i[(0|i[t>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(t=a;;){if(0|wt(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=a;;){if(0|wt(t,e)&&0|wt(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function de(t,e){e|=0;var n=0;if(n=~~(+s(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|wt(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ie(t){return 0|~~+function(t){return+ +Ue(+(t=+t))}(t=+t)}function pe(t){t|=0;var e,n=0,r=0,o=0,a=0,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0;e=U,U=U+16|0,h=e;do{if(t>>>0<245){if(t=(l=t>>>0<11?16:t+11&-8)>>>3,3&(r=(f=0|i[5829])>>>t)|0)return o=0|i[(r=(t=23356+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(A=0|i[(a=o+8|0)>>2]))==(0|t)?i[5829]=f&~(1<<n):(i[A+12>>2]=t,i[r>>2]=A),m=n<<3,i[o+4>>2]=3|m,i[(m=o+m+4|0)>>2]=1|i[m>>2],U=e,0|(m=a);if(l>>>0>(g=0|i[5831])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,A=0|i[(t=(n=23356+((o=((r=(n>>>=c=n>>>12&16)>>>5&8)|c|(A=(n>>>=r)>>>2&4)|(t=(n>>>=A)>>>1&2)|(o=(n>>>=t)>>>1&1))+(n>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(c=A+8|0)>>2]))==(0|n)?(t=f&~(1<<o),i[5829]=t):(i[r+12>>2]=n,i[t>>2]=r,t=f),s=(m=o<<3)-l|0,i[A+4>>2]=3|l,i[(a=A+l|0)+4>>2]=1|s,i[A+m>>2]=s,0|g&&(o=0|i[5834],r=23356+((n=g>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=s,i[5834]=a,U=e,0|(m=c);if(A=0|i[5830]){for(r=(A&0-A)-1|0,r=u=0|i[23620+(((o=(r>>>=a=r>>>12&16)>>>5&8)|a|(s=(r>>>=o)>>>2&4)|(c=(r>>>=s)>>>1&2)|(u=(r>>>=c)>>>1&1))+(r>>>u)<<2)>>2],c=u,u=(-8&i[u+4>>2])-l|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,c=(a=(s=(-8&i[t+4>>2])-l|0)>>>0<u>>>0)?t:c,u=a?s:u;if((s=c+l|0)>>>0>c>>>0){a=0|i[c+24>>2],n=0|i[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|i[(t=c+20|0)>>2])&&!(n=0|i[(t=c+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0,r=n}else r=0|i[c+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[c+28>>2],(0|c)==(0|i[(t=23620+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5830]=A&~(1<<n);break}}else if(i[((0|i[(m=a+16|0)>>2])==(0|c)?m:a+20|0)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[c+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[c+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return u>>>0<16?(m=u+l|0,i[c+4>>2]=3|m,i[(m=c+m+4|0)>>2]=1|i[m>>2]):(i[c+4>>2]=3|l,i[s+4>>2]=1|u,i[s+u>>2]=u,0|g&&(o=0|i[5834],r=23356+((n=g>>>3)<<1<<2)|0,(n=1<<n)&f?n=0|i[(t=r+8|0)>>2]:(i[5829]=n|f,n=r,t=r+8|0),i[t>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=u,i[5834]=s),U=e,0|(m=c+8|0)}f=l}else f=l}else f=l}else if(t>>>0<=4294967231)if(l=-8&(t=t+11|0),o=0|i[5830]){a=0-l|0,u=(t>>>=8)?l>>>0>16777215?31:l>>>((u=14-((c=((p=t<<(f=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(u=((p<<=c)+245760|0)>>>16&2))+(p<<u>>>15)|0)+7|0)&1|u<<1:0,r=0|i[23620+(u<<2)>>2];t:do{if(r)for(t=0,c=l<<(31==(0|u)?0:25-(u>>>1)|0),A=0;;){if((s=(-8&i[r+4>>2])-l|0)>>>0<a>>>0){if(!s){t=r,a=0,p=65;break t}t=r,a=s}if(A=0==(0|(p=0|i[r+20>>2]))|(0|p)==(0|(r=0|i[r+16+(c>>>31<<2)>>2]))?A:p,!r){r=A,p=61;break}c<<=1}else r=0,t=0,p=61}while(0);if(61==(0|p)){if(0==(0|r)&0==(0|t)){if(!(t=((t=2<<u)|0-t)&o)){f=l;break}f=(t&0-t)-1|0,t=0,r=0|i[23620+(((A=(f>>>=s=f>>>12&16)>>>5&8)|s|(c=(f>>>=A)>>>2&4)|(u=(f>>>=c)>>>1&2)|(r=(f>>>=u)>>>1&1))+(f>>>r)<<2)>>2]}r?p=65:(c=t,s=a)}if(65==(0|p))for(A=r;;){if(a=(r=(f=(-8&i[A+4>>2])-l|0)>>>0<a>>>0)?f:a,t=r?A:t,(r=0|i[A+16>>2])||(r=0|i[A+20>>2]),!r){c=t,s=a;break}A=r}if(0!=(0|c)&&s>>>0<((0|i[5831])-l|0)>>>0&&(g=c+l|0)>>>0>c>>>0){A=0|i[c+24>>2],n=0|i[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|i[(t=c+20|0)>>2])&&!(n=0|i[(t=c+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a}i[t>>2]=0}else m=0|i[c+8>>2],i[m+12>>2]=n,i[n+8>>2]=m}while(0);do{if(A){if(t=0|i[c+28>>2],(0|c)==(0|i[(r=23620+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){o&=~(1<<t),i[5830]=o;break}}else if(i[((0|i[(m=A+16|0)>>2])==(0|c)?m:A+20|0)>>2]=n,!n)break;i[n+24>>2]=A,0|(t=0|i[c+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[c+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(s>>>0<16)m=s+l|0,i[c+4>>2]=3|m,i[(m=c+m+4|0)>>2]=1|i[m>>2];else{if(i[c+4>>2]=3|l,i[g+4>>2]=1|s,i[g+s>>2]=s,n=s>>>3,s>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=g,i[n+12>>2]=g,i[g+8>>2]=n,i[g+12>>2]=r;break}if(n=23620+((r=(n=s>>>8)?s>>>0>16777215?31:s>>>((r=14-((v=((m=n<<(B=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|B|(r=((m<<=v)+245760|0)>>>16&2))+(m<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[g+28>>2]=r,i[(t=g+16|0)+4>>2]=0,i[t>>2]=0,!(o&(t=1<<r))){i[5830]=o|t,i[n>>2]=g,i[g+24>>2]=n,i[g+12>>2]=g,i[g+8>>2]=g;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|s)){for(o=s<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|s)){n=t;break e}o<<=1,n=t}i[r>>2]=g,i[g+24>>2]=n,i[g+12>>2]=g,i[g+8>>2]=g;break t}}while(0);m=0|i[(B=n+8|0)>>2],i[m+12>>2]=g,i[B>>2]=g,i[g+8>>2]=m,i[g+12>>2]=n,i[g+24>>2]=0}}while(0);return U=e,0|(m=c+8|0)}f=l}else f=l;else f=-1}while(0);if((r=0|i[5831])>>>0>=f>>>0)return n=r-f|0,t=0|i[5834],n>>>0>15?(m=t+f|0,i[5834]=m,i[5831]=n,i[m+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|f):(i[5831]=0,i[5834]=0,i[t+4>>2]=3|r,i[(m=t+r+4|0)>>2]=1|i[m>>2]),U=e,0|(m=t+8|0);if((s=0|i[5832])>>>0>f>>>0)return v=s-f|0,i[5832]=v,B=(m=0|i[5835])+f|0,i[5835]=B,i[B+4>>2]=1|v,i[m+4>>2]=3|f,U=e,0|(m=m+8|0);if(0|i[5947]?t=0|i[5949]:(i[5949]=4096,i[5948]=4096,i[5950]=-1,i[5951]=-1,i[5952]=0,i[5940]=0,i[5947]=-16&h^1431655768,t=4096),c=f+48|0,(l=(A=t+(u=f+47|0)|0)&(a=0-t|0))>>>0<=f>>>0)return U=e,0|(m=0);if(0|(t=0|i[5939])&&(h=(g=0|i[5937])+l|0)>>>0<=g>>>0|h>>>0>t>>>0)return U=e,0|(m=0);t:do{if(4&i[5940])n=0,p=143;else{r=0|i[5835];e:do{if(r){for(o=23764;!((h=0|i[o>>2])>>>0<=r>>>0&&(h+(0|i[o+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[o+8>>2])){p=128;break e}o=t}if((n=A-s&a)>>>0<2147483647)if((0|(t=0|xe(0|n)))==((0|i[o>>2])+(0|i[o+4>>2])|0)){if(-1!=(0|t)){s=n,A=t,p=145;break t}}else o=t,p=136;else n=0}else p=128}while(0);do{if(128==(0|p))if(-1!=(0|(r=0|xe(0)))&&(n=r,I=(n=(0==((I=(d=0|i[5948])+-1|0)&n|0)?0:(I+n&0-d)-n|0)+l|0)+(d=0|i[5937])|0,n>>>0>f>>>0&n>>>0<2147483647)){if(0|(h=0|i[5939])&&I>>>0<=d>>>0|I>>>0>h>>>0){n=0;break}if((0|(t=0|xe(0|n)))==(0|r)){s=n,A=r,p=145;break t}o=t,p=136}else n=0}while(0);do{if(136==(0|p)){if(r=0-n|0,!(c>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}s=n,A=o,p=145;break t}if((t=u-n+(t=0|i[5949])&0-t)>>>0>=2147483647){s=n,A=o,p=145;break t}if(-1==(0|xe(0|t))){xe(0|r),n=0;break}s=t+n|0,A=o,p=145;break t}}while(0);i[5940]=4|i[5940],p=143}}while(0);if(143==(0|p)&&l>>>0<2147483647&&!(-1==(0|(v=0|xe(0|l)))|1^(y=(C=(I=0|xe(0))-v|0)>>>0>(f+40|0)>>>0)|v>>>0<I>>>0&-1!=(0|v)&-1!=(0|I)^1)&&(s=y?C:n,A=v,p=145),145==(0|p)){n=(0|i[5937])+s|0,i[5937]=n,n>>>0>(0|i[5938])>>>0&&(i[5938]=n),u=0|i[5835];t:do{if(u){for(n=23764;;){if((0|A)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){p=154;break}if(!(o=0|i[n+8>>2]))break;n=o}if(154==(0|p)&&(B=n+4|0,0==(8&i[n+12>>2]|0))&&A>>>0>u>>>0&t>>>0<=u>>>0){i[B>>2]=r+s,B=u+(v=0==(7&(v=u+8|0)|0)?0:0-v&7)|0,v=(m=(0|i[5832])+s|0)-v|0,i[5835]=B,i[5832]=v,i[B+4>>2]=1|v,i[u+m+4>>2]=40,i[5836]=i[5951];break}for(A>>>0<(0|i[5833])>>>0&&(i[5833]=A),r=A+s|0,n=23764;;){if((0|i[n>>2])==(0|r)){p=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|p)&&0==(8&i[n+12>>2]|0)){i[n>>2]=A,i[(g=n+4|0)>>2]=(0|i[g>>2])+s,l=(g=A+(0==(7&(g=A+8|0)|0)?0:0-g&7)|0)+f|0,c=(n=r+(0==(7&(n=r+8|0)|0)?0:0-n&7)|0)-g-f|0,i[g+4>>2]=3|f;e:do{if((0|u)==(0|n))m=(0|i[5832])+c|0,i[5832]=m,i[5835]=l,i[l+4>>2]=1|m;else{if((0|i[5834])==(0|n)){m=(0|i[5831])+c|0,i[5831]=m,i[5834]=l,i[l+4>>2]=1|m,i[l+m>>2]=m;break}if(1==(3&(t=0|i[n+4>>2])|0)){s=-8&t,o=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5829]=i[5829]&~(1<<o);break}i[t+12>>2]=r,i[r+8>>2]=t;break}A=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(o=(r=n+16|0)+4|0)>>2])r=o;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(o=0|i[(a=t+20|0)>>2])t=o,r=a;else{if(!(o=0|i[(a=t+16|0)>>2]))break;t=o,r=a}i[r>>2]=0}else m=0|i[n+8>>2],i[m+12>>2]=t,i[t+8>>2]=m}while(0);if(!A)break;o=23620+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[o>>2])==(0|n)){if(i[o>>2]=t,0|t)break;i[5830]=i[5830]&~(1<<r);break n}if(i[((0|i[(m=A+16|0)>>2])==(0|n)?m:A+20|0)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=A,0|(o=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=o,i[o+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+s|0,a=s+c|0}else a=c;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[l+4>>2]=1|a,i[l+a>>2]=a,n=a>>>3,a>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=l,i[n+12>>2]=l,i[l+8>>2]=n,i[l+12>>2]=r;break}n=a>>>8;do{if(n){if(a>>>0>16777215){o=31;break}o=a>>>((o=14-((v=((m=n<<(B=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|B|(o=((m<<=v)+245760|0)>>>16&2))+(m<<o>>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(n=23620+(o<<2)|0,i[l+28>>2]=o,i[(t=l+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5830])&(r=1<<o))){i[5830]=t|r,i[n>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2]|0)!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|a)){n=t;break n}o<<=1,n=t}i[r>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break e}}while(0);m=0|i[(B=n+8|0)>>2],i[m+12>>2]=l,i[B>>2]=l,i[l+8>>2]=m,i[l+12>>2]=n,i[l+24>>2]=0}}while(0);return U=e,0|(m=g+8|0)}for(n=23764;!((t=0|i[n>>2])>>>0<=u>>>0&&(m=t+(0|i[n+4>>2])|0)>>>0>u>>>0);)n=0|i[n+8>>2];n=(t=(t=(a=m+-47|0)+(0==(7&(t=a+8|0)|0)?0:0-t&7)|0)>>>0<(a=u+16|0)>>>0?u:t)+8|0,B=A+(v=0==(7&(v=A+8|0)|0)?0:0-v&7)|0,v=(r=s+-40|0)-v|0,i[5835]=B,i[5832]=v,i[B+4>>2]=1|v,i[A+r+4>>2]=40,i[5836]=i[5951],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5941],i[n+4>>2]=i[5942],i[n+8>>2]=i[5943],i[n+12>>2]=i[5944],i[5941]=A,i[5942]=s,i[5944]=0,i[5943]=n,n=t+24|0;do{B=n,i[(n=n+4|0)>>2]=7}while((B+8|0)>>>0<m>>>0);if((0|t)!=(0|u)){if(A=t-u|0,i[r>>2]=-2&i[r>>2],i[u+4>>2]=1|A,i[t>>2]=A,n=A>>>3,A>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}if(r=23620+((o=(n=A>>>8)?A>>>0>16777215?31:A>>>((o=14-((v=((m=n<<(B=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|B|(o=((m<<=v)+245760|0)>>>16&2))+(m<<o>>>15)|0)+7|0)&1|o<<1:0)<<2)|0,i[u+28>>2]=o,i[u+20>>2]=0,i[a>>2]=0,!((n=0|i[5830])&(t=1<<o))){i[5830]=n|t,i[r>>2]=u,i[u+24>>2]=r,i[u+12>>2]=u,i[u+8>>2]=u;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|A)){for(o=A<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|A)){n=t;break e}o<<=1,n=t}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break t}}while(0);m=0|i[(B=n+8|0)>>2],i[m+12>>2]=u,i[B>>2]=u,i[u+8>>2]=m,i[u+12>>2]=n,i[u+24>>2]=0}}else 0==(0|(m=0|i[5833]))|A>>>0<m>>>0&&(i[5833]=A),i[5941]=A,i[5942]=s,i[5944]=0,i[5838]=i[5947],i[5837]=-1,i[5842]=23356,i[5841]=23356,i[5844]=23364,i[5843]=23364,i[5846]=23372,i[5845]=23372,i[5848]=23380,i[5847]=23380,i[5850]=23388,i[5849]=23388,i[5852]=23396,i[5851]=23396,i[5854]=23404,i[5853]=23404,i[5856]=23412,i[5855]=23412,i[5858]=23420,i[5857]=23420,i[5860]=23428,i[5859]=23428,i[5862]=23436,i[5861]=23436,i[5864]=23444,i[5863]=23444,i[5866]=23452,i[5865]=23452,i[5868]=23460,i[5867]=23460,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,B=A+(v=0==(7&(v=A+8|0)|0)?0:0-v&7)|0,v=(m=s+-40|0)-v|0,i[5835]=B,i[5832]=v,i[B+4>>2]=1|v,i[A+m+4>>2]=40,i[5836]=i[5951]}while(0);if((n=0|i[5832])>>>0>f>>>0)return v=n-f|0,i[5832]=v,B=(m=0|i[5835])+f|0,i[5835]=B,i[B+4>>2]=1|v,i[m+4>>2]=3|f,U=e,0|(m=m+8|0)}return i[(m=23312)>>2]=12,U=e,0|(m=0)}function Ce(t){var e=0,n=0,r=0,o=0,a=0,A=0,s=0,c=0;if(t|=0){n=t+-8|0,o=0|i[5833],c=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)s=n,A=n;else{if(r=0|i[n>>2],!(3&t))return;if(a=r+e|0,(A=n+(0-r)|0)>>>0<o>>>0)return;if((0|i[5834])==(0|A)){if(3!=(3&(e=0|i[(t=c+4|0)>>2])|0)){s=A,e=a;break}return i[5831]=a,i[t>>2]=-2&e,i[A+4>>2]=1|a,void(i[A+a>>2]=a)}if(n=r>>>3,r>>>0<256){if(t=0|i[A+8>>2],(0|(e=0|i[A+12>>2]))==(0|t)){i[5829]=i[5829]&~(1<<n),s=A,e=a;break}i[t+12>>2]=e,i[e+8>>2]=t,s=A,e=a;break}o=0|i[A+24>>2],t=0|i[A+12>>2];do{if((0|t)==(0|A)){if(t=0|i[(n=(e=A+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else s=0|i[A+8>>2],i[s+12>>2]=t,i[t+8>>2]=s}while(0);if(o){if(e=0|i[A+28>>2],(0|i[(n=23620+(e<<2)|0)>>2])==(0|A)){if(i[n>>2]=t,!t){i[5830]=i[5830]&~(1<<e),s=A,e=a;break}}else if(i[((0|i[(s=o+16|0)>>2])==(0|A)?s:o+20|0)>>2]=t,!t){s=A,e=a;break}i[t+24>>2]=o,0|(n=0|i[(e=A+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,s=A,e=a):(s=A,e=a)}else s=A,e=a}}while(0);if(!(A>>>0>=c>>>0)&&1&(r=0|i[(t=c+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[s+4>>2]=1|e,i[A+e>>2]=e,o=e;else{if((0|i[5835])==(0|c)){if(c=(0|i[5832])+e|0,i[5832]=c,i[5835]=s,i[s+4>>2]=1|c,(0|s)!=(0|i[5834]))return;return i[5834]=0,void(i[5831]=0)}if((0|i[5834])==(0|c))return c=(0|i[5831])+e|0,i[5831]=c,i[5834]=A,i[s+4>>2]=1|c,void(i[A+c>>2]=c);o=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[c+8>>2],(0|(t=0|i[c+12>>2]))==(0|e)){i[5829]=i[5829]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}a=0|i[c+24>>2],t=0|i[c+12>>2];do{if((0|t)==(0|c)){if(t=0|i[(n=(e=c+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[c+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|a){if(t=0|i[c+28>>2],(0|i[(e=23620+(t<<2)|0)>>2])==(0|c)){if(i[e>>2]=n,!n){i[5830]=i[5830]&~(1<<t);break}}else if(i[((0|i[(r=a+16|0)>>2])==(0|c)?r:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,0|(e=0|i[(t=c+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[s+4>>2]=1|o,i[A+o>>2]=o,(0|s)==(0|i[5834]))return void(i[5831]=o)}if(t=o>>>3,o>>>0<256)return n=23356+(t<<1<<2)|0,(e=0|i[5829])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5829]=e|t,t=n,e=n+8|0),i[e>>2]=s,i[t+12>>2]=s,i[s+8>>2]=t,void(i[s+12>>2]=n);t=23620+((r=(t=o>>>8)?o>>>0>16777215?31:o>>>((r=14-((a=((c=t<<(A=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|A|(r=((c<<=a)+245760|0)>>>16&2))+(c<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[s+28>>2]=r,i[s+20>>2]=0,i[s+16>>2]=0,e=0|i[5830],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2]|0)!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|o)){t=e;break e}r<<=1,t=e}i[n>>2]=s,i[s+24>>2]=t,i[s+12>>2]=s,i[s+8>>2]=s;break t}}while(0);c=0|i[(A=t+8|0)>>2],i[c+12>>2]=s,i[A>>2]=s,i[s+8>>2]=c,i[s+12>>2]=t,i[s+24>>2]=0}else i[5830]=e|n,i[t>>2]=s,i[s+24>>2]=t,i[s+12>>2]=s,i[s+8>>2]=s}while(0);if(c=(0|i[5837])-1|0,i[5837]=c,!(0|c)){for(t=23772;t=0|i[t>>2];)t=t+8|0;i[5837]=-1}}}}function ye(t,e){e|=0;var n=0;return(t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=(0|(n>>>0)/(t>>>0))==(0|e)?n:-1)):n=0,(t=0|pe(n))&&3&i[t+-4>>2]?(Re(0|t,0,0|n),0|t):0|t}function ve(t,e,n,r){return 0|(m(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0|0)}function Be(t){return 0|((t|=0)?31-(0|B(t^t-1))|0:32)}function me(t,e,n,r,o){o|=0;var a=0,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0;if(l=t|=0,A=n|=0,s=f=r|=0,!(u=c=e|=0))return a=0!=(0|o),s?a?(i[o>>2]=0|t,i[o+4>>2]=0&e,o=0,0|(m(0|(f=0)),o)):(o=0,0|(m(0|(f=0)),o)):(a&&(i[o>>2]=(l>>>0)%(A>>>0),i[o+4>>2]=0),o=(l>>>0)/(A>>>0)>>>0,0|(m(0|(f=0)),o));a=0==(0|s);do{if(A){if(!a){if((a=(0|B(0|s))-(0|B(0|u))|0)>>>0<=31){A=g=a+1|0,t=l>>>(g>>>0)&(e=a-31>>31)|u<<(s=31-a|0),e&=u>>>(g>>>0),a=0,s=l<<s;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|0&e,o=0,0|(m(0|(f=0)),o)):(o=0,0|(m(0|(f=0)),o))}if((a=A-1|0)&A|0){A=s=33+(0|B(0|A))-(0|B(0|u))|0,t=(g=32-s|0)-1>>31&u>>>((h=s-32|0)>>>0)|(u<<g|l>>>(s>>>0))&(e=h>>31),e&=u>>>(s>>>0),a=l<<(d=64-s|0)&(c=g>>31),s=(u<<d|l>>>(h>>>0))&c|l<<g&s-33>>31;break}return 0|o&&(i[o>>2]=a&l,i[o+4>>2]=0),1==(0|A)?(d=0|t,0|(m(0|(h=c|0&e)),d)):(h=u>>>((d=0|Be(0|A))>>>0)|0,d=u<<32-d|l>>>(d>>>0)|0,0|(m(0|h),d))}if(a)return 0|o&&(i[o>>2]=(u>>>0)%(A>>>0),i[o+4>>2]=0),d=(u>>>0)/(A>>>0)>>>0,0|(m(0|(h=0)),d);if(!l)return 0|o&&(i[o>>2]=0,i[o+4>>2]=(u>>>0)%(s>>>0)),d=(u>>>0)/(s>>>0)>>>0,0|(m(0|(h=0)),d);if(!((a=s-1|0)&s))return 0|o&&(i[o>>2]=0|t,i[o+4>>2]=a&u|0&e),h=0,d=u>>>((0|Be(0|s))>>>0),0|(m(0|h),d);if((a=(0|B(0|s))-(0|B(0|u))|0)>>>0<=30){A=e=a+1|0,t=u<<(s=31-a|0)|l>>>(e>>>0),e=u>>>(e>>>0),a=0,s=l<<s;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|0&e,d=0,0|(m(0|(h=0)),d)):(d=0,0|(m(0|(h=0)),d))}while(0);if(A){u=0|function(t,e,n,r){return 0|(m((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),0|n)}(0|(g=0|n),0|(l=f|0&r),-1,-1),n=0|b(),c=s,s=0;do{r=c,c=a>>>31|c<<1,a=s|a<<1,ve(0|u,0|n,0|(r=t<<1|r>>>31|0),0|(f=t>>>31|e<<1|0)),s=1&(h=(d=0|b())>>31|((0|d)<0?-1:0)<<1),t=0|ve(0|r,0|f,h&g|0,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l|0),e=0|b(),A=A-1|0}while(0!=(0|A));u=c,c=0}else u=s,c=0,s=0;return A=0,0|o&&(i[o>>2]=t,i[o+4>>2]=e),d=-2&(a<<1|0)|s,0|(m(0|(h=(0|a)>>>31|(u|A)<<1|0&(A<<1|a>>>31)|c)),d)}function be(t,e,n,r){var o,a;return a=U,U=U+16|0,me(t|=0,e|=0,n|=0,r|=0,o=0|a),U=a,0|(m(0|i[o+4>>2]),0|i[o>>2])}function Ee(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(m(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(m(0),e>>>n-32|0)}function Qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(m(e<<n|(t&(1<<n)-1<<32-n)>>>32-n|0),t<<n):(m(t<<n-32|0),0)}function Fe(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+v(+t,+e)}function we(t){return(t=+t)>=0?+A(t+.5):+C(t-.5)}function Se(t,e,n){t|=0,e|=0;var o,a,A=0;if((0|(n|=0))>=8192)return w(0|t,0|e,0|n),0|t;if(a=0|t,o=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|a;r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0,n=n-1|0}for(A=(n=-4&o|0)-64|0;(0|t)<=(0|A);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=o-4|0;(0|t)<(0|n);)r[t>>0]=0|r[e>>0],r[t+1>>0]=0|r[e+1>>0],r[t+2>>0]=0|r[e+2>>0],r[t+3>>0]=0|r[e+3>>0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0;return 0|a}function Re(t,e,n){e|=0;var o,a=0,A=0,s=0;if(o=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t>>0]=e,t=t+1|0;for(s=e|e<<8|e<<16|e<<24,A=(a=-4&o|0)-64|0;(0|t)<=(0|A);)i[t>>2]=s,i[t+4>>2]=s,i[t+8>>2]=s,i[t+12>>2]=s,i[t+16>>2]=s,i[t+20>>2]=s,i[t+24>>2]=s,i[t+28>>2]=s,i[t+32>>2]=s,i[t+36>>2]=s,i[t+40>>2]=s,i[t+44>>2]=s,i[t+48>>2]=s,i[t+52>>2]=s,i[t+56>>2]=s,i[t+60>>2]=s,t=t+64|0;for(;(0|t)<(0|a);)i[t>>2]=s,t=t+4|0}for(;(0|t)<(0|o);)r[t>>0]=e,t=t+1|0;return o-n|0}function Ue(t){return(t=+t)>=0?+A(t+.5):+C(t-.5)}function xe(t){t|=0;var e,n,r;return r=0|F(),(0|t)>0&(0|(e=(n=0|i[a>>2])+t|0))<(0|n)|(0|e)<0?(R(0|e),Q(12),-1):(0|e)>(0|r)&&!(0|S(0|e))?(Q(12),-1):(i[a>>2]=e,0|n)}return{___uremdi3:be,_bitshift64Lshr:Ee,_bitshift64Shl:Qe,_calloc:ye,_cellAreaKm2:function(t,e){var n,r,o,a=0;if(o=U,U=U+192|0,r=o,Pt(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Rt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{a+=+Rt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e))}}else a=0;return U=o,6371.007180918475*a*6371.007180918475},_cellAreaM2:function(t,e){var n,r,o,a=0;if(o=U,U=U+192|0,r=o,Pt(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Rt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{a+=+Rt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e))}}else a=0;return U=o,6371.007180918475*a*6371.007180918475*1e3*1e3},_cellAreaRads2:function(t,e){var n,r,o,a=0;if(o=U,U=U+192|0,r=o,Pt(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))<=0)return U=o,+(a=0);if(a=+Rt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1==(0|e))return U=o,+a;t=1;do{a+=+Rt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e));return U=o,+a},_compact:function(t,e,n){e|=0;var r,o=0,a=0,A=0,s=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0,E=0,Q=0,F=0;if(!(n|=0))return 0|(Q=0);if(o=0|i[(a=t|=0)>>2],!0&0==(15728640&(a=0|i[a+4>>2])|0)){if((0|n)<=0)return 0|(Q=0);if(i[(Q=e)>>2]=o,i[Q+4>>2]=a,1==(0|n))return 0|(Q=0);o=1;do{E=0|i[(m=t+(o<<3)|0)+4>>2],i[(Q=e+(o<<3)|0)>>2]=i[m>>2],i[Q+4>>2]=E,o=o+1|0}while((0|o)!=(0|n));return 0|(o=0)}if(!(E=0|pe(m=n<<3)))return 0|(Q=-3);if(Se(0|E,0|t,0|m),!(r=0|ye(n,8)))return Ce(E),0|(Q=-3);o=n;t:for(;;){v=0|Ee(0|(g=0|i[(s=E)>>2]),0|(s=0|i[s+4>>2]),52),b(),B=(v&=15)+-1|0,y=(0|o)>0;e:do{if(y){if(C=((0|o)<0)<<31>>31,I=0|Qe(0|B,0,52),p=0|b(),B>>>0>15)for(a=0,t=g,n=s;;){if(!(0==(0|t)&0==(0|n))){if(A=0|Ee(0|t,0|n,52),b(),c=(0|(A&=15))<(0|B),A=(0|A)==(0|B),n=0|be(0|(l=c?0:A?t:0),0|(t=c?0:A?n:0),0|o,0|C),b(),0==(0|(u=0|i[(c=A=r+(n<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))n=l;else for(I=0,d=n,h=c,n=l;;){if((0|I)>(0|o)){Q=41;break t}if((0|u)==(0|n)&(-117440513&h|0)==(0|t)){l=0|Ee(0|u,0|h,56),b(),f=(l&=7)+1|0,p=0|Ee(0|u,0|h,45),b();n:do{if(0|G(127&p)){if(u=0|Ee(0|u,0|h,52),b(),!(u&=15)){c=6;break}for(c=1;;){if(!(0==((p=0|Qe(7,0,3*(15-c|0)|0))&n|0)&0==((0|b())&t|0))){c=7;break n}if(!(c>>>0<u>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((l+2|0)>>>0>c>>>0){Q=51;break t}p=0|Qe(0|f,0,56),t=0|b()|-117440513&t,i[(c=A)>>2]=0,i[c+4>>2]=0,c=d,n|=p}else c=(d+1|0)%(0|o)|0;if(0==(0|(u=0|i[(h=A=r+(c<<3)|0)>>2]))&0==(0|(h=0|i[h+4>>2])))break;I=I+1|0,d=c}i[(p=A)>>2]=n,i[p+4>>2]=t}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=E+(a<<3)|0)>>2],n=0|i[n+4>>2]}for(a=0,t=g,n=s;;){if(!(0==(0|t)&0==(0|n))){if(c=0|Ee(0|t,0|n,52),b(),(0|(c&=15))>=(0|B)){if((0|c)!=(0|B)&&(t|=I,n=-15728641&n|p,c>>>0>=v>>>0)){A=B;do{d=0|Qe(7,0,3*(14-A|0)|0),A=A+1|0,t|=d,n=0|b()|n}while(A>>>0<c>>>0)}}else t=0,n=0;if(c=0|be(0|t,0|n,0|o,0|C),b(),!(0==(0|(l=0|i[(u=A=r+(c<<3)|0)>>2]))&0==(0|(u=0|i[u+4>>2]))))for(d=0;;){if((0|d)>(0|o)){Q=41;break t}if((0|l)==(0|t)&(-117440513&u|0)==(0|n)){f=0|Ee(0|l,0|u,56),b(),h=(f&=7)+1|0,F=0|Ee(0|l,0|u,45),b();n:do{if(0|G(127&F)){if(l=0|Ee(0|l,0|u,52),b(),!(l&=15)){u=6;break}for(u=1;;){if(!(0==((F=0|Qe(7,0,3*(15-u|0)|0))&t|0)&0==((0|b())&n|0))){u=7;break n}if(!(u>>>0<l>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){Q=51;break t}F=0|Qe(0|h,0,56),n=0|b()|-117440513&n,i[(h=A)>>2]=0,i[h+4>>2]=0,t|=F}else c=(c+1|0)%(0|o)|0;if(0==(0|(l=0|i[(u=A=r+(c<<3)|0)>>2]))&0==(0|(u=0|i[u+4>>2])))break;d=d+1|0}i[(F=A)>>2]=t,i[F+4>>2]=n}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=E+(a<<3)|0)>>2],n=0|i[n+4>>2]}}}while(0);if((o+5|0)>>>0<11){Q=99;break}if(!(p=0|ye((0|o)/6|0,8))){Q=58;break}e:do{if(y){d=0,h=0;do{if(!(0==(0|(a=0|i[(t=c=r+(d<<3)|0)>>2]))&0==(0|(t=0|i[t+4>>2])))){u=0|Ee(0|a,0|t,56),b(),n=(u&=7)+1|0,l=-117440513&t,F=0|Ee(0|a,0|t,45),b();n:do{if(0|G(127&F)){if(f=0|Ee(0|a,0|t,52),b(),0|(f&=15))for(A=1;;){if(!(0==(a&(F=0|Qe(7,0,3*(15-A|0)|0))|0)&0==(l&(0|b())|0)))break n;if(!(A>>>0<f>>>0))break;A=A+1|0}a|=t=0|Qe(0|n,0,56),t=0|b()|l,i[(n=c)>>2]=a,i[n+4>>2]=t,n=u+2|0}}while(0);7==(0|n)&&(i[(F=p+(h<<3)|0)>>2]=a,i[F+4>>2]=-117440513&t,h=h+1|0)}d=d+1|0}while((0|d)!=(0|o));if(y){if(I=((0|o)<0)<<31>>31,f=0|Qe(0|B,0,52),d=0|b(),B>>>0>15)for(t=0,a=0;;){do{if(!(0==(0|g)&0==(0|s))){for(u=0|Ee(0|g,0|s,52),b(),A=(0|(u&=15))<(0|B),u=(0|u)==(0|B),A=0|be(0|(c=A?0:u?g:0),0|(u=A?0:u?s:0),0|o,0|I),b(),n=0;;){if((0|n)>(0|o)){Q=98;break t}if((-117440513&(l=0|i[(F=r+(A<<3)|0)+4>>2])|0)==(0|u)&&(0|i[F>>2])==(0|c)){Q=70;break}if((0|i[(F=r+((A=(A+1|0)%(0|o)|0)<<3)|0)>>2])==(0|c)&&(0|i[F+4>>2])==(0|u))break;n=n+1|0}if(70==(0|Q)&&(Q=0,!0&100663296==(117440512&l|0)))break;i[(F=e+(a<<3)|0)>>2]=g,i[F+4>>2]=s,a=a+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=h;break e}g=0|i[(s=E+(t<<3)|0)>>2],s=0|i[s+4>>2]}for(t=0,a=0;;){do{if(!(0==(0|g)&0==(0|s))){if(u=0|Ee(0|g,0|s,52),b(),(0|(u&=15))>=(0|B))if((0|u)!=(0|B))if(n=g|f,A=-15728641&s|d,u>>>0<v>>>0)u=A;else{c=B;do{F=0|Qe(7,0,3*(14-c|0)|0),c=c+1|0,n|=F,A=0|b()|A}while(c>>>0<u>>>0);u=A}else n=g,u=s;else n=0,u=0;for(c=0|be(0|n,0|u,0|o,0|I),b(),A=0;;){if((0|A)>(0|o)){Q=98;break t}if((-117440513&(l=0|i[(F=r+(c<<3)|0)+4>>2])|0)==(0|u)&&(0|i[F>>2])==(0|n)){Q=93;break}if((0|i[(F=r+((c=(c+1|0)%(0|o)|0)<<3)|0)>>2])==(0|n)&&(0|i[F+4>>2])==(0|u))break;A=A+1|0}if(93==(0|Q)&&(Q=0,!0&100663296==(117440512&l|0)))break;i[(F=e+(a<<3)|0)>>2]=g,i[F+4>>2]=s,a=a+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=h;break e}g=0|i[(s=E+(t<<3)|0)>>2],s=0|i[s+4>>2]}}else a=0,o=h}else a=0,o=0}while(0);if(Re(0|r,0,0|m),Se(0|E,0|p,o<<3|0),Ce(p),!o)break;e=e+(a<<3)|0}return 41==(0|Q)?(Ce(E),Ce(r),0|(F=-1)):51==(0|Q)?(Ce(E),Ce(r),0|(F=-2)):58==(0|Q)?(Ce(E),Ce(r),0|(F=-3)):98==(0|Q)?(Ce(p),Ce(E),Ce(r),0|(F=-1)):(99==(0|Q)&&Se(0|e,0|E,o<<3|0),Ce(E),Ce(r),0|(F=0))},_destroyLinkedPolygon:function(t){var e=0,n=0,r=0,o=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{o=n,n=0|i[n+16>>2],Ce(o)}while(0!=(0|n));o=e,e=0|i[e+8>>2],Ce(o)}while(0!=(0|e));if(e=t,t=0|i[t+8>>2],r||Ce(e),!t)break;r=0}},_edgeLengthKm:function(t){return+ +o[20752+((t|=0)<<3)>>3]},_edgeLengthM:function(t){return+ +o[20880+((t|=0)<<3)>>3]},_emscripten_replace_memory:function(t){return r=new Int8Array(t),new Uint8Array(t),i=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),n=t,!0},_exactEdgeLengthKm:function(t,e){var n,r,a=0,A=0,s=0,u=0,f=0,h=0;if(r=U,U=U+176|0,Yt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return U=r,+(s=0);e=t+-1|0,t=0,a=0,A=+o[n+8>>3],s=+o[n+16>>3];do{f=A,A=+o[n+8+((t=t+1|0)<<4)>>3],h=+g(.5*(A-f)),u=s,s=+o[n+8+(t<<4)+8>>3],u=h*h+(u=+g(.5*(s-u)))*(+l(+f)*+l(+A)*u),a+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return U=r,+(h=6371.007180918475*a)},_exactEdgeLengthM:function(t,e){var n,r,a=0,A=0,s=0,u=0,f=0,h=0;if(r=U,U=U+176|0,Yt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return U=r,+(s=0);e=t+-1|0,t=0,a=0,A=+o[n+8>>3],s=+o[n+16>>3];do{f=A,A=+o[n+8+((t=t+1|0)<<4)>>3],h=+g(.5*(A-f)),u=s,s=+o[n+8+(t<<4)+8>>3],u=h*h+(u=+g(.5*(s-u)))*(+l(+f)*+l(+A)*u),a+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return U=r,+(h=6371.007180918475*a*1e3)},_exactEdgeLengthRads:function(t,e){var n,r,a=0,A=0,s=0,u=0,f=0,h=0;if(r=U,U=U+176|0,Yt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return U=r,+(s=0);e=t+-1|0,t=0,a=0,A=+o[n+8>>3],s=+o[n+16>>3];do{f=A,A=+o[n+8+((t=t+1|0)<<4)>>3],h=+g(.5*(A-f)),u=s,s=+o[n+8+(t<<4)+8>>3],u=h*h+(u=+g(.5*(s-u)))*(+l(+A)*+l(+f)*u),a+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return U=r,+a},_experimentalH3ToLocalIj:function(t,e,n,r,i){var o,a;return i|=0,a=U,U=U+16|0,(t=0|$t(t|=0,e|=0,n|=0,r|=0,o=a))||(ft(o,i),t=0),U=a,0|t},_experimentalLocalIjToH3:function(t,e,n,r){var i,o;return t|=0,e|=0,r|=0,i=U,U=U+16|0,ht(n|=0,o=i),r=0|te(t,e,o,r),U=i,0|r},_free:Ce,_geoToH3:Lt,_getDestinationH3IndexFromUnidirectionalEdge:function(t,e){t|=0;var n,r,o=0;return n=U,U=U+16|0,o=n,!0&268435456==(2013265920&(e|=0)|0)?(r=0|Ee(0|t,0|e,56),b(),i[o>>2]=0,o=0|N(t,-2130706433&e|134217728,7&r,o),e=0|b(),m(0|e),U=n,0|o):(o=0,m(0|(e=0)),U=n,0|o)},_getH3IndexesFromUnidirectionalEdge:function(t,e,n){t|=0;var r,o,a,A,s=0;a=U,U=U+16|0,r=a,A=!0&268435456==(2013265920&(e|=0)|0),o=-2130706433&e|134217728,i[(s=n|=0)>>2]=A?t:0,i[s+4>>2]=A?o:0,A?(e=0|Ee(0|t,0|e,56),b(),i[r>>2]=0,t=0|N(t,o,7&e,r),e=0|b()):(t=0,e=0),i[(s=n+8|0)>>2]=t,i[s+4>>2]=e,U=a},_getH3UnidirectionalEdge:function(t,e,n,r){var o,a,A=0,s=0,c=0,u=0,l=0;if(a=U,U=U+16|0,o=a,!(0|Ht(t|=0,e|=0,n|=0,r|=0)))return u=0,m(0|(c=0)),U=a,0|u;for(c=-2130706433&e,A=(A=0==(0|Nt(t,e)))?1:2;i[o>>2]=0,s=A+1|0,!((0|(l=0|N(t,e,A,o)))==(0|n)&(0|b())==(0|r));){if(!(s>>>0<7)){A=0,t=0,u=6;break}A=s}return 6==(0|u)?(m(0|A),U=a,0|t):(l=0|Qe(0|A,0,56),u=0|c|b()|268435456,l|=t,m(0|u),U=a,0|l)},_getH3UnidirectionalEdgeBoundary:Yt,_getH3UnidirectionalEdgesFromHexagon:function(t,e,n){n|=0;var r,o=0;r=0==(0|Nt(t|=0,e|=0)),e&=-2130706433,i[(o=n)>>2]=r?t:0,i[o+4>>2]=r?285212672|e:0,i[(o=n+8|0)>>2]=t,i[o+4>>2]=301989888|e,i[(o=n+16|0)>>2]=t,i[o+4>>2]=318767104|e,i[(o=n+24|0)>>2]=t,i[o+4>>2]=335544320|e,i[(o=n+32|0)>>2]=t,i[o+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e},_getOriginH3IndexFromUnidirectionalEdge:function(t,e){var n;return t|=0,m(0|((n=!0&268435456==(2013265920&(e|=0)|0))?-2130706433&e|134217728:0)),0|(n?t:0)},_getPentagonIndexes:Jt,_getRes0Indexes:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Qe(0|e,0,45),r=134225919|b(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e))},_h3Distance:function(t,e,n,r){var i,o,a;return n|=0,r|=0,a=U,U=U+32|0,o=a,t=0==(0|$t(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|$t(t,e,n,r,o))?0|gt(i,o):-1,U=a,0|t},_h3GetBaseCell:Ut,_h3GetFaces:function t(e,n,r){r|=0;var o,a=0,A=0,s=0,c=0,u=0,l=0,g=0,f=0;o=U,U=U+128|0,g=o+112|0,s=o+96|0,f=o,A=0|Ee(0|(e|=0),0|(n|=0),52),b(),u=15&A,i[g>>2]=u,c=0|Ee(0|e,0|n,45),b(),c&=127;t:do{if(0|G(c)){if(0|u)for(a=1;;){if(!(0==((l=0|Qe(7,0,3*(15-a|0)|0))&e|0)&0==((0|b())&n|0))){A=0;break t}if(!(a>>>0<u>>>0))break;a=a+1|0}if(!(1&A))return l=0|Qe(u+1|0,0,52),f=0|b()|-15728641&n,t((l|e)&~(g=0|Qe(7,0,3*(14-u|0)|0)),f&~(0|b()),r),void(U=o);A=1}else A=0}while(0);Zt(e,n,s),A?(Bt(s,g,f),l=5):(Qt(s,g,f),l=6);t:do{if(0|G(c))if(u)for(a=1;;){if(!(0==((c=0|Qe(7,0,3*(15-a|0)|0))&e|0)&0==((0|b())&n|0))){a=8;break t}if(!(a>>>0<u>>>0)){a=20;break}a=a+1|0}else a=20;else a=8}while(0);if(Re(0|r,-1,0|a),A){A=0;do{for(bt(s=f+(A<<4)|0,0|i[g>>2]),s=0|i[s>>2],a=0;!(-1==(0|(u=0|i[(c=r+(a<<2)|0)>>2]))|(0|u)==(0|s));)a=a+1|0;i[c>>2]=s,A=A+1|0}while((0|A)!=(0|l))}else{A=0;do{for(mt(s=f+(A<<4)|0,0|i[g>>2],0,1),s=0|i[s>>2],a=0;!(-1==(0|(u=0|i[(c=r+(a<<2)|0)>>2]))|(0|u)==(0|s));)a=a+1|0;i[c>>2]=s,A=A+1|0}while((0|A)!=(0|l))}U=o},_h3IndexesAreNeighbors:Ht,_h3IsPentagon:Nt,_h3IsResClassIII:function(t,e){return e=0|Ee(0|(t|=0),0|(e|=0),52),b(),1&e|0},_h3IsValid:xt,_h3Line:function(t,e,n,r,o){n|=0,r|=0,o|=0;var a,A=0,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0,b=0,E=0;if(a=U,U=U+48|0,c=a+12|0,b=a,0==(0|$t(t|=0,e|=0,t,e,A=a+24|0))&&0==(0|$t(t,e,n,r,c))){if((0|(m=0|gt(A,c)))<0)return U=a,0|(b=m);for(i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,$t(t,e,t,e,A),$t(t,e,n,r,c),dt(A),dt(c),m?(I=+(0|m),B=A,n=f=0|i[A>>2],r=h=0|i[(y=A+4|0)>>2],A=d=0|i[(v=A+8|0)>>2],p=+((0|i[c>>2])-f|0)/I,C=+((0|i[c+4>>2])-h|0)/I,I=+((0|i[c+8>>2])-d|0)/I):(y=r=A+4|0,v=d=A+8|0,B=A,n=0|i[A>>2],r=0|i[r>>2],A=0|i[d>>2],p=0,C=0,I=0),i[b>>2]=n,i[(d=b+4|0)>>2]=r,i[(h=b+8|0)>>2]=A,f=0;;){E=p*(l=+(0|f))+ +(0|n),u=C*l+ +(0|i[y>>2]),l=I*l+ +(0|i[v>>2]),r=~~+we(+E),c=~~+we(+u),n=~~+we(+l),E=+s(+(+(0|r)-E)),u=+s(+(+(0|c)-u)),l=+s(+(+(0|n)-l));do{if(!(E>u&E>l)){if(g=0-r|0,u>l){A=g-n|0;break}A=c,n=g-c|0;break}r=0-(c+n)|0,A=c}while(0);if(i[b>>2]=r,i[d>>2]=A,i[h>>2]=n,It(b),te(t,e,b,o+(f<<3)|0),(0|f)==(0|m))break;f=f+1|0,n=0|i[B>>2]}return U=a,0|(b=0)}return U=a,0|(b=-1)},_h3LineSize:function(t,e,n,r){var i,o,a;return n|=0,r|=0,a=U,U=U+32|0,o=a,t=0==(0|$t(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|$t(t,e,n,r,o))?0|gt(i,o):-1,U=a,(t>>>31^1)+t|0},_h3SetToLinkedGeo:function(t,e,n){n|=0;var r,o,a,A=0;if(a=U,U=U+32|0,r=a,function(t,e,n){t|=0,n|=0;var r,o,a=0,A=0,s=0,c=0,u=0;if(o=U,U=U+176|0,r=o,(0|(e|=0))<1)return ce(n,0,0),void(U=o);c=0|Ee(0|i[(c=t)>>2],0|i[c+4>>2],52),b(),ce(n,(0|e)>6?e:6,15&c),c=0;do{if(Wt(0|i[(a=t+(c<<3)|0)>>2],0|i[a+4>>2],r),(0|(a=0|i[r>>2]))>0){u=0;do{s=r+8+(u<<4)|0,(A=0|he(n,a=r+8+(((0|(u=u+1|0))%(0|a)|0)<<4)|0,s))?ge(n,A):fe(n,s,a),a=0|i[r>>2]}while((0|u)<(0|a))}c=c+1|0}while((0|c)!=(0|e));U=o}(t|=0,e|=0,o=a+16|0),i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,!(t=0|le(o)))return Kt(n),ue(o),void(U=a);do{e=0|Xt(n);do{zt(e,t),A=t+16|0,i[r>>2]=i[A>>2],i[r+4>>2]=i[A+4>>2],i[r+8>>2]=i[A+8>>2],i[r+12>>2]=i[A+12>>2],ge(o,t),t=0|de(o,r)}while(0!=(0|t));t=0|le(o)}while(0!=(0|t));Kt(n),ue(o),U=a},_h3ToCenterChild:function(t,e,n){n|=0;var r=0,i=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),b(),(0|n)<16&(0|(r&=15))<=(0|n)){if((0|r)!=(0|n)&&(t|=i=0|Qe(0|n,0,52),e=0|b()|-15728641&e,(0|r)<(0|n)))do{i=0|Qe(7,0,3*(14-r|0)|0),r=r+1|0,t&=~i,e&=~(0|b())}while((0|r)<(0|n))}else e=0,t=0;return m(0|e),0|t},_h3ToChildren:Ot,_h3ToGeo:Pt,_h3ToGeoBoundary:Wt,_h3ToParent:kt,_h3UnidirectionalEdgeIsValid:function(t,e){var n=0;if(!(!0&268435456==(2013265920&(e|=0)|0)))return 0|(n=0);switch(n=0|Ee(0|(t|=0),0|e,56),b(),7&n){case 0:case 7:return 0|(n=0)}return!0&16777216==(117440512&e|0)&0!=(0|Nt(t,n=-2130706433&e|134217728))?0|(n=0):0|(n=0|xt(t,n))},_hexAreaKm2:function(t){return+ +o[20496+((t|=0)<<3)>>3]},_hexAreaM2:function(t){return+ +o[20624+((t|=0)<<3)>>3]},_hexRing:function(t,e,n,r){t|=0,e|=0,r|=0;var o,a=0,A=0,s=0,c=0,u=0,l=0,g=0;if(o=U,U=U+16|0,g=o,!(n|=0))return i[(g=r)>>2]=t,i[g+4>>2]=e,U=o,0|(g=0);i[g>>2]=0;t:do{if(0|Nt(t,e))t=1;else{if(A=(0|n)>0){a=0,l=t;do{if(0==(0|(l=0|N(l,e,4,g)))&0==(0|(e=0|b()))){t=2;break t}if(a=a+1|0,0|Nt(l,e)){t=1;break t}}while((0|a)<(0|n));if(i[(u=r)>>2]=l,i[u+4>>2]=e,u=n+-1|0,A){A=0,s=1,a=l,t=e;do{if(0==(0|(a=0|N(a,t,2,g)))&0==(0|(t=0|b()))){t=2;break t}if(i[(c=r+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|Nt(a,t)){t=1;break t}A=A+1|0}while((0|A)<(0|n));c=0,A=s;do{if(0==(0|(a=0|N(a,t,3,g)))&0==(0|(t=0|b()))){t=2;break t}if(i[(s=r+(A<<3)|0)>>2]=a,i[s+4>>2]=t,A=A+1|0,0|Nt(a,t)){t=1;break t}c=c+1|0}while((0|c)<(0|n));s=0;do{if(0==(0|(a=0|N(a,t,1,g)))&0==(0|(t=0|b()))){t=2;break t}if(i[(c=r+(A<<3)|0)>>2]=a,i[c+4>>2]=t,A=A+1|0,0|Nt(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|n));s=0;do{if(0==(0|(a=0|N(a,t,5,g)))&0==(0|(t=0|b()))){t=2;break t}if(i[(c=r+(A<<3)|0)>>2]=a,i[c+4>>2]=t,A=A+1|0,0|Nt(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|n));s=0;do{if(0==(0|(a=0|N(a,t,4,g)))&0==(0|(t=0|b()))){t=2;break t}if(i[(c=r+(A<<3)|0)>>2]=a,i[c+4>>2]=t,A=A+1|0,0|Nt(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|n));for(s=0;;){if(0==(0|(a=0|N(a,t,6,g)))&0==(0|(t=0|b()))){t=2;break t}if((0|s)!=(0|u)){if(i[(c=r+(A<<3)|0)>>2]=a,i[c+4>>2]=t,0|Nt(a,t)){t=1;break t}A=A+1|0}if((0|(s=s+1|0))>=(0|n)){s=l,A=e;break}}}else s=l,a=l,A=e,t=e}else i[(s=r)>>2]=t,i[s+4>>2]=e,s=t,a=t,A=e,t=e;t=1&((0|s)!=(0|a)|(0|A)!=(0|t))}}while(0);return U=o,0|(g=t)},_i64Subtract:ve,_kRing:x,_kRingDistances:function(t,e,n,r,i){var o;if(0|k(t|=0,e|=0,n|=0,r|=0,i|=0)){if(Re(0|r,0,(o=1+(0|y(3*n|0,n+1|0))|0)<<3|0),0|i)return Re(0|i,0,o<<2|0),void O(t,e,n,r,i,o,0);(i=0|ye(o,4))&&(O(t,e,n,r,i,o,0),Ce(i))}},_llvm_minnum_f64:Fe,_llvm_round_f64:we,_malloc:pe,_maxFaceCount:function(t,e){var n=0,r=0;if(r=0|Ee(0|(t|=0),0|(e|=0),45),b(),!(0|G(127&r)))return 0|(r=2);if(r=0|Ee(0|t,0|e,52),b(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|Qe(7,0,3*(15-n|0)|0))&t|0)&0==((0|b())&e|0))){n=2,t=6;break}if(!(n>>>0<r>>>0)){n=5,t=6;break}n=n+1|0}return 6==(0|t)?0|n:0},_maxH3ToChildrenSize:function(t,e,n){return n|=0,t=0|Ee(0|(t|=0),0|(e|=0),52),b(),(0|n)<16&(0|(t&=15))<=(0|n)?0|(n=0|ee(7,n-t|0)):0|(n=0)},_maxKringSize:function(t){return 1+(0|y(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){e|=0;var n,r=0,o=0,a=0,A=0,s=0;if(n=U,U=U+48|0,a=n+8|0,o=n,A=0|i[(s=t|=0)+4>>2],i[(r=o)>>2]=i[s>>2],i[r+4>>2]=A,re(o,a),a=0|W(a,e),e=0|i[o>>2],(0|(o=0|i[t+8>>2]))<=0)return U=n,0|(s=(s=(A=(0|a)<(0|(s=e)))?s:a)+12|0);r=0|i[t+12>>2],t=0;do{e=(0|i[r+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|o));return U=n,0|(s=(s=(s=(0|a)<(0|e))?e:a)+12|0)},_maxUncompactSize:function(t,e,n){t|=0,n|=0;var r=0,o=0,a=0,A=0;if((0|(e|=0))<=0)return 0|(n=0);if((0|n)>=16){for(r=0;;){if(!(0==(0|i[(A=t+(r<<3)|0)>>2])&0==(0|i[A+4>>2]))){r=-1,o=13;break}if((0|(r=r+1|0))>=(0|e)){r=0,o=13;break}}if(13==(0|o))return 0|r}r=0,A=0;t:for(;;){a=0|i[(o=t+(A<<3)|0)>>2],o=0|i[o+4>>2];do{if(!(0==(0|a)&0==(0|o))){if(o=0|Ee(0|a,0|o,52),b(),(0|(o&=15))>(0|n)){r=-1,o=13;break t}if((0|o)==(0|n)){r=r+1|0;break}r=(0|ee(7,n-o|0))+r|0;break}}while(0);if((0|(A=A+1|0))>=(0|e)){o=13;break}}return 13==(0|o)?0|r:0},_memcpy:Se,_memset:Re,_numHexagons:function(t){var e;return t=0|i[(e=21008+((t|=0)<<3)|0)>>2],m(0|i[e+4>>2]),0|t},_pentagonIndexCount:function(){return 12},_pointDistKm:St,_pointDistM:function(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+g(.5*(r-n)))*i+(a=+g(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+l(+r)*+l(+n)*a),2*+p(+ +c(+a),+ +c(+(1-a)))*6371.007180918475*1e3},_pointDistRads:function(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+g(.5*(r-n)))*i+(a=+g(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+l(+r)*+l(+n)*a),2*+p(+ +c(+a),+ +c(+(1-a)))},_polyfill:function(t,e,n){var r,o=0,a=0,A=0,s=0,c=0;if(r=U,U=U+48|0,o=r+8|0,a=r,0|function(t,e,n){e|=0,n|=0;var r,o,a,A,s,c=0,u=0,l=0,g=0,f=0,h=0,d=0,I=0,p=0,C=0,y=0,v=0,B=0,m=0,Q=0,F=0,w=0,S=0,R=0,x=0,N=0,G=0,_=0,M=0,T=0;s=U,U=U+112|0,o=s+80|0,h=s+72|0,a=s,A=s+56|0,(T=0|pe(32+(i[(d=(t=t|0)+8|0)>>2]<<5)|0))||E(22848,22448,800,22456);if(ie(t,T),c=0|i[(l=t)+4>>2],i[(f=h)>>2]=i[l>>2],i[f+4>>2]=c,re(h,o),f=0|W(o,e),c=0|i[h>>2],(0|(l=0|i[d>>2]))>0){g=0|i[t+12>>2],u=0;do{c=(0|i[g+(u<<3)>>2])+c|0,u=u+1|0}while((0|u)!=(0|l))}if(u=0|ye(r=(f=(0|f)<(0|c)?c:f)+12|0,8),I=0|ye(r,8),i[o>>2]=0,M=0|i[(_=t)+4>>2],i[(c=h)>>2]=i[_>>2],i[c+4>>2]=M,0|(c=0|D(h,r,e,o,u,I)))return Ce(u),Ce(I),Ce(T),U=s,0|(T=c);t:do{if((0|i[d>>2])>0){for(l=t+12|0,c=0;g=0|D((0|i[l>>2])+(c<<3)|0,r,e,o,u,I),c=c+1|0,!(0|g);)if((0|c)>=(0|i[d>>2]))break t;return Ce(u),Ce(I),Ce(T),U=s,0|(T=g)}}while(0);(0|f)>-12&&Re(0|I,0,((0|r)>1?r:1)<<3|0);t:do{if((0|i[o>>2])>0){M=((0|r)<0)<<31>>31,S=u,R=I,x=u,N=u,G=I,_=u,c=u,m=u,Q=I,F=I,w=I,u=I;e:for(;;){for(B=0|i[o>>2],y=0,v=0,l=0;;){f=(g=a)+56|0;do{i[g>>2]=0,g=g+4|0}while((0|g)<(0|f));if(h=0|i[(e=S+(y<<3)|0)>>2],e=0|i[e+4>>2],0|k(h,e,1,a,0)){f=(g=a)+56|0;do{i[g>>2]=0,g=g+4|0}while((0|g)<(0|f));0|(g=0|ye(7,4))&&(O(h,e,1,a,g,7,0),Ce(g))}C=0;do{I=0|i[(p=a+(C<<3)|0)>>2],p=0|i[p+4>>2];n:do{if(!(0==(0|I)&0==(0|p))){if(h=0|be(0|I,0|p,0|r,0|M),b(),e=0|i[(f=g=n+(h<<3)|0)>>2],f=0|i[f+4>>2],!(0==(0|e)&0==(0|f)))for(d=0;;){if((0|d)>(0|r))break e;if((0|e)==(0|I)&(0|f)==(0|p))break n;if(e=0|i[(f=g=n+((h=(h+1|0)%(0|r)|0)<<3)|0)>>2],f=0|i[f+4>>2],0==(0|e)&0==(0|f))break;d=d+1|0}0==(0|I)&0==(0|p)||(Pt(I,p,A),0|oe(t,T,A)&&(i[(d=g)>>2]=I,i[d+4>>2]=p,i[(d=R+(l<<3)|0)>>2]=I,i[d+4>>2]=p,l=l+1|0))}}while(0);C=C+1|0}while(C>>>0<7);if((0|(v=v+1|0))>=(0|B))break;y=y+1|0}if((0|B)>0&&Re(0|x,0,B<<3|0),i[o>>2]=l,!((0|l)>0))break t;I=u,p=w,C=_,y=F,v=Q,B=R,u=m,w=c,F=N,Q=x,m=I,c=p,_=G,G=C,N=y,x=v,R=S,S=B}return Ce(N),Ce(G),Ce(T),U=s,0|(T=-1)}c=I}while(0);return Ce(T),Ce(u),Ce(c),U=s,0|(T=0)}(t|=0,e|=0,n|=0)){if(A=0|i[(c=t)+4>>2],i[(s=a)>>2]=i[c>>2],i[s+4>>2]=A,re(a,o),s=0|W(o,e),e=0|i[a>>2],(0|(A=0|i[t+8>>2]))>0){a=0|i[t+12>>2],o=0;do{e=(0|i[a+(o<<3)>>2])+e|0,o=o+1|0}while((0|o)!=(0|A))}(0|(e=(0|s)<(0|e)?e:s))<=-12||Re(0|n,0,8+(((0|(c=e+11|0))>0?c:0)<<3)|0),U=r}else U=r},_res0IndexCount:function(){return 122},_round:Ue,_sbrk:xe,_sizeOfCoordIJ:function(){return 8},_sizeOfGeoBoundary:function(){return 168},_sizeOfGeoCoord:function(){return 16},_sizeOfGeoPolygon:function(){return 16},_sizeOfGeofence:function(){return 8},_sizeOfH3Index:function(){return 8},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompact:function(t,e,n,r,o){t|=0,n|=0,r|=0,o|=0;var a=0,A=0,s=0,c=0,u=0,l=0;if((0|(e|=0))<=0)return 0|(o=0);if((0|o)>=16){for(a=0;;){if(!(0==(0|i[(l=t+(a<<3)|0)>>2])&0==(0|i[l+4>>2]))){a=14;break}if((0|(a=a+1|0))>=(0|e)){A=0,a=16;break}}if(14==(0|a))return 0|((0|r)>0?-2:-1);if(16==(0|a))return 0|A}a=0,l=0;t:for(;;){A=0|i[(s=u=t+(l<<3)|0)>>2],s=0|i[s+4>>2];do{if(!(0==(0|A)&0==(0|s))){if((0|a)>=(0|r)){A=-1,a=16;break t}if(c=0|Ee(0|A,0|s,52),b(),(0|(c&=15))>(0|o)){A=-2,a=16;break t}if((0|c)==(0|o)){i[(u=n+(a<<3)|0)>>2]=A,i[u+4>>2]=s,a=a+1|0;break}if((0|(A=(0|ee(7,o-c|0))+a|0))>(0|r)){A=-1,a=16;break t}Ot(0|i[u>>2],0|i[u+4>>2],o,n+(a<<3)|0),a=A}}while(0);if((0|(l=l+1|0))>=(0|e)){A=0,a=16;break}}return 16==(0|a)?0|A:0},establishStackSpace:function(t,e){U=t|=0},stackAlloc:function(t){var e;return e=U,U=(U=U+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){U=t|=0},stackSave:function(){return 0|U}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:st,b:function(t){c=t},c:u,d:function(t,e,n,r){st("Assertion failed: "+d(t)+", at: "+[e?d(e):"unknown filename",n,r?d(r):"unknown function"])},e:function(t){return n.___errno_location&&(v[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){C.set(C.subarray(e,e+n),t)},h:function(t){var e=J();if(t>2130706432)return!1;for(var n=Math.max(e,16777216);n<t;)n=n<=536870912?b(2*n,16777216):Math.min(b((3*n+2147483648)/4,16777216),2130706432);return!!H(n)},i:function(t){st("OOM")},j:Z,k:P,l:H,m:W,n:function(){var t=W();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),P(t)},o:24032,p:24016},I),$=(n.___uremdi3=q.___uremdi3,n._bitshift64Lshr=q._bitshift64Lshr,n._bitshift64Shl=q._bitshift64Shl,n._calloc=q._calloc,n._cellAreaKm2=q._cellAreaKm2,n._cellAreaM2=q._cellAreaM2,n._cellAreaRads2=q._cellAreaRads2,n._compact=q._compact,n._destroyLinkedPolygon=q._destroyLinkedPolygon,n._edgeLengthKm=q._edgeLengthKm,n._edgeLengthM=q._edgeLengthM,n._emscripten_replace_memory=q._emscripten_replace_memory),tt=(n._exactEdgeLengthKm=q._exactEdgeLengthKm,n._exactEdgeLengthM=q._exactEdgeLengthM,n._exactEdgeLengthRads=q._exactEdgeLengthRads,n._experimentalH3ToLocalIj=q._experimentalH3ToLocalIj,n._experimentalLocalIjToH3=q._experimentalLocalIjToH3,n._free=q._free,n._geoToH3=q._geoToH3,n._getDestinationH3IndexFromUnidirectionalEdge=q._getDestinationH3IndexFromUnidirectionalEdge,n._getH3IndexesFromUnidirectionalEdge=q._getH3IndexesFromUnidirectionalEdge,n._getH3UnidirectionalEdge=q._getH3UnidirectionalEdge,n._getH3UnidirectionalEdgeBoundary=q._getH3UnidirectionalEdgeBoundary,n._getH3UnidirectionalEdgesFromHexagon=q._getH3UnidirectionalEdgesFromHexagon,n._getOriginH3IndexFromUnidirectionalEdge=q._getOriginH3IndexFromUnidirectionalEdge,n._getPentagonIndexes=q._getPentagonIndexes,n._getRes0Indexes=q._getRes0Indexes,n._h3Distance=q._h3Distance,n._h3GetBaseCell=q._h3GetBaseCell,n._h3GetFaces=q._h3GetFaces,n._h3IndexesAreNeighbors=q._h3IndexesAreNeighbors,n._h3IsPentagon=q._h3IsPentagon,n._h3IsResClassIII=q._h3IsResClassIII,n._h3IsValid=q._h3IsValid,n._h3Line=q._h3Line,n._h3LineSize=q._h3LineSize,n._h3SetToLinkedGeo=q._h3SetToLinkedGeo,n._h3ToCenterChild=q._h3ToCenterChild,n._h3ToChildren=q._h3ToChildren,n._h3ToGeo=q._h3ToGeo,n._h3ToGeoBoundary=q._h3ToGeoBoundary,n._h3ToParent=q._h3ToParent,n._h3UnidirectionalEdgeIsValid=q._h3UnidirectionalEdgeIsValid,n._hexAreaKm2=q._hexAreaKm2,n._hexAreaM2=q._hexAreaM2,n._hexRing=q._hexRing,n._i64Subtract=q._i64Subtract,n._kRing=q._kRing,n._kRingDistances=q._kRingDistances,n._llvm_minnum_f64=q._llvm_minnum_f64,n._llvm_round_f64=q._llvm_round_f64,n._malloc=q._malloc,n._maxFaceCount=q._maxFaceCount,n._maxH3ToChildrenSize=q._maxH3ToChildrenSize,n._maxKringSize=q._maxKringSize,n._maxPolyfillSize=q._maxPolyfillSize,n._maxUncompactSize=q._maxUncompactSize,n._memcpy=q._memcpy,n._memset=q._memset,n._numHexagons=q._numHexagons,n._pentagonIndexCount=q._pentagonIndexCount,n._pointDistKm=q._pointDistKm,n._pointDistM=q._pointDistM,n._pointDistRads=q._pointDistRads,n._polyfill=q._polyfill,n._res0IndexCount=q._res0IndexCount,n._round=q._round,n._sbrk=q._sbrk,n._sizeOfCoordIJ=q._sizeOfCoordIJ,n._sizeOfGeoBoundary=q._sizeOfGeoBoundary,n._sizeOfGeoCoord=q._sizeOfGeoCoord,n._sizeOfGeoPolygon=q._sizeOfGeoPolygon,n._sizeOfGeofence=q._sizeOfGeofence,n._sizeOfH3Index=q._sizeOfH3Index,n._sizeOfLinkedGeoPolygon=q._sizeOfLinkedGeoPolygon,n._uncompact=q._uncompact,n.establishStackSpace=q.establishStackSpace,n.stackAlloc=q.stackAlloc),et=n.stackRestore=q.stackRestore,nt=n.stackSave=q.stackSave;if(n.asm=q,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!r?g(t):function(){return f(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":p[t>>0]=e;break;case"i16":y[t>>1]=e;break;case"i32":v[t>>2]=e;break;case"i64":T=[e>>>0,(M=e,+x(M)>=1?M>0?(0|N(+O(M/4294967296),4294967295))>>>0:~~+k((M-+(~~M>>>0))/4294967296)>>>0:0)],v[t>>2]=T[0],v[t+4>>2]=T[1];break;case"float":B[t>>2]=e;break;case"double":m[t>>3]=e;break;default:st("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return p[t>>0];case"i16":return y[t>>1];case"i32":case"i64":return v[t>>2];case"float":return B[t>>2];case"double":return m[t>>3];default:st("invalid type for getValue: "+e)}return null},n.getTempRet0=u,j){V(j)||(z=j,j=n.locateFile?n.locateFile(z,a):a+z),D++,n.monitorRunDependencies&&n.monitorRunDependencies(D);var rt=function(t){t.byteLength&&(t=new Uint8Array(t)),C.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(D--,n.monitorRunDependencies&&n.monitorRunDependencies(D),0==D&&(null!==G&&(clearInterval(G),G=null),_)){var e=_;_=null,e()}}()},it=function(){i(j,rt,(function(){throw"could not load memory initializer "+j}))},ot=X(j);if(ot)rt(ot.buffer);else if(n.memoryInitializerRequest){var at=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=X(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+j),void it();e=r.buffer}rt(e)};n.memoryInitializerRequest.response?setTimeout(at,0):n.memoryInitializerRequest.addEventListener("load",at)}else it()}function At(t){function e(){K||(K=!0,l||(F(S),F(R),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),U.unshift(t);var t;F(U)}()))}t=t||o,D>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),w.unshift(t);var t;F(w)}(),D>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function st(t){throw n.onAbort&&n.onAbort(t),A(t+=""),s(t),l=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(_=function t(){K||At(),K||(_=t)},n.run=At,n.abort=st,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return At(),t}("object"===typeof r?r:{}),i="number",o={};[["sizeOfH3Index",i],["sizeOfGeoCoord",i],["sizeOfGeoBoundary",i],["sizeOfGeoPolygon",i],["sizeOfGeofence",i],["sizeOfLinkedGeoPolygon",i],["sizeOfCoordIJ",i],["h3IsValid","number",["number","number"]],["geoToH3","number",[i,i,"number"]],["h3ToGeo",null,["number","number",i]],["h3ToGeoBoundary",null,["number","number",i]],["maxKringSize",i,[i]],["kRing",null,["number","number",i,i]],["kRingDistances",null,["number","number",i,i,i]],["hexRing",null,["number","number",i,i]],["maxPolyfillSize",i,[i,"number"]],["polyfill",null,[i,"number",i]],["h3SetToLinkedGeo",null,[i,i,i]],["destroyLinkedPolygon",null,[i]],["compact",i,[i,i,i]],["uncompact",i,[i,i,i,i,"number"]],["maxUncompactSize",i,[i,i,"number"]],["h3IsPentagon","number",["number","number"]],["h3IsResClassIII","number",["number","number"]],["h3GetBaseCell",i,["number","number"]],["maxFaceCount",i,["number","number"]],["h3GetFaces",null,["number","number",i]],["h3ToParent","number",["number","number","number"]],["h3ToChildren",null,["number","number","number",i]],["h3ToCenterChild","number",["number","number","number"]],["maxH3ToChildrenSize",i,["number","number","number"]],["h3IndexesAreNeighbors","number",["number","number","number","number"]],["getH3UnidirectionalEdge","number",["number","number","number","number"]],["getOriginH3IndexFromUnidirectionalEdge","number",["number","number"]],["getDestinationH3IndexFromUnidirectionalEdge","number",["number","number"]],["h3UnidirectionalEdgeIsValid","number",["number","number"]],["getH3IndexesFromUnidirectionalEdge",null,["number","number",i]],["getH3UnidirectionalEdgesFromHexagon",null,["number","number",i]],["getH3UnidirectionalEdgeBoundary",null,["number","number",i]],["h3Distance",i,["number","number","number","number"]],["h3Line",i,["number","number","number","number",i]],["h3LineSize",i,["number","number","number","number"]],["experimentalH3ToLocalIj",i,["number","number","number","number",i]],["experimentalLocalIjToH3",i,["number","number",i,i]],["hexAreaM2",i,["number"]],["hexAreaKm2",i,["number"]],["edgeLengthM",i,["number"]],["edgeLengthKm",i,["number"]],["pointDistM",i,[i,i]],["pointDistKm",i,[i,i]],["pointDistRads",i,[i,i]],["cellAreaM2",i,["number","number"]],["cellAreaKm2",i,["number","number"]],["cellAreaRads2",i,["number","number"]],["exactEdgeLengthM",i,["number","number"]],["exactEdgeLengthKm",i,["number","number"]],["exactEdgeLengthRads",i,["number","number"]],["numHexagons",i,["number"]],["getRes0Indexes",null,[i]],["res0IndexCount",i],["getPentagonIndexes",null,[i,i]],["pentagonIndexCount",i]].forEach((function(t){o[t[0]]=r.cwrap.apply(r,t)}));var a=o.sizeOfH3Index(),A=o.sizeOfGeoCoord(),s=o.sizeOfGeoBoundary(),c=o.sizeOfGeoPolygon(),u=o.sizeOfGeofence(),l=o.sizeOfLinkedGeoPolygon(),g=o.sizeOfCoordIJ(),f={m:"m",m2:"m2",km:"km",km2:"km2",rads:"rads",rads2:"rads2"};function h(t){if("number"!==typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}var d=/[^0-9a-fA-F]/;function I(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!==typeof t||d.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),16);return[parseInt(t.substring(t.length-8),16),e]}function p(t){if(t>=0)return t.toString(16);var e=y(8,(t&=2147483647).toString(16));return e=(parseInt(e[0],16)+8).toString(16)+e.substring(1)}function C(t,e){return p(e)+y(8,p(t))}function y(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function v(t,e,n){for(var i=t.length,o=r._calloc(i,A),a=n?1:0,s=n?0:1,c=0;c<2*i;c+=2)r.HEAPF64.set([t[c/2][a],t[c/2][s]].map(pt),o/8+c);return r.HEAPU32.set([i,o],e/4),e}function B(t){return[t,r.getTempRet0()]}function m(t){var e=B(t),n=e[0],r=e[1];return r?C(n,r):null}function b(t,e){void 0===e&&(e=0);var n=r.getValue(t+4*e*2,"i32"),i=r.getValue(t+4*(2*e+1),"i32");return i?C(n,i):null}function E(t,e,n){r.HEAPU32.set(I(t),e/4+2*n)}function Q(t,e){for(var n=[],r=0;r<e;r++){var i=b(t,r);null!==i&&n.push(i)}return n}function F(t,e){for(var n=e.length,r=0;r<n;r++)E(e[r],t,r)}function w(t,e){var n=r._calloc(1,A);return r.HEAPF64.set([t,e].map(pt),n/8),n}function S(t){return Ct(r.getValue(t,"double"))}function R(t){return[S(t),S(t+8)]}function U(t){return[S(t+8),S(t)]}function x(t,e,n){for(var i=r.getValue(t,"i32"),o=t+8,a=[],A=e?U:R,s=0;s<2*i;s+=2)a.push(A(o+8*s));return n&&a.push(a[0]),a}function k(t){var e=I(t),n=e[0],r=e[1];return Boolean(o.h3IsValid(n,r))}function O(t){var e=I(t),n=e[0],r=e[1];return Boolean(o.h3IsPentagon(n,r))}function N(t){var e=I(t),n=e[0],r=e[1];return Boolean(o.h3IsResClassIII(n,r))}function D(t){var e=I(t),n=e[0],r=e[1];return o.h3GetBaseCell(n,r)}function G(t){var e=I(t),n=e[0],i=e[1],a=o.maxFaceCount(n,i),A=r._malloc(4*a);o.h3GetFaces(n,i,A);var s=function(t,e){for(var n=[],i=0;i<e;i++){var o=r.getValue(t+4*i,"i32");o>=0&&n.push(o)}return n}(A,a);return r._free(A),s}function _(t){return"string"!==typeof t?-1:parseInt(t.charAt(1),16)}function M(t,e,n){var i=r._malloc(A);r.HEAPF64.set([t,e].map(pt),i/8);var a=m(o.geoToH3(i,n));return r._free(i),a}function T(t){var e=r._malloc(A),n=I(t),i=n[0],a=n[1];o.h3ToGeo(i,a,e);var s=R(e);return r._free(e),s}function j(t,e){var n=r._malloc(s),i=I(t),a=i[0],A=i[1];o.h3ToGeoBoundary(a,A,n);var c=x(n,e,e);return r._free(n),c}function L(t,e){var n=I(t),r=n[0],i=n[1];return m(o.h3ToParent(r,i,e))}function V(t,e){if(!k(t))return[];var n=I(t),i=n[0],A=n[1],s=o.maxH3ToChildrenSize(i,A,e),c=r._calloc(s,a);o.h3ToChildren(i,A,e,c);var u=Q(c,s);return r._free(c),u}function Z(t,e){var n=I(t),r=n[0],i=n[1];return m(o.h3ToCenterChild(r,i,e))}function P(t,e){var n=I(t),i=n[0],A=n[1],s=o.maxKringSize(e),c=r._calloc(s,a);o.kRing(i,A,e,c);var u=Q(c,s);return r._free(c),u}function W(t,e){var n=I(t),i=n[0],A=n[1],s=o.maxKringSize(e),c=r._calloc(s,a),u=r._calloc(s,4);o.kRingDistances(i,A,e,c,u);for(var l=[],g=0;g<e+1;g++)l.push([]);for(var f=0;f<2*s;f+=2){var h=r.getValue(c+4*f,"i32"),d=r.getValue(c+4*(f+1),"i32"),p=r.getValue(u+f/2*4,"i32");0===h&&0===d||l[p].push(C(h,d))}return r._free(c),r._free(u),l}function J(t,e){var n=0===e?1:6*e,i=r._calloc(n,a);if(0!==o.hexRing.apply(o,I(t).concat([e],[i])))throw r._free(i),new Error("Failed to get hexRing (encountered a pentagon?)");var A=Q(i,n);return r._free(i),A}function H(t,e,n){if(h(e),n=Boolean(n),0===t.length||0===t[0].length)return[];"number"===typeof t[0][0]&&(t=[t]);var i=function(t,e){var n,i=t.length-1,o=r._calloc(c),a=0+u,A=a+4;if(v(t[0],o+0,e),i>0){n=r._calloc(i,u);for(var s=0;s<i;s++)v(t[s+1],n+u*s,e)}return r.setValue(o+a,i,"i32"),r.setValue(o+A,n,"i32"),o}(t,n),A=o.maxPolyfillSize(i,e),s=r._calloc(A,a);o.polyfill(i,e,s);var l=Q(s,A);return r._free(s),function(t){var e=0+u,n=e+4;r._free(r.getValue(t+0,"i8*"));for(var i=r.getValue(t+e,"i32"),o=0;o<i;o++)r._free(r.getValue(t+n+u*o,"i8*"));r._free(t)}(i),l}function Y(t,e){if(!t||!t.length)return[];var n=t.length,i=r._calloc(n,a);F(i,t);var A=r._calloc(l),s=A;o.h3SetToLinkedGeo(i,n,A);var c=function(t,e){for(var n,i,o,a,A=[],s=e?U:R;t;){for(A.push(n=[]),i=r.getValue(t,"i8*");i;){for(n.push(o=[]),a=r.getValue(i,"i8*");a;)o.push(s(a)),a=r.getValue(a+16,"i8*");e&&o.push(o[0]),i=r.getValue(i+8,"i8*")}t=r.getValue(t+8,"i8*")}return A}(A,e);return o.destroyLinkedPolygon(s),r._free(s),r._free(i),c}function X(t){if(!t||!t.length)return[];var e=t.length,n=r._calloc(e,a);F(n,t);var i=r._calloc(e,a);if(0!==o.compact(n,i,e))throw r._free(n),r._free(i),new Error("Failed to compact, malformed input data (duplicate hexagons?)");var A=Q(i,e);return r._free(n),r._free(i),A}function z(t,e){if(h(e),!t||!t.length)return[];var n=t.length,i=r._calloc(n,a);F(i,t);var A=o.maxUncompactSize(i,n,e),s=r._calloc(A,a);if(0!==o.uncompact(i,n,s,A,e))throw r._free(i),r._free(s),new Error("Failed to uncompact (bad resolution?)");var c=Q(s,A);return r._free(i),r._free(s),c}function K(t,e){var n=I(t),r=n[0],i=n[1],a=I(e),A=a[0],s=a[1];return Boolean(o.h3IndexesAreNeighbors(r,i,A,s))}function q(t,e){var n=I(t),r=n[0],i=n[1],a=I(e),A=a[0],s=a[1];return m(o.getH3UnidirectionalEdge(r,i,A,s))}function $(t){var e=I(t),n=e[0],r=e[1];return m(o.getOriginH3IndexFromUnidirectionalEdge(n,r))}function tt(t){var e=I(t),n=e[0],r=e[1];return m(o.getDestinationH3IndexFromUnidirectionalEdge(n,r))}function et(t){var e=I(t),n=e[0],r=e[1];return Boolean(o.h3UnidirectionalEdgeIsValid(n,r))}function nt(t){var e=I(t),n=e[0],i=e[1],A=r._calloc(2,a);o.getH3IndexesFromUnidirectionalEdge(n,i,A);var s=Q(A,2);return r._free(A),s}function rt(t){var e=I(t),n=e[0],i=e[1],A=r._calloc(6,a);o.getH3UnidirectionalEdgesFromHexagon(n,i,A);var s=Q(A,6);return r._free(A),s}function it(t,e){var n=r._malloc(s),i=I(t),a=i[0],A=i[1];o.getH3UnidirectionalEdgeBoundary(a,A,n);var c=x(n,e);return r._free(n),c}function ot(t,e){var n=I(t),r=n[0],i=n[1],a=I(e),A=a[0],s=a[1];return o.h3Distance(r,i,A,s)}function at(t,e){var n=I(t),i=n[0],A=n[1],s=I(e),c=s[0],u=s[1],l=o.h3LineSize(i,A,c,u);if(l<0)throw new Error("Line cannot be calculated");var g=r._calloc(l,a);o.h3Line(i,A,c,u,g);var f=Q(g,l);return r._free(g),f}function At(t,e){var n,i=r._malloc(g),a=o.experimentalH3ToLocalIj.apply(o,I(t).concat(I(e),[i])),A=(n=i,{i:r.getValue(n,"i32"),j:r.getValue(n+4,"i32")});switch(r._free(i),a){case 0:return A;case 1:throw new Error("Incompatible origin and index.");case 2:default:throw new Error("Local IJ coordinates undefined for this origin and index pair. The index may be too far from the origin.");case 3:case 4:case 5:throw new Error("Encountered possible pentagon distortion")}}function st(t,e){if(!e||"number"!==typeof e.i||"number"!==typeof e.j)throw new Error("Coordinates must be provided as an {i, j} object");var n=r._malloc(g),i=r._malloc(a);!function(t,e){var n=e.i,i=e.j;r.setValue(t,n,"i32"),r.setValue(t+4,i,"i32")}(n,e);var A=o.experimentalLocalIjToH3.apply(o,I(t).concat([n],[i])),s=b(i);if(r._free(n),r._free(i),0!==A)throw new Error("Index not defined for this origin and IJ coordinates pair. IJ coordinates may be too far from origin, or a pentagon distortion was encountered.");return s}function ct(t,e,n){var i,a=w(t[0],t[1]),A=w(e[0],e[1]);switch(n){case f.m:i=o.pointDistM(a,A);break;case f.km:i=o.pointDistKm(a,A);break;case f.rads:i=o.pointDistRads(a,A);break;default:i=null}if(r._free(a),r._free(A),null===i)throw new Error("Unknown unit: "+n);return i}function ut(t,e){var n=I(t),r=n[0],i=n[1];switch(e){case f.m2:return o.cellAreaM2(r,i);case f.km2:return o.cellAreaKm2(r,i);case f.rads2:return o.cellAreaRads2(r,i);default:throw new Error("Unknown unit: "+e)}}function lt(t,e){var n=I(t),r=n[0],i=n[1];switch(e){case f.m:return o.exactEdgeLengthM(r,i);case f.km:return o.exactEdgeLengthKm(r,i);case f.rads:return o.exactEdgeLengthRads(r,i);default:throw new Error("Unknown unit: "+e)}}function gt(t,e){switch(h(t),e){case f.m2:return o.hexAreaM2(t);case f.km2:return o.hexAreaKm2(t);default:throw new Error("Unknown unit: "+e)}}function ft(t,e){switch(h(t),e){case f.m:return o.edgeLengthM(t);case f.km:return o.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function ht(t){h(t);var e=B(o.numHexagons(t)),n=e[0],r=e[1];return r?r*Math.pow(2,32)+n:n}function dt(){var t=o.res0IndexCount(),e=r._malloc(a*t);o.getRes0Indexes(e);var n=Q(e,t);return r._free(e),n}function It(t){h(t);var e=o.pentagonIndexCount(),n=r._malloc(a*e);o.getPentagonIndexes(t,n);var i=Q(n,e);return r._free(n),i}function pt(t){return t*Math.PI/180}function Ct(t){return 180*t/Math.PI}},function(t,e,n){"use strict";var r=n(0),i=n.n(r);e.a=i.a.createContext(null)},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(781),a=n(9),A=n(28),s=(n(20),n(396)),c=n(714),u=n(867),l=n(196),g=n(106),f=n(60);function h(t){return"function"===typeof t?t():t}var d="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,I={},p=r.forwardRef((function(t,e){var n=t.anchorEl,i=t.children,o=t.container,p=t.disablePortal,C=void 0!==p&&p,y=t.keepMounted,v=void 0!==y&&y,B=t.modifiers,m=t.open,b=t.placement,E=void 0===b?"bottom":b,Q=t.popperOptions,F=void 0===Q?I:Q,w=t.popperRef,S=t.transition,R=void 0!==S&&S,U=Object(A.a)(t,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition"]),x=r.useRef(null),k=Object(f.a)(x,e),O=r.useRef(null),N=Object(f.a)(O,w),D=r.useRef(N);d((function(){D.current=N}),[N]),r.useImperativeHandle(w,(function(){return O.current}),[]);var G=r.useState(!0),_=G[0],M=G[1],T=function(t,e){if("ltr"===(e&&e.direction||"ltr"))return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}(E,Object(c.a)()),j=r.useState(T),L=j[0],V=j[1];r.useEffect((function(){O.current&&O.current.update()}));var Z=r.useCallback((function(){if(x.current&&n&&m){O.current&&(O.current.destroy(),D.current(null));var t=function(t){V(t.placement)},e=(h(n),new s.a(h(n),x.current,Object(a.a)({placement:T},F,{modifiers:Object(a.a)({},C?{}:{preventOverflow:{boundariesElement:"window"}},{},B,{},F.modifiers),onCreate:Object(l.a)(t,F.onCreate),onUpdate:Object(l.a)(t,F.onUpdate)})));D.current(e)}}),[n,C,B,m,T,F]),P=r.useCallback((function(t){Object(g.a)(k,t),Z()}),[k,Z]),W=function(){O.current&&(O.current.destroy(),D.current(null))};if(r.useEffect((function(){Z()}),[Z]),r.useEffect((function(){return function(){W()}}),[]),r.useEffect((function(){m||R||W()}),[m,R]),!v&&!m&&(!R||_))return null;var J={placement:L};return R&&(J.TransitionProps={in:m,onEnter:function(){M(!1)},onExited:function(){M(!0),W()}}),r.createElement(u.a,{disablePortal:C,container:o},r.createElement("div",Object(a.a)({ref:P,role:"tooltip"},U,{style:Object(a.a)({position:"fixed",top:0,left:0},U.style)}),"function"===typeof i?i(J):i))})),C=n(868),y=n(903),v=n(65),B=n(88),m=n(83);function b(t){return t.substring(2).toLowerCase()}var E=r.forwardRef((function(t,e){var n=t.children,i=t.mouseEvent,o=void 0===i?"onClick":i,a=t.touchEvent,A=void 0===a?"onTouchEnd":a,s=t.onClickAway,c=r.useRef(!1),u=r.useRef(null),l=r.useRef(!1);r.useEffect((function(){return l.current=!0,function(){l.current=!1}}),[]);var h=Object(f.a)(u,e),d=r.useCallback((function(t){Object(g.a)(h,v.findDOMNode(t))}),[h]),I=Object(f.a)(n.ref,d),p=Object(m.a)((function(t){if(l.current)if(c.current)c.current=!1;else if(u.current){var e=Object(B.a)(u.current);e.documentElement&&e.documentElement.contains(t.target)&&!u.current.contains(t.target)&&s(t)}})),C=r.useCallback((function(){c.current=!0}),[]);return r.useEffect((function(){if(!1!==A){var t=b(A),e=Object(B.a)(u.current);return e.addEventListener(t,p),e.addEventListener("touchmove",C),function(){e.removeEventListener(t,p),e.removeEventListener("touchmove",C)}}}),[p,C,A]),r.useEffect((function(){if(!1!==o){var t=b(o),e=Object(B.a)(u.current);return e.addEventListener(t,p),function(){e.removeEventListener(t,p)}}}),[p,o]),r.createElement(r.Fragment,null,r.cloneElement(n,{ref:I}))})),Q=n(202);function F(t){var e=Object(Q.b)(),n=t.anchorEl,r=t.open,o=t.placement,a=void 0===o?"bottom-start":o,A=t.children;return i.a.createElement(p,{className:e.popper,open:r,anchorEl:n.current,placement:a},A)}function w(t){var e=t.children,n=Object(Q.b)();return i.a.createElement(o.a,{className:n.paper,elevation:4},e)}function S(t){var e=t.children,n=Object(Q.b)();return i.a.createElement("span",{className:n.span},e)}function R(t){var e=t.buttonIcon,n=t.open,o=t.toggle,a=t.children,A=t.placement,s=t.buttonClassName,c=Object(r.useRef)(null),u=Object(Q.b)();return i.a.createElement(i.a.Fragment,null,i.a.createElement(C.a,{onClick:o,size:"small",ref:c,className:s},e),i.a.createElement(F,{className:u.popper,open:n,anchorEl:c,placement:A},i.a.createElement(w,null,i.a.createElement(E,{onClickAway:o},i.a.createElement(y.a,null,a)))))}n.d(e,"a",(function(){return S})),n.d(e,"b",(function(){return R}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(111),i=n(3),o=n(2),a=n(197),A=n(47),s={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Object(a.c)("geometry"):n,o=e.drawMode,A=void 0===o?s.TRIANGLES:o,c=e.attributes,u=void 0===c?{}:c,l=e.indices,g=void 0===l?null:l,f=e.vertexCount,h=void 0===f?null:f;this.id=r,this.drawMode=0|A,this.attributes={},this.userData={},this._setAttributes(u,g),this.vertexCount=h||this._calculateVertexCount(this.attributes,this.indices)}return Object(o.a)(t,null,[{key:"DRAW_MODE",get:function(){return s}}]),Object(o.a)(t,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(r.a)({indices:this.indices},this.attributes):this.attributes}},{key:"_print",value:function(t){return"Geometry ".concat(this.id," attribute ").concat(t)}},{key:"_setAttributes",value:function(t,e){for(var n in e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e),t){var r=t[n];r=ArrayBuffer.isView(r)?{value:r}:r,Object(A.a)(ArrayBuffer.isView(r.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||r.size||(r.size=3),"indices"===n?(Object(A.a)(!this.indices),this.indices=r):this.attributes[n]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(t,e){if(e)return e.value.length;var n=1/0;for(var r in t){var i=t[r],o=i.value,a=i.size;!i.constant&&o&&a>=1&&(n=Math.min(n,o.length/a))}return Object(A.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),t}()},,function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"===typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"===typeof t},e.isString=function(t){return"string"===typeof t},e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"===typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"===typeof t},e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=t.isBuffer}).call(this,n(96).Buffer)},function(t,e,n){"use strict";n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return l}));var r=n(27),i=n(107),o=n(354);function a(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t){if(o.toArrayBuffer&&(t=o.toArrayBuffer(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.buffer;if("string"===typeof t){var e=t;return(new TextEncoder).encode(e).buffer}return t&&"object"===Object(r.a)(t)&&t._toArrayBuffer?t._toArrayBuffer():Object(i.a)(!1)}function c(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;for(var r=new Uint8Array(t),i=new Uint8Array(e),o=0;o<r.length;++o)if(r[o]!==i[o])return!1;return!0}function u(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e.map((function(t){return t instanceof ArrayBuffer?new Uint8Array(t):t})),o=i.reduce((function(t,e){return t+e.byteLength}),0),A=new Uint8Array(o),s=0,c=a(i);try{for(c.s();!(r=c.n()).done;){var u=r.value;A.set(u,s),s+=u.byteLength}}catch(l){c.e(l)}finally{c.f()}return A.buffer}function l(t,e,n){var r=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}},function(t,e,n){"use strict";(function(t){function r(){var e;if("undefined"!==typeof window&&window.performance)e=window.performance.now();else if("undefined"!==typeof t&&t.hrtime){var n=t.hrtime();e=1e3*n[0]+n[1]/1e6}else e=Date.now();return e}n.d(e,"a",(function(){return r}))}).call(this,n(68))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(161),c=n(35),u=n(135),l=n(33),g=n(45),f=[0,0,0,1],h=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(r.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,-0,-0,-0,-0)),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i,A,s),t}return Object(A.a)(e,t),Object(i.a)(e,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromMatrix3",value:function(t){return l.e(this,t),this.check()}},{key:"identity",value:function(){return l.f(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return l.p(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"len",value:function(){return l.h(this)}},{key:"lengthSquared",value:function(t){return l.r(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return l.d(this,t)}},{key:"rotationTo",value:function(t,e){return l.n(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return l.a(this,this,t),this.check()}},{key:"calculateW",value:function(){return l.b(this,this),this.check()}},{key:"conjugate",value:function(){return l.c(this,this),this.check()}},{key:"invert",value:function(){return l.g(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return l.i(this,t,e,n),this.check()}},{key:"multiplyRight",value:function(t,e){return Object(u.a)(!e),l.j(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Object(u.a)(!e),l.j(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return l.k(this,this,t),this.check()}},{key:"rotateY",value:function(t){return l.l(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return l.m(this,this,t),this.check()}},{key:"scale",value:function(t){return l.o(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){switch(arguments.length){case 1:var r=arguments[0],i=r.start;t=void 0===i?f:i,e=r.target,n=r.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],n=o[1],t=this}return l.q(this,t,e,n),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return g.o(e,t,this),Object(c.b)(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){return this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){return this[1]=Object(c.a)(t)}},{key:"z",get:function(){return this[2]},set:function(t){return this[2]=Object(c.a)(t)}},{key:"w",get:function(){return this[3]},set:function(t){return this[3]=Object(c.a)(t)}}]),e}(s.a)},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return l}));var r=n(477),i=n.n(r);function o(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,A=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return A=t.done,t},e:function(t){s=!0,o=t},f:function(){try{A||null==n.return||n.return()}finally{if(s)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e,n,r){for(var i=0;i<e;i++)if(t[n+i]!==t[r-e+i])return!1;return!0}function s(t,e,n,r){for(var i=e,o=n.length,a=0;a<o;a++)for(var A=0;A<r;A++)t[i++]=n[a][A]||0;if(!function(t){var e=t[0],n=t[t.length-1];return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}(n))for(var s=0;s<r;s++)t[i++]=n[0][s]||0;return i}function c(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,a=(o=o||n.length)-i;if(a<=0)return e;for(var s=e,c=0;c<a;c++)t[s++]=n[i+c];if(!A(n,r,i,o))for(var u=0;u<r;u++)t[s++]=n[i+u];return s}function u(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);var n=[],r=[];if(t.positions){var i=t,a=i.positions,A=i.holeIndices;if(A){for(var u=0,l=0;l<=A.length;l++)u=c(n,u,a,e,A[l-1],A[l]),r.push(u);return r.pop(),{positions:n,holeIndices:r}}t=a}if(Number.isFinite(t[0]))return c(n,0,t,e),n;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){var g,f=0,h=o(t);try{for(h.s();!(g=h.n()).done;){f=s(n,f,g.value,e),r.push(f)}}catch(d){h.e(d)}finally{h.f()}return r.pop(),{positions:n,holeIndices:r}}return s(n,0,t,e),n}function l(t,e,n){var r=null;t.holeIndices&&(r=t.holeIndices.map((function(t){return t/e})));var o=t.positions||t;if(n){var a=o.length;o=o.slice();for(var A=[],s=0;s<a;s+=e){A[0]=o[s],A[1]=o[s+1];var c=n(A);o[s]=c[0],o[s+1]=c[1]}}return i()(o,r,e)}},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return A}));var i=n(27),o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t,document:"undefined"!==typeof document&&document},a=o.global||o.self||o.window,A="object"!==("undefined"===typeof r?"undefined":Object(i.a)(r))||"[object process]"!==String(r)||r.browser,s="undefined"!==typeof r&&r.version&&r.version.match(/v([0-9]*)/);s&&parseFloat(s[1])}).call(this,n(56),n(68))},function(t,e,n){"use strict";var r=n(11),i=n(14),o=n(15),a=function(){return"function"===typeof Symbol},A=function(t){return a()&&Boolean(Symbol[t])},s=function(t){return A(t)?Symbol[t]:"@@"+t};A("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));var c=s("iterator"),u=s("observable"),l=s("species");function g(t,e){var n=t[e];if(null!=n){if("function"!==typeof n)throw new TypeError(n+" is not a function");return n}}function f(t){var e=t.constructor;return void 0!==e&&null===(e=e[l])&&(e=void 0),void 0!==e?e:m}function h(t){h.log?h.log(t):setTimeout((function(){throw t}),0)}function d(t){Promise.resolve().then((function(){try{t()}catch(e){h(e)}}))}function I(t){var e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if("function"===typeof e)e();else{var n=g(e,"unsubscribe");n&&n.call(e)}}catch(r){h(r)}}function p(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function C(t,e,n){t._state="running";var r=t._observer;try{var i=r?g(r,e):void 0;switch(e){case"next":i&&i.call(r,n);break;case"error":if(p(t),!i)throw n;i.call(r,n);break;case"complete":p(t),i&&i.call(r)}}catch(o){h(o)}"closed"===t._state?I(t):"running"===t._state&&(t._state="ready")}function y(t,e,n){if("closed"!==t._state)return"buffering"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:n})):"ready"!==t._state?(t._state="buffering",t._queue=[{type:e,value:n}],void d((function(){return function(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";var n,r=Object(o.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(C(t,i.type,i.value),"closed"===t._state)break}}catch(a){r.e(a)}finally{r.f()}}}(t)}))):void C(t,e,n)}var v=function(){function t(e,n){Object(r.a)(this,t),this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var i=new B(this);try{this._cleanup=n.call(void 0,i)}catch(o){i.error(o)}"initializing"===this._state&&(this._state="ready")}return Object(i.a)(t,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(p(this),I(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),t}(),B=function(){function t(e){Object(r.a)(this,t),this._subscription=e}return Object(i.a)(t,[{key:"next",value:function(t){y(this._subscription,"next",t)}},{key:"error",value:function(t){y(this._subscription,"error",t)}},{key:"complete",value:function(){y(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),t}(),m=function(){function t(e){if(Object(r.a)(this,t),!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if("function"!==typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}return Object(i.a)(t,[{key:"subscribe",value:function(t,e,n){return"object"===typeof t&&null!==t||(t={next:t,error:e,complete:n}),new v(t,this._subscriber)}},{key:"pipe",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=[t].concat(r);o<a.length;o++){var A=a[o];e=A(e)}return e}},{key:"tap",value:function(e,n,r){var i=this,o="object"!==typeof e||null===e?{next:e,error:n,complete:r}:e;return new t((function(t){return i.subscribe({next:function(e){o.next&&o.next(e),t.next(e)},error:function(e){o.error&&o.error(e),t.error(e)},complete:function(){o.complete&&o.complete(),t.complete()},start:function(t){o.start&&o.start(t)}})}))}},{key:"forEach",value:function(t){var e=this;return new Promise((function(n,r){if("function"===typeof t)var i=e.subscribe({next:function(e){try{t(e,o)}catch(n){r(n),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(t+" is not a function"));function o(){i.unsubscribe(),n()}}))}},{key:"map",value:function(t){var e=this;if("function"!==typeof t)throw new TypeError(t+" is not a function");return new(f(this))((function(n){return e.subscribe({next:function(e){var r=e;try{r=t(e)}catch(i){return n.error(i)}n.next(r)},error:function(t){n.error(t)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(t){var e=this;if("function"!==typeof t)throw new TypeError(t+" is not a function");return new(f(this))((function(n){return e.subscribe({next:function(e){try{if(!t(e))return}catch(r){return n.error(r)}n.next(e)},error:function(t){n.error(t)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(t,e){var n=this;if("function"!==typeof t)throw new TypeError(t+" is not a function");var r=f(this),i=arguments.length>1,o=!1,a=e;return new r((function(e){return n.subscribe({next:function(n){var r=!o;if(o=!0,!r||i)try{a=t(a,n)}catch(A){return e.error(A)}else a=n},error:function(t){e.error(t)},complete:function(){if(!o&&!i)return e.error(new TypeError("Cannot reduce an empty sequence"));e.next(a),e.complete()}})}))}},{key:"concat",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=f(this);return new i((function(e){var r,o=0;return function t(a){r=a.subscribe({next:function(t){e.next(t)},error:function(t){e.error(t)},complete:function(){o===n.length?(r=void 0,e.complete()):t(i.from(n[o++]))}})}(t),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(t){var e=this;if("function"!==typeof t)throw new TypeError(t+" is not a function");var n=f(this);return new n((function(r){var i=[],o=e.subscribe({next:function(e){var o;if(t)try{o=t(e)}catch(s){return r.error(s)}else o=e;var A=n.from(o).subscribe({next:function(t){r.next(t)},error:function(t){r.error(t)},complete:function(){var t=i.indexOf(A);t>=0&&i.splice(t,1),a()}});i.push(A)},error:function(t){r.error(t)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(t){return t.unsubscribe()})),o.unsubscribe()}}))}},{key:u,value:function(){return this}}],[{key:"from",value:function(e){var n="function"===typeof this?this:t;if(null==e)throw new TypeError(e+" is not an object");var r=g(e,u);if(r){var i=r.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return function(t){return t instanceof m}(i)&&i.constructor===n?i:new n((function(t){return i.subscribe(t)}))}if(A("iterator")){var a=g(e,c);if(a)return new n((function(t){d((function(){if(!t.closed){var n,r=Object(o.a)(a.call(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t.next(i),t.closed)return}}catch(A){r.e(A)}finally{r.f()}t.complete()}}))}))}if(Array.isArray(e))return new n((function(t){d((function(){if(!t.closed){var n,r=Object(o.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t.next(i),t.closed)return}}catch(a){r.e(a)}finally{r.f()}t.complete()}}))}));throw new TypeError(e+" is not observable")}},{key:"of",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i="function"===typeof this?this:t;return new i((function(t){d((function(){if(!t.closed){var e,r=Object(o.a)(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(t.next(i),t.closed)return}}catch(a){r.e(a)}finally{r.f()}t.complete()}}))}))}},{key:l,get:function(){return this}}]),t}();a()&&Object.defineProperty(m,Symbol("extensions"),{value:{symbol:u,hostReportError:h},configurable:!0});e.a=m},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.internalError="internalError",t.message="message",t.termination="termination"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(2),o=n(19),a=n(309),A=n(58),s=new(function(){function t(){Object(r.a)(this,t),this.stats=new Map}return Object(i.a)(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new a.a({id:t})),this.stats.get(t)}}]),t}());if(A.global.luma&&"8.3.1"!==A.global.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(A.global.luma.VERSION," vs ").concat("8.3.1"));A.global.luma||(Object(A.isBrowser)()&&o.h.log(1,"luma.gl ".concat("8.3.1"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),A.global.luma=A.global.luma||{VERSION:"8.3.1",version:"8.3.1",log:o.h,stats:s,globals:{modules:{},nodeIO:{}}});A.global.luma},function(t,e,n){var r;!function(i,o,a,A){"use strict";var s,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),l=Math.round,g=Math.abs,f=Date.now;function h(t,e,n){return setTimeout(B(t,n),e)}function d(t,e,n){return!!Array.isArray(t)&&(I(t,n[e],n),!0)}function I(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function p(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}s="function"!==typeof Object.assign?function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var C=p((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&void 0===t[r[i]])&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),y=p((function(t,e){return C(t,e,!0)}),"merge","Use `assign`.");function v(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&s(r,n)}function B(t,e){return function(){return t.apply(e,arguments)}}function m(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function b(t,e){return void 0===t?e:t}function E(t,e,n){I(S(e),(function(e){t.addEventListener(e,n,!1)}))}function Q(t,e,n){I(S(e),(function(e){t.removeEventListener(e,n,!1)}))}function F(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function w(t,e){return t.indexOf(e)>-1}function S(t){return t.trim().split(/\s+/g)}function R(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function U(t){return Array.prototype.slice.call(t,0)}function x(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];R(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}function k(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((r=(n=c[o])?n+i:e)in t)return r;o++}}var O=1;function N(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var D="ontouchstart"in i,G=void 0!==k(i,"PointerEvent"),_=D&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),M=["x","y"],T=["clientX","clientY"];function j(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){m(t.options.enable,[t])&&n.handler(e)},this.init()}function L(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&e&&r-i===0,a=12&e&&r-i===0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=V(e));i>1&&!n.firstMultiple?n.firstMultiple=V(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,A=a?a.center:o.center,s=e.center=Z(r);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=H(A,s),e.distance=J(A,s),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=W(e.deltaX,e.deltaY);var c=P(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=g(c.x)>g(c.y)?c.x:c.y,e.scale=a?(u=a.pointers,l=r,J(l[0],l[1],T)/J(u[0],u[1],T)):1,e.rotation=a?function(t,e){return H(e[1],e[0],T)+H(t[1],t[0],T)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,A=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(A>25||void 0===a.velocity)){var s=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,u=P(A,s,c);r=u.x,i=u.y,n=g(u.x)>g(u.y)?u.x:u.y,o=W(s,c),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var u,l;var h=t.element;F(e.srcEvent.target,h)&&(h=e.srcEvent.target);e.target=h}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function V(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:l(t.pointers[n].clientX),clientY:l(t.pointers[n].clientY)},n++;return{timeStamp:f(),pointers:e,center:Z(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Z(t){var e=t.length;if(1===e)return{x:l(t[0].clientX),y:l(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:l(n/e),y:l(r/e)}}function P(t,e,n){return{x:e/t||0,y:n/t||0}}function W(t,e){return t===e?1:g(t)>=g(e)?t<0?2:4:e<0?8:16}function J(t,e,n){n||(n=M);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function H(t,e,n){n||(n=M);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Q(this.element,this.evEl,this.domHandler),this.evTarget&&Q(this.target,this.evTarget,this.domHandler),this.evWin&&Q(N(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function X(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,j.apply(this,arguments)}v(X,j,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},K={2:"touch",3:"pen",4:"mouse",5:"kinect"},q="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=q,this.evWin=$,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(q="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),v(tt,j,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=z[r],o=K[t.pointerType]||t.pointerType,a="touch"==o,A=R(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?A<0&&(e.push(t),A=e.length-1):12&i&&(n=!0),A<0||(e[A]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(A,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function rt(t,e){var n=U(t.touches),r=U(t.changedTouches);return 12&e&&(n=x(n.concat(r),"identifier",!0)),[n,r]}v(nt,j,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var n=rt.call(this,t,e);12&e&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},j.apply(this,arguments)}function at(t,e){var n=U(t.touches),r=this.targetIds;if(3&e&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=U(t.changedTouches),A=[],s=this.target;if(o=n.filter((function(t){return F(t.target,s)})),1===e)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&A.push(a[i]),12&e&&delete r[a[i].identifier],i++;return A.length?[x(o.concat(A),"identifier",!0),A]:void 0}v(ot,j,{handler:function(t){var e=it[t.type],n=at.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});function At(){j.apply(this,arguments);var t=B(this.handler,this);this.touch=new ot(this.manager,t),this.mouse=new X(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function st(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,ct.call(this,e)):12&t&&ct.call(this,e)}function ct(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)}),2500)}}function ut(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}v(At,j,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)st.call(this,e,n);else if(i&&ut.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var lt=k(u.style,"touchAction"),gt=void 0!==lt,ft=function(){if(!gt)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||i.CSS.supports("touch-action",n)})),t}();function ht(t,e){this.manager=t,this.set(e)}ht.prototype={set:function(t){"compute"==t&&(t=this.compute()),gt&&this.manager.element.style&&ft[t]&&(this.manager.element.style[lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return I(this.manager.recognizers,(function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(w(t,"none"))return"none";var e=w(t,"pan-x"),n=w(t,"pan-y");if(e&&n)return"none";if(e||n)return e?"pan-x":"pan-y";if(w(t,"manipulation"))return"manipulation";return"auto"}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=w(r,"none")&&!ft.none,o=w(r,"pan-y")&&!ft["pan-y"],a=w(r,"pan-x")&&!ft["pan-x"];if(i){var A=1===t.pointers.length,s=t.distance<2,c=t.deltaTime<250;if(A&&s&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function dt(t){this.options=s({},this.defaults,t||{}),this.id=O++,this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function It(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function pt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function Ct(t,e){var n=e.manager;return n?n.get(t):t}function yt(){dt.apply(this,arguments)}function vt(){yt.apply(this,arguments),this.pX=null,this.pY=null}function Bt(){yt.apply(this,arguments)}function mt(){dt.apply(this,arguments),this._timer=null,this._input=null}function bt(){yt.apply(this,arguments)}function Et(){yt.apply(this,arguments)}function Qt(){dt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ft(t,e){return(e=e||{}).recognizers=b(e.recognizers,Ft.defaults.preset),new wt(t,e)}dt.prototype={defaults:{},set:function(t){return s(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Ct(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)||(t=Ct(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return-1===R(e,t=Ct(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=Ct(t,this);var e=R(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+It(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+It(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=s({},t);if(!m(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},v(yt,dt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=6&e,i=this.attrTest(t);return r&&(8&n||!i)?16|e:r||i?4&n?8|e:2&e?4|e:2:32}}),v(vt,yt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push("pan-y"),24&t&&e.push("pan-x"),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(6&e.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return yt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=pt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),v(Bt,yt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),v(mt,dt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),v(bt,yt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),v(Et,yt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return vt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&g(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=pt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),v(Qt,dt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||J(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=h((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ft.VERSION="2.0.7",Ft.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[bt,{enable:!1}],[Bt,{enable:!1},["rotate"]],[Et,{direction:6}],[vt,{direction:6},["swipe"]],[Qt],[Qt,{event:"doubletap",taps:2},["tap"]],[mt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function wt(t,e){this.options=s({},Ft.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){var e=t.options.inputClass;return new(e||(G?tt:_?ot:D?At:X))(t,L)}(this),this.touchAction=new ht(this,this.options.touchAction),St(this,!0),I(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function St(t,e){var n,r=t.element;r.style&&(I(t.options.cssProps,(function(i,o){n=k(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}wt.prototype={set:function(t){return s(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof dt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(d(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(d(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=R(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(void 0!==t&&void 0!==e){var n=this.handlers;return I(S(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(void 0!==t){var n=this.handlers;return I(S(t),(function(t){e?n[t]&&n[t].splice(R(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&St(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(Ft,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:wt,Input:j,TouchAction:ht,TouchInput:ot,MouseInput:X,PointerEventInput:tt,TouchMouseInput:At,SingleTouchInput:nt,Recognizer:dt,AttrRecognizer:yt,Tap:Qt,Pan:vt,Swipe:Et,Pinch:Bt,Rotate:bt,Press:mt,on:E,off:Q,each:I,merge:y,extend:C,assign:s,inherit:v,bindFn:B,prefixed:k}),("undefined"!==typeof i?i:"undefined"!==typeof self?self:{}).Hammer=Ft,void 0===(r=function(){return Ft}.call(e,n,e,t))||(t.exports=r)}(window,document)},,function(t,e,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function A(){A.init.call(this)}t.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?A.defaultMaxListeners:t._maxListeners}function l(t,e,n,r){var i,o,a,A;if(c(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"===typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,A=s,console&&console.warn&&console.warn(A)}return t}function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=g.bind(r);return i.listener=n,r.wrapFn=i,i}function h(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):I(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function I(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!==typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),A.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(t){if("number"!==typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},A.prototype.getMaxListeners=function(){return u(this)},A.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var A=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw A.context=a,A}var s=i[t];if(void 0===s)return!1;if("function"===typeof s)o(s,this,e);else{var c=s.length,u=I(s,c);for(n=0;n<c;++n)o(u[n],this,e)}return!0},A.prototype.addListener=function(t,e){return l(this,t,e,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(t,e){return l(this,t,e,!0)},A.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},A.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},A.prototype.removeListener=function(t,e){var n,r,i,o,a;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!==typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},A.prototype.listeners=function(t){return h(this,t,!0)},A.prototype.rawListeners=function(t){return h(this,t,!1)},A.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},A.prototype.listenerCount=d,A.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(1),i=n(3),o=n(2),a=n(54),A=n(7),s=n(8),c=n(6),u=n(98),l=n(67),g=n(36),f=n(37);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var p=function(t){Object(A.a)(n,t);var e=I(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,n);var o=r.latitude,A=void 0===o?0:o,s=r.longitude,c=void 0===s?0:s,u=r.zoom,g=void 0===u?11:u,h=r.pitch,d=void 0===h?0:h,I=r.bearing,p=void 0===I?0:I,C=r.nearZMultiplier,y=void 0===C?.1:C,v=r.farZMultiplier,B=void 0===v?1.01:v,m=r.orthographic,b=void 0!==m&&m,E=r.repeat,Q=void 0!==E&&E,F=r.worldOffset,w=void 0===F?0:F,S=r.width,R=r.height,U=r.altitude,x=void 0===U?1.5:U,k=Math.pow(2,g);S=S||1,R=R||1,x=Math.max(.75,x);var O=Object(l.h)({width:S,height:R,pitch:d,altitude:x,nearZMultiplier:y,farZMultiplier:B}),N=O.fov,D=O.aspect,G=O.focalDistance,_=O.near,M=O.far,T=Object(l.i)({height:R,pitch:d,bearing:p,scale:k,altitude:x});if(w){var j=(new f.a).translate([512*w,0,0]);T=j.multiplyLeft(T)}var L=Object.assign({},r,{width:S,height:R,viewMatrix:T,longitude:c,latitude:A,zoom:g,orthographic:b,fovyRadians:N,aspect:D,focalDistance:b?G:1,near:_,far:M});return(t=e.call(this,L)).latitude=A,t.longitude=c,t.zoom=g,t.pitch=d,t.bearing=p,t.altitude=x,t.orthographic=b,t._subViewports=Q?[]:null,Object.freeze(Object(a.a)(t)),t}return Object(o.a)(n,[{key:"addMetersToLngLat",value:function(t,e){return Object(l.a)(t,e)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=t.pos,r=Object(l.l)(n,this.pixelUnprojectionMatrix),i=this.projectFlat(e),o=g.a([],i,g.d([],r)),a=g.a([],this.center,o);return this.unprojectFlat(a)}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(l.d)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}},{key:"fitBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=Object(l.b)(Object.assign({width:r,height:i,bounds:t},e)),a=o.longitude,A=o.latitude,s=o.zoom;return new n({width:r,height:i,longitude:a,latitude:A,zoom:s})}},{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var t=this.getBounds(),e=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360),i=e;i<=r;i++){var o=i?new n(d(d({},this),{},{worldOffset:i})):this;this._subViewports.push(o)}return this._subViewports}}]),n}(u.a);p.displayName="WebMercatorViewport"},function(t,e,n){"use strict";var r=n(17),i=n(3),o=n(2),a=n(7),A=n(8),s=n(6),c=n(40),u=n(369),l=n(1),g=n(89),f=n(37),h=n(134);function d(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var I=function(t){Object(a.a)(n,t);var e=d(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"_onUpdate",value:function(){var t=this.time,e=this.settings,n=e.fromValue,r=e.toValue,i=e.duration,o=(0,e.easing)(t/i);this._value=Object(f.g)(n,r,o)}},{key:"value",get:function(){return this._value}}]),n}(h.a);function p(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}function C(t,e,n,r,i){var o=e-t;return(n-e)*i+-o*r+o+e}function y(t,e){if(Array.isArray(t)){for(var n=0,r=0;r<t.length;r++){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}return Math.abs(t-e)}var v=function(t){Object(a.a)(n,t);var e=p(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"_onUpdate",value:function(){var t=this.settings,e=t.fromValue,n=t.toValue,r=t.damping,i=t.stiffness,o=this._prevValue,a=void 0===o?e:o,A=this._currValue,s=void 0===A?e:A,c=function(t,e,n,r,i){if(Array.isArray(n)){for(var o=[],a=0;a<n.length;a++)o[a]=C(t[a],e[a],n[a],r,i);return o}return C(t,e,n,r,i)}(a,s,n,r,i),u=y(c,n),l=y(c,s);u<1e-5&&l<1e-5&&(c=n,this.end()),this._prevValue=s,this._currValue=c}},{key:"value",get:function(){return this._currValue}}]),n}(h.a),B=n(44);function m(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var F,w={interpolation:I,spring:v},S=function(){function t(e){Object(i.a)(this,t),this.transitions=new Map,this.timeline=e}return Object(o.a)(t,[{key:"add",value:function(t,e,n,r){var i=this.transitions;if(i.has(t)){var o=i.get(t),a=o.value;e=void 0===a?o.settings.fromValue:a,this.remove(t)}if(r=Object(g.e)(r)){var A=w[r.type];if(A){var s=new A(this.timeline);s.start(Q(Q({},r),{},{fromValue:e,toValue:n})),i.set(t,s)}else B.a.error("unsupported transition type '".concat(r.type,"'"))()}}},{key:"remove",value:function(t){var e=this.transitions;e.has(t)&&(e.get(t).cancel(),e.delete(t))}},{key:"update",value:function(){var t,e={},n=m(this.transitions);try{for(n.s();!(t=n.n()).done;){var i=Object(r.a)(t.value,2),o=i[0],a=i[1];a.update(),e[o]=a.value,a.inProgress||this.remove(o)}}catch(A){n.e(A)}finally{n.f()}return e}},{key:"clear",value:function(){var t,e=m(this.transitions.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.remove(n)}}catch(r){e.e(r)}finally{e.f()}}},{key:"active",get:function(){return this.transitions.size>0}}]),t}(),R=n(304),U=n(365),x=n(72),k=n(19),O=n(53),N=n(169),D=n(364),G=n(307),_=n(123),M=n(73),T=n(110),j=n(27),L=n(218);function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var P=(F={},Object(l.a)(F,10241,9987),Object(l.a)(F,10240,9729),Object(l.a)(F,10242,33071),Object(l.a)(F,10243,33071),F),W={};var J={boolean:{validate:function(t,e){return!0},equal:function(t,e,n){return Boolean(t)===Boolean(e)}},number:{validate:function(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate:function(t,e){return e.optional&&!t||z(t)&&(3===t.length||4===t.length)},equal:function(t,e,n){return H(t,e)}},accessor:{validate:function(t,e){var n=K(t);return"function"===n||n===K(e.value)},equal:function(t,e,n){return"function"===typeof e||H(t,e)}},array:{validate:function(t,e){return e.optional&&!t||z(t)},equal:function(t,e,n){return n.compare?H(t,e):t===e}},function:{validate:function(t,e){return e.optional&&!t||"function"===typeof t},equal:function(t,e,n){return!n.compare||t===e}},data:{transform:function(t,e,n){var r=(n?n.props:{}).dataTransform;return r&&t?r(t):t}},image:{transform:function(t,e,n){return function(t,e){var n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof L.a)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});var r=new L.a(n,Z(Z({},e),{},{parameters:Z(Z({},P),t.props.textureParameters)}));return W[r.id]=!0,r}(n,t)},release:function(t){var e;(e=t)&&e instanceof L.a&&W[e.id]&&(e.delete(),delete W[e.id])}}};function H(t,e){if(t===e)return!0;if(!z(t)||!z(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Y(t,e){switch(K(e)){case"object":return X(t,e);case"array":return X(t,{type:"array",value:e,compare:!1});case"boolean":return X(t,{type:"boolean",value:e});case"number":return X(t,{type:"number",value:e});case"function":return X(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function X(t,e){return"type"in e?Object.assign({name:t},J[e.type],e):"value"in e?Object.assign({name:t,type:K(e.value)},e):{name:t,type:"object",value:e}}function z(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function K(t){return z(t)?"array":null===t?"null":Object(j.a)(t)}function q(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return $(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tt=M.b.COMPONENT,et=M.b.ASYNC_ORIGINAL,nt=M.b.ASYNC_RESOLVED,rt=M.b.ASYNC_DEFAULTS;function it(){var t=this,e=ot(t.constructor),n=Object.create(e);n[tt]=t,n[et]={},n[nt]={};for(var r=0;r<arguments.length;++r){var i=arguments[r];for(var o in i)n[o]=i[o]}return Object.freeze(n),n}function ot(t){var e=st(t,"_mergedDefaultProps");return e||(function(t){if(!t.prototype)return;var e=Object.getPrototypeOf(t),n=ot(e),i=function(t){for(var e={},n={},i={},o=0,a=Object.entries(t);o<a.length;o++){var A=Object(r.a)(a[o],2),s=A[0],c=A[1];if(c&&c.deprecatedFor)i[s]=Array.isArray(c.deprecatedFor)?c.deprecatedFor:[c.deprecatedFor];else{var u=Y(s,c);e[s]=u,n[s]=u.value}}return{propTypes:e,defaultProps:n,deprecatedProps:i}}(st(t,"defaultProps")||{}),o=function(t,e,n){var r=Object.create(null);Object.assign(r,e,t);var i=function(t){var e=st(t,"layerName")||st(t,"componentName");e||B.a.once(0,"".concat(t.name,".componentName not specified"))();return e||t.name}(n);return delete t.id,Object.defineProperties(r,{id:{writable:!0,value:i}}),r}(i.defaultProps,n,t),a=Object.assign({},e._propTypes,i.propTypes);!function(t,e){var n={},r={};for(var i in e){var o=e[i],a=o.name,A=o.value;o.async&&(n[a]=A,r[a]=at(a))}t[rt]=n,t[et]={},Object.defineProperties(t,r)}(o,a);var A=Object.assign({},e._deprecatedProps,i.deprecatedProps);(function(t,e){var n=function(n){Object.defineProperty(t,n,{enumerable:!1,set:function(t){var r,i="".concat(this.id,": ").concat(n),o=q(e[n]);try{for(o.s();!(r=o.n()).done;){var a=r.value;At(this,a)||(this[a]=t)}}catch(A){o.e(A)}finally{o.f()}B.a.deprecated(i,e[n].join("/"))()}})};for(var r in e)n(r)})(o,A),t._mergedDefaultProps=o,t._propTypes=a,t._deprecatedProps=A}(t),t._mergedDefaultProps)}function at(t){return{enumerable:!0,set:function(e){"string"===typeof e||e instanceof Promise||Object(T.c)(e)?this[et][t]=e:this[nt][t]=e},get:function(){if(this[nt]){if(t in this[nt])return this[nt][t]||this[rt][t];if(t in this[et]){var e=this[tt]&&this[tt].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[rt][t]}}return this[rt][t]}}}function At(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function st(t,e){return At(t,e)&&t[e]}var ct=n(13),ut=n.n(ct),lt=n(30),gt=n(211),ft=M.b.ASYNC_ORIGINAL,ht=M.b.ASYNC_RESOLVED,dt=M.b.ASYNC_DEFAULTS,It=Object.freeze({}),pt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Object(i.a)(this,t),this.component=e,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=It,this.oldAsyncProps=null}return Object(o.a)(t,[{key:"finalize",value:function(){for(var t in this.asyncProps){var e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var t in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}},{key:"hasAsyncProp",value:function(t){return t in this.asyncProps}},{key:"getAsyncProp",value:function(t){var e=this.asyncProps[t];return e&&e.resolvedValue}},{key:"isAsyncPropLoading",value:function(t){if(t){var e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(var n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}},{key:"reloadAsyncProp",value:function(t,e){this._watchPromise(t,Promise.resolve(e))}},{key:"setAsyncProps",value:function(t){var e=t[ht]||{},n=t[ft]||t,r=t[dt]||{};for(var i in e){var o=e[i];this._createAsyncPropData(i,r[i]),this._updateAsyncProp(i,o),e[i]=this.getAsyncProp(i)}for(var a in n){var A=n[a];this._createAsyncPropData(a,r[a]),this._updateAsyncProp(a,A)}}},{key:"_updateAsyncProp",value:function(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"===typeof e){var n=this.layer&&this.layer.props.fetch;n&&(e=n(e,{propName:t,layer:this.layer}))}e instanceof Promise?this._watchPromise(t,e):Object(T.c)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e)}}},{key:"_didAsyncInputValueChange",value:function(t,e){var n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}},{key:"_setPropValue",value:function(t,e){var n=this.asyncProps[t];e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(t,e,n){var r=this.asyncProps[t];r&&n>=r.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),r.resolvedValue=e,r.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}},{key:"_watchPromise",value:function(t,e){var n=this,r=this.asyncProps[t];r.pendingLoadCount++;var i=r.pendingLoadCount;e.then((function(e){e=n._postProcessValue(r,e),n._setAsyncPropValue(t,e,i);var o=n.layer&&n.layer.props.onDataLoad;"data"===t&&o&&o(e,{propName:t,layer:n.layer})})).catch((function(t){return B.a.error(t)()}))}},{key:"_resolveAsyncIterable",value:function(){var t=Object(lt.a)(ut.a.mark((function t(e,n){var r,i,o,a,A,s,c,u,l,g,f,h,d,I;return ut.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:"data"!==e&&this._setPropValue(e,n),(r=this.asyncProps[e]).pendingLoadCount++,i=r.pendingLoadCount,o=[],a=0,A=!0,s=!1,t.prev=8,u=Object(gt.a)(n);case 10:return t.next=12,u.next();case 12:return l=t.sent,A=l.done,t.next=16,l.value;case 16:if(g=t.sent,A){t.next=27;break}f=g,h=this.component?this.component.props:{},d=h.dataTransform,o=d?d(f,o):o.concat(f),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,this._setAsyncPropValue(e,o,i);case 24:A=!0,t.next=10;break;case 27:t.next=33;break;case 29:t.prev=29,t.t0=t.catch(8),s=!0,c=t.t0;case 33:if(t.prev=33,t.prev=34,A||null==u.return){t.next=38;break}return t.next=38,u.return();case 38:if(t.prev=38,!s){t.next=41;break}throw c;case 41:return t.finish(38);case 42:return t.finish(33);case 43:(I=this.layer&&this.layer.props.onDataLoad)&&I(o,{propName:e,layer:this.layer});case 45:case"end":return t.stop()}}),t,this,[[8,29,33,43],[34,,38,42]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(t,e){var n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}},{key:"_createAsyncPropData",value:function(t,e){if(!this.asyncProps[t]){var n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}]),t}(),Ct=M.b.ASYNC_ORIGINAL,yt=M.b.ASYNC_RESOLVED,vt=M.b.ASYNC_DEFAULTS,Bt=0,mt=function(){function t(){Object(i.a)(this,t),this.props=it.apply(this,arguments),this.id=this.props.id,this.count=Bt++,this.lifecycle=M.a.NO_STATE,this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}return Object(o.a)(t,[{key:"clone",value:function(t){var e=this.props,n={};for(var r in e[vt])r in e[yt]?n[r]=e[yt][r]:r in e[Ct]&&(n[r]=e[Ct][r]);return new this.constructor(Object.assign({},e,n,t))}},{key:"_initState",value:function(){this.internalState=new pt({})}},{key:"stats",get:function(){return this.internalState.stats}}]),t}();function bt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}mt.componentName="Component",mt.defaultProps={};var Et=function(t){Object(a.a)(n,t);var e=bt(n);function n(t){var r,o=t.attributeManager,a=t.layer;return Object(i.a)(this,n),(r=e.call(this,a)).attributeManager=o,r.model=null,r.needsRedraw=!0,r.subLayers=null,r}return Object(o.a)(n,[{key:"layer",get:function(){return this.component},set:function(t){this.component=t}}]),n}(pt),Qt=n(67),Ft=n(927);function wt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return St(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return Dt}));var Ut=Math.pow(2,24)-1,xt=Object.freeze([]),kt=Object(N.a)((function(t){var e=t.oldViewport,n=t.viewport;return e.equals(n)})),Ot=new Uint8ClampedArray(0),Nt={data:{type:"data",value:xt,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(t){return t&&t.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(t,e){var n=e.propName,r=e.layer,i=r.context.resourceManager,o=r.getLoadOptions(),a=i.contains(t);return a||o||(i.add({resourceId:t,data:t,persistent:!1}),a=!0),a?i.subscribe({resourceId:t,onChange:function(t){return r.internalState.reloadAsyncProp(n,t)},consumerId:r.id,requestId:n}):Object(Ft.a)(t,o)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:c.a.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],getPolygonOffset:{type:"function",value:function(t){return[0,100*-t.layerIndex]},compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},Dt=function(t){Object(a.a)(n,t);var e=Rt(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"toString",value:function(){var t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}},{key:"setState",value:function(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=t)}},{key:"setNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}},{key:"needsUpdate",value:function(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}},{key:"hasUniformTransition",value:function(){return this.internalState.uniformTransitions.active}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"project",value:function(t){var e=this.context.viewport,n=Object(G.a)(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(Qt.n)(n,e.pixelProjectionMatrix),o=Object(r.a)(i,3),a=o[0],A=o[1],s=o[2];return 2===t.length?[a,A]:[a,A,s]}},{key:"unproject",value:function(t){return this.context.viewport.unproject(t)}},{key:"projectPosition",value:function(t){return Object(G.b)(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"use64bitPositions",value:function(){var t=this.props.coordinateSystem;return t===c.a.DEFAULT||t===c.a.LNGLAT||t===c.a.CARTESIAN}},{key:"onHover",value:function(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}},{key:"onClick",value:function(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}},{key:"decodePickingColor",value:function(t){Object(O.a)(t instanceof Uint8Array);var e=Object(r.a)(t,3);return e[0]+256*e[1]+65536*e[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(t){var e,n=wt(this.props.extensions);try{for(n.s();!(e=n.n()).done;){var r=e.value;t=Object(D.a)(t,r.getShaders.call(this,r))}}catch(i){n.e(i)}finally{n.f()}return t}},{key:"shouldUpdateState",value:function(t){t.oldProps,t.props,t.context;return t.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(t){var e=t.oldProps,n=t.props,r=(t.context,t.changeFlags),i=this.getAttributeManager();if(r.dataChanged&&i){var o=r.dataChanged;if(Array.isArray(o)){var a,A=wt(o);try{for(A.s();!(a=A.n()).done;){var s=a.value;i.invalidateAll(s)}}catch(d){A.e(d)}finally{A.f()}}else i.invalidateAll()}var c=e.highlightedObjectIndex>=0||e.pickable,u=n.highlightedObjectIndex>=0||n.pickable;if(c!==u&&i){var l=i.attributes,g=l.pickingColors,f=l.instancePickingColors,h=g||f;h&&(u&&h.constant&&(h.constant=!1,i.invalidate(h.id)),h.value||u||(h.constant=!0,h.value=[0,0,0]))}}},{key:"finalizeState",value:function(){var t,e=wt(this.getModels());try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(r){e.e(r)}finally{e.f()}var n=this.getAttributeManager();n&&n.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}},{key:"draw",value:function(t){var e,n=wt(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.draw(t)}}catch(r){n.e(r)}finally{n.f()}}},{key:"getPickingInfo",value:function(t){var e=t.info,n=(t.mode,e.index);return n>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[n]),e}},{key:"activateViewport",value:function(t){var e=this.internalState.viewport;this.internalState.viewport=t,e&&kt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}},{key:"invalidateAttribute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],this.getAttributeManager());e&&("all"===t?e.invalidateAll():e.invalidate(t))}},{key:"updateAttributes",value:function(t){var e,n=wt(this.getModels());try{for(n.s();!(e=n.n()).done;){var r=e.value;this._setModelAttributes(r,t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_updateAttributes",value:function(t){var e=this.getAttributeManager();if(e){var n=this.getNumInstances(t),r=this.getStartIndices(t);e.update({data:t.data,numInstances:n,startIndices:r,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});var i=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}}},{key:"_updateAttributeTransition",value:function(){var t=this.getAttributeManager();t&&t.updateTransition()}},{key:"_updateUniformTransition",value:function(){var t=this.internalState.uniformTransitions;if(t.active){var e=t.update(),n=Object.create(this.props);for(var r in e)Object.defineProperty(n,r,{value:e[r]});return n}return this.props}},{key:"calculateInstancePickingColors",value:function(t,e){var n=e.numInstances;if(!t.constant){var r=Ot.length/3;if(r<n){n>Ut&&B.a.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")();for(var i=(Ot=_.a.allocate(Ot,n,{size:3,copy:!0,maxCount:Math.max(n,Ut)})).length/3,o=[],a=r;a<i;a++)this.encodePickingColor(a,o),Ot[3*a+0]=o[0],Ot[3*a+1]=o[1],Ot[3*a+2]=o[2]}t.value=Ot.subarray(0,3*n)}}},{key:"_setModelAttributes",value:function(t,e){var n=this.getAttributeManager(),r=t.userData.excludeAttributes||{},i=n.getShaderAttributes(e,r);t.setAttributes(i)}},{key:"clearPickingColor",value:function(t){var e=this.getAttributeManager().attributes,n=e.pickingColors,r=e.instancePickingColors,i=n||r,o=this.decodePickingColor(t),a=i.getVertexOffset(o),A=i.getVertexOffset(o+1);i.buffer.subData({data:new Uint8Array(A-a),offset:a})}},{key:"restorePickingColors",value:function(){var t=this.getAttributeManager().attributes,e=t.pickingColors,n=t.instancePickingColors;(e||n).updateSubBuffer({startOffset:0})}},{key:"getNumInstances",value:function(t){return void 0!==(t=t||this.props).numInstances?t.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:Object(U.a)(t.data)}},{key:"getStartIndices",value:function(t){return void 0!==(t=t||this.props).startIndices?t.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}},{key:"_initialize",value:function(){Object(x.a)("layer.initialize",this),this._initState(),this.initializeState(this.context);var t,e=wt(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.initializeState.call(this,this.context,n)}}catch(r){e.e(r)}finally{e.f()}this.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,extensionsChanged:!0}),this._updateState()}},{key:"_update",value:function(){var t=this.needsUpdate();Object(x.a)("layer.update",this,t),t&&this._updateState()}},{key:"_updateState",value:function(){var t=this.props,e=this.context.viewport,n=this._updateUniformTransition();this.internalState.propsInTransition=n,this.context.viewport=this.internalState.viewport||e,this.props=n;var r=this._getUpdateParams(),i=this.getModels();if(this.context.gl)this.updateState(r);else try{this.updateState(r)}catch(c){}var o,a=wt(this.props.extensions);try{for(a.s();!(o=a.n()).done;){var A=o.value;A.updateState.call(this,r,A)}}catch(u){a.e(u)}finally{a.f()}var s=this.getModels()[0]!==i[0];this._updateModules(r,s),this.isComposite?this._renderLayers(r):(this.setNeedsRedraw(),this._updateAttributes(this.props),this.state.model&&this.state.model.setInstanceCount(this.getNumInstances())),this.context.viewport=e,this.props=t,this.clearChangeFlags(),this.internalState.needsUpdate=!1,this.internalState.resetOldProps()}},{key:"_finalize",value:function(){Object(x.a)("layer.finalize",this),Object(O.a)(this.internalState&&this.state),this.finalizeState(this.context);var t,e=wt(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.finalizeState.call(this,n)}}catch(r){e.e(r)}finally{e.f()}}},{key:"drawLayer",value:function(t){var e=this,n=t.moduleParameters,r=void 0===n?null:n,i=t.uniforms,o=void 0===i?{}:i,a=t.parameters,A=void 0===a?{}:a;this._updateAttributeTransition();var s=this.props;this.props=this.internalState.propsInTransition||s;var c=this.props.opacity;o.opacity=Math.pow(c,1/2.2),r&&this.setModuleParameters(r);var u=this.props.getPolygonOffset,l=u&&u(o)||[0,0];Object(k.k)(this.context.gl,{polygonOffset:l}),Object(k.l)(this.context.gl,A,(function(){var t,n={moduleParameters:r,uniforms:o,parameters:A,context:e.context},i=wt(e.props.extensions);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.draw.call(e,n,a)}}catch(s){i.e(s)}finally{i.f()}e.draw(n)})),this.props=s}},{key:"getChangeFlags",value:function(){return this.internalState.changeFlags}},{key:"setChangeFlags",value:function(t){var e=this.internalState.changeFlags;for(var n in t)if(t[n]){var r=!1;switch(n){case"dataChanged":Array.isArray(e[n])&&(e[n]=Array.isArray(t[n])?e[n].concat(t[n]):t[n],r=!0);default:e[n]||(e[n]=t[n],r=!0)}r&&Object(x.a)("layer.changeFlag",this,n,t)}var i=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=i,e.somethingChanged=i||t.viewportChanged||t.stateChanged}},{key:"clearChangeFlags",value:function(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}},{key:"diffProps",value:function(t,e){var n=Object(R.b)(t,e);if(n.updateTriggersChanged)for(var r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(n.transitionsChanged)for(var i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(n)}},{key:"validateProps",value:function(){Object(R.c)(this.props)}},{key:"setModuleParameters",value:function(t){var e,n=wt(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.updateModuleSettings(t)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_updateModules",value:function(t,e){var n=t.props,r=t.oldProps,i=n.autoHighlight,o=n.highlightedObjectIndex,a=n.highlightColor;if(e||r.autoHighlight!==i||r.highlightedObjectIndex!==o||r.highlightColor!==a){var A={};i||(A.pickingSelectedColor=null),Array.isArray(a)&&(A.pickingHighlightColor=a),Number.isInteger(o)&&(A.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(A)}}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(t){if(!this.internalState)return!1;var e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;var n=this.getAttributeManager(),r=n&&n.getNeedsRedraw(t);return e=e||r}},{key:"_getAttributeManager",value:function(){return new u.a(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){Object(O.a)(!this.internalState&&!this.state),Object(O.a)(isFinite(this.props.coordinateSystem),"".concat(this.id,": invalid coordinateSystem"));var t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Et({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return B.a.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t}}),this.internalState.layer=this,this.internalState.uniformTransitions=new S(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(t){Object(x.a)("layer.matched",this,this===t);var e=t.state,n=t.internalState;Object(O.a)(e&&n),this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}},{key:"_onAsyncPropUpdated",value:function(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}},{key:"isLoaded",get:function(){return this.internalState&&!this.internalState.isAsyncPropLoading()}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}}]),n}(mt);Dt.layerName="Layer",Dt.defaultProps=Nt},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(933),l=n(436),g=n(40),f=n(252),h=n(702),d=n(353),I=n(379),p=n(235),C=n(1),y=n(243),v=n(706),B=n(219);function m(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){Object(C.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function F(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var w=function(t){Object(a.a)(n,t);var e=F(n);function n(t){Object(r.a)(this,n);var i=t.fp64,o=t.IndexType,a=void 0===o?Uint32Array:o;return e.call(this,Q(Q({},t),{},{attributes:{positions:{size:3,type:i?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:a,size:1}}}))}return Object(i.a)(n,[{key:"get",value:function(t){var e=this.attributes;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}},{key:"updateGeometry",value:function(t){Object(o.a)(Object(s.a)(n.prototype),"updateGeometry",this).call(this,t);var e=this.buffers.indices;e&&(this.vertexCount=(e.value||e).length)}},{key:"normalizeGeometry",value:function(t){if(this.normalize){if(t=y.b(t,this.positionSize),this.opts.resolution)return Object(B.a)(t.positions||t,t.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(B.b)(t.positions||t,t.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return t}},{key:"getGeometrySize",value:function(t){if(Array.isArray(t)&&!Number.isFinite(t[0])){var e,n=0,r=m(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(o){r.e(o)}finally{r.f()}return n}return(t.positions||t).length/this.positionSize}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize||!this.buffers.indices?Object(o.a)(Object(s.a)(n.prototype),"getGeometryFromBuffer",this).call(this,t):function(){return null}}},{key:"updateGeometryAttributes",value:function(t,e){if(Array.isArray(t)&&!Number.isFinite(t[0])){var n,r=m(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o,e.indexStart=this.indexStarts[e.geometryIndex+1]}}catch(a){r.e(a)}finally{r.f()}}else this._updateIndices(t,e),this._updatePositions(t,e),this._updateVertexValid(t,e)}},{key:"_updateIndices",value:function(t,e){var n=e.geometryIndex,r=e.vertexStart,i=e.indexStart,o=this.attributes,a=this.indexStarts,A=this.typedArrayManager,s=o.indices;if(s){var c=i,u=y.a(t,this.positionSize,this.opts.preproject);s=A.allocate(s,i+u.length,{copy:!0});for(var l=0;l<u.length;l++)s[c++]=u[l]+r;a[n+1]=i+u.length,o.indices=s}}},{key:"_updatePositions",value:function(t,e){var n=e.vertexStart,r=e.geometrySize,i=this.attributes.positions,o=this.positionSize;if(i)for(var a=t.positions||t,A=n,s=0;s<r;A++,s++){var c=a[s*o],u=a[s*o+1],l=o>2?a[s*o+2]:0;i[3*A]=c,i[3*A+1]=u,i[3*A+2]=l}}},{key:"_updateVertexValid",value:function(t,e){var n=e.vertexStart,r=e.geometrySize,i=this.attributes.vertexValid,o=this.positionSize,a=t&&t.holeIndices;if(t&&t.edgeTypes?i.set(t.edgeTypes,n):i.fill(1,n,n+r),a)for(var A=0;A<a.length;A++)i[n+a[A]/o-1]=0;i[n+r-1]=0}}]),n}(v.a),S="\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n  vec4 fillColors;\n  vec4 lineColors;\n  vec3 positions;\n  vec3 nextPositions;\n  vec3 pickingColors;\n  vec3 positions64Low;\n  vec3 nextPositions64Low;\n  float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n  if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n    return normalize(vector * project_uCommonUnitsPerWorldUnit);\n  }\n  return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n  if(vertexValid < 0.5){\n    gl_Position = vec4(0.);\n    return;\n  }\n#endif\n\n  vec3 pos;\n  vec3 pos64Low;\n  vec3 normal;\n  vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n  geometry.worldPosition = props.positions;\n  geometry.worldPositionAlt = props.nextPositions;\n  geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n  pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n  pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n  pos = props.positions;\n  pos64Low = props.positions64Low;\n#endif\n\n  if (extruded) {\n    pos.z += props.elevations * vertexPositions.y * elevationScale;\n\n#ifdef IS_SIDE_VERTEX\n    normal = vec3(\n      props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n      props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n      0.0);\n    normal = project_offset_normal(normal);\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n    geometry.normal = normal;\n  }\n\n  gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  if (extruded) {\n    vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n    vColor = vec4(lightColor, colors.a * opacity);\n  } else {\n    vColor = vec4(colors.rgb, colors.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",R="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float elevations;\nattribute vec4 fillColors;\nattribute vec4 lineColors;\nattribute vec3 pickingColors;\n\n".concat(S,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  props.positions = positions;\n  props.positions64Low = positions64Low;\n  props.elevations = elevations;\n  props.fillColors = fillColors;\n  props.lineColors = lineColors;\n  props.pickingColors = pickingColors;\n\n  calculatePosition(props);\n}\n"),U="#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\n\n\nattribute vec3 instancePositions;\nattribute vec3 nextPositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 nextPositions64Low;\nattribute float instanceElevations;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\n".concat(S,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  props.positions = instancePositions;\n  props.positions64Low = instancePositions64Low;\n  props.elevations = instanceElevations;\n  props.fillColors = instanceFillColors;\n  props.lineColors = instanceLineColors;\n  props.pickingColors = instancePickingColors;\n  props.nextPositions = nextPositions;\n  props.nextPositions64Low = nextPositions64Low;\n\n  calculatePosition(props);\n}\n");function x(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return D}));var k=[0,0,0,255],O={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:function(t){return t.polygon}},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:k},getLineColor:{type:"accessor",value:k},material:!0},N={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},D=function(t){Object(a.a)(n,t);var e=x(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(t){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"top"===t?R:U,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{},modules:[c.a,u.a,l.a]})}},{key:"initializeState",value:function(){var t=this,e=this.context,n=e.gl,r=e.viewport,i=this.props.coordinateSystem;r.isGeospatial&&i===g.a.DEFAULT&&(i=g.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new w({preproject:i===g.a.LNGLAT&&r.projectFlat,fp64:this.use64bitPositions(),IndexType:!n||Object(h.c)(n,d.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});var o=this.getAttributeManager();o.remove(["instancePickingColors"]),o.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:N,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,transition:N,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:N,accessor:"getFillColor",defaultValue:k,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:N,accessor:"getLineColor",defaultValue:k,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(e&&e.__source?e.__source.index:r,i)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}},{key:"getPickingInfo",value:function(t){var e=Object(o.a)(Object(s.a)(n.prototype),"getPickingInfo",this).call(this,t),r=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===r}))),e}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.extruded,i=n.filled,o=n.wireframe,a=n.elevationScale,A=this.state,s=A.topModel,c=A.sideModel,u=A.polygonTesselator,l=Object.assign({},e,{extruded:Boolean(r),elevationScale:a});c&&(c.setInstanceCount(u.instanceCount-1),c.setUniforms(l),o&&(c.setDrawMode(3),c.setUniforms({isWireframe:!0}).draw()),i&&(c.setDrawMode(6),c.setUniforms({isWireframe:!1}).draw())),s&&(s.setVertexCount(u.vertexCount),s.setUniforms(l).draw())}},{key:"updateState",value:function(t){Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,t),this.updateGeometry(t);var e=t.props,r=t.oldProps,i=t.changeFlags,a=this.getAttributeManager();(i.extensionsChanged||e.filled!==r.filled||e.extruded!==r.extruded)&&(this.state.models&&this.state.models.forEach((function(t){return t.delete()})),this.setState(this._getModels(this.context.gl)),a.invalidateAll())}},{key:"updateGeometry",value:function(t){var e=t.props,n=(t.oldProps,t.changeFlags);if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){var r=this.state.polygonTesselator,i=e.data.attributes||{};r.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:i.getPolygon,buffers:i,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged}),this.setState({numInstances:r.instanceCount,startIndices:r.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}},{key:"_getModels",value:function(t){var e,n,r=this.props,i=r.id,o=r.filled,a=r.extruded;if(o){var A=this.getShaders("top");A.defines.NON_INSTANCED_MODEL=1,e=new I.a(t,Object.assign({},A,{id:"".concat(i,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0}))}return a&&((n=new I.a(t,Object.assign({},this.getShaders("side"),{id:"".concat(i,"-side"),geometry:new p.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}))).userData.excludeAttributes={indices:!0}),{models:[n,e].filter(Boolean),topModel:e,sideModel:n}}},{key:"calculateIndices",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.indexStarts,t.value=e.get("indices")}},{key:"calculatePositions",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateVertexValid",value:function(t){t.value=this.state.polygonTesselator.get("vertexValid")}},{key:"wrapLongitude",get:function(){return!1}}]),n}(f.a);D.layerName="SolidPolygonLayer",D.defaultProps=O},function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d}));var r=n(10),i=n(45),o=n(40),a=n(169),A=n(53),s=[0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=[0,0,0],g=[0,0,0],f=Object(a.a)((function(t){var e=t.viewport,n=t.devicePixelRatio,a=t.coordinateSystem,A=t.coordinateOrigin,u=function(t,e,n){var o=t.viewMatrixUncentered,a=t.projectionMatrix,A=t.viewMatrix,u=t.viewProjectionMatrix,l=s,g=t.cameraPosition,f=h(t,e,n),d=f.geospatialOrigin,I=f.shaderCoordinateOrigin;if(f.offsetMode){var p=t.projectPosition(d||I);g=[g[0]-p[0],g[1]-p[1],g[2]-p[2]],p[3]=1,l=i.n([],p,u),A=o||A,u=r.h([],a,A),u=r.h([],u,c)}return{viewMatrix:A,viewProjectionMatrix:u,projectionCenter:l,cameraPosCommon:g,shaderCoordinateOrigin:I,geospatialOrigin:d}}(e,a,A),g=u.projectionCenter,f=u.viewProjectionMatrix,d=u.cameraPosCommon,I=u.shaderCoordinateOrigin,p=u.geospatialOrigin,C=e.getDistanceScales(),y=[e.width*n,e.height*n],v={project_uCoordinateSystem:a,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:I,project_uCenter:g,project_uViewportSize:y,project_uDevicePixelRatio:n,project_uFocalDistance:e.focalDistance||1,project_uCommonUnitsPerMeter:C.unitsPerMeter,project_uCommonUnitsPerWorldUnit:C.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:l,project_uScale:e.scale,project_uViewProjectionMatrix:f,project_uCameraPosition:d};if(p){var B=e.getDistanceScales(p);switch(a){case o.a.METER_OFFSETS:v.project_uCommonUnitsPerWorldUnit=B.unitsPerMeter,v.project_uCommonUnitsPerWorldUnit2=B.unitsPerMeter2;break;case o.a.LNGLAT:case o.a.LNGLAT_OFFSETS:v.project_uCommonUnitsPerWorldUnit=B.unitsPerDegree,v.project_uCommonUnitsPerWorldUnit2=B.unitsPerDegree2;break;case o.a.CARTESIAN:v.project_uCommonUnitsPerWorldUnit=[1,1,B.unitsPerMeter[2]],v.project_uCommonUnitsPerWorldUnit2=[0,0,B.unitsPerMeter2[2]]}}return v}));function h(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g,i=r,a=!0;switch(n=e===o.a.LNGLAT_OFFSETS||e===o.a.METER_OFFSETS?r:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.c.WEB_MERCATOR:e!==o.a.LNGLAT&&e!==o.a.CARTESIAN||(a=!1);break;case o.c.WEB_MERCATOR_AUTO_OFFSET:e===o.a.LNGLAT?i=n:e===o.a.CARTESIAN&&(i=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],n=t.unprojectPosition(i),i[0]-=r[0],i[1]-=r[1],i[2]-=r[2]);break;case o.c.IDENTITY:i=t.position.map(Math.fround);break;case o.c.GLOBE:a=!1,n=null;break;default:a=!1}return i[2]=i[2]||0,{geospatialOrigin:n,shaderCoordinateOrigin:i,offsetMode:a}}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.viewport,n=t.devicePixelRatio,r=void 0===n?1:n,i=t.modelMatrix,a=void 0===i?null:i,s=t.coordinateSystem,c=void 0===s?o.a.DEFAULT:s,l=t.coordinateOrigin,g=t.autoWrapLongitude,h=void 0!==g&&g;t.projectionMode,t.positionOrigin;Object(A.a)(e),c===o.a.DEFAULT&&(c=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN);var d=f({viewport:e,devicePixelRatio:r,coordinateSystem:c,coordinateOrigin:l});return d.project_uWrapLongitude=h,d.project_uModelMatrix=a||u,d}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(3),i=n(2),o=n(53),a=function(){function t(e){Object(r.a)(this,t),Object(o.a)(Number.isFinite(e.width),"`width` must be supplied"),Object(o.a)(Number.isFinite(e.height),"`height` must be supplied"),this._viewportProps=this._applyConstraints(e)}return Object(i.a)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"shortestPathFrom",value:function(t){return this._viewportProps}},{key:"_applyConstraints",value:function(t){return t}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(714),i=n(175);function o(){return Object(r.a)()||i.a}},function(t,e,n){"use strict";var r=n(23),i=n(17),o=n(3),a=n(2),A=n(45);function s(t,e){var n=A.n([],e,t);return A.k(n,n,1/n[3]),n}function c(t,e){var n=t%e;return n<0?e+n:n}function u(t,e,n){return n*e+(1-n)*t}var l=n(10),g=n(36),f=n(22);function h(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var d=Math.PI,I=d/4,p=d/180,C=180/d;function y(t){return Math.pow(2,t)}function v(t){return Math.log2(t)}function B(t){var e=Object(i.a)(t,2),n=e[0],r=e[1];h(Number.isFinite(n)),h(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var o=r*p;return[512*(n*p+d)/(2*d),512*(d+Math.log(Math.tan(I+.5*o)))/(2*d)]}function m(t){var e=Object(i.a)(t,2),n=e[0],r=e[1],o=n/512*(2*d)-d,a=2*(Math.atan(Math.exp(r/512*(2*d)-d))-I);return[o*C,a*C]}function b(t){var e=t.latitude;return h(Number.isFinite(e)),v(4003e4*Math.cos(e*p))-9}function E(t){var e=t.latitude,n=t.longitude,r=t.highPrecision,i=void 0!==r&&r;h(Number.isFinite(e)&&Number.isFinite(n));var o={},a=Math.cos(e*p),A=512/360/a,s=512/4003e4/a;if(o.unitsPerMeter=[s,s,s],o.metersPerUnit=[1/s,1/s,1/s],o.unitsPerDegree=[512/360,A,s],o.degreesPerUnit=[.703125,1/A,1/s],i){var c=p*Math.tan(e*p)/a,u=512/360*c/2,l=512/4003e4*c,g=l/A*s;o.unitsPerDegree2=[0,u,l],o.unitsPerMeter2=[g,0,g]}return o}function Q(t,e){var n=Object(i.a)(t,3),r=n[0],o=n[1],a=n[2],A=Object(i.a)(e,3),s=A[0],c=A[1],u=A[2],l=E({longitude:r,latitude:o,highPrecision:!0}),g=l.unitsPerMeter,f=l.unitsPerMeter2,h=B(t);h[0]+=s*(g[0]+f[0]*c),h[1]+=c*(g[1]+f[1]*c);var d=m(h),I=(a||0)+(u||0);return Number.isFinite(a)||Number.isFinite(u)?[d[0],d[1],I]:d}function F(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.scale,a=t.center,A=void 0===a?null:a,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.p(s,s,[0,0,-i]),l.l(s,s,-n*p),l.n(s,s,r*p),o/=e,l.o(s,s,[o,o,o]),A&&l.p(s,s,f.i([],A)),s}function w(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?1.5:r,o=t.pitch,a=void 0===o?0:o,A=t.nearZMultiplier,s=void 0===A?1:A,c=t.farZMultiplier,u=void 0===c?1:c,l=a*p,g=Math.atan(.5/i),f=Math.sin(g)*i/Math.sin(Math.min(Math.max(Math.PI/2-l-g,.01),Math.PI-.01));return{fov:2*g,aspect:e/n,focalDistance:i,near:s,far:(Math.sin(l)*f+i)*u}}function S(t){var e=t.width,n=t.height,r=t.pitch,i=w({width:e,height:n,altitude:t.altitude,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=i.fov,a=i.aspect,A=i.near,s=i.far;return l.j([],o,a,A,s)}function R(t,e){var n=Object(i.a)(t,3),r=n[0],o=n[1],a=n[2],A=void 0===a?0:a;return h(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(A)),s(e,[r,o,A,1])}function U(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(i.a)(t,3),o=r[0],a=r[1],A=r[2];if(h(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(A)){var c=s(e,[o,a,A,1]);return c}var u=s(e,[o,a,0,1]),l=s(e,[o,a,1,1]),f=u[2],d=l[2],I=f===d?0:((n||0)-f)/(d-f);return g.c([],u,l,I)}function x(t){var e=t.width,n=t.height,r=t.bounds,o=t.minExtent,a=void 0===o?0:o,A=t.maxZoom,s=void 0===A?24:A,c=t.padding,u=void 0===c?0:c,l=t.offset,g=void 0===l?[0,0]:l,f=Object(i.a)(r,2),d=Object(i.a)(f[0],2),I=d[0],p=d[1],C=Object(i.a)(f[1],2),y=C[0],v=C[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else h(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var B=new D({width:e,height:n,longitude:0,latitude:0,zoom:0}),m=B.project([I,v]),b=B.project([y,p]),E=[Math.max(Math.abs(b[0]-m[0]),a),Math.max(Math.abs(b[1]-m[1]),a)],Q=[e-u.left-u.right-2*Math.abs(g[0]),n-u.top-u.bottom-2*Math.abs(g[1])];h(Q[0]>0&&Q[1]>0);var F=Q[0]/E[0],w=Q[1]/E[1],S=(u.right-u.left)/2/F,R=(u.bottom-u.top)/2/w,U=[(b[0]+m[0])/2+S,(b[1]+m[1])/2+R],x=B.unproject(U),k=Math.min(s,B.zoom+Math.log2(Math.abs(Math.min(F,w))));return h(Number.isFinite(k)),{longitude:x[0],latitude:x[1],zoom:k}}var k=Math.PI/180;function O(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width,o=t.height,a=t.unproject,A={targetZ:r},s=a([0,o],A),c=a([i,o],A),u=Math.atan(.5/t.altitude),l=(90-t.pitch)*k;return u>l-.01?(e=N(t,0,r),n=N(t,i,r)):(e=a([0,0],A),n=a([i,0],A)),[s,c,n,e]}function N(t,e,n){var r=t.pixelUnprojectionMatrix,i=s(r,[e,0,1,1]),o=s(r,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(o[2]-i[2]),A=m(g.c([],i,o,a));return A[2]=n,A}var D=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=e.width,r=e.height,i=e.latitude,a=void 0===i?0:i,A=e.longitude,s=void 0===A?0:A,c=e.zoom,u=void 0===c?0:c,l=e.pitch,g=void 0===l?0:l,f=e.bearing,h=void 0===f?0:f,d=e.altitude,I=void 0===d?1.5:d,p=e.nearZMultiplier,C=void 0===p?.02:p,v=e.farZMultiplier,m=void 0===v?1.01:v;Object(o.a)(this,t),n=n||1,r=r||1;var b=y(u);I=Math.max(.75,I);var Q=B([s,a]);Q[2]=0,this.projectionMatrix=S({width:n,height:r,pitch:g,altitude:I,nearZMultiplier:C,farZMultiplier:m}),this.viewMatrix=F({height:r,scale:b,center:Q,pitch:g,bearing:h,altitude:I}),this.width=n,this.height=r,this.scale=b,this.latitude=a,this.longitude=s,this.zoom=u,this.pitch=g,this.bearing=h,this.altitude=I,this.center=Q,this.distanceScales=E(this),this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(a.a)(t,[{key:"_initMatrices",value:function(){var t=this.width,e=this.height,n=this.projectionMatrix,r=this.viewMatrix,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.h(i,i,n),l.h(i,i,r),this.viewProjectionMatrix=i;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.o(o,o,[t/2,-e/2,1]),l.p(o,o,[1,-1,0]),l.h(o,o,i);var a=l.f([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&l.b(e.projectionMatrix,this.projectionMatrix)&&l.b(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=this.projectPosition(t),a=R(o,this.pixelProjectionMatrix),A=Object(i.a)(a,2),s=A[0],c=A[1],u=r?c:this.height-c;return 2===t.length?[s,u]:[s,u,a[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=e.targetZ,a=void 0===o?void 0:o,A=Object(i.a)(t,3),s=A[0],c=A[1],u=A[2],l=r?c:this.height-c,g=a&&a*this.distanceScales.unitsPerMeter[2],f=U([s,l,u],this.pixelUnprojectionMatrix,g),h=this.unprojectPosition(f),d=Object(i.a)(h,3),I=d[0],p=d[1],C=d[2];return Number.isFinite(u)?[I,p,C]:Number.isFinite(a)?[I,p,a]:[I,p]}},{key:"projectPosition",value:function(t){var e=B(t),n=Object(i.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=m(t),n=Object(i.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return B(t)}},{key:"unprojectFlat",value:function(t){return m(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=U(t.pos,this.pixelUnprojectionMatrix),r=B(e),i=g.a([],r,g.d([],n));return m(g.a([],this.center,i))}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=x(Object.assign({width:r,height:i,bounds:e},n)),a=o.longitude,A=o.latitude,s=o.zoom;return new t({width:r,height:i,longitude:a,latitude:A,zoom:s})}},{key:"getBounds",value:function(t){var e=this.getBoundingRegion(t),n=Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[0]}))));return[[n,Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))],[i,Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O(this,t.z||0)}}]),t}();function G(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,A=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s;(r<-180||r>180)&&(r=c(r+180,360)-180),(u<-180||u>180)&&(u=c(u+180,360)-180);var l=new D({width:e,height:n,longitude:r,latitude:i,zoom:o}),g=l.project([r,85.05113])[1],f=l.project([r,-85.05113])[1],h=0;return f-g<n&&(o+=Math.log2(n/(f-g)),g=(l=new D({width:e,height:n,longitude:r,latitude:i,zoom:o})).project([r,85.05113])[1],f=l.project([r,-85.05113])[1]),g>0?h=g:f<n&&(h=f-n),h&&(i=l.unproject([e/2,n/2+h])[1]),{width:e,height:n,longitude:r,latitude:i,zoom:o,pitch:A,bearing:u}}function _(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return M(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var T=["longitude","latitude","zoom"],j={curve:1.414,speed:1.2};function L(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={},o=Z(t,e,r),a=o.startZoom,A=o.startCenterXY,s=o.uDelta,c=o.w0,l=o.u1,f=o.S,h=o.rho,d=o.rho2,I=o.r0;if(l<.01){var p,C=_(T);try{for(C.s();!(p=C.n()).done;){var y=p.value,B=t[y],b=e[y];i[y]=u(B,b,n)}}catch(x){C.e(x)}finally{C.f()}return i}var E=n*f,Q=Math.cosh(I)/Math.cosh(I+h*E),F=c*((Math.cosh(I)*Math.tanh(I+h*E)-Math.sinh(I))/d)/l,w=1/Q,S=a+v(w),R=g.e([],s,F);g.a(R,R,A);var U=m(R);return i.longitude=U[0],i.latitude=U[1],i.zoom=S,i}function V(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r=Object.assign({},j,r),o=i.screenSpeed,a=i.speed,A=i.maxDuration,s=Z(t,e,r),c=s.S,u=s.rho,l=1e3*c;return n=Number.isFinite(o)?l/(o/u):l/a,Number.isFinite(A)&&n>A?0:n}function Z(t,e,n){var r=(n=Object.assign({},j,n)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=y(i),A=e.zoom,s=[e.longitude,e.latitude],c=y(A-i),u=B(o),l=B(s),f=g.f([],l,u),h=Math.max(t.width,t.height),d=h/c,I=g.b(f)*a,p=Math.max(I,.01),C=r*r,v=(d*d-h*h+C*C*p*p)/(2*h*C*p),m=(d*d-h*h-C*C*p*p)/(2*d*C*p),b=Math.log(Math.sqrt(v*v+1)-v),E=Math.log(Math.sqrt(m*m+1)-m);return{startZoom:i,startCenterXY:u,uDelta:f,w0:h,u1:I,S:(E-b)/r,rho:r,rho2:C,r0:b,r1:E}}n.d(e,"a",(function(){return D})),n.d(e,"e",(function(){return O})),n.d(e,"c",(function(){return x})),n.d(e,"m",(function(){return G})),n.d(e,"d",(function(){return L})),n.d(e,"g",(function(){return V})),n.d(e,"l",(function(){return B})),n.d(e,"p",(function(){return m})),n.d(e,"q",(function(){return R})),n.d(e,"n",(function(){return U})),n.d(e,"r",(function(){return y})),n.d(e,"o",(function(){return v})),n.d(e,"h",(function(){return b})),n.d(e,"f",(function(){return E})),n.d(e,"b",(function(){return Q})),n.d(e,"k",(function(){return F})),n.d(e,"i",(function(){return S})),n.d(e,"j",(function(){return w}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(3),i=n(2),o=n(37),a=[255,255,255],A=[0,0,-1],s=0,c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.color,i=void 0===n?a:n,c=e.intensity,u=void 0===c?1:c,l=e.direction,g=void 0===l?A:l,f=e._shadow,h=void 0!==f&&f;this.id=e.id||"directional-".concat(s++),this.color=i,this.intensity=u,this.type="directional",this.direction=new o.c(g).normalize().toArray(),this.shadow=h}return Object(i.a)(t,[{key:"getProjectedLight",value:function(){return this}}]),t}()},function(t,e,n){"use strict";var r=n(1),i=n(28),o=n(540),a=n(9),A=["xs","sm","md","lg","xl"];function s(t){var e=t.values,n=void 0===e?{xs:0,sm:600,md:960,lg:1280,xl:1920}:e,r=t.unit,o=void 0===r?"px":r,s=t.step,c=void 0===s?5:s,u=Object(i.a)(t,["values","unit","step"]);function l(t){var e="number"===typeof n[t]?n[t]:t;return"@media (min-width:".concat(e).concat(o,")")}function g(t,e){var r=A.indexOf(e);return r===A.length-1?l(t):"@media (min-width:".concat("number"===typeof n[t]?n[t]:t).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[A[r+1]]?n[A[r+1]]:e)-c/100).concat(o,")")}return Object(a.a)({keys:A,values:n,up:l,down:function(t){var e=A.indexOf(t)+1,r=n[A[e]];return e===A.length?l("xs"):"@media (max-width:".concat(("number"===typeof r&&e>0?r:t)-c/100).concat(o,")")},between:g,only:function(t){return g(t,t)},width:function(t){return n[t]}},u)}function c(t,e,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:e(2),paddingRight:e(2)},n,Object(r.a)({},t.up("sm"),Object(a.a)({paddingLeft:e(3),paddingRight:e(3)},n[t.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(t.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,t.up("sm"),{minHeight:64}),i)},n)}var u={black:"#000",white:"#fff"},l=n(145),g={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},f={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},h={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},d={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},I={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},p={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},C=n(77),y={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:u.white,default:l.a[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},v={text:{primary:u.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:l.a[800],default:"#303030"},action:{active:u.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function B(t,e,n,r){t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:"light"===e?t.light=Object(C.d)(t.main,r):"dark"===e&&(t.dark=Object(C.a)(t.main,1.5*r)))}function m(t){var e=t.primary,n=void 0===e?{light:g[300],main:g[500],dark:g[700]}:e,r=t.secondary,A=void 0===r?{light:f.A200,main:f.A400,dark:f.A700}:r,s=t.error,c=void 0===s?{light:h[300],main:h[500],dark:h[700]}:s,m=t.warning,b=void 0===m?{light:d[300],main:d[500],dark:d[700]}:m,E=t.info,Q=void 0===E?{light:I[300],main:I[500],dark:I[700]}:E,F=t.success,w=void 0===F?{light:p[300],main:p[500],dark:p[700]}:F,S=t.type,R=void 0===S?"light":S,U=t.contrastThreshold,x=void 0===U?3:U,k=t.tonalOffset,O=void 0===k?.2:k,N=Object(i.a)(t,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function D(t){if(!t)throw new TypeError("Material-UI: missing background argument in getContrastText(".concat(t,")."));return Object(C.c)(t,v.text.primary)>=x?v.text.primary:y.text.primary}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(t=Object(a.a)({},t)).main&&t[e]&&(t.main=t[e]),B(t,"light",n,O),B(t,"dark",r,O),t.contrastText||(t.contrastText=D(t.main)),t}var _={dark:v,light:y};return Object(o.a)(Object(a.a)({common:u,type:R,primary:G(n),secondary:G(A,"A400","A200","A700"),error:G(c),warning:G(b),info:G(Q),success:G(w),grey:l.a,contrastThreshold:x,getContrastText:D,augmentColor:G,tonalOffset:O},_[R]),N)}function b(t){return Math.round(1e5*t)/1e5}var E={textTransform:"uppercase"};function Q(t,e){var n="function"===typeof e?e(t):e,r=n.fontFamily,A=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,s=n.fontSize,c=void 0===s?14:s,u=n.fontWeightLight,l=void 0===u?300:u,g=n.fontWeightRegular,f=void 0===g?400:g,h=n.fontWeightMedium,d=void 0===h?500:h,I=n.fontWeightBold,p=void 0===I?700:I,C=n.htmlFontSize,y=void 0===C?16:C,v=n.allVariants,B=n.pxToRem,m=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var Q=c/14,F=B||function(t){return"".concat(t/y*Q,"rem")},w=function(t,e,n,r,i){return Object(a.a)({fontFamily:A,fontWeight:t,fontSize:F(e),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===A?{letterSpacing:"".concat(b(r/e),"em")}:{},{},i,{},v)},S={h1:w(l,96,1.167,-1.5),h2:w(l,60,1.2,-.5),h3:w(f,48,1.167,0),h4:w(f,34,1.235,.25),h5:w(f,24,1.334,0),h6:w(d,20,1.6,.15),subtitle1:w(f,16,1.75,.15),subtitle2:w(d,14,1.57,.1),body1:w(f,16,1.5,.15),body2:w(f,14,1.43,.15),button:w(d,14,1.75,.4,E),caption:w(f,12,1.66,.4),overline:w(f,12,2.66,1,E)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:F,round:b,fontFamily:A,fontSize:c,fontWeightLight:l,fontWeightRegular:f,fontWeightMedium:d,fontWeightBold:p},S),m,{clone:!1})}function F(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var w=["none",F(0,2,1,-1,0,1,1,0,0,1,3,0),F(0,3,1,-2,0,2,2,0,0,1,5,0),F(0,3,3,-2,0,3,4,0,0,1,8,0),F(0,2,4,-1,0,4,5,0,0,1,10,0),F(0,3,5,-1,0,5,8,0,0,1,14,0),F(0,3,5,-1,0,6,10,0,0,1,18,0),F(0,4,5,-2,0,7,10,1,0,2,16,1),F(0,5,5,-3,0,8,10,1,0,3,14,2),F(0,5,6,-3,0,9,12,1,0,3,16,2),F(0,6,6,-3,0,10,14,1,0,4,18,3),F(0,6,7,-4,0,11,15,1,0,4,20,3),F(0,7,8,-4,0,12,17,2,0,5,22,4),F(0,7,8,-4,0,13,19,2,0,5,24,4),F(0,7,9,-4,0,14,21,2,0,5,26,4),F(0,8,9,-5,0,15,22,2,0,6,28,5),F(0,8,10,-5,0,16,24,2,0,6,30,5),F(0,8,11,-5,0,17,26,2,0,6,32,5),F(0,9,11,-5,0,18,28,2,0,7,34,6),F(0,9,12,-6,0,19,29,2,0,7,36,6),F(0,10,13,-6,0,20,31,3,0,8,38,7),F(0,10,13,-6,0,21,33,3,0,8,40,7),F(0,10,14,-6,0,22,35,3,0,8,42,7),F(0,11,14,-7,0,23,36,3,0,9,44,8),F(0,11,15,-7,0,24,38,3,0,9,46,8)],S={borderRadius:4},R=n(904);function U(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;var e=Object(R.a)({spacing:t}),n=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return 0===n.length?e(1):1===n.length?e(n[0]):n.map((function(t){var n=e(t);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return t}}),n.mui=!0,n}var x=n(351),k=n(320);e.a=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.breakpoints,n=void 0===e?{}:e,r=t.mixins,a=void 0===r?{}:r,A=t.palette,u=void 0===A?{}:A,l=t.spacing,g=t.typography,f=void 0===g?{}:g,h=Object(i.a)(t,["breakpoints","mixins","palette","spacing","typography"]),d=m(u),I=s(n),p=U(l),C=Object(o.a)({breakpoints:I,direction:"ltr",mixins:c(I,p,a),overrides:{},palette:d,props:{},shadows:w,typography:Q(d,f),spacing:p,shape:S,transitions:x.a,zIndex:k.a},h),y=arguments.length,v=new Array(y>1?y-1:0),B=1;B<y;B++)v[B-1]=arguments[B];return C=v.reduce((function(t,e){return Object(o.a)(t,e)}),C)}},function(t,e,n){"use strict";t.exports=n(527)},function(t,e,n){"use strict";function r(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(1188),o=(r=i)&&r.__esModule?r:{default:r};e.default=o.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},,function(t,e){function n(e){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){"use strict";var r=n(5),i=n.n(r),o=n(18),a=n(21),A=n(16),s=n(26),c=n(463),u=n.n(c),l=n(352),g=n(185),f=n(140),h={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function d(t){return"number"===typeof t}function I(t){return t&&!0===t.constructor.prototype.isBigNumber||!1}function p(t){return t&&"object"===typeof t&&!0===Object.getPrototypeOf(t).isComplex||!1}function C(t){return t&&"object"===typeof t&&!0===Object.getPrototypeOf(t).isFraction||!1}function y(t){return t&&!0===t.constructor.prototype.isUnit||!1}function v(t){return"string"===typeof t}var B=Array.isArray;function m(t){return t&&!0===t.constructor.prototype.isMatrix||!1}function b(t){return Array.isArray(t)||m(t)}function E(t){return t&&t.isDenseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function Q(t){return t&&t.isSparseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function F(t){return t&&!0===t.constructor.prototype.isRange||!1}function w(t){return t&&!0===t.constructor.prototype.isIndex||!1}function S(t){return"boolean"===typeof t}function R(t){return t&&!0===t.constructor.prototype.isResultSet||!1}function U(t){return t&&!0===t.constructor.prototype.isHelp||!1}function x(t){return"function"===typeof t}function k(t){return t instanceof Date}function O(t){return t instanceof RegExp}function N(t){return!(!t||"object"!==typeof t||t.constructor!==Object||p(t)||C(t))}function D(t){return null===t}function G(t){return void 0===t}function _(t){return t&&!0===t.isAccessorNode&&!0===t.constructor.prototype.isNode||!1}function M(t){return t&&!0===t.isArrayNode&&!0===t.constructor.prototype.isNode||!1}function T(t){return t&&!0===t.isAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function j(t){return t&&!0===t.isBlockNode&&!0===t.constructor.prototype.isNode||!1}function L(t){return t&&!0===t.isConditionalNode&&!0===t.constructor.prototype.isNode||!1}function V(t){return t&&!0===t.isConstantNode&&!0===t.constructor.prototype.isNode||!1}function Z(t){return t&&!0===t.isFunctionAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function P(t){return t&&!0===t.isFunctionNode&&!0===t.constructor.prototype.isNode||!1}function W(t){return t&&!0===t.isIndexNode&&!0===t.constructor.prototype.isNode||!1}function J(t){return t&&!0===t.isNode&&!0===t.constructor.prototype.isNode||!1}function H(t){return t&&!0===t.isObjectNode&&!0===t.constructor.prototype.isNode||!1}function Y(t){return t&&!0===t.isOperatorNode&&!0===t.constructor.prototype.isNode||!1}function X(t){return t&&!0===t.isParenthesisNode&&!0===t.constructor.prototype.isNode||!1}function z(t){return t&&!0===t.isRangeNode&&!0===t.constructor.prototype.isNode||!1}function K(t){return t&&!0===t.isSymbolNode&&!0===t.constructor.prototype.isNode||!1}function q(t){return t&&!0===t.constructor.prototype.isChain||!1}function $(t){var e=typeof t;return"object"===e?null===t?"null":Array.isArray(t)?"Array":t instanceof Date?"Date":t instanceof RegExp?"RegExp":I(t)?"BigNumber":p(t)?"Complex":C(t)?"Fraction":m(t)?"Matrix":y(t)?"Unit":w(t)?"Index":F(t)?"Range":R(t)?"ResultSet":J(t)?t.type:q(t)?"Chain":U(t)?"Help":"Object":"function"===e?"Function":e}function tt(t){var e=typeof t;if("number"===e||"string"===e||"boolean"===e||null===t||void 0===t)return t;if("function"===typeof t.clone)return t.clone();if(Array.isArray(t))return t.map((function(t){return tt(t)}));if(t instanceof Date)return new Date(t.valueOf());if(I(t))return t;if(t instanceof RegExp)throw new TypeError("Cannot clone "+t);return et(t,tt)}function et(t,e){var n={};for(var r in t)it(t,r)&&(n[r]=e(t[r]));return n}function nt(t,e){for(var n in e)it(e,n)&&(t[n]=e[n]);return t}function rt(t,e){var n,r,i;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(r=0,i=t.length;r<i;r++)if(!rt(t[r],e[r]))return!1;return!0}if("function"===typeof t)return t===e;if(t instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(n in t)if(!(n in e)||!rt(t[n],e[n]))return!1;for(n in e)if(!(n in t)||!rt(t[n],e[n]))return!1;return!0}return t===e}function it(t,e){return t&&Object.hasOwnProperty.call(t,e)}var ot=["Matrix","Array"],at=["number","BigNumber","Fraction"];function At(){return(At=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var st=function(t){if(t)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(h)};function ct(t){return"boolean"===typeof t||!!isFinite(t)&&t===Math.round(t)}At(st,h,{MATRIX_OPTIONS:ot,NUMBER_OPTIONS:at});var ut=Math.sign||function(t){return t>0?1:t<0?-1:0},lt=Math.log2||function(t){return Math.log(t)/Math.LN2},gt=Math.log10||function(t){return Math.log(t)/Math.LN10},ft=(Math.log1p,Math.cbrt||function(t){if(0===t)return t;var e,n=t<0;return n&&(t=-t),e=isFinite(t)?(t/((e=Math.exp(Math.log(t)/3))*e)+2*e)/3:t,n?-e:e}),ht=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function dt(t,e,n){var r={2:"0b",8:"0o",16:"0x"}[e],i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ct(n))throw new Error("size must be an integer");if(t>Math.pow(2,n-1)-1||t<-Math.pow(2,n-1))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!ct(t))throw new Error("Value must be an integer");t<0&&(t+=Math.pow(2,n)),i="i".concat(n)}var o="";return t<0&&(t=-t,o="-"),"".concat(o).concat(r).concat(t.toString(e)).concat(i)}function It(t,e){if("function"===typeof e)return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var n,r,i="auto";if(e&&(e.notation&&(i=e.notation),d(e)?n=e:d(e.precision)&&(n=e.precision),e.wordSize&&"number"!==typeof(r=e.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return Ct(t,n);case"exponential":return yt(t,n);case"engineering":return function(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=vt(pt(t),e),r=n.exponent,i=n.coefficients,o=r%3===0?r:r<0?r-3-r%3:r-r%3;if(d(e))for(;e>i.length||r-o+1>i.length;)i.push(0);else for(var a=Math.abs(r-o)-(i.length-1),A=0;A<a;A++)i.push(0);var s=Math.abs(r-o),c=1;for(;s>0;)c++,s--;var u=i.slice(c).join(""),l=d(e)&&u.length||u.match(/[1-9]/)?"."+u:"",g=i.slice(0,c).join("")+l+"e"+(r>=0?"+":"")+o.toString();return n.sign+g}(t,n);case"bin":return dt(t,2,r);case"oct":return dt(t,8,r);case"hex":return dt(t,16,r);case"auto":return function(t,e,n){if(isNaN(t)||!isFinite(t))return String(t);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,o=pt(t),a=e?vt(o,e):o;if(a.exponent<r||a.exponent>=i)return yt(t,e);var A=a.coefficients,s=a.exponent;A.length<e&&(A=A.concat(Bt(e-A.length))),A=A.concat(Bt(s-A.length+1+(A.length<e?e-A.length:0))),A=Bt(-s).concat(A);var c=s>0?s:0;return c<A.length-1&&A.splice(c+1,0,"."),a.sign+A.join("")}(t,n,e&&e).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e}));default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function pt(t){var e=String(t).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var n=e[1],r=e[2],i=parseFloat(e[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var a=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===a.length&&(a.push(0),i++),{sign:n,coefficients:a,exponent:i}}function Ct(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=pt(t),r="number"===typeof e?vt(n,n.exponent+1+e):n,i=r.coefficients,o=r.exponent+1,a=o+(e||0);return i.length<a&&(i=i.concat(Bt(a-i.length))),o<0&&(i=Bt(1-o).concat(i),o=1),o<i.length&&i.splice(o,0,0===o?"0.":"."),r.sign+i.join("")}function yt(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=pt(t),r=e?vt(n,e):n,i=r.coefficients,o=r.exponent;i.length<e&&(i=i.concat(Bt(e-i.length)));var a=i.shift();return r.sign+a+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function vt(t,e){for(var n={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},r=n.coefficients;e<=0;)r.unshift(0),n.exponent++,e++;if(r.length>e&&r.splice(e,r.length-e)[0]>=5){var i=e-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),r[--i]++}return n}function Bt(t){for(var e=[],n=0;n<t;n++)e.push(0);return e}var mt=Number.EPSILON||2220446049250313e-31;function bt(t,e,n){if(null===n||void 0===n)return t===e;if(t===e)return!0;if(isNaN(t)||isNaN(e))return!1;if(isFinite(t)&&isFinite(e)){var r=Math.abs(t-e);return r<mt||r<=Math.max(Math.abs(t),Math.abs(e))*n}return!1}var Et=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},Qt=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},Ft=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},wt=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function St(t,e,n){var r=new(0,t.constructor)(2),i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ct(n))throw new Error("size must be an integer");if(t.greaterThan(r.pow(n-1).sub(1))||t.lessThan(r.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(n))),i="i".concat(n)}switch(e){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(e," not supported "))}}function Rt(t,e){if("function"===typeof e)return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var n,r,i="auto";if(void 0!==e&&(e.notation&&(i=e.notation),"number"===typeof e?n=e:e.precision&&(n=e.precision),e.wordSize&&"number"!==typeof(r=e.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return function(t,e){return t.toFixed(e)}(t,n);case"exponential":return Ut(t,n);case"engineering":return function(t,e){var n=t.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=t.mul(Math.pow(10,-r)),o=i.toPrecision(e);-1!==o.indexOf("e")&&(o=i.toString());return o+"e"+(n>=0?"+":"")+r.toString()}(t,n);case"bin":return St(t,2,r);case"oct":return St(t,8,r);case"hex":return St(t,16,r);case"auto":var o=e&&void 0!==e.lowerExp?e.lowerExp:-3,a=e&&void 0!==e.upperExp?e.upperExp:5;if(t.isZero())return"0";var A=t.toSignificantDigits(n),s=A.e;return(s>=o&&s<a?A.toFixed():Ut(t,n)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e}));default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ut(t,e){return void 0!==e?t.toExponential(e-1):t.toExponential()}function xt(t,e){var n=t.length-e.length,r=t.length;return t.substring(n,r)===e}function kt(t,e){return"number"===typeof t?It(t,e):I(t)?Rt(t,e):function(t){return t&&"object"===typeof t&&"number"===typeof t.s&&"number"===typeof t.n&&"number"===typeof t.d||!1}(t)?e&&"decimal"===e.fraction?t.toString():t.s*t.n+"/"+t.d:Array.isArray(t)?function t(e,n){if(Array.isArray(e)){for(var r="[",i=e.length,o=0;o<i;o++)0!==o&&(r+=", "),r+=t(e[o],n);return r+="]"}return kt(e,n)}(t,e):v(t)?'"'+t+'"':"function"===typeof t?t.syntax?String(t.syntax):"function":t&&"object"===typeof t?"function"===typeof t.format?t.format(e):t&&t.toString(e)!=={}.toString()?t.toString(e):"{"+Object.keys(t).map((function(n){return'"'+n+'": '+kt(t[n],e)})).join(", ")+"}":String(t)}function Ot(t,e,n){if(!(this instanceof Ot))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=(new Error).stack}function Nt(t,e,n){if(!(this instanceof Nt))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function Dt(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function Gt(t,e){if(0===e.length){if(Array.isArray(t))throw new Ot(t.length,0)}else!function t(e,n,r){var i,o=e.length;if(o!==n[r])throw new Ot(o,n[r]);if(r<n.length-1){var a=r+1;for(i=0;i<o;i++){var A=e[i];if(!Array.isArray(A))throw new Ot(n.length-1,n.length,"<");t(e[i],n,a)}}else for(i=0;i<o;i++)if(Array.isArray(e[i]))throw new Ot(n.length+1,n.length,">")}(t,e,0)}function _t(t,e){if(!d(t)||!ct(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"===typeof e&&t>=e)throw new Nt(t,e)}function Mt(t,e,n){if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new Error("Resizing to scalar is not supported");return e.forEach((function(t){if(!d(t)||!ct(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+kt(e)+")")})),function t(e,n,r,i){var o,a,A=e.length,s=n[r],c=Math.min(A,s);if(e.length=s,r<n.length-1){var u=r+1;for(o=0;o<c;o++)a=e[o],Array.isArray(a)||(a=[a],e[o]=a),t(a,n,u,i);for(o=c;o<s;o++)a=[],e[o]=a,t(a,n,u,i)}else{for(o=0;o<c;o++)for(;Array.isArray(e[o]);)e[o]=e[o][0];for(o=c;o<s;o++)e[o]=i}}(t,e,0,void 0!==n?n:0),t}function Tt(t,e){var n=Zt(t),r=n.length;if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new Ot(0,r,"!=");var i=Lt(e=jt(e,r));if(r!==i)throw new Ot(i,r,"!=");try{return function(t,e){for(var n,r=t,i=e.length-1;i>0;i--){var o=e[i];n=[];for(var a=r.length/o,A=0;A<a;A++)n.push(r.slice(A*o,(A+1)*o));r=n}return r}(n,e)}catch(o){if(o instanceof Ot)throw new Ot(i,r,"!=");throw o}}function jt(t,e){var n=Lt(t),r=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(e%n===0))throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-n);r[i]=-e/n}return r}function Lt(t){return t.reduce((function(t,e){return t*e}),1)}function Vt(t,e,n,r){var i=r||Dt(t);if(n)for(var o=0;o<n;o++)t=[t],i.unshift(1);for(t=function t(e,n,r){var i,o;if(Array.isArray(e)){var a=r+1;for(i=0,o=e.length;i<o;i++)e[i]=t(e[i],n,a)}else for(var A=r;A<n;A++)e=[e];return e}(t,e,0);i.length<e;)i.push(1);return t}function Zt(t){if(!Array.isArray(t))return t;var e=[];return t.forEach((function t(n){Array.isArray(n)?n.forEach(t):e.push(n)})),e}function Pt(t,e){for(var n,r=0,i=0;i<t.length;i++){var o=t[i],a=Array.isArray(o);if(0===i&&a&&(r=o.length),a&&o.length!==r)return;var A=a?Pt(o,e):e(o);if(void 0===n)n=A;else if(n!==A)return"mixed"}return n}function Wt(t,e,n,r){function i(r){var i=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r],o=t[i];void 0!==o&&(n[i]=o)}return n}(r,e.map(Jt));return function(t,e,n){if(!e.filter((function(t){return!function(t){return t&&"?"===t[0]}(t)})).every((function(t){return void 0!==n[t]}))){var r=e.filter((function(t){return void 0===n[t]}));throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map((function(t){return'"'.concat(t,'"')})).join(", "),"."))}}(t,e,r),n(i)}return i.isFactory=!0,i.fn=t,i.dependencies=e.slice().sort(),r&&(i.meta=r),i}function Jt(t){return t&&"?"===t[0]?t.slice(1):t}Ot.prototype=new RangeError,Ot.prototype.constructor=RangeError,Ot.prototype.name="DimensionError",Ot.prototype.isDimensionError=!0,Nt.prototype=new RangeError,Nt.prototype.constructor=RangeError,Nt.prototype.name="IndexError",Nt.prototype.isIndexError=!0;var Ht=n(93),Yt=n.n(Ht),Xt=Wt("Complex",[],(function(){return Yt.a.prototype.type="Complex",Yt.a.prototype.isComplex=!0,Yt.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Yt.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Yt.a.prototype.format=function(t){var e=this.im,n=this.re,r=It(this.re,t),i=It(this.im,t),o=d(t)?t:t?t.precision:null;if(null!==o){var a=Math.pow(10,-o);Math.abs(n/e)<a&&(n=0),Math.abs(e/n)<a&&(e=0)}return 0===e?r:0===n?1===e?"i":-1===e?"-i":i+"i":e<0?-1===e?r+" - i":r+" - "+i.substring(1)+"i":1===e?r+" + i":r+" + "+i+"i"},Yt.a.fromPolar=function(t){switch(arguments.length){case 1:var e=arguments[0];if("object"===typeof e)return Yt()(e);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(d(n)){if(y(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),d(r))return new Yt.a({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Yt.a.prototype.valueOf=Yt.a.prototype.toString,Yt.a.fromJSON=function(t){return new Yt.a(t)},Yt.a.compare=function(t,e){return t.re>e.re?1:t.re<e.re?-1:t.im>e.im?1:t.im<e.im?-1:0},Yt.a}),{isClass:!0});function zt(t){var e=0,n=1,r=Object.create(null),i=Object.create(null),o=0,a=function(t){var a=i[t];if(a&&(delete r[a],delete i[t],--e,n===a)){if(!e)return o=0,void(n=1);for(;!hasOwnProperty.call(r,++n););}};return t=Math.abs(t),{hit:function(A){var s=i[A],c=++o;if(r[c]=A,i[A]=c,!s){if(++e<=t)return;return A=r[n],a(A),A}if(delete r[s],n===s)for(;!hasOwnProperty.call(r,++n););},delete:a,clear:function(){e=o=0,n=1,r=Object.create(null),i=Object.create(null)}}}function Kt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.hasher,r=e.limit;return r=null==r?Number.POSITIVE_INFINITY:r,n=null==n?JSON.stringify:n,function e(){"object"!==typeof e.cache&&(e.cache={values:new Map,lru:zt(r||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=n(i);if(e.cache.values.has(a))return e.cache.lru.hit(a),e.cache.values.get(a);var A=t.apply(t,i);return e.cache.values.set(a,A),e.cache.values.delete(e.cache.lru.hit(a)),A}}Kt((function(t){return new t(1).exp()}),{hasher:$t}),Kt((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:$t});var qt=Kt((function(t){return t.acos(-1)}),{hasher:$t});Kt((function(t){return qt(t).times(2)}),{hasher:$t});function $t(t){return t[0].precision}Math.PI,Math.PI,Math.E;var te=n(217),ee=n.n(te),ne=Wt("BigNumber",["?on","config"],(function(t){var e=t.on,n=t.config,r=ee.a.clone({precision:n.precision,modulo:9});return r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(t){return new r(t.value)},e&&e("config",(function(t,e){t.precision!==e.precision&&r.config({precision:t.precision})})),r}),{isClass:!0}),re=Wt("Matrix",[],(function(){function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,e){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,e,n){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,e,n){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,e){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,e){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,e){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t}),{isClass:!0});ie("fineStructure",.0072973525693),ie("weakMixingAngle",.2229),ie("efimovFactor",22.7),ie("sackurTetrode",-1.16487052358);function ie(t,e){return Wt(t,["config","BigNumber"],(function(t){var n=t.config,r=t.BigNumber;return"BigNumber"===n.number?new r(e):e}))}var oe=n(188),ae=n.n(oe),Ae=Wt("Fraction",[],(function(){return ae.a.prototype.type="Fraction",ae.a.prototype.isFraction=!0,ae.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ae.a.fromJSON=function(t){return new ae.a(t)},ae.a}),{isClass:!0}),se=Wt("DenseMatrix",["Matrix"],(function(t){var e=t.Matrix;function n(t,e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(e&&!v(e))throw new Error("Invalid datatype: "+e);if(m(t))"DenseMatrix"===t.type?(this._data=tt(t._data),this._size=tt(t._size),this._datatype=e||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=e||t._datatype);else if(t&&B(t.data)&&B(t.size))this._data=t.data,this._size=t.size,Gt(this._data,this._size),this._datatype=e||t.datatype;else if(B(t))this._data=function t(e){for(var n=0,r=e.length;n<r;n++){var i=e[n];B(i)?e[n]=t(i):i&&!0===i.isMatrix&&(e[n]=t(i.valueOf()))}return e}(t),this._size=Dt(this._data),Gt(this._data,this._size),this._datatype=e;else{if(t)throw new TypeError("Unsupported type of data ("+$(t)+")");this._data=[],this._size=[0],this._datatype=e}}function r(t,e){if(!w(e))throw new TypeError("Invalid index");if(e.isScalar())return t.get(e.min());var r=e.size();if(r.length!==t._size.length)throw new Ot(r.length,t._size.length);for(var i=e.min(),o=e.max(),a=0,A=t._size.length;a<A;a++)_t(i[a],t._size[a]),_t(o[a],t._size[a]);return new n(function t(e,n,r,i){var o=i===r-1,a=n.dimension(i);return o?a.map((function(t){return _t(t,e.length),e[t]})).valueOf():a.map((function(o){_t(o,e.length);var a=e[o];return t(a,n,r,i+1)})).valueOf()}(t._data,e,r.length,0),t._datatype)}function i(t,e,n,r){if(!e||!0!==e.isIndex)throw new TypeError("Invalid index");var i,o=e.size(),A=e.isScalar();if(m(n)?(i=n.size(),n=n.valueOf()):i=Dt(n),A){if(0!==i.length)throw new TypeError("Scalar expected");t.set(e.min(),n,r)}else{if(o.length<t._size.length)throw new Ot(o.length,t._size.length,"<");if(i.length<o.length){for(var s=0,c=0;1===o[s]&&1===i[s];)s++;for(;1===o[s];)c++,s++;n=Vt(n,o.length,c,i)}if(!rt(o,i))throw new Ot(o,i,">");a(t,e.max().map((function(t){return t+1})),r);var u=o.length;!function t(e,n,r,i,o){var a=o===i-1,A=n.dimension(o);a?A.forEach((function(t,n){_t(t),e[t]=r[n[0]]})):A.forEach((function(a,A){_t(a),t(e[a],n,r[A[0]],i,o+1)}))}(t._data,e,n,u,0)}return t}function o(t,e,n){if(0===e.length){for(var r=t._data;B(r);)r=r[0];return r}return t._size=e.slice(0),t._data=Mt(t._data,t._size,n),t}function a(t,e,n){for(var r=t._size.slice(0),i=!1;r.length<e.length;)r.push(0),i=!0;for(var a=0,A=e.length;a<A;a++)e[a]>r[a]&&(r[a]=e[a],i=!0);i&&o(t,r,n)}return n.prototype=new e,n.prototype.createDenseMatrix=function(t,e){return new n(t,e)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Pt(this._data,$)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(t,e){return new n(t,e)},n.prototype.subset=function(t,e,n){switch(arguments.length){case 1:return r(this,t);case 2:case 3:return i(this,t,e,n);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(t){if(!B(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Ot(t.length,this._size.length);for(var e=0;e<t.length;e++)_t(t[e],this._size[e]);for(var n=this._data,r=0,i=t.length;r<i;r++){var o=t[r];_t(o,n.length),n=n[o]}return n},n.prototype.set=function(t,e,n){if(!B(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new Ot(t.length,this._size.length,"<");var r,i,o;a(this,t.map((function(t){return t+1})),n);var A=this._data;for(r=0,i=t.length-1;r<i;r++)_t(o=t[r],A.length),A=A[o];return _t(o=t[t.length-1],A.length),A[o]=e,this},n.prototype.resize=function(t,e,n){if(!b(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map((function(t){return Array.isArray(t)&&1===t.length?t[0]:t}));return o(n?this.clone():this,r,e)},n.prototype.reshape=function(t,e){var n=e?this.clone():this;n._data=Tt(n._data,t);var r=n._size.reduce((function(t,e){return t*e}));return n._size=jt(t,r),n},n.prototype.clone=function(){return new n({data:tt(this._data),size:tt(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(t){var e=this,r=function n(r,i){return B(r)?r.map((function(t,e){return n(t,i.concat(e))})):t(r,i,e)}(this._data,[]);return new n(r,void 0!==this._datatype?Pt(r,$):void 0)},n.prototype.forEach=function(t){var e=this;!function n(r,i){B(r)?r.forEach((function(t,e){n(t,i.concat(e))})):t(r,i,e)}(this._data,[])},n.prototype.toArray=function(){return tt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(t){return kt(this._data,t)},n.prototype.toString=function(){return kt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(t){if(t){if(I(t)&&(t=t.toNumber()),!d(t)||!ct(t))throw new TypeError("The parameter k must be an integer number")}else t=0;for(var e=t>0?t:0,r=t<0?-t:0,i=this._size[0],o=this._size[1],a=Math.min(i-r,o-e),A=[],s=0;s<a;s++)A[s]=this._data[s+r][s+e];return new n({data:A,size:[a],datatype:this._datatype})},n.diagonal=function(t,e,r,i){if(!B(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(I(t)&&(t=t.toNumber()),!d(t)||!ct(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(I(r)&&(r=r.toNumber()),!d(r)||!ct(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var o,a=r>0?r:0,A=r<0?-r:0,s=t[0],c=t[1],u=Math.min(s-A,c-a);if(B(e)){if(e.length!==u)throw new Error("Invalid value array length");o=function(t){return e[t]}}else if(m(e)){var l=e.size();if(1!==l.length||l[0]!==u)throw new Error("Invalid matrix length");o=function(t){return e.get([t])}}else o=function(){return e};i||(i=I(o(0))?o(0).mul(0):0);var g=[];if(t.length>0){g=Mt(g,t,i);for(var f=0;f<u;f++)g[f+A][f+a]=o(f)}return new n({data:g,size:[s,c]})},n.fromJSON=function(t){return new n(t)},n.prototype.swapRows=function(t,e){if(!d(t)||!ct(t)||!d(e)||!ct(e))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return _t(t,this._size[0]),_t(e,this._size[0]),n._swapRows(t,e,this._data),this},n._swapRows=function(t,e,n){var r=n[t];n[t]=n[e],n[e]=r},n}),{isClass:!0}),ce=n(355),ue=n.n(ce),le=function(){return le=ue.a.create,ue.a},ge=Wt("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var e=t.BigNumber,n=t.Complex,r=t.DenseMatrix,i=t.Fraction,o=le();return o.types=[{name:"number",test:d},{name:"Complex",test:p},{name:"BigNumber",test:I},{name:"Fraction",test:C},{name:"Unit",test:y},{name:"string",test:v},{name:"Chain",test:q},{name:"Array",test:B},{name:"Matrix",test:m},{name:"DenseMatrix",test:E},{name:"SparseMatrix",test:Q},{name:"Range",test:F},{name:"Index",test:w},{name:"boolean",test:S},{name:"ResultSet",test:R},{name:"Help",test:U},{name:"function",test:x},{name:"Date",test:k},{name:"RegExp",test:O},{name:"null",test:D},{name:"undefined",test:G},{name:"AccessorNode",test:_},{name:"ArrayNode",test:M},{name:"AssignmentNode",test:T},{name:"BlockNode",test:j},{name:"ConditionalNode",test:L},{name:"ConstantNode",test:V},{name:"FunctionNode",test:P},{name:"FunctionAssignmentNode",test:Z},{name:"IndexNode",test:W},{name:"Node",test:J},{name:"ObjectNode",test:H},{name:"OperatorNode",test:Y},{name:"ParenthesisNode",test:X},{name:"RangeNode",test:z},{name:"SymbolNode",test:K},{name:"Object",test:N}],o.conversions=[{from:"number",to:"BigNumber",convert:function(t){if(e||fe(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new e(t)}},{from:"number",to:"Complex",convert:function(t){return n||he(t),new n(t,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(t){return n||he(t),new n(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return n||he(t),new n(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||de(t);var e=new i(t);if(e.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return e}},{from:"string",to:"number",convert:function(t){var e=Number(t);if(isNaN(e))throw new Error('Cannot convert "'+t+'" to a number');return e}},{from:"string",to:"BigNumber",convert:function(t){e||fe(t);try{return new e(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||de(t);try{return new i(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){n||he(t);try{return new n(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return e||fe(t),new e(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||de(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],o}));function fe(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function he(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function de(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function Ie(t,e,n){return t&&"function"===typeof t.map?t.map((function(t){return Ie(t,e,n)})):e(t)}var pe=Wt("isNumeric",["typed"],(function(t){return(0,t.typed)("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(t){return Ie(t,this)}})})),Ce="number";function ye(t){return t<0}function ve(t){return t>0}function Be(t){return 0===t}function me(t){return Number.isNaN(t)}ye.signature=Ce,ve.signature=Ce,Be.signature=Ce,me.signature=Ce;function be(t,e,n){if(null===n||void 0===n)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var r=t.minus(e).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return r.lte(i.times(n))}return!1}var Ee=Wt("equalScalar",["typed","config"],(function(t){var e=t.typed,n=t.config;return e("equalScalar",{"boolean, boolean":function(t,e){return t===e},"number, number":function(t,e){return bt(t,e,n.epsilon)},"BigNumber, BigNumber":function(t,e){return t.eq(e)||be(t,e,n.epsilon)},"Fraction, Fraction":function(t,e){return t.equals(e)},"Complex, Complex":function(t,e){return function(t,e,n){return bt(t.re,e.re,n)&&bt(t.im,e.im,n)}(t,e,n.epsilon)},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return this(t.value,e.value)}})})),Qe=(Wt("equalScalar",["typed","config"],(function(t){var e=t.typed,n=t.config;return e("equalScalar",{"number, number":function(t,e){return bt(t,e,n.epsilon)}})})),Wt("number",["typed"],(function(t){var e=(0,t.typed)("number",{"":function(){return 0},number:function(t){return t},string:function(t){if("NaN"===t)return NaN;var e=0,n=t.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);n&&(e=Number(n[2]),t=n[1]);var r=Number(t);if(isNaN(r))throw new SyntaxError('String "'+t+'" is no valid number');if(n){if(r>Math.pow(2,e)-1)throw new SyntaxError('String "'.concat(t,'" is out of range'));r>=Math.pow(2,e-1)&&(r-=Math.pow(2,e))}return r},BigNumber:function(t){return t.toNumber()},Fraction:function(t){return t.valueOf()},Unit:function(t){throw new Error("Second argument with valueless unit expected")},null:function(t){return 0},"Unit, string | Unit":function(t,e){return t.toNumber(e)},"Array | Matrix":function(t){return Ie(t,this)}});return e.fromJSON=function(t){return parseFloat(t.value)},e}))),Fe="number, number";function we(t){return Math.abs(t)}function Se(t,e){return t+e}function Re(t,e){return t*e}function Ue(t){return-t}function xe(t){return t}function ke(t){return ft(t)}function Oe(t){return Math.ceil(t)}function Ne(t){return t*t*t}function De(t){return Math.exp(t)}function Ge(t){return ht(t)}function _e(t,e){if(!ct(t)||!ct(e))throw new Error("Parameters in function gcd must be integer numbers");for(var n;0!==e;)n=t%e,t=e,e=n;return t<0?-t:t}function Me(t,e){if(!ct(t)||!ct(e))throw new Error("Parameters in function lcm must be integer numbers");if(0===t||0===e)return 0;for(var n,r=t*e;0!==e;)e=t%(n=e),t=n;return Math.abs(r/t)}function Te(t){return Math.log(t)}function je(t){return gt(t)}function Le(t){return lt(t)}function Ve(t,e){if(e>0)return t-e*Math.floor(t/e);if(0===e)return t;throw new Error("Cannot calculate mod for a negative divisor")}function Ze(t,e){var n=e<0;if(n&&(e=-e),0===e)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(0===t)return n?1/0:0;if(!isFinite(t))return n?0:t;var r=Math.pow(Math.abs(t),1/e);return r=t<0?-r:r,n?1/r:r}function Pe(t){return ut(t)}function We(t){return t*t}function Je(t,e){var n,r,i,o=0,a=1,A=1,s=0;if(!ct(t)||!ct(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)i=t-(r=Math.floor(t/e))*e,n=o,o=a-r*o,a=n,n=A,A=s-r*A,s=n,t=e,e=i;return t<0?[-t,-a,-s]:[t,t?a:0,s]}function He(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}function Ye(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(Ct(t,e))}we.signature="number",Se.signature=Fe,Re.signature=Fe,Ue.signature="number",xe.signature="number",ke.signature="number",Oe.signature="number",Ne.signature="number",De.signature="number",Ge.signature="number",_e.signature=Fe,Me.signature=Fe,Te.signature="number",je.signature="number",Le.signature="number",Ve.signature=Fe,Ze.signature=Fe,Pe.signature="number",We.signature="number",Je.signature=Fe,He.signature=Fe,Ye.signature=Fe;var Xe=Wt("multiplyScalar",["typed"],(function(t){return(0,t.typed)("multiplyScalar",{"number, number":Re,"Complex, Complex":function(t,e){return t.mul(e)},"BigNumber, BigNumber":function(t,e){return t.times(e)},"Fraction, Fraction":function(t,e){return t.mul(e)},"number | Fraction | BigNumber | Complex, Unit":function(t,e){var n=e.clone();return n.value=null===n.value?n._normalize(t):this(n.value,t),n},"Unit, number | Fraction | BigNumber | Complex":function(t,e){var n=t.clone();return n.value=null===n.value?n._normalize(e):this(n.value,e),n},"Unit, Unit":function(t,e){return t.multiply(e)}})}));var ze="number, number";function Ke(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function bitAnd");return t&e}function qe(t){if(!ct(t))throw new Error("Integer expected in function bitNot");return~t}function $e(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function bitOr");return t|e}function tn(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function bitXor");return t^e}function en(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function leftShift");return t<<e}function nn(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function rightArithShift");return t>>e}function rn(t,e){if(!ct(t)||!ct(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}Ke.signature=ze,qe.signature="number",$e.signature=ze,tn.signature=ze,en.signature=ze,nn.signature=ze,rn.signature=ze;function on(t){return!t}function an(t,e){return!(!t&&!e)}function An(t,e){return!!t!==!!e}function sn(t,e){return!(!t||!e)}on.signature="number",an.signature="number, number",An.signature="number, number",sn.signature="number, number";Math.pow(2,53);var cn=Wt("format",["typed"],(function(t){return(0,t.typed)("format",{any:kt,"any, Object | function | number":kt})}));Wt("oct",["typed","format"],(function(t){var e=t.typed,n=t.format;return e("oct",{"number | BigNumber":function(t){return n(t,{notation:"oct"})},"number | BigNumber, number":function(t,e){return n(t,{notation:"oct",wordSize:e})}})}));function un(t){return Et(t)}function ln(t){return Math.atan(1/t)}function gn(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function fn(t){return Math.asin(1/t)}function hn(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}function dn(t){return Math.acos(1/t)}function In(t){var e=1/t,n=Math.sqrt(e*e-1);return Math.log(n+e)}function pn(t){return Qt(t)}function Cn(t){return Ft(t)}function yn(t){return 1/Math.tan(t)}function vn(t){var e=Math.exp(2*t);return(e+1)/(e-1)}function Bn(t){return 1/Math.sin(t)}function mn(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*ut(t)}function bn(t){return 1/Math.cos(t)}function En(t){return 2/(Math.exp(t)+Math.exp(-t))}function Qn(t){return wt(t)}un.signature="number",ln.signature="number",gn.signature="number",fn.signature="number",hn.signature="number",dn.signature="number",In.signature="number",pn.signature="number",Cn.signature="number",yn.signature="number",vn.signature="number",Bn.signature="number",mn.signature="number",bn.signature="number",En.signature="number",Qn.signature="number";function Fn(t,e){if(e<t)return 1;if(e===t)return e;var n=e+t>>1;return Fn(t,n)*Fn(n+1,e)}function wn(t,e){if(!ct(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!ct(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(e>t)throw new TypeError("k must be less than or equal to n");var n=t-e;return e<n?Fn(n+1,t)/Fn(1,e):Fn(e+1,t)/Fn(1,n)}wn.signature="number, number";var Sn=n(356),Rn=n.n(Sn);Date.now();var Un=Wt("fraction",["typed","Fraction"],(function(t){var e=t.typed,n=t.Fraction;return e("fraction",{number:function(t){if(!isFinite(t)||isNaN(t))throw new Error(t+" cannot be represented as a fraction");return new n(t)},string:function(t){return new n(t)},"number, number":function(t,e){return new n(t,e)},null:function(t){return new n(0)},BigNumber:function(t){return new n(t.toString())},Fraction:function(t){return t},Object:function(t){return new n(t)},"Array | Matrix":function(t){return Ie(t,this)}})})),xn=Wt("unaryMinus",["typed"],(function(t){return(0,t.typed)("unaryMinus",{number:Ue,Complex:function(t){return t.neg()},BigNumber:function(t){return t.neg()},Fraction:function(t){return t.neg()},Unit:function(t){var e=t.clone();return e.value=this(t.value),e},"Array | Matrix":function(t){return Ie(t,this,!0)}})})),kn=Wt("addScalar",["typed"],(function(t){return(0,t.typed)("addScalar",{"number, number":Se,"Complex, Complex":function(t,e){return t.add(e)},"BigNumber, BigNumber":function(t,e){return t.plus(e)},"Fraction, Fraction":function(t,e){return t.add(e)},"Unit, Unit":function(t,e){if(null===t.value||void 0===t.value)throw new Error("Parameter x contains a unit with undefined value");if(null===e.value||void 0===e.value)throw new Error("Parameter y contains a unit with undefined value");if(!t.equalBase(e))throw new Error("Units do not match");var n=t.clone();return n.value=this(n.value,e.value),n.fixPrefix=!1,n}})})),On=Wt("conj",["typed"],(function(t){return(0,t.typed)("conj",{number:function(t){return t},BigNumber:function(t){return t},Complex:function(t){return t.conjugate()},"Array | Matrix":function(t){return Ie(t,this)}})}));Wt("bin",["typed","format"],(function(t){var e=t.typed,n=t.format;return e("bin",{"number | BigNumber":function(t){return n(t,{notation:"bin"})},"number | BigNumber, number":function(t,e){return n(t,{notation:"bin",wordSize:e})}})}));var Nn=Wt("SparseMatrix",["typed","equalScalar","Matrix"],(function(t){var e=t.typed,n=t.equalScalar,r=t.Matrix;function i(t,e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(e&&!v(e))throw new Error("Invalid datatype: "+e);if(m(t))!function(t,e,n){"SparseMatrix"===e.type?(t._values=e._values?tt(e._values):void 0,t._index=tt(e._index),t._ptr=tt(e._ptr),t._size=tt(e._size),t._datatype=n||e._datatype):o(t,e.valueOf(),n||e._datatype)}(this,t,e);else if(t&&B(t.index)&&B(t.ptr)&&B(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=e||t.datatype;else if(B(t))o(this,t,e);else{if(t)throw new TypeError("Unsupported type of data ("+$(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=e}}function o(t,r,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var o=r.length,a=0,A=n,s=0;if(v(i)&&(A=e.find(n,[i,i])||n,s=e.convert(0,i)),o>0){var c=0;do{t._ptr.push(t._index.length);for(var u=0;u<o;u++){var l=r[u];if(B(l)){if(0===c&&a<l.length&&(a=l.length),c<l.length){var g=l[c];A(g,s)||(t._values.push(g),t._index.push(u))}}else 0===c&&a<1&&(a=1),A(l,s)||(t._values.push(l),t._index.push(u))}c++}while(c<a)}t._ptr.push(t._index.length),t._size=[o,a]}function a(t,e){if(!w(e))throw new TypeError("Invalid index");if(e.isScalar())return t.get(e.min());var n,r,o,a,A=e.size();if(A.length!==t._size.length)throw new Ot(A.length,t._size.length);var s=e.min(),c=e.max();for(n=0,r=t._size.length;n<r;n++)_t(s[n],t._size[n]),_t(c[n],t._size[n]);var u=t._values,l=t._index,g=t._ptr,f=e.dimension(0),h=e.dimension(1),d=[],I=[];f.forEach((function(t,e){I[t]=e[0],d[t]=!0}));var p=u?[]:void 0,C=[],y=[];return h.forEach((function(t){for(y.push(C.length),o=g[t],a=g[t+1];o<a;o++)n=l[o],!0===d[n]&&(C.push(I[n]),p&&p.push(u[o]))})),y.push(C.length),new i({values:p,index:C,ptr:y,size:A,datatype:t._datatype})}function A(t,e,n,r){if(!e||!0!==e.isIndex)throw new TypeError("Invalid index");var i,o=e.size(),a=e.isScalar();if(m(n)?(i=n.size(),n=n.toArray()):i=Dt(n),a){if(0!==i.length)throw new TypeError("Scalar expected");t.set(e.min(),n,r)}else{if(1!==o.length&&2!==o.length)throw new Ot(o.length,t._size.length,"<");if(i.length<o.length){for(var A=0,s=0;1===o[A]&&1===i[A];)A++;for(;1===o[A];)s++,A++;n=Vt(n,o.length,s,i)}if(!rt(o,i))throw new Ot(o,i,">");for(var c=e.min()[0],u=e.min()[1],l=i[0],g=i[1],f=0;f<l;f++)for(var h=0;h<g;h++){var d=n[f][h];t.set([f+c,h+u],d,r)}}return t}function s(t,e,n,r){if(n-e===0)return n;for(var i=e;i<n;i++)if(r[i]===t)return i;return e}function c(t,e,n,r,i,o,a){i.splice(t,0,r),o.splice(t,0,e);for(var A=n+1;A<a.length;A++)a[A]++}function u(t,r,i,o){var a=o||0,A=n,s=0;v(t._datatype)&&(A=e.find(n,[t._datatype,t._datatype])||n,s=e.convert(0,t._datatype),a=e.convert(a,t._datatype));var c,u,l,g=!A(a,s),f=t._size[0],h=t._size[1];if(i>h){for(u=h;u<i;u++)if(t._ptr[u]=t._values.length,g)for(c=0;c<f;c++)t._values.push(a),t._index.push(c);t._ptr[i]=t._values.length}else i<h&&(t._ptr.splice(i+1,h-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(h=i,r>f){if(g){var d=0;for(u=0;u<h;u++){t._ptr[u]=t._ptr[u]+d,l=t._ptr[u+1]+d;var I=0;for(c=f;c<r;c++,I++)t._values.splice(l+I,0,a),t._index.splice(l+I,0,c),d++}t._ptr[h]=t._values.length}}else if(r<f){var p=0;for(u=0;u<h;u++){t._ptr[u]=t._ptr[u]-p;var C=t._ptr[u],y=t._ptr[u+1]-p;for(l=C;l<y;l++)(c=t._index[l])>r-1&&(t._values.splice(l,1),t._index.splice(l,1),p++)}t._ptr[u]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function l(t,e,n,r,i){var o,a,A=r[0],s=r[1],c=[];for(o=0;o<A;o++)for(c[o]=[],a=0;a<s;a++)c[o][a]=0;for(a=0;a<s;a++)for(var u=n[a],l=n[a+1],g=u;g<l;g++)c[o=e[g]][a]=t?i?tt(t[g]):t[g]:1;return c}return i.prototype=new r,i.prototype.createSparseMatrix=function(t,e){return new i(t,e)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Pt(this._values,$)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,e){return new i(t,e)},i.prototype.density=function(){var t=this._size[0],e=this._size[1];return 0!==t&&0!==e?this._index.length/(t*e):0},i.prototype.subset=function(t,e,n){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return a(this,t);case 2:case 3:return A(this,t,e,n);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!B(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Ot(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var e=t[0],n=t[1];_t(e,this._size[0]),_t(n,this._size[1]);var r=s(e,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===e?this._values[r]:0},i.prototype.set=function(t,r,i){if(!B(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Ot(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var o=t[0],a=t[1],A=this._size[0],l=this._size[1],g=n,f=0;v(this._datatype)&&(g=e.find(n,[this._datatype,this._datatype])||n,f=e.convert(0,this._datatype)),(o>A-1||a>l-1)&&(u(this,Math.max(o+1,A),Math.max(a+1,l),i),A=this._size[0],l=this._size[1]),_t(o,A),_t(a,l);var h=s(o,this._ptr[a],this._ptr[a+1],this._index);return h<this._ptr[a+1]&&this._index[h]===o?g(r,f)?function(t,e,n,r,i){n.splice(t,1),r.splice(t,1);for(var o=e+1;o<i.length;o++)i[o]--}(h,a,this._values,this._index,this._ptr):this._values[h]=r:c(h,o,a,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,e,n){if(!b(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map((function(t){return Array.isArray(t)&&1===t.length?t[0]:t}));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(t){if(!d(t)||!ct(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+kt(r)+")")})),u(n?this.clone():this,r[0],r[1],e)},i.prototype.reshape=function(t,e){if(!B(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach((function(e){if(!d(e)||!ct(e)||e<=-2||0===e)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+kt(t)+")")}));var n=this._size[0]*this._size[1];if(n!==(t=jt(t,n))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var i=[],o=0;o<r._ptr.length;o++)for(var a=0;a<r._ptr[o+1]-r._ptr[o];a++)i.push(o);for(var A=r._values.slice(),u=r._index.slice(),l=0;l<r._index.length;l++){var g=u[l],f=i[l],h=g*r._size[1]+f;i[l]=h%t[1],u[l]=Math.floor(h/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var I=0;I<r._ptr.length;I++)r._ptr[I]=0;for(var p=0;p<A.length;p++){var C=u[p],y=i[p],v=A[p];c(s(C,r._ptr[y],r._ptr[y+1],r._index),C,y,v,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?tt(this._values):void 0,index:tt(this._index),ptr:tt(this._ptr),size:tt(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(t,r,o,a,A,s,c){var u=[],l=[],g=[],f=n,h=0;v(t._datatype)&&(f=e.find(n,[t._datatype,t._datatype])||n,h=e.convert(0,t._datatype));for(var d=function(t,e,n){t=s(t,e,n),f(t,h)||(u.push(t),l.push(e))},I=a;I<=A;I++){g.push(u.length);var p=t._ptr[I],C=t._ptr[I+1];if(c)for(var y=p;y<C;y++){var B=t._index[y];B>=r&&B<=o&&d(t._values[y],B-r,I-a)}else{for(var m={},b=p;b<C;b++){var E=t._index[b];m[E]=t._values[b]}for(var Q=r;Q<=o;Q++){var F=Q in m?m[Q]:0;d(F,Q-r,I-a)}}}return g.push(u.length),new i({values:u,index:l,ptr:g,size:[o-r+1,A-a+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(e,n,r){return t(e,[n,r],o)}),r)},i.prototype.forEach=function(t,e){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],i=0;i<r;i++){var o=this._ptr[i],a=this._ptr[i+1];if(e)for(var A=o;A<a;A++){var s=this._index[A];t(this._values[A],[s,i],this)}else{for(var c={},u=o;u<a;u++){c[this._index[u]]=this._values[u]}for(var l=0;l<n;l++){t(l in c?c[l]:0,[l,i],this)}}}},i.prototype.toArray=function(){return l(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return l(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var e=this._size[0],n=this._size[1],r=this.density(),i="Sparse Matrix ["+kt(e,t)+" x "+kt(n,t)+"] density: "+kt(r,t)+"\n",o=0;o<n;o++)for(var a=this._ptr[o],A=this._ptr[o+1],s=a;s<A;s++){i+="\n    ("+kt(this._index[s],t)+", "+kt(o,t)+") ==> "+(this._values?kt(this._values[s],t):"X")}return i},i.prototype.toString=function(){return kt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(t){if(t){if(I(t)&&(t=t.toNumber()),!d(t)||!ct(t))throw new TypeError("The parameter k must be an integer number")}else t=0;var e=t>0?t:0,n=t<0?-t:0,r=this._size[0],o=this._size[1],a=Math.min(r-n,o-e),A=[],s=[],c=[];c[0]=0;for(var u=e;u<o&&A.length<a;u++)for(var l=this._ptr[u],g=this._ptr[u+1],f=l;f<g;f++){var h=this._index[f];if(h===u-e+n){A.push(this._values[f]),s[A.length-1]=h-n;break}}return c.push(A.length),new i({values:A,index:s,ptr:c,size:[a,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,o,a,A){if(!B(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(I(t)&&(t=t.toNumber()),!d(t)||!ct(t)||t<1)throw new Error("Size values must be positive integers");return t})),o){if(I(o)&&(o=o.toNumber()),!d(o)||!ct(o))throw new TypeError("The parameter k must be an integer number")}else o=0;var s=n,c=0;v(A)&&(s=e.find(n,[A,A])||n,c=e.convert(0,A));var u,l=o>0?o:0,g=o<0?-o:0,f=t[0],h=t[1],p=Math.min(f-g,h-l);if(B(r)){if(r.length!==p)throw new Error("Invalid value array length");u=function(t){return r[t]}}else if(m(r)){var C=r.size();if(1!==C.length||C[0]!==p)throw new Error("Invalid matrix length");u=function(t){return r.get([t])}}else u=function(){return r};for(var y=[],b=[],E=[],Q=0;Q<h;Q++){E.push(y.length);var F=Q-l;if(F>=0&&F<p){var w=u(F);s(w,c)||(b.push(F+g),y.push(w))}}return E.push(y.length),new i({values:y,index:b,ptr:E,size:[f,h]})},i.prototype.swapRows=function(t,e){if(!d(t)||!ct(t)||!d(e)||!ct(e))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return _t(t,this._size[0]),_t(e,this._size[0]),i._swapRows(t,e,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,e,n,r,i){for(var o=r[t],a=r[t+1],A=o;A<a;A++)i(n[A],e[A])},i._swapRows=function(t,e,n,r,i,o){for(var a=0;a<n;a++){var A=o[a],c=o[a+1],u=s(t,A,c,i),l=s(e,A,c,i);if(u<c&&l<c&&i[u]===t&&i[l]===e){if(r){var g=r[u];r[u]=r[l],r[l]=g}}else if(u<c&&i[u]===t&&(l>=c||i[l]!==e)){var f=r?r[u]:void 0;i.splice(l,0,e),r&&r.splice(l,0,f),i.splice(l<=u?u+1:u,1),r&&r.splice(l<=u?u+1:u,1)}else if(l<c&&i[l]===e&&(u>=c||i[u]!==t)){var h=r?r[l]:void 0;i.splice(u,0,t),r&&r.splice(u,0,h),i.splice(u<=l?l+1:l,1),r&&r.splice(u<=l?l+1:l,1)}}},i}),{isClass:!0}),Dn=Wt("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],(function(t){var e=t.typed,n=(t.Matrix,t.DenseMatrix),r=t.SparseMatrix;return e("matrix",{"":function(){return i([])},string:function(t){return i([],t)},"string, string":function(t,e){return i([],t,e)},Array:function(t){return i(t)},Matrix:function(t){return i(t,t.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(t,e,i){if("dense"===e||"default"===e||void 0===e)return new n(t,i);if("sparse"===e)return new r(t,i);throw new TypeError("Unknown matrix type "+JSON.stringify(e)+".")}})),Gn=Wt("algorithm01",["typed"],(function(t){var e=t.typed;return function(t,n,r,i){var o=t._data,a=t._size,A=t._datatype,s=n._values,c=n._index,u=n._ptr,l=n._size,g=n._datatype;if(a.length!==l.length)throw new Ot(a.length,l.length);if(a[0]!==l[0]||a[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h,d=a[0],I=a[1],p="string"===typeof A&&A===g?A:void 0,C=p?e.find(r,[p,p]):r,y=[];for(f=0;f<d;f++)y[f]=[];var v=[],B=[];for(h=0;h<I;h++){for(var m=h+1,b=u[h],E=u[h+1],Q=b;Q<E;Q++)v[f=c[Q]]=i?C(s[Q],o[f][h]):C(o[f][h],s[Q]),B[f]=m;for(f=0;f<d;f++)B[f]===m?y[f][h]=v[f]:y[f][h]=o[f][h]}return t.createDenseMatrix({data:y,size:[d,I],datatype:p})}})),_n=Wt("algorithm10",["typed","DenseMatrix"],(function(t){var e=t.typed,n=t.DenseMatrix;return function(t,r,i,o){var a=t._values,A=t._index,s=t._ptr,c=t._size,u=t._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,g=c[0],f=c[1],h=i;"string"===typeof u&&(l=u,r=e.convert(r,l),h=e.find(i,[l,l]));for(var d=[],I=[],p=[],C=0;C<f;C++){for(var y=C+1,v=s[C],B=s[C+1],m=v;m<B;m++){var b=A[m];I[b]=a[m],p[b]=y}for(var E=0;E<g;E++)0===C&&(d[E]=[]),p[E]===y?d[E][C]=o?h(r,I[E]):h(I[E],r):d[E][C]=r}return new n({data:d,size:[g,f],datatype:l})}})),Mn=Wt("algorithm13",["typed"],(function(t){var e=t.typed;return function(t,n,r){var i,o=t._data,a=t._size,A=t._datatype,s=n._data,c=n._size,u=n._datatype,l=[];if(a.length!==c.length)throw new Ot(a.length,c.length);for(var g=0;g<a.length;g++){if(a[g]!==c[g])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+c+")");l[g]=a[g]}var f=r;"string"===typeof A&&A===u&&(i=A,f=e.find(r,[i,i]));var h=l.length>0?function t(e,n,r,i,o,a){var A=[];if(n===r.length-1)for(var s=0;s<i;s++)A[s]=e(o[s],a[s]);else for(var c=0;c<i;c++)A[c]=t(e,n+1,r,r[n+1],o[c],a[c]);return A}(f,0,l,l[0],o,s):[];return t.createDenseMatrix({data:h,size:l,datatype:i})}})),Tn=Wt("algorithm14",["typed"],(function(t){var e=t.typed;return function(t,n,r,i){var o,a=t._data,A=t._size,s=t._datatype,c=r;"string"===typeof s&&(o=s,n=e.convert(n,o),c=e.find(r,[o,o]));var u=A.length>0?function t(e,n,r,i,o,a,A){var s=[];if(n===r.length-1)for(var c=0;c<i;c++)s[c]=A?e(a,o[c]):e(o[c],a);else for(var u=0;u<i;u++)s[u]=t(e,n+1,r,r[n+1],o[u],a,A);return s}(c,0,A,A[0],a,n,i):[];return t.createDenseMatrix({data:u,size:tt(A),datatype:o})}})),jn=Wt("algorithm03",["typed"],(function(t){var e=t.typed;return function(t,n,r,i){var o=t._data,a=t._size,A=t._datatype,s=n._values,c=n._index,u=n._ptr,l=n._size,g=n._datatype;if(a.length!==l.length)throw new Ot(a.length,l.length);if(a[0]!==l[0]||a[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var f,h=a[0],d=a[1],I=0,p=r;"string"===typeof A&&A===g&&(f=A,I=e.convert(0,f),p=e.find(r,[f,f]));for(var C=[],y=0;y<h;y++)C[y]=[];for(var v=[],B=[],m=0;m<d;m++){for(var b=m+1,E=u[m],Q=u[m+1],F=E;F<Q;F++){var w=c[F];v[w]=i?p(s[F],o[w][m]):p(o[w][m],s[F]),B[w]=b}for(var S=0;S<h;S++)B[S]===b?C[S][m]=v[S]:C[S][m]=i?p(I,o[S][m]):p(o[S][m],I)}return t.createDenseMatrix({data:C,size:[h,d],datatype:f})}})),Ln=Wt("algorithm05",["typed","equalScalar"],(function(t){var e=t.typed,n=t.equalScalar;return function(t,r,i){var o=t._values,a=t._index,A=t._ptr,s=t._size,c=t._datatype,u=r._values,l=r._index,g=r._ptr,f=r._size,h=r._datatype;if(s.length!==f.length)throw new Ot(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");var d,I=s[0],p=s[1],C=n,y=0,v=i;"string"===typeof c&&c===h&&(d=c,C=e.find(n,[d,d]),y=e.convert(0,d),v=e.find(i,[d,d]));var B,m,b,E,Q=o&&u?[]:void 0,F=[],w=[],S=Q?[]:void 0,R=Q?[]:void 0,U=[],x=[];for(m=0;m<p;m++){w[m]=F.length;var k=m+1;for(b=A[m],E=A[m+1];b<E;b++)B=a[b],F.push(B),U[B]=k,S&&(S[B]=o[b]);for(b=g[m],E=g[m+1];b<E;b++)U[B=l[b]]!==k&&F.push(B),x[B]=k,R&&(R[B]=u[b]);if(Q)for(b=w[m];b<F.length;){var O=U[B=F[b]],N=x[B];if(O===k||N===k){var D=v(O===k?S[B]:y,N===k?R[B]:y);C(D,y)?F.splice(b,1):(Q.push(D),b++)}}}return w[p]=F.length,t.createSparseMatrix({values:Q,index:F,ptr:w,size:[I,p],datatype:d})}})),Vn=Wt("algorithm11",["typed","equalScalar"],(function(t){var e=t.typed,n=t.equalScalar;return function(t,r,i,o){var a=t._values,A=t._index,s=t._ptr,c=t._size,u=t._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,g=c[0],f=c[1],h=n,d=0,I=i;"string"===typeof u&&(l=u,h=e.find(n,[l,l]),d=e.convert(0,l),r=e.convert(r,l),I=e.find(i,[l,l]));for(var p=[],C=[],y=[],v=0;v<f;v++){y[v]=C.length;for(var B=s[v],m=s[v+1],b=B;b<m;b++){var E=A[b],Q=o?I(r,a[b]):I(a[b],r);h(Q,d)||(C.push(E),p.push(Q))}}return y[f]=C.length,t.createSparseMatrix({values:p,index:C,ptr:y,size:[g,f],datatype:l})}})),Zn=Wt("algorithm12",["typed","DenseMatrix"],(function(t){var e=t.typed,n=t.DenseMatrix;return function(t,r,i,o){var a=t._values,A=t._index,s=t._ptr,c=t._size,u=t._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,g=c[0],f=c[1],h=i;"string"===typeof u&&(l=u,r=e.convert(r,l),h=e.find(i,[l,l]));for(var d=[],I=[],p=[],C=0;C<f;C++){for(var y=C+1,v=s[C],B=s[C+1],m=v;m<B;m++){var b=A[m];I[b]=a[m],p[b]=y}for(var E=0;E<g;E++)0===C&&(d[E]=[]),p[E]===y?d[E][C]=o?h(r,I[E]):h(I[E],r):d[E][C]=o?h(r,0):h(0,r)}return new n({data:d,size:[g,f],datatype:l})}})),Pn=Wt("algorithm07",["typed","DenseMatrix"],(function(t){var e=t.typed,n=t.DenseMatrix;return function(t,i,o){var a=t._size,A=t._datatype,s=i._size,c=i._datatype;if(a.length!==s.length)throw new Ot(a.length,s.length);if(a[0]!==s[0]||a[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+s+")");var u,l,g,f=a[0],h=a[1],d=0,I=o;"string"===typeof A&&A===c&&(u=A,d=e.convert(0,u),I=e.find(o,[u,u]));var p=[];for(l=0;l<f;l++)p[l]=[];var C=[],y=[],v=[],B=[];for(g=0;g<h;g++){var m=g+1;for(r(t,g,v,C,m),r(i,g,B,y,m),l=0;l<f;l++){var b=v[l]===m?C[l]:d,E=B[l]===m?y[l]:d;p[l][g]=I(b,E)}}return new n({data:p,size:[f,h],datatype:u})};function r(t,e,n,r,i){for(var o=t._values,a=t._index,A=t._ptr,s=A[e],c=A[e+1];s<c;s++){var u=a[s];n[u]=i,r[u]=o[s]}}}));var Wn=Wt("identity",["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(function(t){var e=t.typed,n=t.config,r=t.matrix,i=t.BigNumber,o=t.DenseMatrix,a=t.SparseMatrix;return e("identity",{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(t){return r(t)},"number | BigNumber":function(t){return s(t,t,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, string":function(t,e){return s(t,t,e)},"number | BigNumber, number | BigNumber":function(t,e){return s(t,e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(t,e,n){return s(t,e,n)},Array:function(t){return A(t)},"Array, string":function(t,e){return A(t,e)},Matrix:function(t){return A(t.valueOf(),t.storage())},"Matrix, string":function(t,e){return A(t.valueOf(),e)}});function A(t,e){switch(t.length){case 0:return e?r(e):[];case 1:return s(t[0],t[0],e);case 2:return s(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function s(t,e,n){var r=I(t)||I(e)?i:null;if(I(t)&&(t=t.toNumber()),I(e)&&(e=e.toNumber()),!ct(t)||t<1)throw new Error("Parameters in function identity must be positive integers");if(!ct(e)||e<1)throw new Error("Parameters in function identity must be positive integers");var A=r?new i(1):1,s=r?new r(0):0,c=[t,e];if(n){if("sparse"===n)return a.diagonal(c,A,0,s);if("dense"===n)return o.diagonal(c,A,0,s);throw new TypeError('Unknown matrix type "'.concat(n,'"'))}for(var u=Mt([],c,s),l=t<e?t:e,g=0;g<l;g++)u[g][g]=A;return u}}));function Jn(){throw new Error('No "bignumber" implementation available')}function Hn(){throw new Error('No "fraction" implementation available')}function Yn(){throw new Error('No "matrix" implementation available')}var Xn=Wt("size",["typed","config","?matrix"],(function(t){var e=t.typed,n=t.config,r=t.matrix;return e("size",{Matrix:function(t){return t.create(t.size())},Array:Dt,string:function(t){return"Array"===n.matrix?[t.length]:r([t.length])},"number | Complex | BigNumber | Unit | boolean | null":function(t){return"Array"===n.matrix?[]:r?r([]):Yn()}})}));var zn=Wt("zeros",["typed","config","matrix","BigNumber"],(function(t){var e=t.typed,n=t.config,r=t.matrix,i=t.BigNumber;return e("zeros",{"":function(){return"Array"===n.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(t){if("string"===typeof t[t.length-1]){var e=t.pop();return o(t,e)}return"Array"===n.matrix?o(t):o(t,"default")},Array:o,Matrix:function(t){var e=t.storage();return o(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return o(t.valueOf(),e)}});function o(t,e){var n=function(t){var e=!1;return t.forEach((function(t,n,r){I(t)&&(e=!0,r[n]=t.toNumber())})),e}(t)?new i(0):0;if(function(t){t.forEach((function(t){if("number"!==typeof t||!ct(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")}))}(t),e){var o=r(e);return t.length>0?o.resize(t,n):o}var a=[];return t.length>0?Mt(a,t,n):a}}));Wt("hex",["typed","format"],(function(t){var e=t.typed,n=t.format;return e("hex",{"number | BigNumber":function(t){return n(t,{notation:"hex"})},"number | BigNumber, number":function(t,e){return n(t,{notation:"hex",wordSize:e})}})}));function Kn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kn(Object(n),!0).forEach((function(e){$n(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tr="Number of decimals in function round must be an integer",er=Wt("round",["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(function(t){var e=t.typed,n=t.matrix,r=t.equalScalar,i=t.zeros,o=t.BigNumber,a=t.DenseMatrix,A=Vn({typed:e,equalScalar:r}),s=Zn({typed:e,DenseMatrix:a}),c=Tn({typed:e});return e("round",qn(qn({},nr),{},{Complex:function(t){return t.round()},"Complex, number":function(t,e){if(e%1)throw new TypeError(tr);return t.round(e)},"Complex, BigNumber":function(t,e){if(!e.isInteger())throw new TypeError(tr);var n=e.toNumber();return t.round(n)},"number, BigNumber":function(t,e){if(!e.isInteger())throw new TypeError(tr);return new o(t).toDecimalPlaces(e.toNumber())},BigNumber:function(t){return t.toDecimalPlaces(0)},"BigNumber, BigNumber":function(t,e){if(!e.isInteger())throw new TypeError(tr);return t.toDecimalPlaces(e.toNumber())},Fraction:function(t){return t.round()},"Fraction, number":function(t,e){if(e%1)throw new TypeError(tr);return t.round(e)},"Array | Matrix":function(t){return Ie(t,this,!0)},"SparseMatrix, number | BigNumber":function(t,e){return A(t,e,this,!1)},"DenseMatrix, number | BigNumber":function(t,e){return c(t,e,this,!1)},"number | Complex | BigNumber, SparseMatrix":function(t,e){return r(t,0)?i(e.size(),e.storage()):s(e,t,this,!0)},"number | Complex | BigNumber, DenseMatrix":function(t,e){return r(t,0)?i(e.size(),e.storage()):c(e,t,this,!0)},"Array, number | BigNumber":function(t,e){return c(n(t),e,this,!1).valueOf()},"number | Complex | BigNumber, Array":function(t,e){return c(n(e),t,this,!0).valueOf()}}))})),nr={number:Ye,"number, number":function(t,e){if(!ct(e))throw new TypeError(tr);if(e<0||e>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return Ye(t,e)}},rr=Wt("compare",["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix"],(function(t){var e=t.typed,n=t.config,r=t.equalScalar,i=t.matrix,o=t.BigNumber,a=t.Fraction,A=t.DenseMatrix,s=jn({typed:e}),c=Ln({typed:e,equalScalar:r}),u=Zn({typed:e,DenseMatrix:A}),l=Mn({typed:e}),g=Tn({typed:e});return e("compare",{"boolean, boolean":function(t,e){return t===e?0:t>e?1:-1},"number, number":function(t,e){return bt(t,e,n.epsilon)?0:t>e?1:-1},"BigNumber, BigNumber":function(t,e){return be(t,e,n.epsilon)?new o(0):new o(t.cmp(e))},"Fraction, Fraction":function(t,e){return new a(t.compare(e))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return this(t.value,e.value)},"SparseMatrix, SparseMatrix":function(t,e){return c(t,e,this)},"SparseMatrix, DenseMatrix":function(t,e){return s(e,t,this,!0)},"DenseMatrix, SparseMatrix":function(t,e){return s(t,e,this,!1)},"DenseMatrix, DenseMatrix":function(t,e){return l(t,e,this)},"Array, Array":function(t,e){return this(i(t),i(e)).valueOf()},"Array, Matrix":function(t,e){return this(i(t),e)},"Matrix, Array":function(t,e){return this(t,i(e))},"SparseMatrix, any":function(t,e){return u(t,e,this,!1)},"DenseMatrix, any":function(t,e){return g(t,e,this,!1)},"any, SparseMatrix":function(t,e){return u(e,t,this,!0)},"any, DenseMatrix":function(t,e){return g(e,t,this,!0)},"Array, any":function(t,e){return g(i(t),e,this,!1).valueOf()},"any, Array":function(t,e){return g(i(e),t,this,!0).valueOf()}})})),ir=Wt("smaller",["typed","config","matrix","DenseMatrix"],(function(t){var e=t.typed,n=t.config,r=t.matrix,i=t.DenseMatrix,o=jn({typed:e}),a=Pn({typed:e,DenseMatrix:i}),A=Zn({typed:e,DenseMatrix:i}),s=Mn({typed:e}),c=Tn({typed:e});return e("smaller",{"boolean, boolean":function(t,e){return t<e},"number, number":function(t,e){return t<e&&!bt(t,e,n.epsilon)},"BigNumber, BigNumber":function(t,e){return t.lt(e)&&!be(t,e,n.epsilon)},"Fraction, Fraction":function(t,e){return-1===t.compare(e)},"Complex, Complex":function(t,e){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return this(t.value,e.value)},"SparseMatrix, SparseMatrix":function(t,e){return a(t,e,this)},"SparseMatrix, DenseMatrix":function(t,e){return o(e,t,this,!0)},"DenseMatrix, SparseMatrix":function(t,e){return o(t,e,this,!1)},"DenseMatrix, DenseMatrix":function(t,e){return s(t,e,this)},"Array, Array":function(t,e){return this(r(t),r(e)).valueOf()},"Array, Matrix":function(t,e){return this(r(t),e)},"Matrix, Array":function(t,e){return this(t,r(e))},"SparseMatrix, any":function(t,e){return A(t,e,this,!1)},"DenseMatrix, any":function(t,e){return c(t,e,this,!1)},"any, SparseMatrix":function(t,e){return A(e,t,this,!0)},"any, DenseMatrix":function(t,e){return c(e,t,this,!0)},"Array, any":function(t,e){return c(r(t),e,this,!1).valueOf()},"any, Array":function(t,e){return c(r(e),t,this,!0).valueOf()}})})),or=Wt("larger",["typed","config","matrix","DenseMatrix"],(function(t){var e=t.typed,n=t.config,r=t.matrix,i=t.DenseMatrix,o=jn({typed:e}),a=Pn({typed:e,DenseMatrix:i}),A=Zn({typed:e,DenseMatrix:i}),s=Mn({typed:e}),c=Tn({typed:e});return e("larger",{"boolean, boolean":function(t,e){return t>e},"number, number":function(t,e){return t>e&&!bt(t,e,n.epsilon)},"BigNumber, BigNumber":function(t,e){return t.gt(e)&&!be(t,e,n.epsilon)},"Fraction, Fraction":function(t,e){return 1===t.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return this(t.value,e.value)},"SparseMatrix, SparseMatrix":function(t,e){return a(t,e,this)},"SparseMatrix, DenseMatrix":function(t,e){return o(e,t,this,!0)},"DenseMatrix, SparseMatrix":function(t,e){return o(t,e,this,!1)},"DenseMatrix, DenseMatrix":function(t,e){return s(t,e,this)},"Array, Array":function(t,e){return this(r(t),r(e)).valueOf()},"Array, Matrix":function(t,e){return this(r(t),e)},"Matrix, Array":function(t,e){return this(t,r(e))},"SparseMatrix, any":function(t,e){return A(t,e,this,!1)},"DenseMatrix, any":function(t,e){return c(t,e,this,!1)},"any, SparseMatrix":function(t,e){return A(e,t,this,!0)},"any, DenseMatrix":function(t,e){return c(e,t,this,!0)},"Array, any":function(t,e){return c(r(t),e,this,!1).valueOf()},"any, Array":function(t,e){return c(r(e),t,this,!0).valueOf()}})})),ar=(Wt("unequal",["typed","equalScalar"],(function(t){var e=t.typed,n=t.equalScalar;return e("unequal",{"any, any":function(t,e){return null===t?null!==e:null===e?null!==t:void 0===t?void 0!==e:void 0===e?void 0!==t:!n(t,e)}})})),Wt("FibonacciHeap",["smaller","larger"],(function(t){var e=t.smaller,n=t.larger,r=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function o(t,e,n){e.left.right=e.right,e.right.left=e.left,n.degree--,n.child===e&&(n.child=e.right),0===n.degree&&(n.child=null),e.left=t,e.right=t.right,t.right=e,e.right.left=e,e.parent=null,e.mark=!1}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(t,n){var r={key:t,value:n,degree:0};if(this._minimum){var i=this._minimum;r.left=i,r.right=i.right,i.right=r,r.right.left=r,e(t,i.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var t=this._minimum;if(null===t)return t;for(var i=this._minimum,o=t.degree,A=t.child;o>0;){var s=A.right;A.left.right=A.right,A.right.left=A.left,A.left=i,A.right=i.right,i.right=A,A.right.left=A,A.parent=null,A=s,o--}return t.left.right=t.right,t.right.left=t.left,i=t===t.right?null:function(t,i){var o,A=Math.floor(Math.log(i)*r)+1,s=new Array(A),c=0,u=t;if(u)for(c++,u=u.right;u!==t;)c++,u=u.right;for(;c>0;){for(var l=u.degree,g=u.right;o=s[l];){if(n(u.key,o.key)){var f=o;o=u,u=f}a(o,u),s[l]=null,l++}s[l]=u,u=g,c--}t=null;for(var h=0;h<A;h++)(o=s[h])&&(t?(o.left.right=o.right,o.right.left=o.left,o.left=t,o.right=t.right,t.right=o,o.right.left=o,e(o.key,t.key)&&(t=o)):t=o);return t}(i=t.right,this._size),this._size--,this._minimum=i,t},i.prototype.remove=function(t){this._minimum=function(t,n,r){n.key=r;var i=n.parent;i&&e(n.key,i.key)&&(o(t,n,i),function t(e,n){var r=n.parent;if(!r)return;n.mark?(o(e,n,r),t(r)):n.mark=!0}(t,i));e(n.key,t.key)&&(t=n);return t}(this._minimum,t,-1),this.extractMinimum()};var a=function(t,e){t.left.right=t.right,t.right.left=t.left,t.parent=e,e.child?(t.left=e.child,t.right=e.child.right,e.child.right=t,t.right.left=t):(e.child=t,t.right=t,t.left=t),e.degree++,t.mark=!1};return i}),{isClass:!0})),Ar=Wt("dot",["typed","addScalar","multiplyScalar","conj","size"],(function(t){var e=t.typed,n=t.addScalar,r=t.multiplyScalar,i=t.conj,o=t.size;return e("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(t,o){var s=a(t,o),c=m(t)?t._data:t,u=m(t)?t._datatype:void 0,l=m(o)?o._data:o,g=m(o)?o._datatype:void 0,f=2===A(t).length,h=2===A(o).length,d=n,I=r;if(u&&g&&u===g&&"string"===typeof u){var p=u;d=e.find(n,[p,p]),I=e.find(r,[p,p])}if(!f&&!h){for(var C=I(i(c[0]),l[0]),y=1;y<s;y++)C=d(C,I(i(c[y]),l[y]));return C}if(!f&&h){for(var v=I(i(c[0]),l[0][0]),B=1;B<s;B++)v=d(v,I(i(c[B]),l[B][0]));return v}if(f&&!h){for(var b=I(i(c[0][0]),l[0]),E=1;E<s;E++)b=d(b,I(i(c[E][0]),l[E]));return b}if(f&&h){for(var Q=I(i(c[0][0]),l[0][0]),F=1;F<s;F++)Q=d(Q,I(i(c[F][0]),l[F][0]));return Q}},"SparseMatrix, SparseMatrix":function(t,e){a(t,e);var i=t._index,o=t._values,A=e._index,s=e._values,c=0,u=n,l=r,g=0,f=0;for(;g<i.length&&f<A.length;){var h=i[g],d=A[f];h<d?g++:h>d?f++:h===d&&(c=u(c,l(o[g],s[f])),g++,f++)}return c}});function a(t,e){var n,r,i=A(t),o=A(e);if(1===i.length)n=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");n=i[0]}if(1===o.length)r=o[0];else{if(2!==o.length||1!==o[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+o.join(", ")+")");r=o[0]}if(n!==r)throw new RangeError("Vectors must have equal length ("+n+" != "+r+")");if(0===n)throw new RangeError("Cannot calculate the dot product of empty vectors");return n}function A(t){return m(t)?t.size():o(t)}})),sr=Wt("abs",["typed"],(function(t){return(0,t.typed)("abs",{number:we,Complex:function(t){return t.abs()},BigNumber:function(t){return t.abs()},Fraction:function(t){return t.abs()},"Array | Matrix":function(t){return Ie(t,this,!0)},Unit:function(t){return t.abs()}})})),cr=n(12),ur=Wt("floor",["typed","config","round","matrix","equalScalar"],(function(t){var e=t.typed,n=t.config,r=t.round,i=t.matrix,o=t.equalScalar,a=Vn({typed:e,equalScalar:o}),A=Tn({typed:e});return e("floor",{number:function(t){return bt(t,r(t),n.epsilon)?r(t):Math.floor(t)},"number, number":function(t,e){if(bt(t,r(t,e),n.epsilon))return r(t,e);var i="".concat(t,"e").split("e"),o=Object(cr.a)(i,2),a=o[0],A=o[1],s=Math.floor(Number("".concat(a,"e").concat(Number(A)+e))),c="".concat(s,"e").split("e"),u=Object(cr.a)(c,2);return a=u[0],A=u[1],Number("".concat(a,"e").concat(Number(A)-e))},Complex:function(t){return t.floor()},"Complex, number":function(t,e){return t.floor(e)},BigNumber:function(t){return be(t,r(t),n.epsilon)?r(t):t.floor()},"BigNumber, BigNumber":function(t,e){return be(t,r(t,e),n.epsilon)?r(t,e):t.toDecimalPlaces(e.toNumber(),ee.a.ROUND_FLOOR)},Fraction:function(t){return t.floor()},"Fraction, number":function(t,e){return t.floor(e)},"Array | Matrix":function(t){return Ie(t,this,!0)},"Array | Matrix, number":function(t,e){var n=this;return Ie(t,(function(t){return n(t,e)}),!0)},"SparseMatrix, number | BigNumber":function(t,e){return a(t,e,this,!1)},"DenseMatrix, number | BigNumber":function(t,e){return A(t,e,this,!1)},"number | Complex | BigNumber, Array":function(t,e){return A(i(e),t,this,!0).valueOf()}})})),lr=Wt("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(function(t){var e=t.typed,n=t.matrix,r=t.addScalar,i=t.multiplyScalar,o=t.equalScalar,a=t.dot,A=Vn({typed:e,equalScalar:o}),s=Tn({typed:e});function c(t,e){switch(t.length){case 1:switch(e.length){case 1:if(t[0]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+e[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+e.length+" dimensions)")}break;case 2:switch(e.length){case 1:if(t[1]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+e[0]+")");break;case 2:if(t[1]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+e[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+e.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}}function u(t,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(t,n){var o,a=t._data,A=t._size,s=t._datatype,c=n._data,u=n._size,l=n._datatype,g=A[0],f=u[1],h=r,d=i;s&&l&&s===l&&"string"===typeof s&&(o=s,h=e.find(r,[o,o]),d=e.find(i,[o,o]));for(var I=[],p=0;p<f;p++){for(var C=d(a[0],c[0][p]),y=1;y<g;y++)C=h(C,d(a[y],c[y][p]));I[p]=C}return t.createDenseMatrix({data:I,size:[f],datatype:o})}(t,n)}var l=e("_multiplyMatrixVector",{"DenseMatrix, any":function(t,n){var o,a=t._data,A=t._size,s=t._datatype,c=n._data,u=n._datatype,l=A[0],g=A[1],f=r,h=i;s&&u&&s===u&&"string"===typeof s&&(o=s,f=e.find(r,[o,o]),h=e.find(i,[o,o]));for(var d=[],I=0;I<l;I++){for(var p=a[I],C=h(p[0],c[0]),y=1;y<g;y++)C=f(C,h(p[y],c[y]));d[I]=C}return t.createDenseMatrix({data:d,size:[l],datatype:o})},"SparseMatrix, any":function(t,n){var a=t._values,A=t._index,s=t._ptr,c=t._datatype;if(!a)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,l=n._data,g=n._datatype,f=t._size[0],h=n._size[0],d=[],I=[],p=[],C=r,y=i,v=o,B=0;c&&g&&c===g&&"string"===typeof c&&(u=c,C=e.find(r,[u,u]),y=e.find(i,[u,u]),v=e.find(o,[u,u]),B=e.convert(0,u));var m=[],b=[];p[0]=0;for(var E=0;E<h;E++){var Q=l[E];if(!v(Q,B))for(var F=s[E],w=s[E+1],S=F;S<w;S++){var R=A[S];b[R]?m[R]=C(m[R],y(Q,a[S])):(b[R]=!0,I.push(R),m[R]=y(Q,a[S]))}}for(var U=I.length,x=0;x<U;x++){var k=I[x];d[x]=m[k]}return p[1]=I.length,t.createSparseMatrix({values:d,index:I,ptr:p,size:[f,1],datatype:u})}}),g=e("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,n){var o,a=t._data,A=t._size,s=t._datatype,c=n._data,u=n._size,l=n._datatype,g=A[0],f=A[1],h=u[1],d=r,I=i;s&&l&&s===l&&"string"===typeof s&&(o=s,d=e.find(r,[o,o]),I=e.find(i,[o,o]));for(var p=[],C=0;C<g;C++){var y=a[C];p[C]=[];for(var v=0;v<h;v++){for(var B=I(y[0],c[0][v]),m=1;m<f;m++)B=d(B,I(y[m],c[m][v]));p[C][v]=B}}return t.createDenseMatrix({data:p,size:[g,h],datatype:o})},"DenseMatrix, SparseMatrix":function(t,n){var a=t._data,A=t._size,s=t._datatype,c=n._values,u=n._index,l=n._ptr,g=n._size,f=n._datatype;if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h,d=A[0],I=g[1],p=r,C=i,y=o,v=0;s&&f&&s===f&&"string"===typeof s&&(h=s,p=e.find(r,[h,h]),C=e.find(i,[h,h]),y=e.find(o,[h,h]),v=e.convert(0,h));for(var B=[],m=[],b=[],E=n.createSparseMatrix({values:B,index:m,ptr:b,size:[d,I],datatype:h}),Q=0;Q<I;Q++){b[Q]=m.length;var F=l[Q],w=l[Q+1];if(w>F)for(var S=0,R=0;R<d;R++){for(var U=R+1,x=void 0,k=F;k<w;k++){var O=u[k];S!==U?(x=C(a[R][O],c[k]),S=U):x=p(x,C(a[R][O],c[k]))}S!==U||y(x,v)||(m.push(R),B.push(x))}}return b[I]=m.length,E},"SparseMatrix, DenseMatrix":function(t,n){var a=t._values,A=t._index,s=t._ptr,c=t._datatype;if(!a)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var u,l=n._data,g=n._datatype,f=t._size[0],h=n._size[0],d=n._size[1],I=r,p=i,C=o,y=0;c&&g&&c===g&&"string"===typeof c&&(u=c,I=e.find(r,[u,u]),p=e.find(i,[u,u]),C=e.find(o,[u,u]),y=e.convert(0,u));for(var v=[],B=[],m=[],b=t.createSparseMatrix({values:v,index:B,ptr:m,size:[f,d],datatype:u}),E=[],Q=[],F=0;F<d;F++){m[F]=B.length;for(var w=F+1,S=0;S<h;S++){var R=l[S][F];if(!C(R,y))for(var U=s[S],x=s[S+1],k=U;k<x;k++){var O=A[k];Q[O]!==w?(Q[O]=w,B.push(O),E[O]=p(R,a[k])):E[O]=I(E[O],p(R,a[k]))}}for(var N=m[F],D=B.length,G=N;G<D;G++){var _=B[G];v[G]=E[_]}}return m[d]=B.length,b},"SparseMatrix, SparseMatrix":function(t,n){var o,a=t._values,A=t._index,s=t._ptr,c=t._datatype,u=n._values,l=n._index,g=n._ptr,f=n._datatype,h=t._size[0],d=n._size[1],I=a&&u,p=r,C=i;c&&f&&c===f&&"string"===typeof c&&(o=c,p=e.find(r,[o,o]),C=e.find(i,[o,o]));for(var y,v,B,m,b,E,Q,F,w=I?[]:void 0,S=[],R=[],U=t.createSparseMatrix({values:w,index:S,ptr:R,size:[h,d],datatype:o}),x=I?[]:void 0,k=[],O=0;O<d;O++){R[O]=S.length;var N=O+1;for(b=g[O],E=g[O+1],m=b;m<E;m++)if(F=l[m],I)for(v=s[F],B=s[F+1],y=v;y<B;y++)Q=A[y],k[Q]!==N?(k[Q]=N,S.push(Q),x[Q]=C(u[m],a[y])):x[Q]=p(x[Q],C(u[m],a[y]));else for(v=s[F],B=s[F+1],y=v;y<B;y++)Q=A[y],k[Q]!==N&&(k[Q]=N,S.push(Q));if(I)for(var D=R[O],G=S.length,_=D;_<G;_++){var M=S[_];w[_]=x[M]}}return R[d]=S.length,U}});return e("multiply",nt({"Array, Array":function(t,e){c(Dt(t),Dt(e));var r=this(n(t),n(e));return m(r)?r.valueOf():r},"Matrix, Matrix":function(t,e){var n=t.size(),r=e.size();return c(n,r),1===n.length?1===r.length?function(t,e,n){if(0===n)throw new Error("Cannot multiply two empty vectors");return a(t,e)}(t,e,n[0]):u(t,e):1===r.length?l(t,e):g(t,e)},"Matrix, Array":function(t,e){return this(t,n(e))},"Array, Matrix":function(t,e){return this(n(t,e.storage()),e)},"SparseMatrix, any":function(t,e){return A(t,e,i,!1)},"DenseMatrix, any":function(t,e){return s(t,e,i,!1)},"any, SparseMatrix":function(t,e){return A(e,t,i,!0)},"any, DenseMatrix":function(t,e){return s(e,t,i,!0)},"Array, any":function(t,e){return s(n(t),e,i,!1).valueOf()},"any, Array":function(t,e){return s(n(e),t,i,!0).valueOf()},"any, any":i,"any, any, ...any":function(t,e,n){for(var r=this(t,e),i=0;i<n.length;i++)r=this(r,n[i]);return r}},i.signatures))}));function gr(t,e,n,r){if(!(this instanceof gr))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=e,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+t+" ("+e+" provided, "+n+(void 0!==r&&null!==r?"-"+r:"")+" expected)",this.stack=(new Error).stack}gr.prototype=new Error,gr.prototype.constructor=Error,gr.prototype.name="ArgumentsError",gr.prototype.isArgumentsError=!0;var fr=Wt("pow",["typed","config","identity","multiply","matrix","fraction","number","Complex"],(function(t){var e=t.typed,n=t.config,r=t.identity,i=t.multiply,o=t.matrix,a=t.number,A=t.fraction,s=t.Complex;return e("pow",{"number, number":c,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(t,e){return e.isInteger()||t>=0||n.predictable?t.pow(e):new s(t.toNumber(),0).pow(e.toNumber(),0)},"Fraction, Fraction":function(t,e){if(1!==e.d){if(n.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return c(t.valueOf(),e.valueOf())}return t.pow(e)},"Array, number":u,"Array, BigNumber":function(t,e){return u(t,e.toNumber())},"Matrix, number":l,"Matrix, BigNumber":function(t,e){return l(t,e.toNumber())},"Unit, number | BigNumber":function(t,e){return t.pow(e)}});function c(t,e){if(n.predictable&&!ct(e)&&t<0)try{var r=A(e),i=a(r);if((e===i||Math.abs((e-i)/e)<1e-14)&&r.d%2===1)return(r.n%2===0?1:-1)*Math.pow(-t,e)}catch(o){}return n.predictable&&(t<-1&&e===1/0||t>-1&&t<0&&e===-1/0)?NaN:ct(e)||t>=0||n.predictable?He(t,e):t*t<1&&e===1/0||t*t>1&&e===-1/0?0:new s(t,0).pow(e,0)}function u(t,e){if(!ct(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var n=Dt(t);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[1]+")");for(var o=r(n[0]).valueOf(),a=t;e>=1;)1===(1&e)&&(o=i(a,o)),e>>=1,a=i(a,a);return o}function l(t,e){return o(u(t.valueOf(),e))}}));n(189);function hr(t){var e;if(ct(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:Fn(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*hr(1-t));if(t>=171.35)return 1/0;if(t>85){var n=t*t,r=n*t,i=r*t,o=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*n)-139/(51840*r)-571/(2488320*i)+163879/(209018880*o)+5246819/(75246796800*o*t))}--t,e=Ir[0];for(var a=1;a<Ir.length;++a)e+=Ir[a]/(t+a);var A=t+dr+.5;return Math.sqrt(2*Math.PI)*Math.pow(A,t+.5)*Math.exp(-A)*e}hr.signature="number";var dr=4.7421875,Ir=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],pr=Wt("bignumber",["typed","BigNumber"],(function(t){var e=t.typed,n=t.BigNumber;return e("bignumber",{"":function(){return new n(0)},number:function(t){return new n(t+"")},string:function(t){var e=t.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(e){var r=e[2],i=n(e[1]),o=new n(2).pow(Number(r));if(i.gt(o.sub(1)))throw new SyntaxError('String "'.concat(t,'" is out of range'));var a=new n(2).pow(Number(r)-1);return i.gte(a)?i.sub(o):i}return new n(t)},BigNumber:function(t){return t},Fraction:function(t){return new n(t.n).div(t.d).times(t.s)},null:function(t){return new n(0)},"Array | Matrix":function(t){return Ie(t,this)}})})),Cr=Wt("numeric",["number","?bignumber","?fraction"],(function(t){var e=t.number,n=t.bignumber,r=t.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:function(t){return e(t)},BigNumber:n?function(t){return n(t)}:Jn,Fraction:r?function(t){return r(t)}:Hn};return function(t,e){var n=$(t);if(!(n in i))throw new TypeError("Cannot convert "+t+' of type "'+n+'"; valid input types are '+Object.keys(i).join(", "));if(!(e in o))throw new TypeError("Cannot convert "+t+' to type "'+e+'"; valid output types are '+Object.keys(o).join(", "));return e===n?t:o[e](t)}}));var yr=Wt("ceil",["typed","config","round","matrix","equalScalar"],(function(t){var e=t.typed,n=t.config,r=t.round,i=t.matrix,o=t.equalScalar,a=Vn({typed:e,equalScalar:o}),A=Tn({typed:e});return e("ceil",{number:function(t){return bt(t,r(t),n.epsilon)?r(t):Oe(t)},"number, number":function(t,e){if(bt(t,r(t,e),n.epsilon))return r(t,e);var i="".concat(t,"e").split("e"),o=Object(cr.a)(i,2),a=o[0],A=o[1],s=Math.ceil(Number("".concat(a,"e").concat(Number(A)+e))),c="".concat(s,"e").split("e"),u=Object(cr.a)(c,2);return a=u[0],A=u[1],Number("".concat(a,"e").concat(Number(A)-e))},Complex:function(t){return t.ceil()},"Complex, number":function(t,e){return t.ceil(e)},BigNumber:function(t){return be(t,r(t),n.epsilon)?r(t):t.ceil()},"BigNumber, BigNumber":function(t,e){return be(t,r(t,e),n.epsilon)?r(t,e):t.toDecimalPlaces(e.toNumber(),ee.a.ROUND_CEIL)},Fraction:function(t){return t.ceil()},"Fraction, number":function(t,e){return t.ceil(e)},"Array | Matrix":function(t){return Ie(t,this,!0)},"Array | Matrix, number":function(t,e){var n=this;return Ie(t,(function(t){return n(t,e)}),!0)},"SparseMatrix, number | BigNumber":function(t,e){return a(t,e,this,!1)},"DenseMatrix, number | BigNumber":function(t,e){return A(t,e,this,!1)},"number | Complex | BigNumber, Array":function(t,e){return A(i(e),t,this,!0).valueOf()}})})),vr=Wt("subtract",["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],(function(t){var e=t.typed,n=t.matrix,r=t.equalScalar,i=t.addScalar,o=t.unaryMinus,a=t.DenseMatrix,A=Gn({typed:e}),s=jn({typed:e}),c=Ln({typed:e,equalScalar:r}),u=_n({typed:e,DenseMatrix:a}),l=Mn({typed:e}),g=Tn({typed:e});return e("subtract",{"number, number":function(t,e){return t-e},"Complex, Complex":function(t,e){return t.sub(e)},"BigNumber, BigNumber":function(t,e){return t.minus(e)},"Fraction, Fraction":function(t,e){return t.sub(e)},"Unit, Unit":function(t,e){if(null===t.value)throw new Error("Parameter x contains a unit with undefined value");if(null===e.value)throw new Error("Parameter y contains a unit with undefined value");if(!t.equalBase(e))throw new Error("Units do not match");var n=t.clone();return n.value=this(n.value,e.value),n.fixPrefix=!1,n},"SparseMatrix, SparseMatrix":function(t,e){return Br(t,e),c(t,e,this)},"SparseMatrix, DenseMatrix":function(t,e){return Br(t,e),s(e,t,this,!0)},"DenseMatrix, SparseMatrix":function(t,e){return Br(t,e),A(t,e,this,!1)},"DenseMatrix, DenseMatrix":function(t,e){return Br(t,e),l(t,e,this)},"Array, Array":function(t,e){return this(n(t),n(e)).valueOf()},"Array, Matrix":function(t,e){return this(n(t),e)},"Matrix, Array":function(t,e){return this(t,n(e))},"SparseMatrix, any":function(t,e){return u(t,o(e),i)},"DenseMatrix, any":function(t,e){return g(t,e,this)},"any, SparseMatrix":function(t,e){return u(e,t,this,!0)},"any, DenseMatrix":function(t,e){return g(e,t,this,!0)},"Array, any":function(t,e){return g(n(t),e,this,!1).valueOf()},"any, Array":function(t,e){return g(n(e),t,this,!0).valueOf()}})}));function Br(t,e){var n=t.size(),r=e.size();if(n.length!==r.length)throw new Ot(n.length,r.length)}var mr=Wt("equal",["typed","matrix","equalScalar","DenseMatrix"],(function(t){var e=t.typed,n=t.matrix,r=t.equalScalar,i=t.DenseMatrix,o=jn({typed:e}),a=Pn({typed:e,DenseMatrix:i}),A=Zn({typed:e,DenseMatrix:i}),s=Mn({typed:e}),c=Tn({typed:e});return e("equal",{"any, any":function(t,e){return null===t?null===e:null===e?null===t:void 0===t?void 0===e:void 0===e?void 0===t:r(t,e)},"SparseMatrix, SparseMatrix":function(t,e){return a(t,e,r)},"SparseMatrix, DenseMatrix":function(t,e){return o(e,t,r,!0)},"DenseMatrix, SparseMatrix":function(t,e){return o(t,e,r,!1)},"DenseMatrix, DenseMatrix":function(t,e){return s(t,e,r)},"Array, Array":function(t,e){return this(n(t),n(e)).valueOf()},"Array, Matrix":function(t,e){return this(n(t),e)},"Matrix, Array":function(t,e){return this(t,n(e))},"SparseMatrix, any":function(t,e){return A(t,e,r,!1)},"DenseMatrix, any":function(t,e){return c(t,e,r,!1)},"any, SparseMatrix":function(t,e){return A(e,t,r,!0)},"any, DenseMatrix":function(t,e){return c(e,t,r,!0)},"Array, any":function(t,e){return c(n(t),e,r,!1).valueOf()},"any, Array":function(t,e){return c(n(e),t,r,!0).valueOf()}})})),br=(Wt("equal",["typed","equalScalar"],(function(t){var e=t.typed,n=t.equalScalar;return e("equal",{"any, any":function(t,e){return null===t?null===e:null===e?null===t:void 0===t?void 0===e:void 0===e?void 0===t:n(t,e)}})})),Wt("fix",["typed","Complex","matrix","ceil","floor"],(function(t){var e=t.typed,n=t.Complex,r=t.matrix,i=t.ceil,o=t.floor,a=Tn({typed:e});return e("fix",{number:function(t){return t>0?o(t):i(t)},"number, number | BigNumber":function(t,e){return t>0?o(t,e):i(t,e)},Complex:function(t){return new n(t.re>0?Math.floor(t.re):Math.ceil(t.re),t.im>0?Math.floor(t.im):Math.ceil(t.im))},"Complex, number | BigNumber":function(t,e){return new n(t.re>0?o(t.re,e):i(t.re,e),t.im>0?o(t.im,e):i(t.im,e))},BigNumber:function(t){return t.isNegative()?i(t):o(t)},"BigNumber, number | BigNumber":function(t,e){return t.isNegative()?i(t,e):o(t,e)},Fraction:function(t){return t.s<0?t.ceil():t.floor()},"Fraction, number | BigNumber":function(t,e){return t.s<0?t.ceil(e):t.floor(e)},"Array | Matrix":function(t){return Ie(t,this,!0)},"Array | Matrix, number | BigNumber":function(t,e){var n=this;return Ie(t,(function(t){return n(t,e)}),!0)},"number | Complex | BigNumber, Array":function(t,e){return a(r(e),t,this,!0).valueOf()}})}))),Er=Wt("divideScalar",["typed","numeric"],(function(t){var e=t.typed,n=t.numeric;return e("divideScalar",{"number, number":function(t,e){return t/e},"Complex, Complex":function(t,e){return t.div(e)},"BigNumber, BigNumber":function(t,e){return t.div(e)},"Fraction, Fraction":function(t,e){return t.div(e)},"Unit, number | Fraction | BigNumber":function(t,e){var r=t.clone(),i=n(1,$(e));return r.value=this(null===r.value?r._normalize(i):r.value,e),r},"number | Fraction | BigNumber, Unit":function(t,e){var r=e.clone();r=r.pow(-1);var i=n(1,$(t));return r.value=this(t,null===e.value?e._normalize(i):e.value),r},"Unit, Unit":function(t,e){return t.divide(e)}})}));var Qr=Wt("Spa",["addScalar","equalScalar","FibonacciHeap"],(function(t){var e=t.addScalar,n=t.equalScalar,r=t.FibonacciHeap;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(t,e){if(this._values[t])this._values[t].value=e;else{var n=this._heap.insert(t,e);this._values[t]=n}},i.prototype.get=function(t){var e=this._values[t];return e?e.value:0},i.prototype.accumulate=function(t,n){var r=this._values[t];r?r.value=e(r.value,n):(r=this._heap.insert(t,n),this._values[t]=r)},i.prototype.forEach=function(t,e,r){var i=this._heap,o=this._values,a=[],A=i.extractMinimum();for(A&&a.push(A);A&&A.key<=e;)A.key>=t&&(n(A.value,0)||r(A.key,A.value,this)),(A=i.extractMinimum())&&a.push(A);for(var s=0;s<a.length;s++){var c=a[s];o[(A=i.insert(c.key,c.value)).key]=A}},i.prototype.swap=function(t,e){var n=this._values[t],r=this._values[e];if(!n&&r)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(n&&!r)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(n&&r){var i=n.value;n.value=r.value,r.value=i}},i}),{isClass:!0}),Fr=Wt("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtract","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(function(t){var e=t.typed,n=t.matrix,r=t.abs,i=t.addScalar,o=t.divideScalar,a=t.multiplyScalar,A=t.subtract,s=t.larger,c=t.equalScalar,u=t.unaryMinus,l=t.DenseMatrix,g=t.SparseMatrix,f=t.Spa;return e("lup",{DenseMatrix:function(t){return h(t)},SparseMatrix:function(t){return d(t)},Array:function(t){var e=h(n(t));return{L:e.L.valueOf(),U:e.U.valueOf(),p:e.p}}});function h(t){var e,n,u,g=t._size[0],f=t._size[1],h=Math.min(g,f),d=tt(t._data),I=[],p=[g,h],C=[],y=[h,f],v=[];for(e=0;e<g;e++)v[e]=e;for(n=0;n<f;n++){if(n>0)for(e=0;e<g;e++){var B=Math.min(e,n),m=0;for(u=0;u<B;u++)m=i(m,a(d[e][u],d[u][n]));d[e][n]=A(d[e][n],m)}var b=n,E=0,Q=0;for(e=n;e<g;e++){var F=d[e][n],w=r(F);s(w,E)&&(b=e,E=w,Q=F)}if(n!==b&&(v[n]=[v[b],v[b]=v[n]][0],l._swapRows(n,b,d)),n<g)for(e=n+1;e<g;e++){var S=d[e][n];c(S,0)||(d[e][n]=o(d[e][n],Q))}}for(n=0;n<f;n++)for(e=0;e<g;e++)0===n&&(e<f&&(C[e]=[]),I[e]=[]),e<n?(e<f&&(C[e][n]=d[e][n]),n<g&&(I[e][n]=0)):e!==n?(e<f&&(C[e][n]=0),n<g&&(I[e][n]=d[e][n])):(e<f&&(C[e][n]=d[e][n]),n<g&&(I[e][n]=1));var R=new l({data:I,size:p}),U=new l({data:C,size:y}),x=[];for(e=0,h=v.length;e<h;e++)x[v[e]]=e;return{L:R,U:U,p:x,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}function d(t){var e,n,i,A=t._size[0],l=t._size[1],h=Math.min(A,l),d=t._values,I=t._index,p=t._ptr,C=[],y=[],v=[],B=[A,h],m=[],b=[],E=[],Q=[h,l],F=[],w=[];for(e=0;e<A;e++)F[e]=e,w[e]=e;var S=function(){var t=new f;n<A&&(v.push(C.length),C.push(1),y.push(n)),E.push(m.length);var l=p[n],h=p[n+1];for(i=l;i<h;i++)e=I[i],t.set(F[e],d[i]);n>0&&t.forEach(0,n-1,(function(e,n){g._forEachRow(e,C,y,v,(function(r,i){r>e&&t.accumulate(r,u(a(i,n)))}))}));var S=n,R=t.get(n),U=r(R);t.forEach(n+1,A-1,(function(t,e){var n=r(e);s(n,U)&&(S=t,U=n,R=e)})),n!==S&&(g._swapRows(n,S,B[1],C,y,v),g._swapRows(n,S,Q[1],m,b,E),t.swap(n,S),function(t,e){var n=w[t],r=w[e];F[n]=e,F[r]=t,w[t]=r,w[e]=n}(n,S)),t.forEach(0,A-1,(function(t,e){t<=n?(m.push(e),b.push(t)):(e=o(e,R),c(e,0)||(C.push(e),y.push(t)))}))};for(n=0;n<l;n++)S();return E.push(m.length),v.push(C.length),{L:new g({values:C,index:y,ptr:v,size:B}),U:new g({values:m,index:b,ptr:E,size:Q}),p:F,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}}));var wr=Wt("det",["typed","matrix","subtract","multiply","unaryMinus","lup"],(function(t){var e=t.typed,n=t.matrix,r=t.subtract,i=t.multiply,o=t.unaryMinus,a=t.lup;return e("det",{any:function(t){return tt(t)},"Array | Matrix":function(t){var e;switch((e=m(t)?t.size():Array.isArray(t)?(t=n(t)).size():[]).length){case 0:return tt(t);case 1:if(1===e[0])return tt(t.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+kt(e)+")");case 2:var A=e[0],s=e[1];if(A===s)return function(t,e,n){if(1===e)return tt(t[0][0]);if(2===e)return r(i(t[0][0],t[1][1]),i(t[1][0],t[0][1]));for(var A=a(t),s=A.U[0][0],c=1;c<e;c++)s=i(s,A.U[c][c]);for(var u=0,l=0,g=[];;){for(;g[l];)l++;if(l>=e)break;for(var f=l,h=0;!g[A.p[f]];)g[A.p[f]]=!0,f=A.p[f],h++;h%2===0&&u++}return u%2===0?s:o(s)}(t.clone().valueOf(),A);throw new RangeError("Matrix must be square (size: "+kt(e)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+kt(e)+")")}}})}));var Sr=Wt("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(function(t){var e=t.typed,n=t.matrix,r=t.divideScalar,i=t.addScalar,o=t.multiply,a=t.unaryMinus,A=t.det,s=t.identity,c=t.abs;return e("inv",{"Array | Matrix":function(t){var e=m(t)?t.size():Dt(t);switch(e.length){case 1:if(1===e[0])return m(t)?n([r(1,t.valueOf()[0])]):[r(1,t[0])];throw new RangeError("Matrix must be square (size: "+kt(e)+")");case 2:var i=e[0],o=e[1];if(i===o)return m(t)?n(u(t.valueOf(),i,o),t.storage()):u(t,i,o);throw new RangeError("Matrix must be square (size: "+kt(e)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+kt(e)+")")}},any:function(t){return r(1,t)}});function u(t,e,n){var u,l,g,f,h;if(1===e){if(0===(f=t[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,f)]]}if(2===e){var d=A(t);if(0===d)throw Error("Cannot calculate inverse, determinant is zero");return[[r(t[1][1],d),r(a(t[0][1]),d)],[r(a(t[1][0]),d),r(t[0][0],d)]]}var I=t.concat();for(u=0;u<e;u++)I[u]=I[u].concat();for(var p=s(e).valueOf(),C=0;C<n;C++){var y=c(I[C][C]),v=C;for(u=C+1;u<e;)c(I[u][C])>y&&(y=c(I[u][C]),v=u),u++;if(0===y)throw Error("Cannot calculate inverse, determinant is zero");(u=v)!==C&&(h=I[C],I[C]=I[u],I[u]=h,h=p[C],p[C]=p[u],p[u]=h);var B=I[C],m=p[C];for(u=0;u<e;u++){var b=I[u],E=p[u];if(u!==C){if(0!==b[C]){for(g=r(a(b[C]),B[C]),l=C;l<n;l++)b[l]=i(b[l],o(g,B[l]));for(l=0;l<n;l++)E[l]=i(E[l],o(g,m[l]))}}else{for(g=B[C],l=C;l<n;l++)b[l]=r(b[l],g);for(l=0;l<n;l++)E[l]=r(E[l],g)}}}return p}})),Rr=Wt("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(function(t){var e=t.typed,n=t.matrix,r=t.multiply,i=t.equalScalar,o=t.divideScalar,a=t.inv,A=Vn({typed:e,equalScalar:i}),s=Tn({typed:e});return e("divide",nt({"Array | Matrix, Array | Matrix":function(t,e){return r(t,a(e))},"DenseMatrix, any":function(t,e){return s(t,e,o,!1)},"SparseMatrix, any":function(t,e){return A(t,e,o,!1)},"Array, any":function(t,e){return s(n(t),e,o,!1).valueOf()},"any, Array | Matrix":function(t,e){return r(t,a(e))}},o.signatures))}));function Ur(){return(Ur=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function xr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xr(Object(n),!0).forEach((function(e){Or(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Or(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Nr=Wt("Unit",["?on","config","addScalar","subtract","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(function(t){var e,n,r,i=t.on,o=t.config,a=t.addScalar,A=t.subtract,s=t.multiplyScalar,c=t.divideScalar,u=t.pow,l=t.abs,g=t.fix,f=t.round,h=t.equal,d=t.isNumeric,I=t.format,C=t.number,v=t.Complex,B=t.BigNumber,m=t.Fraction,b=C;function E(t,e){if(!(this instanceof E))throw new Error("Constructor must be called with the new operator");if(null!==t&&void 0!==t&&!d(t)&&!p(t))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==e&&("string"!==typeof e||""===e))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==e){var n=E.parse(e);this.units=n.units,this.dimensions=n.dimensions}else{this.units=[{unit:M,prefix:N.NONE,power:0}],this.dimensions=[];for(var r=0;r<D.length;r++)this.dimensions[r]=0}this.value=void 0!==t&&null!==t?this._normalize(t):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function Q(){for(;" "===r||"\t"===r;)w()}function F(t){return t>="0"&&t<="9"}function w(){n++,r=e.charAt(n)}function S(t){n=t,r=e.charAt(n)}function R(){var t="",e=n;if("+"===r?w():"-"===r&&(t+=r,w()),!function(t){return t>="0"&&t<="9"||"."===t}(r))return S(e),null;if("."===r){if(t+=r,w(),!F(r))return S(e),null}else{for(;F(r);)t+=r,w();"."===r&&(t+=r,w())}for(;F(r);)t+=r,w();if("E"===r||"e"===r){var i="",o=n;if(i+=r,w(),"+"!==r&&"-"!==r||(i+=r,w()),!F(r))return S(o),t;for(t+=i;F(r);)t+=r,w()}return t}function U(){for(var t="";F(r)||E.isValidAlpha(r);)t+=r,w();var e=t.charAt(0);return E.isValidAlpha(e)?t:null}function x(t){return r===t?(w(),t):null}E.prototype.type="Unit",E.prototype.isUnit=!0,E.parse=function(t,i){if(i=i||{},n=-1,r="","string"!==typeof(e=t))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new E;a.units=[];var A=1,s=!1;w(),Q();var c=R(),u=null;if(c){if("BigNumber"===o.number)u=new B(c);else if("Fraction"===o.number)try{u=new m(c)}catch(v){u=parseFloat(c)}else u=parseFloat(c);Q(),x("*")?(A=1,s=!0):x("/")&&(A=-1,s=!0)}for(var l=[],g=1;;){for(Q();"("===r;)l.push(A),g*=A,A=1,w(),Q();var f=void 0;if(!r)break;var h=r;if(null===(f=U()))throw new SyntaxError('Unexpected "'+h+'" in "'+e+'" at index '+n.toString());var d=k(f);if(null===d)throw new SyntaxError('Unit "'+f+'" not found.');var I=A*g;if(Q(),x("^")){Q();var p=R();if(null===p)throw new SyntaxError('In "'+t+'", "^" must be followed by a floating-point number');I*=p}a.units.push({unit:d.unit,prefix:d.prefix,power:I});for(var C=0;C<D.length;C++)a.dimensions[C]+=(d.unit.dimensions[C]||0)*I;for(Q();")"===r;){if(0===l.length)throw new SyntaxError('Unmatched ")" in "'+e+'" at index '+n.toString());g/=l.pop(),w(),Q()}if(s=!1,x("*")?(A=1,s=!0):x("/")?(A=-1,s=!0):A=1,d.unit.base){var y=d.unit.base.key;V.auto[y]={unit:d.unit,prefix:d.prefix}}}if(Q(),r)throw new SyntaxError('Could not parse: "'+t+'"');if(s)throw new SyntaxError('Trailing characters: "'+t+'"');if(0!==l.length)throw new SyntaxError('Unmatched "(" in "'+e+'"');if(0===a.units.length&&!i.allowNoUnits)throw new SyntaxError('"'+t+'" contains no units');return a.value=void 0!==u?a._normalize(u):null,a},E.prototype.clone=function(){var t=new E;t.fixPrefix=this.fixPrefix,t.skipAutomaticSimplification=this.skipAutomaticSimplification,t.value=tt(this.value),t.dimensions=this.dimensions.slice(0),t.units=[];for(var e=0;e<this.units.length;e++)for(var n in t.units[e]={},this.units[e])it(this.units[e],n)&&(t.units[e][n]=this.units[e][n]);return t},E.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},E.prototype._normalize=function(t){var e,n,r,i,o;if(null===t||void 0===t||0===this.units.length)return t;if(this._isDerived()){var A=t;o=E._getNumberConverter($(t));for(var c=0;c<this.units.length;c++)e=o(this.units[c].unit.value),i=o(this.units[c].prefix.value),r=o(this.units[c].power),A=s(A,u(s(e,i),r));return A}return e=(o=E._getNumberConverter($(t)))(this.units[0].unit.value),n=o(this.units[0].unit.offset),i=o(this.units[0].prefix.value),s(a(t,n),s(e,i))},E.prototype._denormalize=function(t,e){var n,r,i,o,a;if(null===t||void 0===t||0===this.units.length)return t;if(this._isDerived()){var l=t;a=E._getNumberConverter($(t));for(var g=0;g<this.units.length;g++)n=a(this.units[g].unit.value),o=a(this.units[g].prefix.value),i=a(this.units[g].power),l=c(l,u(s(n,o),i));return l}return n=(a=E._getNumberConverter($(t)))(this.units[0].unit.value),o=a(this.units[0].prefix.value),r=a(this.units[0].unit.offset),A(c(c(t,n),void 0===e||null===e?o:e),r)};var k=Kt((function(t){if(it(T,t)){var e=T[t];return{unit:e,prefix:e.prefixes[""]}}for(var n in T)if(it(T,n)&&xt(t,n)){var r=T[n],i=t.length-n.length,o=t.substring(0,i),a=it(r.prefixes,o)?r.prefixes[o]:void 0;if(void 0!==a)return{unit:r,prefix:a}}return null}),{hasher:function(t){return t[0]},limit:100});function O(t){return t.equalBase(G.NONE)&&null!==t.value&&!o.predictable?t.value:t}E.isValuelessUnit=function(t){return null!==k(t)},E.prototype.hasBase=function(t){if("string"===typeof t&&(t=G[t]),!t)return!1;for(var e=0;e<D.length;e++)if(Math.abs((this.dimensions[e]||0)-(t.dimensions[e]||0))>1e-12)return!1;return!0},E.prototype.equalBase=function(t){for(var e=0;e<D.length;e++)if(Math.abs((this.dimensions[e]||0)-(t.dimensions[e]||0))>1e-12)return!1;return!0},E.prototype.equals=function(t){return this.equalBase(t)&&h(this.value,t.value)},E.prototype.multiply=function(t){for(var e=this.clone(),n=0;n<D.length;n++)e.dimensions[n]=(this.dimensions[n]||0)+(t.dimensions[n]||0);for(var r=0;r<t.units.length;r++){var i=kr({},t.units[r]);e.units.push(i)}if(null!==this.value||null!==t.value){var o=null===this.value?this._normalize(1):this.value,a=null===t.value?t._normalize(1):t.value;e.value=s(o,a)}else e.value=null;return e.skipAutomaticSimplification=!1,O(e)},E.prototype.divide=function(t){for(var e=this.clone(),n=0;n<D.length;n++)e.dimensions[n]=(this.dimensions[n]||0)-(t.dimensions[n]||0);for(var r=0;r<t.units.length;r++){var i=kr(kr({},t.units[r]),{},{power:-t.units[r].power});e.units.push(i)}if(null!==this.value||null!==t.value){var o=null===this.value?this._normalize(1):this.value,a=null===t.value?t._normalize(1):t.value;e.value=c(o,a)}else e.value=null;return e.skipAutomaticSimplification=!1,O(e)},E.prototype.pow=function(t){for(var e=this.clone(),n=0;n<D.length;n++)e.dimensions[n]=(this.dimensions[n]||0)*t;for(var r=0;r<e.units.length;r++)e.units[r].power*=t;return null!==e.value?e.value=u(e.value,t):e.value=null,e.skipAutomaticSimplification=!1,O(e)},E.prototype.abs=function(){var t=this.clone();for(var e in t.value=null!==t.value?l(t.value):null,t.units)"VA"!==t.units[e].unit.name&&"VAR"!==t.units[e].unit.name||(t.units[e].unit=T.W);return t},E.prototype.to=function(t){var e,n=null===this.value?this._normalize(1):this.value;if("string"===typeof t){if(e=E.parse(t),!this.equalBase(e))throw new Error("Units do not match ('".concat(e.toString(),"' != '").concat(this.toString(),"')"));if(null!==e.value)throw new Error("Cannot convert to a unit with a value");return e.value=tt(n),e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e}if(y(t)){if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");return(e=t.clone()).value=tt(n),e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e}throw new Error("String or Unit expected as parameter")},E.prototype.toNumber=function(t){return b(this.toNumeric(t))},E.prototype.toNumeric=function(t){var e;return(e=t?this.to(t):this.clone())._isDerived()||0===e.units.length?e._denormalize(e.value):e._denormalize(e.value,e.units[0].prefix.value)},E.prototype.toString=function(){return this.format()},E.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},E.fromJSON=function(t){var e=new E(t.value,t.unit);return e.fixPrefix=t.fixPrefix||!1,e},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){var t,e,n=this.clone(),r=[];for(var i in Z)if(it(Z,i)&&n.hasBase(G[i])){t=i;break}if("NONE"===t)n.units=[];else if(t&&it(Z,t)&&(e=Z[t]),e)n.units=[{unit:e.unit,prefix:e.prefix,power:1}];else{for(var o=!1,a=0;a<D.length;a++){var A=D[a];Math.abs(n.dimensions[a]||0)>1e-12&&(it(Z,A)?r.push({unit:Z[A].unit,prefix:Z[A].prefix,power:n.dimensions[a]||0}):o=!0)}r.length<n.units.length&&!o&&(n.units=r)}return n},E.prototype.toSI=function(){for(var t=this.clone(),e=[],n=0;n<D.length;n++){var r=D[n];if(Math.abs(t.dimensions[n]||0)>1e-12){if(!it(V.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");e.push({unit:V.si[r].unit,prefix:V.si[r].prefix,power:t.dimensions[n]||0})}}return t.units=e,t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},E.prototype.formatUnits=function(){for(var t="",e="",n=0,r=0,i=0;i<this.units.length;i++)this.units[i].power>0?(n++,t+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(t+="^"+this.units[i].power)):this.units[i].power<0&&r++;if(r>0)for(var o=0;o<this.units.length;o++)this.units[o].power<0&&(n>0?(e+=" "+this.units[o].prefix.name+this.units[o].unit.name,Math.abs(this.units[o].power+1)>1e-15&&(e+="^"+-this.units[o].power)):(e+=" "+this.units[o].prefix.name+this.units[o].unit.name,e+="^"+this.units[o].power));t=t.substr(1),e=e.substr(1),n>1&&r>0&&(t="("+t+")"),r>1&&n>0&&(e="("+e+")");var a=t;return n>0&&r>0&&(a+=" / "),a+=e},E.prototype.format=function(t){var e=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(var r in"undefined"!==typeof e.value&&null!==e.value&&p(e.value)&&(n=Math.abs(e.value.re)<1e-14),e.units)it(e.units,r)&&e.units[r].unit&&("VA"===e.units[r].unit.name&&n?e.units[r].unit=T.VAR:"VAR"!==e.units[r].unit.name||n||(e.units[r].unit=T.VA));1!==e.units.length||e.fixPrefix||Math.abs(e.units[0].power-Math.round(e.units[0].power))<1e-14&&(e.units[0].prefix=e._bestPrefix());var i=e._denormalize(e.value),o=null!==e.value?I(i,t||{}):"",a=e.formatUnits();return e.value&&p(e.value)&&(o="("+o+")"),a.length>0&&o.length>0&&(o+=" "),o+=a},E.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var t=null!==this.value?l(this.value):0,e=l(this.units[0].unit.value),n=this.units[0].prefix;if(0===t)return n;var r=this.units[0].power,i=Math.log(t/Math.pow(n.value*e,r))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return n;i=Math.abs(i);var o=this.units[0].unit.prefixes;for(var a in o)if(it(o,a)){var A=o[a];if(A.scientific){var s=Math.abs(Math.log(t/Math.pow(A.value*e,r))/Math.LN10-1.2);(s<i||s===i&&A.name.length<n.name.length)&&(n=A,i=s)}}return n},E.prototype.splitUnit=function(t){for(var e=this.clone(),n=[],r=0;r<t.length&&(e=e.to(t[r]),r!==t.length-1);r++){var i=e.toNumeric(),o=f(i),s=new E(h(o,i)?o:g(e.toNumeric()),t[r].toString());n.push(s),e=A(e,s)}for(var c=0,u=0;u<n.length;u++)c=a(c,n[u].value);return h(c,this.value)&&(e.value=0),n.push(e),n};var N={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};N.SHORTLONG=Ur({},N.SHORT,N.LONG),N.BINARY_SHORT=Ur({},N.BINARY_SHORT_SI,N.BINARY_SHORT_IEC),N.BINARY_LONG=Ur({},N.BINARY_LONG_SI,N.BINARY_LONG_IEC);var D=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],G={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var _ in G)it(G,_)&&(G[_].key=_);var M={name:"",base:{},value:1,offset:0,dimensions:D.map((function(t){return 0}))},T={meter:{name:"meter",base:G.LENGTH,prefixes:N.LONG,value:1,offset:0},inch:{name:"inch",base:G.LENGTH,prefixes:N.NONE,value:.0254,offset:0},foot:{name:"foot",base:G.LENGTH,prefixes:N.NONE,value:.3048,offset:0},yard:{name:"yard",base:G.LENGTH,prefixes:N.NONE,value:.9144,offset:0},mile:{name:"mile",base:G.LENGTH,prefixes:N.NONE,value:1609.344,offset:0},link:{name:"link",base:G.LENGTH,prefixes:N.NONE,value:.201168,offset:0},rod:{name:"rod",base:G.LENGTH,prefixes:N.NONE,value:5.0292,offset:0},chain:{name:"chain",base:G.LENGTH,prefixes:N.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:G.LENGTH,prefixes:N.NONE,value:1e-10,offset:0},m:{name:"m",base:G.LENGTH,prefixes:N.SHORT,value:1,offset:0},in:{name:"in",base:G.LENGTH,prefixes:N.NONE,value:.0254,offset:0},ft:{name:"ft",base:G.LENGTH,prefixes:N.NONE,value:.3048,offset:0},yd:{name:"yd",base:G.LENGTH,prefixes:N.NONE,value:.9144,offset:0},mi:{name:"mi",base:G.LENGTH,prefixes:N.NONE,value:1609.344,offset:0},li:{name:"li",base:G.LENGTH,prefixes:N.NONE,value:.201168,offset:0},rd:{name:"rd",base:G.LENGTH,prefixes:N.NONE,value:5.02921,offset:0},ch:{name:"ch",base:G.LENGTH,prefixes:N.NONE,value:20.1168,offset:0},mil:{name:"mil",base:G.LENGTH,prefixes:N.NONE,value:254e-7,offset:0},m2:{name:"m2",base:G.SURFACE,prefixes:N.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:G.SURFACE,prefixes:N.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:G.SURFACE,prefixes:N.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:G.SURFACE,prefixes:N.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:G.SURFACE,prefixes:N.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:G.SURFACE,prefixes:N.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:G.SURFACE,prefixes:N.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:G.SURFACE,prefixes:N.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:G.SURFACE,prefixes:N.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:G.SURFACE,prefixes:N.NONE,value:1e4,offset:0},m3:{name:"m3",base:G.VOLUME,prefixes:N.CUBIC,value:1,offset:0},L:{name:"L",base:G.VOLUME,prefixes:N.SHORT,value:.001,offset:0},l:{name:"l",base:G.VOLUME,prefixes:N.SHORT,value:.001,offset:0},litre:{name:"litre",base:G.VOLUME,prefixes:N.LONG,value:.001,offset:0},cuin:{name:"cuin",base:G.VOLUME,prefixes:N.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:G.VOLUME,prefixes:N.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:G.VOLUME,prefixes:N.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:G.VOLUME,prefixes:N.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:G.VOLUME,prefixes:N.NONE,value:15e-6,offset:0},drop:{name:"drop",base:G.VOLUME,prefixes:N.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:G.VOLUME,prefixes:N.NONE,value:5e-8,offset:0},minim:{name:"minim",base:G.VOLUME,prefixes:N.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:G.VOLUME,prefixes:N.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:G.VOLUME,prefixes:N.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:G.VOLUME,prefixes:N.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:G.VOLUME,prefixes:N.NONE,value:1e-6,offset:0},cup:{name:"cup",base:G.VOLUME,prefixes:N.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:G.VOLUME,prefixes:N.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:G.VOLUME,prefixes:N.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:G.VOLUME,prefixes:N.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:G.VOLUME,prefixes:N.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:G.VOLUME,prefixes:N.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:G.VOLUME,prefixes:N.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:G.VOLUME,prefixes:N.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:G.VOLUME,prefixes:N.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:G.VOLUME,prefixes:N.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:G.VOLUME,prefixes:N.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:G.VOLUME,prefixes:N.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:G.VOLUME,prefixes:N.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:G.VOLUME,prefixes:N.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:G.VOLUME,prefixes:N.NONE,value:.1173478,offset:0},obl:{name:"obl",base:G.VOLUME,prefixes:N.NONE,value:.1589873,offset:0},g:{name:"g",base:G.MASS,prefixes:N.SHORT,value:.001,offset:0},gram:{name:"gram",base:G.MASS,prefixes:N.LONG,value:.001,offset:0},ton:{name:"ton",base:G.MASS,prefixes:N.SHORT,value:907.18474,offset:0},t:{name:"t",base:G.MASS,prefixes:N.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:G.MASS,prefixes:N.LONG,value:1e3,offset:0},grain:{name:"grain",base:G.MASS,prefixes:N.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:G.MASS,prefixes:N.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:G.MASS,prefixes:N.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:G.MASS,prefixes:N.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:G.MASS,prefixes:N.NONE,value:45.359237,offset:0},stick:{name:"stick",base:G.MASS,prefixes:N.NONE,value:.115,offset:0},stone:{name:"stone",base:G.MASS,prefixes:N.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:G.MASS,prefixes:N.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:G.MASS,prefixes:N.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:G.MASS,prefixes:N.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:G.MASS,prefixes:N.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:G.MASS,prefixes:N.NONE,value:45.359237,offset:0},s:{name:"s",base:G.TIME,prefixes:N.SHORT,value:1,offset:0},min:{name:"min",base:G.TIME,prefixes:N.NONE,value:60,offset:0},h:{name:"h",base:G.TIME,prefixes:N.NONE,value:3600,offset:0},second:{name:"second",base:G.TIME,prefixes:N.LONG,value:1,offset:0},sec:{name:"sec",base:G.TIME,prefixes:N.LONG,value:1,offset:0},minute:{name:"minute",base:G.TIME,prefixes:N.NONE,value:60,offset:0},hour:{name:"hour",base:G.TIME,prefixes:N.NONE,value:3600,offset:0},day:{name:"day",base:G.TIME,prefixes:N.NONE,value:86400,offset:0},week:{name:"week",base:G.TIME,prefixes:N.NONE,value:604800,offset:0},month:{name:"month",base:G.TIME,prefixes:N.NONE,value:2629800,offset:0},year:{name:"year",base:G.TIME,prefixes:N.NONE,value:31557600,offset:0},decade:{name:"decade",base:G.TIME,prefixes:N.NONE,value:315576e3,offset:0},century:{name:"century",base:G.TIME,prefixes:N.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:G.TIME,prefixes:N.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:G.FREQUENCY,prefixes:N.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:G.FREQUENCY,prefixes:N.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:G.ANGLE,prefixes:N.SHORT,value:1,offset:0},radian:{name:"radian",base:G.ANGLE,prefixes:N.LONG,value:1,offset:0},deg:{name:"deg",base:G.ANGLE,prefixes:N.SHORT,value:null,offset:0},degree:{name:"degree",base:G.ANGLE,prefixes:N.LONG,value:null,offset:0},grad:{name:"grad",base:G.ANGLE,prefixes:N.SHORT,value:null,offset:0},gradian:{name:"gradian",base:G.ANGLE,prefixes:N.LONG,value:null,offset:0},cycle:{name:"cycle",base:G.ANGLE,prefixes:N.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:G.ANGLE,prefixes:N.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:G.ANGLE,prefixes:N.NONE,value:null,offset:0},A:{name:"A",base:G.CURRENT,prefixes:N.SHORT,value:1,offset:0},ampere:{name:"ampere",base:G.CURRENT,prefixes:N.LONG,value:1,offset:0},K:{name:"K",base:G.TEMPERATURE,prefixes:N.NONE,value:1,offset:0},degC:{name:"degC",base:G.TEMPERATURE,prefixes:N.NONE,value:1,offset:273.15},degF:{name:"degF",base:G.TEMPERATURE,prefixes:N.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:G.TEMPERATURE,prefixes:N.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:G.TEMPERATURE,prefixes:N.NONE,value:1,offset:0},celsius:{name:"celsius",base:G.TEMPERATURE,prefixes:N.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:G.TEMPERATURE,prefixes:N.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:G.TEMPERATURE,prefixes:N.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:G.AMOUNT_OF_SUBSTANCE,prefixes:N.SHORT,value:1,offset:0},mole:{name:"mole",base:G.AMOUNT_OF_SUBSTANCE,prefixes:N.LONG,value:1,offset:0},cd:{name:"cd",base:G.LUMINOUS_INTENSITY,prefixes:N.SHORT,value:1,offset:0},candela:{name:"candela",base:G.LUMINOUS_INTENSITY,prefixes:N.LONG,value:1,offset:0},N:{name:"N",base:G.FORCE,prefixes:N.SHORT,value:1,offset:0},newton:{name:"newton",base:G.FORCE,prefixes:N.LONG,value:1,offset:0},dyn:{name:"dyn",base:G.FORCE,prefixes:N.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:G.FORCE,prefixes:N.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:G.FORCE,prefixes:N.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:G.FORCE,prefixes:N.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:G.FORCE,prefixes:N.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:G.FORCE,prefixes:N.NONE,value:9.80665,offset:0},J:{name:"J",base:G.ENERGY,prefixes:N.SHORT,value:1,offset:0},joule:{name:"joule",base:G.ENERGY,prefixes:N.SHORT,value:1,offset:0},erg:{name:"erg",base:G.ENERGY,prefixes:N.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:G.ENERGY,prefixes:N.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:G.ENERGY,prefixes:N.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:G.ENERGY,prefixes:N.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:G.ENERGY,prefixes:N.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:G.POWER,prefixes:N.SHORT,value:1,offset:0},watt:{name:"watt",base:G.POWER,prefixes:N.LONG,value:1,offset:0},hp:{name:"hp",base:G.POWER,prefixes:N.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:G.POWER,prefixes:N.SHORT,value:v.I,offset:0},VA:{name:"VA",base:G.POWER,prefixes:N.SHORT,value:1,offset:0},Pa:{name:"Pa",base:G.PRESSURE,prefixes:N.SHORT,value:1,offset:0},psi:{name:"psi",base:G.PRESSURE,prefixes:N.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:G.PRESSURE,prefixes:N.NONE,value:101325,offset:0},bar:{name:"bar",base:G.PRESSURE,prefixes:N.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:G.PRESSURE,prefixes:N.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:G.PRESSURE,prefixes:N.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:G.PRESSURE,prefixes:N.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:G.PRESSURE,prefixes:N.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:G.ELECTRIC_CHARGE,prefixes:N.LONG,value:1,offset:0},C:{name:"C",base:G.ELECTRIC_CHARGE,prefixes:N.SHORT,value:1,offset:0},farad:{name:"farad",base:G.ELECTRIC_CAPACITANCE,prefixes:N.LONG,value:1,offset:0},F:{name:"F",base:G.ELECTRIC_CAPACITANCE,prefixes:N.SHORT,value:1,offset:0},volt:{name:"volt",base:G.ELECTRIC_POTENTIAL,prefixes:N.LONG,value:1,offset:0},V:{name:"V",base:G.ELECTRIC_POTENTIAL,prefixes:N.SHORT,value:1,offset:0},ohm:{name:"ohm",base:G.ELECTRIC_RESISTANCE,prefixes:N.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:G.ELECTRIC_INDUCTANCE,prefixes:N.LONG,value:1,offset:0},H:{name:"H",base:G.ELECTRIC_INDUCTANCE,prefixes:N.SHORT,value:1,offset:0},siemens:{name:"siemens",base:G.ELECTRIC_CONDUCTANCE,prefixes:N.LONG,value:1,offset:0},S:{name:"S",base:G.ELECTRIC_CONDUCTANCE,prefixes:N.SHORT,value:1,offset:0},weber:{name:"weber",base:G.MAGNETIC_FLUX,prefixes:N.LONG,value:1,offset:0},Wb:{name:"Wb",base:G.MAGNETIC_FLUX,prefixes:N.SHORT,value:1,offset:0},tesla:{name:"tesla",base:G.MAGNETIC_FLUX_DENSITY,prefixes:N.LONG,value:1,offset:0},T:{name:"T",base:G.MAGNETIC_FLUX_DENSITY,prefixes:N.SHORT,value:1,offset:0},b:{name:"b",base:G.BIT,prefixes:N.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:G.BIT,prefixes:N.BINARY_LONG,value:1,offset:0},B:{name:"B",base:G.BIT,prefixes:N.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:G.BIT,prefixes:N.BINARY_LONG,value:8,offset:0}},j={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function L(t){if("BigNumber"===t.number){var e=qt(B);T.rad.value=new B(1),T.deg.value=e.div(180),T.grad.value=e.div(200),T.cycle.value=e.times(2),T.arcsec.value=e.div(648e3),T.arcmin.value=e.div(10800)}else T.rad.value=1,T.deg.value=Math.PI/180,T.grad.value=Math.PI/200,T.cycle.value=2*Math.PI,T.arcsec.value=Math.PI/648e3,T.arcmin.value=Math.PI/10800;T.radian.value=T.rad.value,T.degree.value=T.deg.value,T.gradian.value=T.grad.value}L(o),i&&i("config",(function(t,e){t.number!==e.number&&L(t)}));var V={si:{NONE:{unit:M,prefix:N.NONE[""]},LENGTH:{unit:T.m,prefix:N.SHORT[""]},MASS:{unit:T.g,prefix:N.SHORT.k},TIME:{unit:T.s,prefix:N.SHORT[""]},CURRENT:{unit:T.A,prefix:N.SHORT[""]},TEMPERATURE:{unit:T.K,prefix:N.SHORT[""]},LUMINOUS_INTENSITY:{unit:T.cd,prefix:N.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:T.mol,prefix:N.SHORT[""]},ANGLE:{unit:T.rad,prefix:N.SHORT[""]},BIT:{unit:T.bits,prefix:N.SHORT[""]},FORCE:{unit:T.N,prefix:N.SHORT[""]},ENERGY:{unit:T.J,prefix:N.SHORT[""]},POWER:{unit:T.W,prefix:N.SHORT[""]},PRESSURE:{unit:T.Pa,prefix:N.SHORT[""]},ELECTRIC_CHARGE:{unit:T.C,prefix:N.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:T.F,prefix:N.SHORT[""]},ELECTRIC_POTENTIAL:{unit:T.V,prefix:N.SHORT[""]},ELECTRIC_RESISTANCE:{unit:T.ohm,prefix:N.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:T.H,prefix:N.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:T.S,prefix:N.SHORT[""]},MAGNETIC_FLUX:{unit:T.Wb,prefix:N.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:T.T,prefix:N.SHORT[""]},FREQUENCY:{unit:T.Hz,prefix:N.SHORT[""]}}};V.cgs=JSON.parse(JSON.stringify(V.si)),V.cgs.LENGTH={unit:T.m,prefix:N.SHORT.c},V.cgs.MASS={unit:T.g,prefix:N.SHORT[""]},V.cgs.FORCE={unit:T.dyn,prefix:N.SHORT[""]},V.cgs.ENERGY={unit:T.erg,prefix:N.NONE[""]},V.us=JSON.parse(JSON.stringify(V.si)),V.us.LENGTH={unit:T.ft,prefix:N.NONE[""]},V.us.MASS={unit:T.lbm,prefix:N.NONE[""]},V.us.TEMPERATURE={unit:T.degF,prefix:N.NONE[""]},V.us.FORCE={unit:T.lbf,prefix:N.NONE[""]},V.us.ENERGY={unit:T.BTU,prefix:N.BTU[""]},V.us.POWER={unit:T.hp,prefix:N.NONE[""]},V.us.PRESSURE={unit:T.psi,prefix:N.NONE[""]},V.auto=JSON.parse(JSON.stringify(V.si));var Z=V.auto;for(var P in E.setUnitSystem=function(t){if(!it(V,t))throw new Error("Unit system "+t+" does not exist. Choices are: "+Object.keys(V).join(", "));Z=V[t]},E.getUnitSystem=function(){for(var t in V)if(it(V,t)&&V[t]===Z)return t},E.typeConverters={BigNumber:function(t){return new B(t+"")},Fraction:function(t){return new m(t)},Complex:function(t){return t},number:function(t){return t}},E._getNumberConverter=function(t){if(!E.typeConverters[t])throw new TypeError('Unsupported type "'+t+'"');return E.typeConverters[t]},T)if(it(T,P)){var W=T[P];W.dimensions=W.base.dimensions}for(var J in j)if(it(j,J)){var H=T[j[J]],Y={};for(var X in H)it(H,X)&&(Y[X]=H[X]);Y.name=J,T[J]=Y}return E.isValidAlpha=function(t){return/^[a-zA-Z]$/.test(t)},E.createUnit=function(t,e){if("object"!==typeof t)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(e&&e.override)for(var n in t)if(it(t,n)&&E.deleteUnit(n),t[n].aliases)for(var r=0;r<t[n].aliases.length;r++)E.deleteUnit(t[n].aliases[r]);var i;for(var o in t)it(t,o)&&(i=E.createUnitSingle(o,t[o]));return i},E.createUnitSingle=function(t,e,n){if("undefined"!==typeof e&&null!==e||(e={}),"string"!==typeof t)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(it(T,t))throw new Error('Cannot create unit "'+t+'": a unit with that name already exists');!function(t){for(var e=0;e<t.length;e++){if(r=t.charAt(e),0===e&&!E.isValidAlpha(r))throw new Error('Invalid unit name (must begin with alpha character): "'+t+'"');if(e>0&&!E.isValidAlpha(r)&&!F(r))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+t+'"')}}(t);var i,o,a,A=null,s=[],c=0;if(e&&"Unit"===e.type)A=e.clone();else if("string"===typeof e)""!==e&&(i=e);else{if("object"!==typeof e)throw new TypeError('Cannot create unit "'+t+'" from "'+e.toString()+'": expecting "string" or "Unit" or "Object"');i=e.definition,o=e.prefixes,c=e.offset,a=e.baseName,e.aliases&&(s=e.aliases.valueOf())}if(s)for(var u=0;u<s.length;u++)if(it(T,s[u]))throw new Error('Cannot create alias "'+s[u]+'": a unit with that name already exists');if(i&&"string"===typeof i&&!A)try{A=E.parse(i,{allowNoUnits:!0})}catch(Q){throw Q.message='Could not create unit "'+t+'" from "'+i+'": '+Q.message,Q}else i&&"Unit"===i.type&&(A=i.clone());s=s||[],c=c||0,o=o&&o.toUpperCase&&N[o.toUpperCase()]||N.NONE;var l={};if(A){l={name:t,value:A.value,dimensions:A.dimensions.slice(0),prefixes:o,offset:c};var g=!1;for(var f in G)if(it(G,f)){for(var h=!0,d=0;d<D.length;d++)if(Math.abs((l.dimensions[d]||0)-(G[f].dimensions[d]||0))>1e-12){h=!1;break}if(h){g=!0,l.base=G[f];break}}if(!g){a=a||t+"_STUFF";var I={dimensions:A.dimensions.slice(0)};I.key=a,G[a]=I,Z[a]={unit:l,prefix:N.NONE[""]},l.base=G[a]}}else{if(a=a||t+"_STUFF",D.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+t+'": a base unit with that name already exists (and cannot be overridden)');for(var p in D.push(a),G)it(G,p)&&(G[p].dimensions[D.length-1]=0);for(var C={dimensions:[]},y=0;y<D.length;y++)C.dimensions[y]=0;C.dimensions[D.length-1]=1,C.key=a,G[a]=C,l={name:t,value:1,dimensions:G[a].dimensions.slice(0),prefixes:o,offset:c,base:G[a]},Z[a]={unit:l,prefix:N.NONE[""]}}E.UNITS[t]=l;for(var v=0;v<s.length;v++){var B=s[v],m={};for(var b in l)it(l,b)&&(m[b]=l[b]);m.name=B,E.UNITS[B]=m}return delete k.cache,new E(null,t)},E.deleteUnit=function(t){delete E.UNITS[t]},E.PREFIXES=N,E.BASE_DIMENSIONS=D,E.BASE_UNITS=G,E.UNIT_SYSTEMS=V,E.UNITS=T,E}),{isClass:!0});var Dr=["typed","Unit"],Gr=Wt("unit",Dr,(function(t){var e=t.typed,n=t.Unit;return e("unit",{Unit:function(t){return t.clone()},string:function(t){return n.isValuelessUnit(t)?new n(null,t):n.parse(t,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(t,e){return new n(t,e)},"Array | Matrix":function(t){return Ie(t,this)}})})),_r=Xt({}),Mr=ne({config:st}),Tr=re({}),jr=Ae({}),Lr=se({Matrix:Tr}),Vr=ge({BigNumber:Mr,Complex:_r,DenseMatrix:Lr,Fraction:jr}),Zr=pe({typed:Vr}),Pr=Ee({config:st,typed:Vr}),Wr=Qe({typed:Vr}),Jr=Xe({typed:Vr}),Hr=cn({typed:Vr}),Yr=Un({Fraction:jr,typed:Vr}),Xr=xn({typed:Vr}),zr=kn({typed:Vr}),Kr=On({typed:Vr}),qr=Nn({Matrix:Tr,equalScalar:Pr,typed:Vr}),$r=Dn({DenseMatrix:Lr,Matrix:Tr,SparseMatrix:qr,typed:Vr}),ti=Wn({BigNumber:Mr,DenseMatrix:Lr,SparseMatrix:qr,config:st,matrix:$r,typed:Vr}),ei=Xn({matrix:$r,config:st,typed:Vr}),ni=zn({BigNumber:Mr,config:st,matrix:$r,typed:Vr}),ri=er({BigNumber:Mr,DenseMatrix:Lr,equalScalar:Pr,matrix:$r,typed:Vr,zeros:ni}),ii=rr({BigNumber:Mr,DenseMatrix:Lr,Fraction:jr,config:st,equalScalar:Pr,matrix:$r,typed:Vr}),oi=ir({DenseMatrix:Lr,config:st,matrix:$r,typed:Vr}),ai=or({DenseMatrix:Lr,config:st,matrix:$r,typed:Vr}),Ai=ar({larger:ai,smaller:oi}),si=Ar({addScalar:zr,conj:Kr,multiplyScalar:Jr,size:ei,typed:Vr}),ci=sr({typed:Vr}),ui=ur({config:st,equalScalar:Pr,matrix:$r,round:ri,typed:Vr}),li=lr({addScalar:zr,dot:si,equalScalar:Pr,matrix:$r,multiplyScalar:Jr,typed:Vr}),gi=fr({Complex:_r,config:st,fraction:Yr,identity:ti,matrix:$r,multiply:li,number:Wr,typed:Vr}),fi=pr({BigNumber:Mr,typed:Vr}),hi=Cr({bignumber:fi,fraction:Yr,number:Wr}),di=yr({config:st,equalScalar:Pr,matrix:$r,round:ri,typed:Vr}),Ii=vr({DenseMatrix:Lr,addScalar:zr,equalScalar:Pr,matrix:$r,typed:Vr,unaryMinus:Xr}),pi=mr({DenseMatrix:Lr,equalScalar:Pr,matrix:$r,typed:Vr}),Ci=br({Complex:_r,ceil:di,floor:ui,matrix:$r,typed:Vr}),yi=Er({numeric:hi,typed:Vr}),vi=Qr({FibonacciHeap:Ai,addScalar:zr,equalScalar:Pr}),Bi=Fr({DenseMatrix:Lr,Spa:vi,SparseMatrix:qr,abs:ci,addScalar:zr,divideScalar:yi,equalScalar:Pr,larger:ai,matrix:$r,multiplyScalar:Jr,subtract:Ii,typed:Vr,unaryMinus:Xr}),mi=wr({lup:Bi,matrix:$r,multiply:li,subtract:Ii,typed:Vr,unaryMinus:Xr}),bi=Sr({abs:ci,addScalar:zr,det:mi,divideScalar:yi,identity:ti,matrix:$r,multiply:li,typed:Vr,unaryMinus:Xr}),Ei=Rr({divideScalar:yi,equalScalar:Pr,inv:bi,matrix:$r,multiply:li,typed:Vr}),Qi=Nr({BigNumber:Mr,Complex:_r,Fraction:jr,abs:ci,addScalar:zr,config:st,divideScalar:yi,equal:pi,fix:Ci,format:Hr,isNumeric:Zr,multiplyScalar:Jr,number:Wr,pow:gi,round:ri,subtract:Ii}),Fi=Gr({Unit:Qi,typed:Vr}),wi=n(92),Si=n(75),Ri=n(120);function Ui(t,e,n){return[[t,e+n],[t+n,e],[t,e-n],[t-n,e]]}function xi(t){return t.sort((function(t,e){return Ri.b.indexOf(t.type)-Ri.b.indexOf(e.type)}))}function ki(t){for(var e=[],n=function(t){var e=t.filter((function(t){return Ri.g.includes(t.field)})),n={};return e.forEach((function(t){n[t.field]=Math.floor((t.values.length||0)/2)})),n}(t),r=t.filter((function(t){return!Ri.g.includes(t.field)&&t.values}))[0],i=0;i<Math.min(4,r.values.length);i+=1)e.push(Object(s.a)(Object(A.a)({},r.field,i),n));return e}function Oi(t,e,n){return Ni.apply(this,arguments)}function Ni(){return(Ni=Object(a.a)(i.a.mark((function t(e,n,r){var o,a,A,s;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(g.h)({loader:e,loaderSelection:[n]});case 2:return o=t.sent,a=e.isRgb?[[0,255],[0,255],[0,255]][r]:o[0].domain,A=e.isRgb?[[255,0,0],[0,255,0],[0,0,255]][r]:Si.e[r],s=e.isRgb?[[0,255],[0,255],[0,255]][r]:o[0].autoSliders,t.abrupt("return",{selection:n,color:A,visible:!0,slider:s||a});case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Di(t){return Gi.apply(this,arguments)}function Gi(){return(Gi=Object(a.a)(i.a.mark((function t(e){var n,r,o,a,A,s,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],r=e.dimensions,o=ki(r),t.next=5,Object(g.h)({loader:e,loaderSelection:o});case 5:return a=t.sent,A=e.isRgb?[[0,255],[0,255],[0,255]]:a.map((function(t){return t.domain})),s=e.isRgb?[[255,0,0],[0,255,0],[0,0,255]]:null,c=e.isRgb?[[0,255],[0,255],[0,255]]:a.map((function(t){return t.autoSliders})),o.forEach((function(t,e){var r=A[e],i=c[e],o={selection:t,color:s?s[e]:Si.e[e],visible:!0,slider:i||r};n.push(o)})),t.abrupt("return",n);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _i(t,e){return Mi.apply(this,arguments)}function Mi(){return(Mi=Object(a.a)(i.a.mark((function t(e,n){var r,o,a,A,c,u;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=Object(l.cloneDeep)(e),o=[],a=!1,A=function(t){var e=r[t],i=n[e.index],A=Promise.resolve(e);if(e.channels){for(var c=[],u=function(t){var n=e.channels[t],r=Promise.resolve(n);!n.selection||n.color&&n.slider||(r=Oi(i,n.selection,t).then((function(t){return Promise.resolve(Object(s.a)({},t,{},n))})),a=!0),c.push(r)},l=0;l<e.channels.length;l++)u(l);A=Promise.all(c).then((function(t){return Promise.resolve(Object(s.a)({},e,{channels:t}))}))}o.push(A)},c=0;c<r.length;c++)A(c);return t.next=7,Promise.all(o);case 7:return u=t.sent,t.abrupt("return",[u,a]);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ti(t,e){if(t.map((function(t){var e,n,r,i,o,a;return(null===t||void 0===t||null===(e=t.metadata)||void 0===e||null===(n=e.transform)||void 0===n?void 0:n.matrix)||(null===t||void 0===t||null===(r=t.metadata)||void 0===r||null===(i=r.transform)||void 0===i?void 0:i.scale)||(null===t||void 0===t||null===(o=t.metadata)||void 0===o||null===(a=o.transform)||void 0===a?void 0:a.translate)})).some(Boolean)||e.every((function(t){var e,n;return!(null===t||void 0===t||null===(e=t.physicalSizes)||void 0===e?void 0:e.x)||!(null===t||void 0===t||null===(n=t.physicalSizes)||void 0===n?void 0:n.y)})))return t;var n=e.reduce((function(t,e){var n=[Fi("".concat(e.physicalSizes.x.value," ").concat(e.physicalSizes.x.unit).replace("\xb5","u")),Fi("".concat(e.physicalSizes.y.value," ").concat(e.physicalSizes.y.unit).replace("\xb5","u"))];return t[0]=void 0===t[0]||-1===ii(n[0],t[0])?n[0]:t[0],t[1]=void 0===t[1]||-1===ii(n[1],t[1])?n[1]:t[1],t}),[]);return t.map((function(t,r){var i=e[r],a=[Fi("".concat(i.physicalSizes.x.value," ").concat(i.physicalSizes.x.unit).replace("\xb5","u")),Fi("".concat(i.physicalSizes.y.value," ").concat(i.physicalSizes.y.unit).replace("\xb5","u"))].map((function(t,e){return Ei(t,n[e])}));if(Object(l.isEqual)(a,[1,1]))return t;var A=(new f.Matrix4).scale([].concat(Object(o.a)(a),[1])),c=Object(s.a)({},t);return c.metadata=Object(s.a)({},c.metadata,{transform:{matrix:A.toArray()}}),c}))}function ji(t,e,n){return Li.apply(this,arguments)}function Li(){return(Li=Object(a.a)(i.a.mark((function t(e,n,r){var o,a,A,c,u,l,g,f,h,d,I,p,C,y;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=[],a=[],A=[],t.next=5,Promise.all(e.map((function(t){return t.loaderCreator()})));case 5:for(c=t.sent,u=0;u<e.length;u++)l=e[u],g=c[u],o[u]=g,a[u]=l;if(r&&(a=Ti(a,o)),n)for(I=n.map((function(t){return e.findIndex((function(e){return e.name===t}))})),p=function(t){var e=I[t],n=Di(o[e]).then((function(n){var r,i,o;return Promise.resolve(Object(s.a)({type:"raster",index:e},Ri.f,{channels:n,domainType:"Min/Max",modelMatrix:null===(r=a[e])||void 0===r||null===(i=r.metadata)||void 0===i||null===(o=i.transform)||void 0===o?void 0:o.matrix,transparentColor:t>0?[0,0,0]:null}))}));A.push(n)},C=0;C<I.length;C++)p(C);else f=Math.floor(e.length/2),h=o[f],d=Di(h).then((function(t){var e,n,r;return Promise.resolve(Object(s.a)({type:"raster",index:f},Ri.f,{channels:t,modelMatrix:null===(e=a[f])||void 0===e||null===(n=e.metadata)||void 0===n||null===(r=n.transform)||void 0===r?void 0:r.matrix,transparentColor:f>0?[0,0,0]:null}))})),A.push(d);return t.next=11,Promise.all(A);case 11:return y=t.sent,t.abrupt("return",[y,o,a]);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Vi(t){var e=t.observationsCount,n=t.observationsLabel,r=t.observationsPluralLabel,i=t.subobservationsCount,o=t.subobservationsLabel,a=t.subobservationsPluralLabel,A=t.locationsCount,s=[];if(i>0){var c="".concat(i," ").concat(Object(wi.d)(o,a,i));A>0&&(c+=" at ".concat(u()(A)," locations")),s.push(c)}return e>0&&s.push("".concat(e," ").concat(Object(wi.d)(n,r,e))),s.join(", ")}n.d(e,"f",(function(){return Ui})),n.d(e,"e",(function(){return xi})),n.d(e,"a",(function(){return Di})),n.d(e,"b",(function(){return _i})),n.d(e,"c",(function(){return ji})),n.d(e,"d",(function(){return Vi}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69),i=n(109);function o(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=o(e,t);return n=(n+180)%360}(t,e);var a=i.getCoord(t),A=i.getCoord(e),s=r.degreesToRadians(a[0]),c=r.degreesToRadians(A[0]),u=r.degreesToRadians(a[1]),l=r.degreesToRadians(A[1]),g=Math.sin(c-s)*Math.cos(l),f=Math.cos(u)*Math.sin(l)-Math.sin(u)*Math.cos(l)*Math.cos(c-s);return r.radiansToDegrees(Math.atan2(g,f))}e.default=o},function(t,e,n){var r=n(192),i=n(578),o=n(404),a=Math.max,A=Math.min;t.exports=function(t,e,n){var s,c,u,l,g,f,h=0,d=!1,I=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function C(e){var n=s,r=c;return s=c=void 0,h=e,l=t.apply(r,n)}function y(t){return h=t,g=setTimeout(B,e),d?C(t):l}function v(t){var n=t-f;return void 0===f||n>=e||n<0||I&&t-h>=u}function B(){var t=i();if(v(t))return m(t);g=setTimeout(B,function(t){var n=e-(t-f);return I?A(n,u-(t-h)):n}(t))}function m(t){return g=void 0,p&&s?C(t):(s=c=void 0,l)}function b(){var t=i(),n=v(t);if(s=arguments,c=this,f=t,n){if(void 0===g)return y(f);if(I)return clearTimeout(g),g=setTimeout(B,e),C(f)}return void 0===g&&(g=setTimeout(B,e)),l}return e=o(e)||0,r(n)&&(d=!!n.leading,u=(I="maxWait"in n)?a(o(n.maxWait)||0,e):u,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==g&&clearTimeout(g),h=0,s=f=c=g=void 0},b.flush=function(){return void 0===g?l:m(i())},b}},function(t,e,n){"use strict";function r(t){var e=t.props,n=t.states,r=t.muiFormControl;return n.reduce((function(t,n){return t[n]=e[n],r&&"undefined"===typeof e[n]&&(t[n]=r[n]),t}),{})}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(97);function i(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function o(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.a.debug&&!i(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var A={};function s(t,e){A[t]||(A[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,n){var r=n(869),i=n(404);t.exports=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=i(n))===n?n:0),void 0!==e&&(e=(e=i(e))===e?e:0),r(i(t),e,n)}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(1055),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t,e,n){return e in t?(0,o.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},,function(t,e,n){"use strict";var r=n(589).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=c,e=4;break;case"utf8":this.fillLast=A,e=4;break;case"base64":this.text=u,this.end=l,e=3;break;default:return this.write=g,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function A(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function g(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\ufffd":e},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=a(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=a(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=a(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var r="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!==typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],a.set(o,i),i+=o.length;return a}},a={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(r)},function(t,e,n){"use strict";(function(e){"undefined"===typeof e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,i){if("function"!==typeof t)throw new TypeError('"callback" argument must be a function');var o,a,A=arguments.length;switch(A){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,i)}));default:for(o=new Array(A-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this,n(68))},function(t,e,n){"use strict";var r=n(147),i=n(147).buildOptions,o=n(626);"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var a={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};e.defaultOptions=a;var A=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];function s(t,e,n){return e&&(n.trimValues&&(e=e.trim()),e=u(e=n.tagValueProcessor(e,t),n.parseNodeValue,n.parseTrueNumberOnly)),e}function c(t,e){if(e.ignoreNameSpace){var n=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===n[0])return"";2===n.length&&(t=r+n[1])}return t}function u(t,e,n){var i;return e&&"string"===typeof t?(""===t.trim()||isNaN(t)?i="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?i=Number.parseInt(t,16):-1!==t.indexOf(".")?(i=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):i=Number.parseInt(t,10),n&&(i=String(i)===t?i:t)),i):r.isExist(t)?t:""}e.props=A;var l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function g(t,e){if(!e.ignoreAttributes&&"string"===typeof t){t=t.replace(/\r?\n/g," ");for(var n=r.getAllMatches(t,l),i=n.length,o={},a=0;a<i;a++){var A=c(n[a][1],e);A.length&&(void 0!==n[a][4]?(e.trimValues&&(n[a][4]=n[a][4].trim()),n[a][4]=e.attrValueProcessor(n[a][4],A),o[e.attributeNamePrefix+A]=u(n[a][4],e.parseAttributeValue,e.parseTrueNumberOnly)):e.allowBooleanAttributes&&(o[e.attributeNamePrefix+A]=!0))}if(!Object.keys(o).length)return;if(e.attrNodeName){var s={};return s[e.attrNodeName]=o,s}return o}}function f(t,e){for(var n,r="",i=e;i<t.length;i++){var o=t[i];if(n)o===n&&(n="");else if('"'===o||"'"===o)n=o;else{if(">"===o)return{data:r,index:i};"\t"===o&&(o=" ")}r+=o}}function h(t,e,n,r){var i=t.indexOf(e,n);if(-1===i)throw new Error(r);return i+e.length-1}e.getTraversalObj=function(t,e){t=t.replace(/\r\n?/g,"\n"),e=i(e,a,A);for(var n=new o("!xml"),c=n,u="",l=0;l<t.length;l++){if("<"===t[l])if("/"===t[l+1]){var d=h(t,">",l,"Closing Tag is not closed."),I=t.substring(l+2,d).trim();if(e.ignoreNameSpace){var p=I.indexOf(":");-1!==p&&(I=I.substr(p+1))}c&&(c.val?c.val=r.getValue(c.val)+""+s(I,u,e):c.val=s(I,u,e)),e.stopNodes.length&&e.stopNodes.includes(c.tagname)&&(c.child=[],void 0==c.attrsMap&&(c.attrsMap={}),c.val=t.substr(c.startIndex+1,l-c.startIndex-1)),c=c.parent,u="",l=d}else if("?"===t[l+1])l=h(t,"?>",l,"Pi Tag is not closed.");else if("!--"===t.substr(l+1,3))l=h(t,"--\x3e",l,"Comment is not closed.");else if("!D"===t.substr(l+1,2)){var C=h(t,">",l,"DOCTYPE is not closed.");l=t.substring(l,C).indexOf("[")>=0?t.indexOf("]>",l)+1:C}else if("!["===t.substr(l+1,2)){var y=h(t,"]]>",l,"CDATA is not closed.")-2,v=t.substring(l+9,y);if(u&&(c.val=r.getValue(c.val)+""+s(c.tagname,u,e),u=""),e.cdataTagName){var B=new o(e.cdataTagName,c,v);c.addChild(B),c.val=r.getValue(c.val)+e.cdataPositionChar,v&&(B.val=v)}else c.val=(c.val||"")+(v||"");l=y+2}else{var m=f(t,l+1),b=m.data,E=m.index,Q=b.indexOf(" "),F=b;if(-1!==Q&&(F=b.substr(0,Q).replace(/\s\s*$/,""),b=b.substr(Q+1)),e.ignoreNameSpace){var w=F.indexOf(":");-1!==w&&(F=F.substr(w+1))}if(c&&u&&"!xml"!==c.tagname&&(c.val=r.getValue(c.val)+""+s(c.tagname,u,e)),b.length>0&&b.lastIndexOf("/")===b.length-1){b="/"===F[F.length-1]?F=F.substr(0,F.length-1):b.substr(0,b.length-1);var S=new o(F,c,"");F!==b&&(S.attrsMap=g(b,e)),c.addChild(S)}else{var R=new o(F,c);e.stopNodes.length&&e.stopNodes.includes(R.tagname)&&(R.startIndex=E),F!==b&&(R.attrsMap=g(b,e)),c.addChild(R),c=R}u="",l=E}else u+=t[l]}return n}},function(t,e,n){var r=n(643),i=n(644),o=n(645),a=n(646),A=n(647);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=A,t.exports=s},function(t,e,n){var r=n(329);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(194)(Object,"create");t.exports=r},function(t,e,n){var r=n(665);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){"use strict";var r=n(620),i=n(621);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=y,e.resolve=function(t,e){return y(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?y(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=y(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,A=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),l=["%","/","?",";","#"].concat(u),g=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=n(622);function y(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),A=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(A);c[0]=c[0].replace(/\\/g,"/");var y=t=c.join(A);if(y=y.trim(),!n&&1===t.split("#").length){var v=s.exec(y);if(v)return this.path=y,this.href=y,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?C.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var B=a.exec(y);if(B){var m=(B=B[0]).toLowerCase();this.protocol=m,y=y.substr(B.length)}if(n||B||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var b="//"===y.substr(0,2);!b||B&&I[B]||(y=y.substr(2),this.slashes=!0)}if(!I[B]&&(b||B&&!p[B])){for(var E,Q,F=-1,w=0;w<g.length;w++){-1!==(S=y.indexOf(g[w]))&&(-1===F||S<F)&&(F=S)}-1!==(Q=-1===F?y.lastIndexOf("@"):y.lastIndexOf("@",F))&&(E=y.slice(0,Q),y=y.slice(Q+1),this.auth=decodeURIComponent(E)),F=-1;for(w=0;w<l.length;w++){var S;-1!==(S=y.indexOf(l[w]))&&(-1===F||S<F)&&(F=S)}-1===F&&(F=y.length),this.host=y.slice(0,F),y=y.slice(F),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var U=this.hostname.split(/\./),x=(w=0,U.length);w<x;w++){var k=U[w];if(k&&!k.match(f)){for(var O="",N=0,D=k.length;N<D;N++)k.charCodeAt(N)>127?O+="x":O+=k[N];if(!O.match(f)){var G=U.slice(0,w),_=U.slice(w+1),M=k.match(h);M&&(G.push(M[1]),_.unshift(M[2])),_.length&&(y="/"+_.join(".")+y),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var T=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+T,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!d[m])for(w=0,x=u.length;w<x;w++){var L=u[w];if(-1!==y.indexOf(L)){var V=encodeURIComponent(L);V===L&&(V=escape(L)),y=y.split(L).join(V)}}var Z=y.indexOf("#");-1!==Z&&(this.hash=y.substr(Z),y=y.slice(0,Z));var P=y.indexOf("?");if(-1!==P?(this.search=y.substr(P),this.query=y.substr(P+1),e&&(this.query=C.parse(this.query)),y=y.slice(0,P)):e&&(this.search="",this.query={}),y&&(this.pathname=y),p[m]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){T=this.pathname||"";var W=this.search||"";this.path=T+W}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=C.stringify(this.query));var A=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||p[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),A&&"?"!==A.charAt(0)&&(A="?"+A),e+o+(n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(A=A.replace("#","%23"))+r},o.prototype.resolve=function(t){return this.resolveObject(y(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var n=new o,r=Object.keys(this),a=0;a<r.length;a++){var A=r[a];n[A]=this[A]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),c=0;c<s.length;c++){var u=s[c];"protocol"!==u&&(n[u]=t[u])}return p[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!p[t.protocol]){for(var l=Object.keys(t),g=0;g<l.length;g++){var f=l[g];n[f]=t[f]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||I[t.protocol])n.pathname=t.pathname;else{for(var h=(t.pathname||"").split("/");h.length&&!(t.host=h.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var d=n.pathname||"",C=n.search||"";n.path=d+C}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),B=v||y||n.host&&t.pathname,m=B,b=n.pathname&&n.pathname.split("/")||[],E=(h=t.pathname&&t.pathname.split("/")||[],n.protocol&&!p[n.protocol]);if(E&&(n.hostname="",n.port=null,n.host&&(""===b[0]?b[0]=n.host:b.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===h[0]?h[0]=t.host:h.unshift(t.host)),t.host=null),B=B&&(""===h[0]||""===b[0])),v)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,b=h;else if(h.length)b||(b=[]),b.pop(),b=b.concat(h),n.search=t.search,n.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(E)n.hostname=n.host=b.shift(),(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!b.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var Q=b.slice(-1)[0],F=(n.host||t.host||b.length>1)&&("."===Q||".."===Q)||""===Q,w=0,S=b.length;S>=0;S--)"."===(Q=b[S])?b.splice(S,1):".."===Q?(b.splice(S,1),w++):w&&(b.splice(S,1),w--);if(!B&&!m)for(;w--;w)b.unshift("..");!B||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),F&&"/"!==b.join("/").substr(-1)&&b.push("");var R,U=""===b[0]||b[0]&&"/"===b[0].charAt(0);E&&(n.hostname=n.host=U?"":b.length?b.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(B=B||n.host&&b.length)&&!U&&b.unshift(""),b.length?n.pathname=b.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=A.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(291),c=n(38),u=n(62),l=n(22),g=n(163);function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var h=[0,0,0],d={},I=function(t){Object(o.a)(n,t);var e=f(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&Object(c.f)(i)?t.copy(i):(c.b.debug&&(Object(u.a)(i),Object(u.a)(o),Object(u.a)(a)),t[0]=i,t[1]=o,t[2]=a),t}return Object(i.a)(n,null,[{key:"ZERO",get:function(){return d.ZERO=d.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(i.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return c.b.debug&&(Object(u.a)(t.x),Object(u.a)(t.y),Object(u.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return l.a(this,t)}},{key:"cross",value:function(t){return l.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?h:n;return l.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?h:n;return l.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?h:n;return l.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return l.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(g.c)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return l.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Object(g.b)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return l.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(u.a)(t)}}]),n}(s.a)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var r=n(27),i=n(287);function o(){return!("object"===("undefined"===typeof t?"undefined":Object(r.a)(t))&&"[object process]"===String(t)&&!t.browser)||Object(i.a)()}}).call(this,n(68))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(27);function i(e){if("undefined"!==typeof window&&"object"===Object(r.a)(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!==typeof t&&"object"===Object(r.a)(t.versions)&&Boolean(t.versions.electron))return!0;var n="object"===("undefined"===typeof navigator?"undefined":Object(r.a)(navigator))&&"string"===typeof navigator.userAgent&&navigator.userAgent,i=e||n;return!!(i&&i.indexOf("Electron")>=0)}}).call(this,n(68))},function(t,e,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(241);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){(function(t){var r=n(610),i=n(425),o=n(618),a=n(619),A=n(284),s=e;s.request=function(e,n){e="string"===typeof e?A.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||i,s=e.hostname||e.host,c=e.port,u=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?a+"//"+s:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new r(e);return n&&l.on("response",n),l},s.get=function(t,e){var n=s.request(t,e);return n.end(),n},s.ClientRequest=r,s.IncomingMessage=i.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=a,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(292),c=n(62),u=n(122);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"copy",value:function(t){return Object(u.a)(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(c.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(c.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(c.a)(this[t])}},{key:"setComponent",value:function(t,e){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(c.a)(t)}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(105),c=n(38),u=n(122);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(c.f)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(c.b)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(c.e)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(c.d)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(c.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(u.a)(!1),0}},{key:"RANK",get:function(){return Object(u.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(s.a)(Array))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(161),c=n(35),u=n(31),l=function(t){function e(){return Object(r.a)(this,e),Object(o.a)(this,Object(a.a)(e).apply(this,arguments))}return Object(A.a)(e,t),Object(i.a)(e,[{key:"toString",value:function(){var t="[";if(u.f.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(c.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(215),c=n(51),u=n(49);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"toString",value:function(){var t="[";if(u.a.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(c.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(s.a)},function(t,e,n){"use strict";function r(t){for(var e=t.data,n=t.getIndex,r=t.dataRange,i=t.replace,o=r.startRow,a=void 0===o?0:o,A=r.endRow,s=void 0===A?1/0:A,c=e.length,u=c,l=c,g=0;g<c;g++){var f=n(e[g]);if(u>g&&f>=a&&(u=g),f>=s){l=g;break}}for(var h=u,d=l-u!==i.length,I=d&&e.slice(l),p=0;p<i.length;p++)e[h++]=i[p];if(d){for(var C=0;C<I.length;C++)e[h++]=I[C];e.length=h}return{startRow:u,endRow:u+i.length}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(1),i=n(3),o=n(2),a=n(34),A=n(7),s=n(8),c=n(6),u=n(191),l=n(19);function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var d={blendFunc:[1,0,32771,0],blendEquation:32774},I=function(t){Object(A.a)(n,t);var e=h(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(t){t.pickingFBO?this._drawPickingBuffer(t):Object(a.a)(Object(c.a)(n.prototype),"render",this).call(this,t)}},{key:"_drawPickingBuffer",value:function(t){var e=this,r=t.layers,i=t.layerFilter,o=t.views,A=t.viewports,s=t.onViewportActive,u=t.pickingFBO,g=t.deviceRect,h=g.x,I=g.y,p=g.width,C=g.height,y=t.pass,v=void 0===y?"picking":y,B=t.redrawReason,m=t.pickZ,b=this.gl;return this.pickZ=m,Object(l.l)(b,f(f({scissorTest:!0,scissor:[h,I,p,C],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},d),{},{blend:!m}),(function(){Object(a.a)(Object(c.a)(n.prototype),"render",e).call(e,{target:u,layers:r,layerFilter:i,views:o,viewports:A,onViewportActive:s,pass:v,redrawReason:B})}))}},{key:"shouldDrawLayer",value:function(t){return t.props.pickable}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(t,e){var n=this.pickZ?{blend:!1}:f(f({},d),{},{blend:!0,blendColor:[0,0,0,(e+1)/255]});return Object.assign({},t.props.parameters,n)}}]),n}(u.a)},function(t,e,n){"use strict";var r=n(209);function i(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,n){return(o=i()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&Object(r.a)(o,n.prototype),o}).apply(null,arguments)}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";function r(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==t&&void 0!==t&&this.setState(t)}function i(t){this.setState(function(e){var n=this.constructor.getDerivedStateFromProps(t,e);return null!==n&&void 0!==n?n:null}.bind(this))}function o(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof t.getDerivedStateFromProps&&"function"!==typeof e.getSnapshotBeforeUpdate)return t;var n=null,a=null,A=null;if("function"===typeof e.componentWillMount?n="componentWillMount":"function"===typeof e.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof e.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof e.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof e.componentWillUpdate?A="componentWillUpdate":"function"===typeof e.UNSAFE_componentWillUpdate&&(A="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==A){var s=t.displayName||t.name,c="function"===typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n  "+n:"")+(null!==a?"\n  "+a:"")+(null!==A?"\n  "+A:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof t.getDerivedStateFromProps&&(e.componentWillMount=r,e.componentWillReceiveProps=i),"function"===typeof e.getSnapshotBeforeUpdate){if("function"!==typeof e.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=o;var u=e.componentDidUpdate;e.componentDidUpdate=function(t,e,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,t,e,r)}}return t}n.d(e,"a",(function(){return a})),r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return s}));var r=n(17),i=n(19),o=n(127),a=n(47);function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.framebuffer,r=void 0===n?null:n,o=e.color,A=void 0===o?null:o,s=e.depth,c=void 0===s?null:s,u=e.stencil,l=void 0===u?null:u,g={};r&&(g.framebuffer=r);var f=0;A&&(f|=16384,!0!==A&&(g.clearColor=A)),c&&(f|=256,!0!==c&&(g.clearDepth=c)),l&&(f|=1024,!0!==c&&(g.clearStencil=c)),Object(a.a)(0!==f,"clear: bad arguments"),Object(i.l)(t,g,(function(){t.clear(f)}))}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.framebuffer,A=void 0===n?null:n,s=e.buffer,c=void 0===s?6144:s,u=e.drawBuffer,l=void 0===u?0:u,g=e.value,f=void 0===g?[0,0,0,0]:g;Object(o.a)(t),Object(i.l)(t,{framebuffer:A},(function(){switch(c){case 6144:switch(f.constructor){case Int32Array:t.clearBufferiv(c,l,f);break;case Uint32Array:t.clearBufferuiv(c,l,f);break;case Float32Array:default:t.clearBufferfv(c,l,f)}break;case 6145:t.clearBufferfv(6145,0,[f]);break;case 6146:t.clearBufferiv(6146,0,[f]);break;case 34041:var e=Object(r.a)(f,2),n=e[0],i=e[1];t.clearBufferfi(34041,0,n,i);break;default:Object(a.a)(!1,"clear: bad arguments")}}))}},function(t,e,n){"use strict";var r,i=n(1),o=n(136),a=n(300);n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return g})),n.d(e,"b",(function(){return f}));var A=(r={},Object(i.a)(r,o.b,"#ifdef MODULE_LOGDEPTH\n  logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(i.a)(r,o.a,"#ifdef MODULE_MATERIAL\n  gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n  gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n  gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n  gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n  gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n  logdepth_setFragDepth();\n#endif\n"),r),s="__LUMA_INJECT_DECLARATIONS__",c=/void\s+main\s*\([^)]*\)\s*\{\n?/,u=/}\n?[^{}]*$/,l=[];function g(t,e,n,r){var i=e===o.b,a=function(e){var r=n[e];r.sort((function(t,e){return t.order-e.order})),l.length=r.length;for(var o=0,a=r.length;o<a;++o)l[o]=r[o].injection;var A="".concat(l.join("\n"),"\n");switch(e){case"vs:#decl":i&&(t=t.replace(s,A));break;case"vs:#main-start":i&&(t=t.replace(c,(function(t){return t+A})));break;case"vs:#main-end":i&&(t=t.replace(u,(function(t){return A+t})));break;case"fs:#decl":i||(t=t.replace(s,A));break;case"fs:#main-start":i||(t=t.replace(c,(function(t){return t+A})));break;case"fs:#main-end":i||(t=t.replace(u,(function(t){return A+t})));break;default:t=t.replace(e,(function(t){return t+A}))}};for(var g in n)a(g);return t=t.replace(s,""),r&&(t=t.replace(/\}\s*$/,(function(t){return t+A[e]}))),t}function f(t){var e={};return Object(a.a)(Array.isArray(t)&&t.length>1),t.forEach((function(t){for(var n in t)e[n]=e[n]?"".concat(e[n],"\n").concat(t[n]):t[n]})),e}},function(t,e,n){var r=n(131).Symbol;t.exports=r},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(27),i=n(73).b.COMPONENT;function o(t){var e=g(t);for(var n in e){var r=e[n],i=r.validate;if(i&&!i(t[n],r))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}function a(t,e){var n=s({newProps:t,oldProps:e,propTypes:g(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=function(t,e){if(null===e)return"oldProps is null, initial diff";var n=null,r=t.dataComparator,i=t._dataDiff;r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied");n&&i&&(n=i(t.data,e.data)||n);return n}(t,e),i=!1;return r||(i=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers){if(l(t,e,"all"))return{all:!0}}var n={},r=!1;for(var i in t.updateTriggers){if("all"!==i)l(t,e,i)&&(n[i]=!0,r=n)}return r}(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:u(t,e),transitionsChanged:A(t,e)}}function A(t,e){if(!t.transitions)return null;var n={},r=g(t);for(var i in t.transitions){var o=r[i],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&c(t[i],e[i],o)&&(n[i]=!0)}return n}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.newProps,n=t.oldProps,i=t.ignoreProps,o=void 0===i?{}:i,a=t.propTypes,A=void 0===a?{}:a,s=t.triggerName,u=void 0===s?"props":s;if(n===e)return null;if("object"!==Object(r.a)(e)||null===e)return"".concat(u," changed shallowly");if("object"!==Object(r.a)(n)||null===n)return"".concat(u," changed shallowly");for(var l=0,g=Object.keys(e);l<g.length;l++){var f=g[l];if(!(f in o)){if(!(f in n))return"".concat(u,".").concat(f," added");var h=c(e[f],n[f],A[f]);if(h)return"".concat(u,".").concat(f," ").concat(h)}}for(var d=0,I=Object.keys(n);d<I.length;d++){var p=I[d];if(!(p in o)){if(!(p in e))return"".concat(u,".").concat(p," dropped");if(!Object.hasOwnProperty.call(e,p)){var C=c(e[p],n[p],A[p]);if(C)return"".concat(u,".").concat(p," ").concat(C)}}}return null}function c(t,e,n){var r=n&&n.equal;return r&&!r(t,e,n)?"changed deeply":r||!(r=t&&e&&t.equals)||r.call(t,e)?r||e===t?null:"changed shallowly":"changed deeply"}function u(t,e){if(null===e)return"oldProps is null, initial diff";var n=e.extensions,r=t.extensions;if(r===n)return!1;if(r.length!==n.length)return!0;for(var i=0;i<r.length;i++)if(!r[i].equals(n[i]))return!0;return!1}function l(t,e,n){var r=t.updateTriggers[n];r=void 0===r||null===r?{}:r;var i=e.updateTriggers[n];return s({oldProps:i=void 0===i||null===i?{}:i,newProps:r,triggerName:n})}function g(t){var e=t[i],n=e&&e.constructor;return n?n._propTypes:{}}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(479),c=n(218),u=n(368),l=n(260),g=n(227),f=n(37),h=n(1),d=n(34),I=n(191),p=n(186),C=n(133),y=n(19);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){Object(h.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var b=function(t){Object(o.a)(n,t);var e=m(n);function n(t,i){var o,a,A;return Object(r.a)(this,n),(A=e.call(this,t,i)).shadowMap=new c.a(t,{width:1,height:1,parameters:(o={},Object(h.a)(o,10241,9729),Object(h.a)(o,10240,9729),Object(h.a)(o,10242,33071),Object(h.a)(o,10243,33071),o)}),A.depthBuffer=new p.a(t,{format:33189,width:1,height:1}),A.fbo=new C.a(t,{id:"shadowmap",width:1,height:1,attachments:(a={},Object(h.a)(a,36064,A.shadowMap),Object(h.a)(a,36096,A.depthBuffer),a)}),A}return Object(i.a)(n,[{key:"render",value:function(t){var e=this,r=this.fbo;Object(y.l)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(function(){var i=t.viewports[0],o=Object(y.c)(e.gl),a=i.width*o,s=i.height*o;a===r.width&&s===r.height||r.resize({width:a,height:s}),Object(d.a)(Object(A.a)(n.prototype),"render",e).call(e,B(B({},t),{},{target:r,pass:"shadow"}))}))}},{key:"shouldDrawLayer",value:function(t){return!1!==t.props.shadowEnabled}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),n}(I.a),E=n(216);function Q(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function w(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}n.d(e,"a",(function(){return x}));var S={color:[255,255,255],intensity:1},R=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],U=[0,0,0,200/255],x=function(t){Object(o.a)(n,t);var e=w(n);function n(t){var i;for(var o in Object(r.a)(this,n),(i=e.call(this,t)).ambientLight=null,i.directionalLights=[],i.pointLights=[],i.shadowColor=U,i.shadowPasses=[],i.shadowMaps=[],i.dummyShadowMap=null,i.shadow=!1,i.programManager=null,t){var a=t[o];switch(a.type){case"ambient":i.ambientLight=a;break;case"directional":i.directionalLights.push(a);break;case"point":i.pointLights.push(a)}}return i._applyDefaultLights(),i.shadow=i.directionalLights.some((function(t){return t.shadow})),i}return Object(i.a)(n,[{key:"preRender",value:function(t,e){var n=e.layers,r=e.layerFilter,i=e.viewports,o=e.onViewportActive,a=e.views;if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=s.a.getDefaultProgramManager(t),E.a&&this.programManager.addDefaultModule(E.a)),this.dummyShadowMap||(this.dummyShadowMap=new c.a(t,{width:1,height:1}));for(var A=0;A<this.shadowPasses.length;A++){this.shadowPasses[A].render({layers:n,layerFilter:r,viewports:i,onViewportActive:o,views:a,moduleParameters:{shadowLightId:A,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}},{key:"getModuleParameters",value:function(t){var e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((function(e){return e.getProjectedLight({layer:t})})),pointLights:this.pointLights.map((function(e){return e.getProjectedLight({layer:t})}))},e}},{key:"cleanup",value:function(){var t,e=Q(this.shadowPasses);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(E.a),this.programManager=null)}},{key:"_createLightMatrix",value:function(){var t,e=[],n=Q(this.directionalLights);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=(new f.a).lookAt({eye:new f.c(r.direction).negate()});e.push(i)}}catch(o){n.e(o)}finally{n.f()}return e}},{key:"_createShadowPasses",value:function(t){for(var e=0;e<this.directionalLights.length;e++){var n=new b(t);this.shadowPasses[e]=n,this.shadowMaps[e]=n.shadowMap}}},{key:"_applyDefaultLights",value:function(){var t=this.ambientLight,e=this.pointLights,n=this.directionalLights;t||0!==e.length||0!==n.length||(this.ambientLight=new u.a(S),this.directionalLights.push(new l.a(R[0]),new l.a(R[1])))}}]),n}(g.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(402);function o(){return r.useContext(i.a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return g}));var r=n(17),i=n(40),o=n(256),a=n(251),A=n(45),s=n(22),c=n(67);function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.projectPosition(t);if(n&&e instanceof a.a){var o=Object(r.a)(t,3),A=o[0],s=o[1],c=o[2],u=void 0===c?0:c,l=e.getDistanceScales([A,s]);i[2]=u*l.unitsPerMeter[2]}return i}function l(t,e){var n=e.viewport,o=e.modelMatrix,a=e.coordinateSystem,s=e.coordinateOrigin,l=e.offsetMode,g=Object(r.a)(t,3),f=g[0],h=g[1],d=g[2],I=void 0===d?0:d;if(o){var p=A.n([],[f,h,I,1],o),C=Object(r.a)(p,3);f=C[0],h=C[1],I=C[2]}switch(a){case i.a.LNGLAT:return u([f,h,I],n,l);case i.a.LNGLAT_OFFSETS:return u([f+s[0],h+s[1],I+(s[2]||0)],n,l);case i.a.METER_OFFSETS:return u(Object(c.a)(s,[f,h,I]),n,l);case i.a.CARTESIAN:default:return n.isGeospatial?[f+s[0],h+s[1],I+s[2]]:n.projectPosition([f,h,I])}}function g(t,e){var n=function(t){var e=Object.assign({},t),n=t.coordinateSystem,r=t.viewport,o=t.coordinateOrigin,a=t.fromCoordinateSystem,A=t.fromCoordinateOrigin;return n===i.a.DEFAULT&&(n=r.isGeospatial?i.a.LNGLAT:i.a.CARTESIAN),void 0===a&&(e.fromCoordinateSystem=n),void 0===A&&(e.fromCoordinateOrigin=o),e.coordinateSystem=n,e}(e),r=n.viewport,a=n.coordinateSystem,A=n.coordinateOrigin,c=n.modelMatrix,u=n.fromCoordinateSystem,g=n.fromCoordinateOrigin,f=Object(o.a)(r,a,A),h=f.geospatialOrigin,d=f.shaderCoordinateOrigin,I=f.offsetMode,p=l(t,{viewport:r,modelMatrix:c,coordinateSystem:u,coordinateOrigin:g,offsetMode:I});if(I){var C=r.projectPosition(h||d);s.o(p,p,C)}return p}},function(t,e,n){var r=n(761)();t.exports=r},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(239),a=function(){function t(e,n){Object(r.a)(this,t),this.name=e,this.type=n,this.sampleSize=1,this.reset()}return Object(i.a)(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Object(o.a)(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Object(o.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return 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=!1,this}},{key:"_checkSampling",value:function(){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)}}]),t}(),A=function(){function t(e){var n=e.id,i=e.stats;Object(r.a)(this,t),this.id=n,this.stats={},this._initializeStats(i),Object.seal(this)}return Object(i.a)(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,n=t.type;return this.stats[e]||(this.stats[e]=t instanceof a?t:new a(e,n)),this.stats[e]}},{key:"size",get:function(){return Object.keys(this.stats).length}}]),t}();n.d(e,"a",(function(){return A}))},function(t,e,n){"use strict";var r="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n  vec3 color;\n  vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n  return pointLight.attenuation.x\n       + pointLight.attenuation.y * distance\n       + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",i=(e.a={name:"lights",vs:r,fs:r,getUniforms:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;if("lightSources"in e){var n=e.lightSources||{},r=n.ambientLight,o=n.pointLights,A=n.directionalLights,s=r||o&&o.length>0||A&&A.length>0;return s?Object.assign({},a({ambientLight:r,pointLights:o,directionalLights:A}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){var c={pointLights:[],directionalLights:[]},u=!0,l=!1,g=void 0;try{for(var f,h=(e.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":c.ambientLight=d;break;case"directional":c.directionalLights.push(d);break;case"point":c.pointLights.push(d)}}}catch(I){l=!0,g=I}finally{try{u||null==h.return||h.return()}finally{if(l)throw g}}return t({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.color,n=void 0===e?[0,0,0]:e,r=t.intensity,i=void 0===r?1:r;return n.map((function(t){return t*i/255}))}function a(t){var e=t.ambientLight,n=t.pointLights,r=void 0===n?[]:n,i=t.directionalLights,a=void 0===i?[]:i,A={};return A["lighting_uAmbientLight.color"]=e?o(e):[0,0,0],r.forEach((function(t,e){A["lighting_uPointLight[".concat(e,"].color")]=o(t),A["lighting_uPointLight[".concat(e,"].position")]=t.position,A["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]})),A.lighting_uPointLightCount=r.length,a.forEach((function(t,e){A["lighting_uDirectionalLight[".concat(e,"].color")]=o(t),A["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction})),A.lighting_uDirectionalLightCount=a.length,A}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(3),i=n(2),o=n(37),a=n(53);function A(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t),Array.isArray(e)&&(e={compare:e,extract:e,required:e});var n=e,i=n.compare,o=n.extract,a=n.required;this._propsToCompare=i,this._propsToExtract=o,this._requiredProps=a}return Object(i.a)(t,[{key:"arePropsEqual",value:function(t,e){var n,r=A(this._propsToCompare||Object.keys(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!(i in t)||!(i in e)||!Object(o.f)(t[i],e[i]))return!1}}catch(a){r.e(a)}finally{r.f()}return!0}},{key:"initializeProps",value:function(t,e){var n;if(this._propsToExtract){var r,i={},o={},a=A(this._propsToExtract);try{for(a.s();!(r=a.n()).done;){var s=r.value;i[s]=t[s],o[s]=e[s]}}catch(c){a.e(c)}finally{a.f()}n={start:i,end:o}}else n={start:t,end:e};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(t,e,n){return e}},{key:"getDuration",value:function(t,e){return e.transitionDuration}},{key:"_checkRequiredProps",value:function(t){this._requiredProps&&this._requiredProps.forEach((function(e){var n=t[e];Object(a.a)(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))}))}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return C})),n.d(e,"b",(function(){return y}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(37),c=n(154),u=n(257),l=n(138),g=n(139),f=n(86);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var d={orbitAxis:"Z",rotationX:0,rotationOrbit:0,zoom:0,target:[0,0,0],minRotationX:-90,maxRotationX:90,minZoom:-1/0,maxZoom:1/0},I={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new l.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:g.a.BREAK},p=function(t){return Math.pow(2,t)},C=function(t){Object(o.a)(n,t);var e=h(n);function n(t){var i,o=t.makeViewport,a=t.width,A=t.height,s=t.orbitAxis,c=void 0===s?d.orbitAxis:s,u=t.rotationX,l=void 0===u?d.rotationX:u,g=t.rotationOrbit,f=void 0===g?d.rotationOrbit:g,h=t.target,I=void 0===h?d.target:h,p=t.zoom,C=void 0===p?d.zoom:p,y=t.minRotationX,v=void 0===y?d.minRotationX:y,B=t.maxRotationX,m=void 0===B?d.maxRotationX:B,b=t.minZoom,E=void 0===b?d.minZoom:b,Q=t.maxZoom,F=void 0===Q?d.maxZoom:Q,w=t.startPanPosition,S=t.startTarget,R=t.startRotationX,U=t.startRotationOrbit,x=t.startZoomPosition,k=t.startZoom;return Object(r.a)(this,n),(i=e.call(this,{width:a,height:A,orbitAxis:c,rotationX:l,rotationOrbit:f,target:I,zoom:C,minRotationX:v,maxRotationX:m,minZoom:E,maxZoom:F}))._interactiveState={startPanPosition:w,startTarget:S,startRotationX:R,startRotationOrbit:U,startZoomPosition:x,startZoom:k},i.makeViewport=o,i}return Object(i.a)(n,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(t){var e=t.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:e,startTarget:n})}},{key:"pan",value:function(t){var e=t.pos,n=(t.startPos,this._interactiveState),r=n.startPanPosition,i=n.startTarget,o=new s.b(e).subtract(r);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:i,pixelOffset:o})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(t){t.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=this._interactiveState,i=r.startRotationX,o=r.startRotationOrbit;return Number.isFinite(i)&&Number.isFinite(o)?((i<-90||i>90)&&(e*=-1),this._getUpdatedState({rotationX:i+180*n,rotationOrbit:o+180*e,isRotating:!0})):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=Object.assign({},this._viewportProps),r=n.rotationOrbit;return Math.abs(r-e.rotationOrbit)>180&&(n.rotationOrbit=r<0?r+360:r-360),n}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedState({startZoomPosition:e,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale,i=this._viewportProps,o=i.zoom,a=i.width,A=i.height,s=i.target,c=this._interactiveState,u=c.startZoom,l=c.startZoomPosition,g=c.startTarget;Number.isFinite(u)||(u=o,g=s,l=n||e);var f=this._calculateNewZoom({scale:r,startZoom:u}),h=p(u),d=p(f),I=(a/2-l[0])*(d/h-1),C=(A/2-l[1])*(d/h-1);return this._getUpdatedState({zoom:f,target:this._calculateNewTarget({startTarget:g,zoom:f,pixelOffset:[I,C]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=[-t,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=[t,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=[0,-t];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=[0,t];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var a=n+Math.log2(e);return Object(s.e)(a,o,i)}},{key:"_calculateNewTarget",value:function(t){var e=t.startTarget,n=t.zoom,r=t.pixelOffset,i=Object.assign({},this._viewportProps);Number.isFinite(n)&&(i.zoom=n),e&&(i.target=e);var o=this.makeViewport(i),a=o.project(i.target);return o.unproject([a[0]-r[0],a[1]-r[1],a[2]])}},{key:"_getUpdatedState",value:function(t){return new n(Object.assign({},this._viewportProps,this._interactiveState,t))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom,i=t.maxRotationX,o=t.minRotationX,a=t.rotationOrbit;return t.zoom=Object(s.e)(r,n,e),t.rotationX=Object(s.e)(t.rotationX,o,i),(a<-180||a>180)&&(t.rotationOrbit=Object(f.e)(a+180,360)-180),t}}]),n}(u.a),y=function(t){Object(o.a)(n,t);var e=h(n);function n(t){return Object(r.a)(this,n),e.call(this,C,t)}return Object(i.a)(n,[{key:"_getTransitionProps",value:function(){return I}}]),n}(c.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return R})),n.d(e,"b",(function(){return U}));var r=n(1),i=n(17),o=n(3),a=n(2),A=n(7),s=n(8),c=n(6),u=n(37),l=n(154),g=n(257),f=n(67),h=n(53),d=n(138),I=n(139);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var v={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new d.a,transitionInterruption:I.a.BREAK},B={transitionDuration:0},m=0,b=0,E=1.5,Q=0,F=20,w=0,S=60,R=function(t){Object(A.a)(n,t);var e=y(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.makeViewport,a=r.width,A=r.height,s=r.latitude,c=r.longitude,u=r.zoom,l=r.bearing,g=void 0===l?b:l,f=r.pitch,d=void 0===f?m:f,I=r.altitude,p=void 0===I?E:I,C=r.maxZoom,y=void 0===C?F:C,v=r.minZoom,B=void 0===v?Q:v,R=r.maxPitch,U=void 0===R?S:R,x=r.minPitch,k=void 0===x?w:x,O=r.startPanLngLat,N=r.startZoomLngLat,D=r.startBearing,G=r.startPitch,_=r.startZoom;return Object(o.a)(this,n),Object(h.a)(Number.isFinite(c),"`longitude` must be supplied"),Object(h.a)(Number.isFinite(s),"`latitude` must be supplied"),Object(h.a)(Number.isFinite(u),"`zoom` must be supplied"),(t=e.call(this,{width:a,height:A,latitude:s,longitude:c,zoom:u,bearing:g,pitch:d,altitude:p,maxZoom:y,minZoom:B,maxPitch:U,minPitch:k}))._interactiveState={startPanLngLat:O,startZoomLngLat:N,startBearing:D,startPitch:G,startZoom:_},t.makeViewport=i,t}return Object(a.a)(n,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,r=this._interactiveState.startPanLngLat||this._unproject(n);if(!r)return this;var o=this._calculateNewLngLat({startPanLngLat:r,pos:e}),a=Object(i.a)(o,2),A=a[0],s=a[1];return this._getUpdatedState({longitude:A,latitude:s})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){t.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,n=void 0===e?0:e,r=t.deltaScaleY,i=void 0===r?0:r,o=this._interactiveState,a=o.startBearing,A=o.startPitch;if(!Number.isFinite(a)||!Number.isFinite(A))return this;var s=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:i,startBearing:a,startPitch:A}),c=s.pitch,u=s.bearing;return this._getUpdatedState({bearing:u,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale,o=this._interactiveState,a=o.startZoom,A=o.startZoomLngLat;Number.isFinite(a)||(a=this._viewportProps.zoom,A=this._unproject(n)||this._unproject(e));var s=this._calculateNewZoom({scale:r,startZoom:a}),c=this.makeViewport(C(C({},this._viewportProps),{},{zoom:s})).getMapCenterByLngLatPosition({lngLat:A,pos:e}),u=Object(i.a)(c,2),l=u[0],g=u[1];return this._getUpdatedState({zoom:s,longitude:l,latitude:g})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=Object.assign({},this._viewportProps),r=n.bearing,i=n.longitude;return Math.abs(r-e.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(i-e.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}},{key:"_zoomFromCenter",value:function(t){var e=this._viewportProps,n=e.width,r=e.height;return this.zoom({pos:[n/2,r/2],scale:t})}},{key:"_panFromCenter",value:function(t){var e=this._viewportProps,n=e.width,r=e.height;return this.pan({startPos:[n/2,r/2],pos:[n/2+t[0],r/2+t[1]]})}},{key:"_getUpdatedState",value:function(t){return new this.constructor(C(C(C({makeViewport:this.makeViewport},this._viewportProps),this._interactiveState),t))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=Object(u.e)(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=Object(u.e)(a,o,i),Object.assign(t,Object(f.k)(t)),t}},{key:"_unproject",value:function(t){var e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,n=t.pos;return this.makeViewport(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom,a=n+Math.log2(e);return Object(u.e)(a,o,i)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=t.startBearing,i=t.startPitch;n=Object(u.e)(n,-1,1);var o=this._viewportProps,a=o.minPitch,A=o.maxPitch,s=i;return n>0?s=i+n*(A-i):n<0&&(s=i-n*(a-i)),{pitch:s,bearing:r+180*e}}}]),n}(g.a),U=function(t){Object(A.a)(n,t);var e=y(n);function n(t){return Object(o.a)(this,n),t.dragMode=t.dragMode||"pan",e.call(this,R,t)}return Object(a.a)(n,[{key:"_getTransitionProps",value:function(){return v}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=t.deltaX,n=t.deltaY,r=this.getCenter(t),o=Object(i.a)(r,2)[1],a=o-n,A=this.controllerState.getViewportProps(),s=A.width,c=A.height,u=e/s,l=0;n>0?Math.abs(c-a)>5&&(l=n/(a-c)*1.2):n<0&&a>5&&(l=1-o/a),l=Math.min(1,Math.max(-1,l));var g=this.controllerState.rotate({deltaScaleX:u,deltaScaleY:l});return this.updateViewport(g,B,{isDragging:!0,isRotating:!0})}}]),n}(l.a)},function(t,e,n){"use strict";function r(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"===typeof i?null===i?n[r]=null:i.length?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=i(t.geometry),e}function i(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return i(t)})),e):(e.coordinates=function t(e){if("object"!==typeof e[0])return e.slice();return e.map((function(e){return t(e)}))}(t.coordinates),e)}e.a=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return r(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(t);default:throw new Error("unknown GeoJSON type")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ArrowStyles",{enumerable:!0,get:function(){return r.ArrowStyles}}),Object.defineProperty(e,"DEFAULT_ARROWS",{enumerable:!0,get:function(){return r.DEFAULT_ARROWS}}),Object.defineProperty(e,"MAX_ARROWS",{enumerable:!0,get:function(){return r.MAX_ARROWS}}),Object.defineProperty(e,"SELECTION_TYPE",{enumerable:!0,get:function(){return i.SELECTION_TYPE}}),Object.defineProperty(e,"Feature",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"LayerMouseEvent",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"NebulaLayer",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"JunctionsLayer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"TextsLayer",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"SegmentsLayer",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"NebulaCore",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"toDeckColor",{enumerable:!0,get:function(){return g.toDeckColor}}),Object.defineProperty(e,"EditableGeoJsonLayer",{enumerable:!0,get:function(){return f.EditableGeoJsonLayer}}),Object.defineProperty(e,"SelectionLayer",{enumerable:!0,get:function(){return f.SelectionLayer}}),Object.defineProperty(e,"ElevatedEditHandleLayer",{enumerable:!0,get:function(){return f.ElevatedEditHandleLayer}}),Object.defineProperty(e,"PathOutlineLayer",{enumerable:!0,get:function(){return f.PathOutlineLayer}}),Object.defineProperty(e,"PathMarkerLayer",{enumerable:!0,get:function(){return f.PathMarkerLayer}}),Object.defineProperty(e,"GeoJsonEditMode",{enumerable:!0,get:function(){return h.GeoJsonEditMode}}),Object.defineProperty(e,"ModifyMode",{enumerable:!0,get:function(){return h.ModifyMode}}),Object.defineProperty(e,"TranslateMode",{enumerable:!0,get:function(){return h.TranslateMode}}),Object.defineProperty(e,"ScaleMode",{enumerable:!0,get:function(){return h.ScaleMode}}),Object.defineProperty(e,"RotateMode",{enumerable:!0,get:function(){return h.RotateMode}}),Object.defineProperty(e,"DuplicateMode",{enumerable:!0,get:function(){return h.DuplicateMode}}),Object.defineProperty(e,"ExtendLineStringMode",{enumerable:!0,get:function(){return h.ExtendLineStringMode}}),Object.defineProperty(e,"SplitPolygonMode",{enumerable:!0,get:function(){return h.SplitPolygonMode}}),Object.defineProperty(e,"ExtrudeMode",{enumerable:!0,get:function(){return h.ExtrudeMode}}),Object.defineProperty(e,"ElevationMode",{enumerable:!0,get:function(){return h.ElevationMode}}),Object.defineProperty(e,"TransformMode",{enumerable:!0,get:function(){return h.TransformMode}}),Object.defineProperty(e,"DrawPointMode",{enumerable:!0,get:function(){return h.DrawPointMode}}),Object.defineProperty(e,"DrawLineStringMode",{enumerable:!0,get:function(){return h.DrawLineStringMode}}),Object.defineProperty(e,"DrawPolygonMode",{enumerable:!0,get:function(){return h.DrawPolygonMode}}),Object.defineProperty(e,"DrawRectangleMode",{enumerable:!0,get:function(){return h.DrawRectangleMode}}),Object.defineProperty(e,"DrawCircleByDiameterMode",{enumerable:!0,get:function(){return h.DrawCircleByDiameterMode}}),Object.defineProperty(e,"DrawCircleFromCenterMode",{enumerable:!0,get:function(){return h.DrawCircleFromCenterMode}}),Object.defineProperty(e,"DrawEllipseByBoundingBoxMode",{enumerable:!0,get:function(){return h.DrawEllipseByBoundingBoxMode}}),Object.defineProperty(e,"DrawEllipseUsingThreePointsMode",{enumerable:!0,get:function(){return h.DrawEllipseUsingThreePointsMode}}),Object.defineProperty(e,"DrawRectangleUsingThreePointsMode",{enumerable:!0,get:function(){return h.DrawRectangleUsingThreePointsMode}}),Object.defineProperty(e,"Draw90DegreePolygonMode",{enumerable:!0,get:function(){return h.Draw90DegreePolygonMode}}),Object.defineProperty(e,"DrawPolygonByDraggingMode",{enumerable:!0,get:function(){return h.DrawPolygonByDraggingMode}}),Object.defineProperty(e,"ImmutableFeatureCollection",{enumerable:!0,get:function(){return h.ImmutableFeatureCollection}}),Object.defineProperty(e,"ViewMode",{enumerable:!0,get:function(){return h.ViewMode}}),Object.defineProperty(e,"MeasureDistanceMode",{enumerable:!0,get:function(){return h.MeasureDistanceMode}}),Object.defineProperty(e,"MeasureAreaMode",{enumerable:!0,get:function(){return h.MeasureAreaMode}}),Object.defineProperty(e,"MeasureAngleMode",{enumerable:!0,get:function(){return h.MeasureAngleMode}}),Object.defineProperty(e,"CompositeMode",{enumerable:!0,get:function(){return h.CompositeMode}}),Object.defineProperty(e,"SnappableMode",{enumerable:!0,get:function(){return h.SnappableMode}});var r=n(803),i=n(804),o=d(n(988)),a=d(n(805)),A=d(n(512)),s=d(n(989)),c=d(n(1028)),u=d(n(1029)),l=d(n(1030)),g=n(548),f=n(736),h=n(376);function d(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(892),i=n(893),o=n(776),a=n(775),A=a.MAX_LENGTH,s=a.MAX_SAFE_INTEGER,c=n(691),u=c.re,l=c.t,g=n(894).compareIdentifiers,f=function(){"use strict";function t(e,n){if(r(this,t),n&&"object"===typeof n||(n={loose:!!n,includePrerelease:!1}),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!==typeof e)throw new TypeError("Invalid Version: ".concat(e));if(e.length>A)throw new TypeError("version is longer than ".concat(A," characters"));o("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=e.trim().match(n.loose?u[l.LOOSE]:u[l.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<s)return e}return t})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}return i(t,[{key:"format",value:function(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}},{key:"toString",value:function(){return this.version}},{key:"compare",value:function(e){if(o("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if("string"===typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}},{key:"compareMain",value:function(e){return e instanceof t||(e=new t(e,this.options)),g(this.major,e.major)||g(this.minor,e.minor)||g(this.patch,e.patch)}},{key:"comparePre",value:function(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var n=0;do{var r=this.prerelease[n],i=e.prerelease[n];if(o("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return g(r,i)}while(++n)}},{key:"compareBuild",value:function(e){e instanceof t||(e=new t(e,this.options));var n=0;do{var r=this.build[n],i=e.build[n];if(o("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return g(r,i)}while(++n)}},{key:"inc",value:function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"===typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: ".concat(t))}return this.format(),this.raw=this.version,this}}]),t}();t.exports=f},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(32)),A=n(43),s=n(64),c=o.forwardRef((function(t,e){var n=t.children,A=t.classes,c=t.className,u=t.color,l=void 0===u?"inherit":u,g=t.component,f=void 0===g?"svg":g,h=t.fontSize,d=void 0===h?"default":h,I=t.htmlColor,p=t.titleAccess,C=t.viewBox,y=void 0===C?"0 0 24 24":C,v=Object(i.a)(t,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return o.createElement(f,Object(r.a)({className:Object(a.a)(A.root,c,"inherit"!==l&&A["color".concat(Object(s.a)(l))],"default"!==d&&A["fontSize".concat(Object(s.a)(d))]),focusable:"false",viewBox:y,color:I,"aria-hidden":p?void 0:"true",role:p?"img":"presentation",ref:e},v),n,p?o.createElement("title",null,p):null)}));c.muiName="SvgIcon",e.a=Object(A.a)((function(t){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:t.typography.pxToRem(24),transition:t.transitions.create("fill",{duration:t.transitions.duration.shorter})},colorPrimary:{color:t.palette.primary.main},colorSecondary:{color:t.palette.secondary.main},colorAction:{color:t.palette.action.active},colorError:{color:t.palette.error.main},colorDisabled:{color:t.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:t.typography.pxToRem(20)},fontSizeLarge:{fontSize:t.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(c)},function(t,e,n){"use strict";var r=n(262),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},A={};function s(t){return r.isMemo(t)?a:A[t.$$typeof]||i}A[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},A[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(h){var i=f(n);i&&i!==h&&t(e,i,r)}var a=u(n);l&&(a=a.concat(l(n)));for(var A=s(e),d=s(n),I=0;I<a.length;++I){var p=a[I];if(!o[p]&&(!r||!r[p])&&(!d||!d[p])&&(!A||!A[p])){var C=g(n,p);try{c(e,p,C)}catch(y){}}}}return e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));n(23),n(9);var r=n(27),i=(n(20),n(180),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(t){return"@media (min-width:".concat(i[t],"px)")}};function a(t,e,n){if(Array.isArray(e)){var i=t.theme.breakpoints||o;return e.reduce((function(t,r,o){return t[i.up(i.keys[o])]=n(e[o]),t}),{})}if("object"===Object(r.a)(e)){var a=t.theme.breakpoints||o;return Object.keys(e).reduce((function(t,r){return t[a.up(r)]=n(e[r]),t}),{})}return n(e)}},function(t,e,n){"use strict";e.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(t,e,n){"use strict";function r(){var t=document.createElement("div");t.style.width="99px",t.style.height="99px",t.style.position="absolute",t.style.top="-9999px",t.style.overflow="scroll",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(88);function i(t){return Object(r.a)(t).defaultView||window}},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M7 14l5-5 5 5z"}),"ArrowDropUp");e.default=o},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");e.default=o},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);function i(t){var e=t.controlled,n=t.default,i=(t.name,r.useRef(void 0!==e).current),o=r.useState(n),a=o[0],A=o[1];return[i?e:a,r.useCallback((function(t){i||A(t)}),[])]}},,,function(t,e){t.exports=function(t,e){return t===e||t!==t&&e!==e}},function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0}),e.ImmutableFeatureCollection=void 0;var c=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,"featureCollection",void 0),this.featureCollection=e}var e,n,i;return e=t,(n=[{key:"getObject",value:function(){return this.featureCollection}},{key:"replacePosition",value:function(t,e,n){var r=this.featureCollection.features[t].geometry,i="Polygon"===r.type||"MultiPolygon"===r.type,o=a({},r,{coordinates:l(r.coordinates,e,n,i)});return this.replaceGeometry(t,o)}},{key:"removePosition",value:function(t,e){var n=this.featureCollection.features[t].geometry;if("Point"===n.type)throw Error("Can't remove a position from a Point or there'd be nothing left");if("MultiPoint"===n.type&&n.coordinates.length<2)throw Error("Can't remove the last point of a MultiPoint or there'd be nothing left");if("LineString"===n.type&&n.coordinates.length<3)throw Error("Can't remove position. LineString must have at least two positions");if("Polygon"===n.type&&n.coordinates[0].length<5&&Array.isArray(e)&&0===e[0])throw Error("Can't remove position. Polygon's outer ring must have at least four positions");if("MultiLineString"===n.type&&1===n.coordinates.length&&n.coordinates[0].length<3)throw Error("Can't remove position. MultiLineString must have at least two positions");if("MultiPolygon"===n.type&&1===n.coordinates.length&&n.coordinates[0][0].length<5&&Array.isArray(e)&&0===e[0]&&0===e[1])throw Error("Can't remove position. MultiPolygon's outer ring must have at least four positions");var r="Polygon"===n.type||"MultiPolygon"===n.type,i=a({},n,{coordinates:g(n.coordinates,e,r)});return function(t){switch(t.type){case"Polygon":!function(t){for(var e=t.coordinates,n=1;n<e.length;n++)h(e,n)&&n--}(t);break;case"MultiLineString":!function(t){for(var e=0;e<t.coordinates.length;e++)1===t.coordinates[e].length&&(t.coordinates.splice(e,1),e--)}(t);break;case"MultiPolygon":!function(t){for(var e=0;e<t.coordinates.length;e++){var n=t.coordinates[e];n[0].length<=3&&(t.coordinates.splice(e,1),e--);for(var r=1;r<n.length;r++)h(n,r)&&r--}}(t)}}(i),this.replaceGeometry(t,i)}},{key:"addPosition",value:function(t,e,n){var r=this.featureCollection.features[t].geometry;if("Point"===r.type)throw new Error("Unable to add a position to a Point feature");var i="Polygon"===r.type||"MultiPolygon"===r.type,o=a({},r,{coordinates:f(r.coordinates,e,n,i)});return this.replaceGeometry(t,o)}},{key:"replaceGeometry",value:function(e,n){var i=a({},this.featureCollection.features[e],{geometry:n});return new t(a({},this.featureCollection,{features:[].concat(r(this.featureCollection.features.slice(0,e)),[i],r(this.featureCollection.features.slice(e+1)))}))}},{key:"addFeature",value:function(t){return this.addFeatures([t])}},{key:"addFeatures",value:function(e){return new t(a({},this.featureCollection,{features:[].concat(r(this.featureCollection.features),r(e))}))}},{key:"deleteFeature",value:function(t){return this.deleteFeatures([t])}},{key:"deleteFeatures",value:function(e){var n=r(this.featureCollection.features);e.sort();for(var i=e.length-1;i>=0;i--){var o=e[i];o>=0&&o<n.length&&n.splice(o,1)}return new t(a({},this.featureCollection,{features:n}))}}])&&A(e.prototype,n),i&&A(e,i),t}();function u(t,e){if(2===t.length&&3===e.length){var n=e[2];return[t[0],t[1],n]}return t}function l(t,e,n,i){if(!e)return t;if(0===e.length)return u(n,t);if(1===e.length){var o=[].concat(r(t.slice(0,e[0])),[u(n,t[e[0]])],r(t.slice(e[0]+1)));return!i||0!==e[0]&&e[0]!==t.length-1||(o[0]=u(n,t[0]),o[t.length-1]=u(n,t[0])),o}return[].concat(r(t.slice(0,e[0])),[l(t[e[0]],e.slice(1,e.length),n,i)],r(t.slice(e[0]+1)))}function g(t,e,n){if(!e)return t;if(0===e.length)throw Error("Must specify the index of the position to remove");if(1===e.length){var i=[].concat(r(t.slice(0,e[0])),r(t.slice(e[0]+1)));return!n||0!==e[0]&&e[0]!==t.length-1||(0===e[0]?i[i.length-1]=i[0]:e[0]===t.length-1&&(i[0]=i[i.length-1])),i}return[].concat(r(t.slice(0,e[0])),[g(t[e[0]],e.slice(1,e.length),n)],r(t.slice(e[0]+1)))}function f(t,e,n,i){if(!e)return t;if(0===e.length)throw Error("Must specify the index of the position to remove");return 1===e.length?[].concat(r(t.slice(0,e[0])),[n],r(t.slice(e[0]))):[].concat(r(t.slice(0,e[0])),[f(t[e[0]],e.slice(1,e.length),n,i)],r(t.slice(e[0]+1)))}function h(t,e){return t[e].length<=3&&(t.splice(e,1),!0)}e.ImmutableFeatureCollection=c},function(t,e,n){var r=n(729),i=n(730);t.exports=function(t,e,n){var o=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var a=(t=t||{}).random||(t.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e)for(var A=0;A<16;++A)e[o+A]=a[A];return e||i(a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(9),i=n(0),o=n(317);function a(t,e){var n=i.memo(i.forwardRef((function(e,n){return i.createElement(o.a,Object(r.a)({},e,{ref:n}),t)})));return n.muiName=o.a.muiName,n}},function(t,e,n){"use strict";var r={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325};function i(t,e,n){if(!u(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&l(r),i&&g(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function o(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!c(t[0])||!c(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function a(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function A(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function s(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return function(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}(a(t,e),n||"kilometers")}function c(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function u(t){return!!t&&t.constructor===Object}function l(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!c(t))throw new Error("bbox must only contain numbers")}))}function g(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}e.a=function(t,e,n,r){if(!u(r=r||{}))throw new Error("options is invalid");var i=r.units,a=r.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var c=s(e,i,"meters"),l=function(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),g=function(t,e,n,r){r=void 0===r?6371008.8:Number(r);var i=e/r,o=t[0]*Math.PI/180,a=A(t[1]),s=A(n),c=i*Math.cos(s),u=a+c;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var l=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),g=Math.abs(l)>1e-11?c/l:Math.cos(a),f=i*Math.sin(s)/g;return[(180*(o+f)/Math.PI+540)%360-180,180*u/Math.PI]}(l,c,n);return g[0]+=g[0]-l[0]>180?-360:l[0]-g[0]>180?360:0,o(g,a)}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(436),l=n(252),g=n(379),f=n(235);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return p}));var d=[0,0,0,255],I={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,getPosition:{type:"accessor",value:function(t){return t.position}},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:d},getLineColor:{type:"accessor",value:d},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},p=function(t){Object(a.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  outerRadiusPixels = clamp(\n    project_size_to_pixel(radiusScale * instanceRadius),\n    radiusMinPixels, radiusMaxPixels\n  );\n  float lineWidthPixels = clamp(\n    project_size_to_pixel(lineWidthScale * instanceLineWidths),\n    lineWidthMinPixels, lineWidthMaxPixels\n  );\n  outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n  unitPosition = positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n\n  innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n  \n  vec3 offset = positions * project_pixel_size(outerRadiusPixels);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n  DECKGL_FILTER_COLOR(vFillColor, geometry);\n  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n  DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition) * outerRadiusPixels;\n  float inCircle = smoothedge(distToCenter, outerRadiusPixels);\n\n  if (inCircle == 0.0) {\n    discard;\n  }\n\n  if (stroked > 0.5) {\n    float isLine = smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter);\n    if (filled) {\n      gl_FragColor = mix(vFillColor, vLineColor, isLine);\n    } else {\n      if (isLine == 0.0) {\n        discard;\n      }\n      gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n    }\n  } else if (filled) {\n    gl_FragColor = vFillColor;\n  } else {\n    discard;\n  }\n\n  gl_FragColor.a *= inCircle;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;if(Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i}),i.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.radiusUnits,o=r.radiusScale,a=r.radiusMinPixels,A=r.radiusMaxPixels,s=r.stroked,c=r.filled,u=r.lineWidthUnits,l=r.lineWidthScale,g=r.lineWidthMinPixels,f=r.lineWidthMaxPixels,h="pixels"===i?n.metersPerPixel:1,d="pixels"===u?n.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:c,radiusScale:o*h,radiusMinPixels:a,radiusMaxPixels:A,lineWidthScale:l*d,lineWidthMinPixels:g,lineWidthMaxPixels:f}).draw()}},{key:"_getModel",value:function(t){return new g.a(t,Object.assign(this.getShaders(),{id:this.props.id,geometry:new f.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0])}}}),isInstanced:!0}))}}]),n}(l.a);p.layerName="ScatterplotLayer",p.defaultProps=I},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#cell-sets","title":"Vitessce cell sets data","type":"object","definitions":{"stringArray":{"type":"array","items":{"type":"string"}},"stringProbabilityTupleArray":{"type":"array","items":{"type":"array","additionalItems":false,"items":[{"type":"string"},{"oneOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}]}},"colorArray":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"minItems":3,"maxItems":3},"treeNodeLeaf":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"color":{"$ref":"#/definitions/colorArray"},"set":{"$ref":"#/definitions/stringArray"}}},"treeNodeNonLeaf":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"color":{"$ref":"#/definitions/colorArray"},"children":{"type":"array","items":{"$ref":"#/definitions/treeNode"}}}},"treeNode":{"oneOf":[{"$ref":"#/definitions/treeNodeNonLeaf"},{"$ref":"#/definitions/treeNodeLeaf"}]},"version0.1.2":{"type":"object","additionalProperties":false,"required":["version","datatype","tree"],"properties":{"dataset":{"type":"string"},"version":{"type":"string","enum":["0.1.2"]},"datatype":{"type":"string","enum":["cell"]},"tree":{"type":"array","items":{"$ref":"#/definitions/treeNodeNonLeaf"}}}},"treeNodeLeafProbabilistic":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"color":{"$ref":"#/definitions/colorArray"},"set":{"$ref":"#/definitions/stringProbabilityTupleArray"}}},"treeNodeNonLeafProbabilistic":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"color":{"$ref":"#/definitions/colorArray"},"children":{"type":"array","items":{"$ref":"#/definitions/treeNodeProbabilistic"}}}},"treeNodeProbabilistic":{"oneOf":[{"$ref":"#/definitions/treeNodeNonLeafProbabilistic"},{"$ref":"#/definitions/treeNodeLeafProbabilistic"}]},"version0.1.3":{"type":"object","additionalProperties":false,"required":["version","datatype","tree"],"properties":{"dataset":{"type":"string"},"version":{"type":"string","enum":["0.1.3"]},"datatype":{"type":"string","enum":["cell"]},"tree":{"type":"array","items":{"$ref":"#/definitions/treeNodeNonLeafProbabilistic"}}}}},"oneOf":[{"$ref":"#/definitions/version0.1.2"},{"$ref":"#/definitions/version0.1.3"}]}')},function(t,e,n){"use strict";var r=n(17),i=n(1),o=n(3),a=n(2),A=n(7),s=n(8),c=n(6),u=n(110),l=n(360),g=n(372),f=n(478),h=n.n(f),d=n(44);function I(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var C=[];function y(t,e,n,r){for(var i=0,o=e;o<n;o++){var a=t[o],A=null,s=r&&r[a];s&&(A=s.width),i+=A}return i}function v(t,e,n,r,i,o){for(var a=e,A=0,s=e;s<n;s++){var c=y(t,s,s+1,i);A+c>r&&(a<s&&o.push(s),a=s,A=0),A+=c}return A}function B(t,e,n,r,i,o){for(var a=e,A=e,s=e,c=0,u=e;u<n;u++)if(" "===t[u]?s=u+1:" "!==t[u+1]&&u+1!==n||(s=u+1),s>A){var l=y(t,A,s,i);c+l>r&&(a<A&&(o.push(A),a=A,c=0),l>r&&(l=v(t,A,s,r,i,o),a=o[o.length-1])),A=s,c+=l}return c}function m(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);var a=[];return"break-all"===e?v(t,i,o,n,r,a):B(t,i,o,n,r,a),a}function b(t,e,n,r,i,o){for(var a=0,A=0,s=e;s<n;s++){var c=t[s],u=r[c];u?(A||(A=u.height),i[s]=a+u.width/2,a+=u.width):(d.a.warn("Missing character: ".concat(c," (").concat(c.codePointAt(0),")"))(),i[s]=a,a+=32)}o[0]=a,o[1]=A}var E=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;Object(o.a)(this,t),this.limit=e,this.clear()}return Object(a.a)(t,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(t){var e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}},{key:"set",value:function(t,e){this._cache[t]?(this.delete(t),this._cache[t]=e,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=e,this._appendOrder(t))}},{key:"delete",value:function(t){this._cache[t]&&(this._deleteCache(t),this._deleteOrder(t))}},{key:"_deleteCache",value:function(t){delete this._cache[t]}},{key:"_deleteOrder",value:function(t){var e=this._order.findIndex((function(e){return e===t}));e>=0&&this._order.splice(e,1)}},{key:"_appendOrder",value:function(t){this._order.push(t)}}]),t}();function Q(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var w=function(){for(var t=[],e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),S=new E(3),R=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function U(t,e){var n=S.get(t);if(!n)return e;var r=[],i=n.mapping,o=Object.keys(i);o=new Set(o);var a=e;return a instanceof Array&&(a=new Set(a)),a.forEach((function(t){o.has(t)||r.push(t)})),r}function x(t,e){for(var n=0;n<t.length;n++)e.data[4*n+3]=t[n]}function k(t,e,n,r){t.font="".concat(r," ").concat(n,"px ").concat(e),t.fillStyle="#000",t.textBaseline="baseline",t.textAlign="left"}var O=function(){function t(){Object(o.a)(this,t),this.props={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:w,fontSize:64,buffer:2,sdf:!1,cutoff:.25,radius:3},this._key=null,this._atlas=null}return Object(a.a)(t,[{key:"setProps",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R.forEach((function(n){n in e&&(t.props[n]=e[n])}));var n=this._key;this._key=this._getKey();var r=U(this._key,this.props.characterSet),i=S.get(this._key);if(i&&0===r.length)this._key!==n&&(this._atlas=i);else{var o=this._generateFontAtlas(this._key,r,i);this._atlas=o,S.set(this._key,o)}}},{key:"_generateFontAtlas",value:function(t,e,n){var r=this.props,i=r.fontFamily,o=r.fontWeight,a=r.fontSize,A=r.buffer,s=r.sdf,c=r.radius,u=r.cutoff,l=n&&n.data;l||((l=document.createElement("canvas")).width=1024);var g=l.getContext("2d");k(g,i,a,o);var f=function(t){var e,n=t.characterSet,r=t.getFontWidth,i=t.fontHeight,o=t.buffer,a=t.maxCanvasWidth,A=t.mapping,s=void 0===A?{}:A,c=t.xOffset,u=void 0===c?0:c,l=t.yOffset,g=void 0===l?0:l,f=0,h=u,d=0,p=I(n);try{for(p.s();!(e=p.n()).done;){var C=e.value;if(!s[C]){var y=r(C,d++);h+y+2*o>a&&(h=0,f++),s[C]={x:h+o,y:g+f*(i+2*o)+o,width:y,height:i},h+=y+2*o}}}catch(m){p.e(m)}finally{p.f()}var v,B=i+2*o;return{mapping:s,xOffset:h,yOffset:g+f*B,canvasHeight:(v=g+(f+1)*B,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(t){return g.measureText(t).width},fontHeight:1.2*a,buffer:A,characterSet:e,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),d=f.mapping,p=f.canvasHeight,C=f.xOffset,y=f.yOffset;if(l.height!==p){var v=g.getImageData(0,0,l.width,l.height);l.height=p,g.putImageData(v,0,0)}if(k(g,i,a,o),s){var B,m=new h.a(a,A,c,u,i,o),b=g.getImageData(0,0,m.size,m.size),E=Q(e);try{for(E.s();!(B=E.n()).done;){var F=B.value;x(m.draw(F),b),g.putImageData(b,d[F].x-A,d[F].y-A)}}catch(U){E.e(U)}finally{E.f()}}else{var w,S=Q(e);try{for(S.s();!(w=S.n()).done;){var R=w.value;g.fillText(R,d[R].x,d[R].y+.9*a)}}catch(U){S.e(U)}finally{S.f()}}return{xOffset:C,yOffset:y,mapping:d,data:l,width:l.width,height:l.height}}},{key:"_getKey",value:function(){var t=this.props,e=t.fontFamily,n=t.fontWeight,r=t.fontSize,i=t.buffer,o=t.sdf,a=t.radius,A=t.cutoff;return o?"".concat(e," ").concat(n," ").concat(r," ").concat(i," ").concat(a," ").concat(A):"".concat(e," ").concat(n," ").concat(r," ").concat(i)}},{key:"texture",get:function(){return this._atlas}},{key:"mapping",get:function(){return this._atlas&&this._atlas.mapping}},{key:"scale",get:function(){return 1.2}}]),t}();function N(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return D(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function G(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?G(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function M(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}n.d(e,"a",(function(){return P}));var T={fontSize:64,buffer:2,sdf:!1,radius:3,cutoff:.25},j={start:1,middle:0,end:-1},L={top:1,center:0,bottom:-1},V=["fontSize","buffer","sdf","radius","cutoff"],Z={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,backgroundColor:{type:"color",value:null,optional:!0},characterSet:w,fontFamily:"Monaco, monospace",fontWeight:"normal",lineHeight:1,fontSettings:{},wordBreak:"word-break",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(t){return t.text}},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:[0,0,0,255]},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]}},P=function(t){Object(A.a)(n,t);var e=M(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(a.a)(n,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new O}}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags,i=this._fontChanged(n,e);i&&this._updateFontAtlas(n,e);var o=i||e.lineHeight!==n.lineHeight||e.wordBreak!==n.wordBreak||e.maxWidth!==n.maxWidth;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText(),o&&this.setState({styleVersion:this.state.styleVersion+1})}},{key:"getPickingInfo",value:function(t){var e=t.info;return Object.assign(e,{object:e.index>=0?this.props.data[e.index]:null})}},{key:"_updateFontAtlas",value:function(t,e){var n=e.characterSet,r=e.fontSettings,i=e.fontFamily,o=e.fontWeight;this.state.fontAtlasManager.setProps(Object.assign({},T,r,{characterSet:n,fontFamily:i,fontWeight:o})),this.setNeedsRedraw(!0)}},{key:"_fontChanged",value:function(t,e){if(t.fontFamily!==e.fontFamily||t.characterSet!==e.characterSet||t.fontWeight!==e.fontWeight)return!0;if(t.fontSettings===e.fontSettings)return!1;var n=t.fontSettings||{},r=e.fontSettings||{};return V.some((function(t){return n[t]!==r[t]}))}},{key:"_updateText",value:function(){var t,e=this.props.data,n=e.attributes&&e.attributes.getText,r=this.props.getText,i=e.startIndices;if(n&&i){var o=function(t){var e=t.value,n=t.length,r=t.stride,i=t.offset,o=t.startIndices,a=e.BYTES_PER_ELEMENT,A=r?r/a:1,s=i?i/a:0,c=o[n]||Math.floor((e.length-s-a)/A)+1,u=new Array(n),l=e;if(A>1||s>0){l=new e.constructor(c);for(var g=0;g<c;g++)l[g]=e[g*A+s]}for(var f=0;f<n;f++){var h=o[f],d=o[f+1]||c;u[f]=String.fromCodePoint.apply(null,l.subarray(h,d))}return{texts:u,characterCount:c}}(_(_({},ArrayBuffer.isView(n)?{value:n}:n),{},{length:e.length,startIndices:i})),a=o.texts;t=o.characterCount,r=function(t,e){var n=e.index;return a[n]}}else{var A=Object(u.a)(e),s=A.iterable,c=A.objectInfo;i=[0],t=0;var l,g=N(s);try{for(g.s();!(l=g.n()).done;){var f=l.value;c.index++;var h=r(f,c)||"";t+=Array.from(h).length,i.push(t)}}catch(d){g.e(d)}finally{g.f()}}this.setState({getText:r,startIndices:i,numInstances:t})}},{key:"getIconOffsets",value:function(t,e){for(var n=this.state.fontAtlasManager.mapping,i=this.state.getText,o=this.props,a=o.wordBreak,A=o.maxWidth,s=o.lineHeight,c=o.getTextAnchor,u=o.getAlignmentBaseline,l=function(t,e,n,r,i){for(var o=(t=Array.from(t)).length,a=new Array(o),A=new Array(o),s=new Array(o),c=("break-word"===n||"break-all"===n)&&isFinite(r)&&r>0,u=[0,0],l=[],g=0,f=0,h=0,d=0;d<=o;d++){var I=t[d];if("\n"!==I&&d!==o||(h=d),h>f){for(var p=c?m(t,n,r,i,f,h):C,y=0;y<=p.length;y++){var v=0===y?f:p[y-1],B=y<p.length?p[y]:h;b(t,v,B,i,a,l);for(var E=v;E<B;E++)A[E]=g+l[1]/2,s[E]=l[0];g+=l[1]*e,u[0]=c?r:Math.max(u[0],l[0])}f=h}"\n"===I&&(a[f]=0,A[f]=0,s[f]=0,f++)}return u[1]=g,{x:a,y:A,rowWidth:s,size:u}}(i(t,e)||"",s,a,A,n),g=l.x,f=l.y,h=l.rowWidth,d=Object(r.a)(l.size,2),I=d[0],p=d[1],y=j["function"===typeof c?c(t,e):c],v=L["function"===typeof u?u(t,e):u],B=g.length,E=new Array(2*B),Q=0,F=0;F<B;F++){var w=(1-y)*(I-h[F])/2;E[Q++]=(y-1)*I/2+w+g[F],E[Q++]=(v-1)*p/2+f[F]}return E}},{key:"renderLayers",value:function(){var t=this.state,e=t.startIndices,n=t.numInstances,r=t.getText,i=t.fontAtlasManager,o=i.scale,a=i.texture,A=i.mapping,s=t.styleVersion,c=this.props,u=c.data,l=c._dataDiff,f=c.backgroundColor,h=c.getPosition,d=c.getColor,I=c.getSize,p=c.getAngle,C=c.getPixelOffset,y=c.billboard,v=c.fontSettings,B=c.sizeScale,m=c.sizeUnits,b=c.sizeMinPixels,E=c.sizeMaxPixels,Q=c.transitions,F=c.updateTriggers,w=this.getIconOffsets.bind(this);return new(this.getSubLayerClass("characters",g.a))({sdf:v.sdf,iconAtlas:a,iconMapping:A,backgroundColor:f,getPosition:h,getColor:d,getSize:I,getAngle:p,getPixelOffset:C,billboard:y,sizeScale:B*o,sizeUnits:m,sizeMinPixels:b*o,sizeMaxPixels:E*o,transitions:Q&&{getPosition:Q.getPosition,getAngle:Q.getAngle,getColor:Q.getColor,getSize:Q.getSize,getPixelOffset:Q.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:F.getText,getPosition:F.getPosition,getAngle:F.getAngle,getColor:F.getColor,getSize:F.getSize,getPixelOffset:F.getPixelOffset,getIconOffsets:{getText:F.getText,getTextAnchor:F.getTextAnchor,getAlignmentBaseline:F.getAlignmentBaseline,styleVersion:s}}}),{data:u,_dataDiff:l,startIndices:e,numInstances:n,getIconOffsets:w,getIcon:r})}}]),n}(l.a);P.layerName="TextLayer",P.defaultProps=Z},,,,,function(t,e,n){"use strict";var r=n(203).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"===typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(o||i);var a=n.readable||!1!==n.readable&&e.readable,A=n.writable||!1!==n.writable&&e.writable,s=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){A=!1,c=!0,a||o.call(e)},l=e._readableState&&e._readableState.endEmitted,g=function(){a=!1,l=!0,A||o.call(e)},f=function(t){o.call(e,t)},h=function(){var t;return a&&!l?(e._readableState&&e._readableState.ended||(t=new r),o.call(e,t)):A&&!c?(e._writableState&&e._writableState.ended||(t=new r),o.call(e,t)):void 0},d=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"===typeof t.abort}(e)?A&&!e._writableState&&(e.on("end",s),e.on("close",s)):(e.on("complete",u),e.on("abort",h),e.req?d():e.on("request",d)),e.on("end",g),e.on("finish",u),!1!==n.error&&e.on("error",f),e.on("close",h),function(){e.removeListener("complete",u),e.removeListener("abort",h),e.removeListener("request",d),e.req&&e.req.removeListener("finish",u),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",u),e.removeListener("end",g),e.removeListener("error",f),e.removeListener("close",h)}}},function(t,e,n){var r=n(96),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),o(i,a),a.from=function(t,e,n){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},a.alloc=function(t,e,n){if("number"!==typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"===typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(t){var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){if("undefined"!==typeof window&&"object"===(0,i.default)(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!==typeof t&&"object"===(0,i.default)(t.versions)&&Boolean(t.versions.electron))return!0;var n="object"===("undefined"===typeof navigator?"undefined":(0,i.default)(navigator))&&"string"===typeof navigator.userAgent&&navigator.userAgent,r=e||n;if(r&&r.indexOf("Electron")>=0)return!0;return!1};var i=r(n(266))}).call(this,n(68))},function(t,e,n){var r=n(194)(n(131),"Map");t.exports=r},function(t,e,n){var r=n(406),i=n(409);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(1282),i=n(1285)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(1),c=n(144),u=n(360),l=n(713),g=n(927),f=n(17),h=n(13),d=n.n(h),I=n(30),p=n(44),C=function(){function t(e){var n=e.x,i=e.y,o=e.z,a=e.onTileLoad,A=e.onTileError;Object(r.a)(this,t),this.x=n,this.y=i,this.z=o,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._isLoaded=!1,this._isCancelled=!1,this.onTileLoad=a,this.onTileError=A}return Object(i.a)(t,[{key:"_loadData",value:function(){var t=Object(I.a)(d.a.mark((function t(e,n){var r,i,o,a,A,s,c,u;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.x,i=this.y,o=this.z,a=this.bbox,this._abortController=new AbortController,A=this._abortController.signal,t.next=5,n.scheduleRequest(this,(function(t){return t.isSelected?1:-1}));case 5:if(s=t.sent){t.next=9;break}return this._isCancelled=!0,t.abrupt("return");case 9:if(!this._isCancelled){t.next=12;break}return s.done(),t.abrupt("return");case 12:return t.prev=12,t.next=15,e({x:r,y:i,z:o,bbox:a,signal:A});case 15:c=t.sent,t.next=21;break;case 18:t.prev=18,t.t0=t.catch(12),u=t.t0||!0;case 21:return t.prev=21,s.done(),this._isCancelled&&!c?this._isLoaded=!1:(this._isLoaded=!0,this._isCancelled=!1),t.finish(21);case 25:if(this._isLoaded){t.next=27;break}return t.abrupt("return");case 27:u?this.onTileError(u,this):(this.content=c,this.onTileLoad(this));case 28:case"end":return t.stop()}}),t,this,[[12,18,21,25]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"loadData",value:function(t,e){var n=this;t&&(this._isCancelled=!1,this._loader=this._loadData(t,e),this._loader.finally((function(){n._loader=void 0})))}},{key:"abort",value:function(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}},{key:"data",get:function(){return this._isLoaded?this.content:this._loader}},{key:"isLoaded",get:function(){return this._isLoaded}},{key:"isLoading",get:function(){return Boolean(this._loader)}},{key:"isCancelled",get:function(){return this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||p.a.error("byteLength not defined in tile data")(),t}}]),t}(),y=n(143),v=n(707),B=n(181);function m(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var E=function(){function t(e){var n=this;Object(r.a)(this,t),this.opts=e,this._getTileData=e.getTileData,this.onTileError=e.onTileError,this.onTileLoad=function(t){e.onTileLoad(t),n.opts.maxCacheByteSize&&(n._cacheByteSize+=t.byteLength,n._resizeCache())},this.onTileUnload=e.onTileUnload,this._requestScheduler=new v.a({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this.setOptions(e)}return Object(i.a)(t,[{key:"setOptions",value:function(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.zRange,i=n.modelMatrix,o=new B.a(i),a=!o.equals(this._modelMatrix);if(!t.equals(this._viewport)||a){a&&(this._modelMatrixInverse=i&&o.clone().invert(),this._modelMatrix=i&&o),this._viewport=t;var A=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=A.map((function(t){return e._getTile(t,!0)})),this._dirty&&this._rebuildTree()}var s=this.updateTileStates();return this._dirty&&this._resizeCache(),s&&this._frameNumber++,this._frameNumber}},{key:"getTileIndices",value:function(t){var e=t.viewport,n=t.maxZoom,r=t.minZoom,i=t.zRange,o=t.modelMatrix,a=t.modelMatrixInverse,A=this.opts,s=A.tileSize,c=A.extent;return Object(y.a)({viewport:e,maxZoom:n,minZoom:r,zRange:i,tileSize:s,extent:c,modelMatrix:o,modelMatrixInverse:a})}},{key:"getTileMetadata",value:function(t){var e=t.x,n=t.y,r=t.z;return{bbox:Object(y.e)(this._viewport,e,n,r)}}},{key:"getParentIndex",value:function(t){return t.x=Math.floor(t.x/2),t.y=Math.floor(t.y/2),t.z-=1,t}},{key:"updateTileStates",value:function(){this._updateTileStates(this.selectedTiles);var t,e=this.opts.maxRequests,n=[],r=0,i=!1,o=m(this._cache.values());try{for(o.s();!(t=o.n()).done;){var a=t.value,A=Boolean(1&a.state);a.isVisible!==A&&(i=!0,a.isVisible=A),a.isSelected=5===a.state,a.isLoading&&(r++,a.isSelected||n.push(a))}}catch(s){o.e(s)}finally{o.f()}if(e>0)for(;r>e&&n.length>0;){n.shift().abort(),r--}return i}},{key:"_rebuildTree",value:function(){var t,e=this._cache,n=m(e.values());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.parent=null,r.children.length=0}}catch(s){n.e(s)}finally{n.f()}var i,o=m(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,A=this._getNearestAncestor(a.x,a.y,a.z);a.parent=A,A&&A.children.push(a)}}catch(s){o.e(s)}finally{o.f()}}},{key:"_updateTileStates",value:function(t){var e,n=this._cache,r=this.opts.refinementStrategy||"best-available",i=m(n.values());try{for(i.s();!(e=i.n()).done;){e.value.state=0}}catch(g){i.e(g)}finally{i.f()}var o,a=m(t);try{for(a.s();!(o=a.n()).done;){o.value.state=5}}catch(g){a.e(g)}finally{a.f()}if("never"!==r){var A,s=m(t);try{for(s.s();!(A=s.n()).done;){F(A.value,r)}}catch(g){s.e(g)}finally{s.f()}var c,u=m(t);try{for(u.s();!(c=u.n()).done;){var l=c.value;Q(l)&&w(l)}}catch(g){u.e(g)}finally{u.f()}}}},{key:"_resizeCache",value:function(){var t=this._cache,e=this.opts,n=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),r=e.maxCacheByteSize||1/0;if(t.size>n||this._cacheByteSize>r){var i,o=m(t);try{for(o.s();!(i=o.n()).done;){var a=Object(f.a)(i.value,2),A=a[0],s=a[1];if(s.isVisible||(this._cacheByteSize-=e.maxCacheByteSize?s.byteLength:0,t.delete(A),this.onTileUnload(s)),t.size<=n&&this._cacheByteSize<=r)break}}catch(c){o.e(c)}finally{o.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(t,e){return t.z-e.z})),this._dirty=!1)}},{key:"_getTile",value:function(t,e){var n=t.x,r=t.y,i=t.z,o="".concat(n,",").concat(r,",").concat(i),a=this._cache.get(o);return!a&&e?(a=new C({x:n,y:r,z:i,onTileLoad:this.onTileLoad,onTileError:this.onTileError}),Object.assign(a,this.getTileMetadata(a)),a.loadData(this._getTileData,this._requestScheduler),this._cache.set(o,a),this._dirty=!0):a&&a.isCancelled&&!a.isLoading&&a.loadData(this._getTileData,this._requestScheduler),a}},{key:"_getNearestAncestor",value:function(t,e,n){for(var r=this._minZoom,i=void 0===r?0:r,o={x:t,y:e,z:n};o.z>i;){o=this.getParentIndex(o);var a=this._getTile(o);if(a)return a}return null}},{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles.every((function(t){return t.isLoaded}))}}]),t}();function Q(t){for(var e=t;e;){if(!1&e.state)return!0;if(e.isLoaded)return!1;e=e.parent}return!0}function F(t,e){for(var n,r=3;n=t.parent;){if(t.isLoaded&&(r=4,"best-available"===e))return;n.state=Math.max(n.state,r),t=n}}function w(t){var e,n=m(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.state=Math.max(r.state,3),r.isLoaded||w(r)}}catch(i){n.e(i)}finally{n.f()}}function S(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}n.d(e,"a",(function(){return x}));var U={data:[],dataComparator:y.f.equals,renderSubLayers:{type:"function",value:function(t){return new l.a(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,fetch:{type:"function",value:function(t,e){var n=e.layer,r=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){Object(s.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({signal:e.signal},n.getLoadOptions()||{});return Object(g.a)(t,r)},compare:!1},maxRequests:6},x=function(t){Object(o.a)(n,t);var e=S(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"initializeState",value:function(){this.state={tiles:[],isLoaded:!1}}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,n=(t.oldProps,t.context,t.changeFlags),r=this.state.tileset;if(!r||n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getTileData)){var i=Number.isFinite(this.state.maxZoom)?this.state.maxZoom:e.maxZoom,o=Number.isFinite(this.state.minZoom)?this.state.minZoom:e.minZoom,a=e.tileSize,A=e.maxCacheSize,s=e.maxCacheByteSize,c=e.refinementStrategy,u=e.extent,l=e.maxRequests;r=new E({getTileData:this.getTileData.bind(this),maxCacheSize:A,maxCacheByteSize:s,maxZoom:i,minZoom:o,tileSize:a,refinementStrategy:c,extent:u,onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this),maxRequests:l}),this.setState({tileset:r})}else(n.propsChanged||n.updateTriggersChanged)&&(r.setOptions(e),this.state.tileset.tiles.forEach((function(t){t.layers=null})));this._updateTileset()}},{key:"_updateTileset",value:function(){var t=this.state.tileset,e=this.props,n=e.zRange,r=e.modelMatrix,i=t.update(this.context.viewport,{zRange:n,modelMatrix:r}),o=t.isLoaded,a=this.state.isLoaded!==o,A=this.state.frameNumber!==i;o&&(a||A)&&this._onViewportLoad(),A&&this.setState({frameNumber:i}),this.state.isLoaded=o}},{key:"_onViewportLoad",value:function(){var t=this.state.tileset,e=this.props.onViewportLoad;e&&e(t.selectedTiles.map((function(t){return t.data})))}},{key:"_onTileLoad",value:function(t){this.getCurrentLayer().props.onTileLoad(t),t.isVisible&&this.setNeedsUpdate()}},{key:"_onTileError",value:function(t,e){var n=this.getCurrentLayer();n.props.onTileError(t),n._updateTileset(),e.isVisible&&this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){this.getCurrentLayer().props.onTileUnload(t)}},{key:"getTileData",value:function(t){var e=this.props.data,n=this.getCurrentLayer().props,r=n.getTileData,i=n.fetch,o=t.signal;return t.url=Object(y.b)(e,t),r?r(t):t.url?i(t.url,{layer:this,signal:o}):null}},{key:"renderSubLayers",value:function(t){return this.props.renderSubLayers(t)}},{key:"getHighlightedObjectIndex",value:function(){return-1}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.sourceLayer;return e.sourceLayer=n,e.tile=n.props.tile,e}},{key:"renderLayers",value:function(){var t=this,e=this.props.visible;return this.state.tileset.tiles.map((function(n){var r=e&&n.isVisible,i=t.getHighlightedObjectIndex(n);if(n.isLoaded)if(n.layers)!n.layers[0]||n.layers[0].props.visible===r&&n.layers[0].props.highlightedObjectIndex===i||(n.layers=n.layers.map((function(t){return t.clone({visible:r,highlightedObjectIndex:i})})));else{var o=t.renderSubLayers(Object.assign({},t.props,{id:"".concat(t.id,"-").concat(n.x,"-").concat(n.y,"-").concat(n.z),data:n.data,visible:r,_offset:0,tile:n,highlightedObjectIndex:i}));n.layers=Object(c.b)(o,Boolean)}else;return n.layers}))}},{key:"isLoaded",get:function(){return this.state.tileset.selectedTiles.every((function(t){return t.layers&&t.layers.every((function(t){return t.isLoaded}))}))}}]),n}(u.a);x.layerName="TileLayer",x.defaultProps=U},function(t,e,n){"use strict";function r(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o}));var r=n(28),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(t){return"".concat(Math.round(t),"ms")}e.a={easing:i,duration:o,create:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.duration,A=void 0===n?o.standard:n,s=e.easing,c=void 0===s?i.easeInOut:s,u=e.delay,l=void 0===u?0:u;Object(r.a)(e,["duration","easing","delay"]);return(Array.isArray(t)?t:[t]).map((function(t){return"".concat(t," ").concat("string"===typeof A?A:a(A)," ").concat(c," ").concat("string"===typeof l?l:a(l))})).join(",")},getAutoHeightDuration:function(t){if(!t)return 0;var e=t/36;return Math.round(10*(4+15*Math.pow(e,.25)+e/5))}}},function(t,e,n){(function(t,r){var i;(function(){var o="Expected a function",a="__lodash_placeholder__",A=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",c="[object Array]",u="[object Boolean]",l="[object Date]",g="[object Error]",f="[object Function]",h="[object GeneratorFunction]",d="[object Map]",I="[object Number]",p="[object Object]",C="[object RegExp]",y="[object Set]",v="[object String]",B="[object Symbol]",m="[object WeakMap]",b="[object ArrayBuffer]",E="[object DataView]",Q="[object Float32Array]",F="[object Float64Array]",w="[object Int8Array]",S="[object Int16Array]",R="[object Int32Array]",U="[object Uint8Array]",x="[object Uint16Array]",k="[object Uint32Array]",O=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,D=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,_=/[&<>"']/g,M=RegExp(G.source),T=RegExp(_.source),j=/<%-([\s\S]+?)%>/g,L=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,J=/[\\^$.*+?()[\]{}|]/g,H=RegExp(J.source),Y=/^\s+|\s+$/g,X=/^\s+/,z=/\s+$/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,At=/^0o[0-7]+$/i,st=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ut=/($^)/,lt=/['\n\r\u2028\u2029\\]/g,gt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ft="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ht="[\\ud800-\\udfff]",dt="["+ft+"]",It="["+gt+"]",pt="\\d+",Ct="[\\u2700-\\u27bf]",yt="[a-z\\xdf-\\xf6\\xf8-\\xff]",vt="[^\\ud800-\\udfff"+ft+pt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Bt="\\ud83c[\\udffb-\\udfff]",mt="[^\\ud800-\\udfff]",bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",Qt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ft="(?:"+yt+"|"+vt+")",wt="(?:"+Qt+"|"+vt+")",St="(?:"+It+"|"+Bt+")"+"?",Rt="[\\ufe0e\\ufe0f]?"+St+("(?:\\u200d(?:"+[mt,bt,Et].join("|")+")[\\ufe0e\\ufe0f]?"+St+")*"),Ut="(?:"+[Ct,bt,Et].join("|")+")"+Rt,xt="(?:"+[mt+It+"?",It,bt,Et,ht].join("|")+")",kt=RegExp("['\u2019]","g"),Ot=RegExp(It,"g"),Nt=RegExp(Bt+"(?="+Bt+")|"+xt+Rt,"g"),Dt=RegExp([Qt+"?"+yt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[dt,Qt,"$"].join("|")+")",wt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[dt,Qt+Ft,"$"].join("|")+")",Qt+"?"+Ft+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Qt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pt,Ut].join("|"),"g"),Gt=RegExp("[\\u200d\\ud800-\\udfff"+gt+"\\ufe0e\\ufe0f]"),_t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Mt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tt=-1,jt={};jt[Q]=jt[F]=jt[w]=jt[S]=jt[R]=jt[U]=jt["[object Uint8ClampedArray]"]=jt[x]=jt[k]=!0,jt[s]=jt[c]=jt[b]=jt[u]=jt[E]=jt[l]=jt[g]=jt[f]=jt[d]=jt[I]=jt[p]=jt[C]=jt[y]=jt[v]=jt[m]=!1;var Lt={};Lt[s]=Lt[c]=Lt[b]=Lt[E]=Lt[u]=Lt[l]=Lt[Q]=Lt[F]=Lt[w]=Lt[S]=Lt[R]=Lt[d]=Lt[I]=Lt[p]=Lt[C]=Lt[y]=Lt[v]=Lt[B]=Lt[U]=Lt["[object Uint8ClampedArray]"]=Lt[x]=Lt[k]=!0,Lt[g]=Lt[f]=Lt[m]=!1;var Vt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=parseFloat,Pt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Jt="object"==typeof self&&self&&self.Object===Object&&self,Ht=Wt||Jt||Function("return this")(),Yt=e&&!e.nodeType&&e,Xt=Yt&&"object"==typeof r&&r&&!r.nodeType&&r,zt=Xt&&Xt.exports===Yt,Kt=zt&&Wt.process,qt=function(){try{var t=Xt&&Xt.require&&Xt.require("util").types;return t||Kt&&Kt.binding&&Kt.binding("util")}catch(e){}}(),$t=qt&&qt.isArrayBuffer,te=qt&&qt.isDate,ee=qt&&qt.isMap,ne=qt&&qt.isRegExp,re=qt&&qt.isSet,ie=qt&&qt.isTypedArray;function oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ae(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ue(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function le(t,e){return!!(null==t?0:t.length)&&Be(t,e,0)>-1}function ge(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function fe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function he(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function de(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function pe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ce=Qe("length");function ye(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function ve(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Be(t,e,n){return e===e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):ve(t,be,n)}function me(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function be(t){return t!==t}function Ee(t,e){var n=null==t?0:t.length;return n?Se(t,e)/n:NaN}function Qe(t){return function(e){return null==e?void 0:e[t]}}function Fe(t){return function(e){return null==t?void 0:t[e]}}function we(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Se(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Re(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ue(t){return function(e){return t(e)}}function xe(t,e){return fe(e,(function(e){return t[e]}))}function ke(t,e){return t.has(e)}function Oe(t,e){for(var n=-1,r=t.length;++n<r&&Be(e,t[n],0)>-1;);return n}function Ne(t,e){for(var n=t.length;n--&&Be(e,t[n],0)>-1;);return n}function De(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Ge=Fe({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),_e=Fe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Me(t){return"\\"+Vt[t]}function Te(t){return Gt.test(t)}function je(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Le(t,e){return function(n){return t(e(n))}}function Ve(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var A=t[n];A!==e&&A!==a||(t[n]=a,o[i++]=n)}return o}function Ze(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function Pe(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function We(t){return Te(t)?function(t){var e=Nt.lastIndex=0;for(;Nt.test(t);)++e;return e}(t):Ce(t)}function Je(t){return Te(t)?function(t){return t.match(Nt)||[]}(t):function(t){return t.split("")}(t)}var He=Fe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Ye=function t(e){var n=(e=null==e?Ht:Ye.defaults(Ht.Object(),e,Ye.pick(Ht,Mt))).Array,r=e.Date,i=e.Error,gt=e.Function,ft=e.Math,ht=e.Object,dt=e.RegExp,It=e.String,pt=e.TypeError,Ct=n.prototype,yt=gt.prototype,vt=ht.prototype,Bt=e["__core-js_shared__"],mt=yt.toString,bt=vt.hasOwnProperty,Et=0,Qt=function(){var t=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ft=vt.toString,wt=mt.call(ht),St=Ht._,Rt=dt("^"+mt.call(bt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=zt?e.Buffer:void 0,xt=e.Symbol,Nt=e.Uint8Array,Gt=Ut?Ut.allocUnsafe:void 0,Vt=Le(ht.getPrototypeOf,ht),Wt=ht.create,Jt=vt.propertyIsEnumerable,Yt=Ct.splice,Xt=xt?xt.isConcatSpreadable:void 0,Kt=xt?xt.iterator:void 0,qt=xt?xt.toStringTag:void 0,Ce=function(){try{var t=qi(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Fe=e.clearTimeout!==Ht.clearTimeout&&e.clearTimeout,Xe=r&&r.now!==Ht.Date.now&&r.now,ze=e.setTimeout!==Ht.setTimeout&&e.setTimeout,Ke=ft.ceil,qe=ft.floor,$e=ht.getOwnPropertySymbols,tn=Ut?Ut.isBuffer:void 0,en=e.isFinite,nn=Ct.join,rn=Le(ht.keys,ht),on=ft.max,an=ft.min,An=r.now,sn=e.parseInt,cn=ft.random,un=Ct.reverse,ln=qi(e,"DataView"),gn=qi(e,"Map"),fn=qi(e,"Promise"),hn=qi(e,"Set"),dn=qi(e,"WeakMap"),In=qi(ht,"create"),pn=dn&&new dn,Cn={},yn=Fo(ln),vn=Fo(gn),Bn=Fo(fn),mn=Fo(hn),bn=Fo(dn),En=xt?xt.prototype:void 0,Qn=En?En.valueOf:void 0,Fn=En?En.toString:void 0;function wn(t){if(Za(t)&&!ka(t)&&!(t instanceof xn)){if(t instanceof Un)return t;if(bt.call(t,"__wrapped__"))return wo(t)}return new Un(t)}var Sn=function(){function t(){}return function(e){if(!Va(e))return{};if(Wt)return Wt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Rn(){}function Un(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function xn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function On(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Dn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Nn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new On(t);this.size=e.size}function _n(t,e){var n=ka(t),r=!n&&xa(t),i=!n&&!r&&Ga(t),o=!n&&!r&&!i&&Ka(t),a=n||r||i||o,A=a?Re(t.length,It):[],s=A.length;for(var c in t)!e&&!bt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oo(c,s))||A.push(c);return A}function Mn(t){var e=t.length;return e?t[Dr(0,e-1)]:void 0}function Tn(t,e){return bo(Ii(t),Yn(e,0,t.length))}function jn(t){return bo(Ii(t))}function Ln(t,e,n){(void 0!==n&&!Sa(t[e],n)||void 0===n&&!(e in t))&&Jn(t,e,n)}function Vn(t,e,n){var r=t[e];bt.call(t,e)&&Sa(r,n)&&(void 0!==n||e in t)||Jn(t,e,n)}function Zn(t,e){for(var n=t.length;n--;)if(Sa(t[n][0],e))return n;return-1}function Pn(t,e,n,r){return $n(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Wn(t,e){return t&&pi(e,yA(e),t)}function Jn(t,e,n){"__proto__"==e&&Ce?Ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Hn(t,e){for(var r=-1,i=e.length,o=n(i),a=null==t;++r<i;)o[r]=a?void 0:hA(t,e[r]);return o}function Yn(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Xn(t,e,n,r,i,o){var a,A=1&e,c=2&e,g=4&e;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!Va(t))return t;var m=ka(t);if(m){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&bt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!A)return Ii(t,a)}else{var O=eo(t),N=O==f||O==h;if(Ga(t))return ui(t,A);if(O==p||O==s||N&&!i){if(a=c||N?{}:ro(t),!A)return c?function(t,e){return pi(t,to(t),e)}(t,function(t,e){return t&&pi(e,vA(e),t)}(a,t)):function(t,e){return pi(t,$i(t),e)}(t,Wn(a,t))}else{if(!Lt[O])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case b:return li(t);case u:case l:return new r(+t);case E:return function(t,e){var n=e?li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Q:case F:case w:case S:case R:case U:case"[object Uint8ClampedArray]":case x:case k:return gi(t,n);case d:return new r;case I:case v:return new r(t);case C:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return new r;case B:return i=t,Qn?ht(Qn.call(i)):{}}var i}(t,O,A)}}o||(o=new Gn);var D=o.get(t);if(D)return D;o.set(t,a),Ya(t)?t.forEach((function(r){a.add(Xn(r,e,n,r,t,o))})):Pa(t)&&t.forEach((function(r,i){a.set(i,Xn(r,e,n,i,t,o))}));var G=m?void 0:(g?c?Wi:Pi:c?vA:yA)(t);return Ae(G||t,(function(r,i){G&&(r=t[i=r]),Vn(a,i,Xn(r,e,n,i,t,o))})),a}function zn(t,e,n){var r=n.length;if(null==t)return!r;for(t=ht(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Kn(t,e,n){if("function"!=typeof t)throw new pt(o);return yo((function(){t.apply(void 0,n)}),e)}function qn(t,e,n,r){var i=-1,o=le,a=!0,A=t.length,s=[],c=e.length;if(!A)return s;n&&(e=fe(e,Ue(n))),r?(o=ge,a=!1):e.length>=200&&(o=ke,a=!1,e=new Dn(e));t:for(;++i<A;){var u=t[i],l=null==n?u:n(u);if(u=r||0!==u?u:0,a&&l===l){for(var g=c;g--;)if(e[g]===l)continue t;s.push(u)}else o(e,l,r)||s.push(u)}return s}wn.templateSettings={escape:j,evaluate:L,interpolate:V,variable:"",imports:{_:wn}},wn.prototype=Rn.prototype,wn.prototype.constructor=wn,Un.prototype=Sn(Rn.prototype),Un.prototype.constructor=Un,xn.prototype=Sn(Rn.prototype),xn.prototype.constructor=xn,kn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},kn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},kn.prototype.get=function(t){var e=this.__data__;if(In){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return bt.call(e,t)?e[t]:void 0},kn.prototype.has=function(t){var e=this.__data__;return In?void 0!==e[t]:bt.call(e,t)},kn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=In&&void 0===e?"__lodash_hash_undefined__":e,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.prototype.delete=function(t){var e=this.__data__,n=Zn(e,t);return!(n<0)&&(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,!0)},On.prototype.get=function(t){var e=this.__data__,n=Zn(e,t);return n<0?void 0:e[n][1]},On.prototype.has=function(t){return Zn(this.__data__,t)>-1},On.prototype.set=function(t,e){var n=this.__data__,r=Zn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new kn,map:new(gn||On),string:new kn}},Nn.prototype.delete=function(t){var e=zi(this,t).delete(t);return this.size-=e?1:0,e},Nn.prototype.get=function(t){return zi(this,t).get(t)},Nn.prototype.has=function(t){return zi(this,t).has(t)},Nn.prototype.set=function(t,e){var n=zi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Dn.prototype.add=Dn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new On,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!gn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(t,e),this.size=n.size,this};var $n=vi(Ar),tr=vi(sr,!0);function er(t,e){var n=!0;return $n(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function nr(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===A?a===a&&!za(a):n(a,A)))var A=a,s=o}return s}function rr(t,e){var n=[];return $n(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function ir(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=io),i||(i=[]);++o<a;){var A=t[o];e>0&&n(A)?e>1?ir(A,e-1,n,r,i):he(i,A):r||(i[i.length]=A)}return i}var or=Bi(),ar=Bi(!0);function Ar(t,e){return t&&or(t,e,yA)}function sr(t,e){return t&&ar(t,e,yA)}function cr(t,e){return ue(e,(function(e){return Ta(t[e])}))}function ur(t,e){for(var n=0,r=(e=ai(e,t)).length;null!=t&&n<r;)t=t[Qo(e[n++])];return n&&n==r?t:void 0}function lr(t,e,n){var r=e(t);return ka(t)?r:he(r,n(t))}function gr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":qt&&qt in ht(t)?function(t){var e=bt.call(t,qt),n=t[qt];try{t[qt]=void 0;var r=!0}catch(o){}var i=Ft.call(t);r&&(e?t[qt]=n:delete t[qt]);return i}(t):function(t){return Ft.call(t)}(t)}function fr(t,e){return t>e}function hr(t,e){return null!=t&&bt.call(t,e)}function dr(t,e){return null!=t&&e in ht(t)}function Ir(t,e,r){for(var i=r?ge:le,o=t[0].length,a=t.length,A=a,s=n(a),c=1/0,u=[];A--;){var l=t[A];A&&e&&(l=fe(l,Ue(e))),c=an(l.length,c),s[A]=!r&&(e||o>=120&&l.length>=120)?new Dn(A&&l):void 0}l=t[0];var g=-1,f=s[0];t:for(;++g<o&&u.length<c;){var h=l[g],d=e?e(h):h;if(h=r||0!==h?h:0,!(f?ke(f,d):i(u,d,r))){for(A=a;--A;){var I=s[A];if(!(I?ke(I,d):i(t[A],d,r)))continue t}f&&f.push(d),u.push(h)}}return u}function pr(t,e,n){var r=null==(t=ho(t,e=ai(e,t)))?t:t[Qo(Mo(e))];return null==r?void 0:oe(r,t,n)}function Cr(t){return Za(t)&&gr(t)==s}function yr(t,e,n,r,i){return t===e||(null==t||null==e||!Za(t)&&!Za(e)?t!==t&&e!==e:function(t,e,n,r,i,o){var a=ka(t),A=ka(e),f=a?c:eo(t),h=A?c:eo(e),m=(f=f==s?p:f)==p,Q=(h=h==s?p:h)==p,F=f==h;if(F&&Ga(t)){if(!Ga(e))return!1;a=!0,m=!1}if(F&&!m)return o||(o=new Gn),a||Ka(t)?Vi(t,e,n,r,i,o):function(t,e,n,r,i,o,a){switch(n){case E:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!o(new Nt(t),new Nt(e)));case u:case l:case I:return Sa(+t,+e);case g:return t.name==e.name&&t.message==e.message;case C:case v:return t==e+"";case d:var A=je;case y:var s=1&r;if(A||(A=Ze),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=Vi(A(t),A(e),r,i,o,a);return a.delete(t),f;case B:if(Qn)return Qn.call(t)==Qn.call(e)}return!1}(t,e,f,n,r,i,o);if(!(1&n)){var w=m&&bt.call(t,"__wrapped__"),S=Q&&bt.call(e,"__wrapped__");if(w||S){var R=w?t.value():t,U=S?e.value():e;return o||(o=new Gn),i(R,U,n,r,o)}}if(!F)return!1;return o||(o=new Gn),function(t,e,n,r,i,o){var a=1&n,A=Pi(t),s=A.length,c=Pi(e).length;if(s!=c&&!a)return!1;var u=s;for(;u--;){var l=A[u];if(!(a?l in e:bt.call(e,l)))return!1}var g=o.get(t);if(g&&o.get(e))return g==e;var f=!0;o.set(t,e),o.set(e,t);var h=a;for(;++u<s;){l=A[u];var d=t[l],I=e[l];if(r)var p=a?r(I,d,l,e,t,o):r(d,I,l,t,e,o);if(!(void 0===p?d===I||i(d,I,n,r,o):p)){f=!1;break}h||(h="constructor"==l)}if(f&&!h){var C=t.constructor,y=e.constructor;C==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof C&&C instanceof C&&"function"==typeof y&&y instanceof y||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,r,i,o)}(t,e,n,r,yr,i))}function vr(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=ht(t);i--;){var A=n[i];if(a&&A[2]?A[1]!==t[A[0]]:!(A[0]in t))return!1}for(;++i<o;){var s=(A=n[i])[0],c=t[s],u=A[1];if(a&&A[2]){if(void 0===c&&!(s in t))return!1}else{var l=new Gn;if(r)var g=r(c,u,s,t,e,l);if(!(void 0===g?yr(u,c,3,r,l):g))return!1}}return!0}function Br(t){return!(!Va(t)||(e=t,Qt&&Qt in e))&&(Ta(t)?Rt:at).test(Fo(t));var e}function mr(t){return"function"==typeof t?t:null==t?WA:"object"==typeof t?ka(t)?Sr(t[0],t[1]):wr(t):ts(t)}function br(t){if(!uo(t))return rn(t);var e=[];for(var n in ht(t))bt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Er(t){if(!Va(t))return function(t){var e=[];if(null!=t)for(var n in ht(t))e.push(n);return e}(t);var e=uo(t),n=[];for(var r in t)("constructor"!=r||!e&&bt.call(t,r))&&n.push(r);return n}function Qr(t,e){return t<e}function Fr(t,e){var r=-1,i=Na(t)?n(t.length):[];return $n(t,(function(t,n,o){i[++r]=e(t,n,o)})),i}function wr(t){var e=Ki(t);return 1==e.length&&e[0][2]?go(e[0][0],e[0][1]):function(n){return n===t||vr(n,t,e)}}function Sr(t,e){return Ao(t)&&lo(e)?go(Qo(t),e):function(n){var r=hA(n,t);return void 0===r&&r===e?dA(n,t):yr(e,r,3)}}function Rr(t,e,n,r,i){t!==e&&or(e,(function(o,a){if(i||(i=new Gn),Va(o))!function(t,e,n,r,i,o,a){var A=po(t,n),s=po(e,n),c=a.get(s);if(c)return void Ln(t,n,c);var u=o?o(A,s,n+"",t,e,a):void 0,l=void 0===u;if(l){var g=ka(s),f=!g&&Ga(s),h=!g&&!f&&Ka(s);u=s,g||f||h?ka(A)?u=A:Da(A)?u=Ii(A):f?(l=!1,u=ui(s,!0)):h?(l=!1,u=gi(s,!0)):u=[]:Ja(s)||xa(s)?(u=A,xa(A)?u=oA(A):Va(A)&&!Ta(A)||(u=ro(s))):l=!1}l&&(a.set(s,u),i(u,s,r,o,a),a.delete(s));Ln(t,n,u)}(t,e,a,n,Rr,r,i);else{var A=r?r(po(t,a),o,a+"",t,e,i):void 0;void 0===A&&(A=o),Ln(t,a,A)}}),vA)}function Ur(t,e){var n=t.length;if(n)return oo(e+=e<0?n:0,n)?t[e]:void 0}function xr(t,e,n){var r=-1;return e=fe(e.length?e:[WA],Ue(Xi())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Fr(t,(function(t,n,i){return{criteria:fe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,a=i.length,A=n.length;for(;++r<a;){var s=fi(i[r],o[r]);if(s){if(r>=A)return s;var c=n[r];return s*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function kr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],A=ur(t,a);n(A,a)&&jr(o,ai(a,t),A)}return o}function Or(t,e,n,r){var i=r?me:Be,o=-1,a=e.length,A=t;for(t===e&&(e=Ii(e)),n&&(A=fe(t,Ue(n)));++o<a;)for(var s=0,c=e[o],u=n?n(c):c;(s=i(A,u,s,r))>-1;)A!==t&&Yt.call(A,s,1),Yt.call(t,s,1);return t}function Nr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;oo(i)?Yt.call(t,i,1):qr(t,i)}}return t}function Dr(t,e){return t+qe(cn()*(e-t+1))}function Gr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=qe(e/2))&&(t+=t)}while(e);return n}function _r(t,e){return vo(fo(t,e,WA),t+"")}function Mr(t){return Mn(SA(t))}function Tr(t,e){var n=SA(t);return bo(n,Yn(e,0,n.length))}function jr(t,e,n,r){if(!Va(t))return t;for(var i=-1,o=(e=ai(e,t)).length,a=o-1,A=t;null!=A&&++i<o;){var s=Qo(e[i]),c=n;if(i!=a){var u=A[s];void 0===(c=r?r(u,s,A):void 0)&&(c=Va(u)?u:oo(e[i+1])?[]:{})}Vn(A,s,c),A=A[s]}return t}var Lr=pn?function(t,e){return pn.set(t,e),t}:WA,Vr=Ce?function(t,e){return Ce(t,"toString",{configurable:!0,enumerable:!1,value:VA(e),writable:!0})}:WA;function Zr(t){return bo(SA(t))}function Pr(t,e,r){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=n(o);++i<o;)a[i]=t[i+e];return a}function Wr(t,e){var n;return $n(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function Jr(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e===e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!za(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Hr(t,e,WA,n)}function Hr(t,e,n,r){e=n(e);for(var i=0,o=null==t?0:t.length,a=e!==e,A=null===e,s=za(e),c=void 0===e;i<o;){var u=qe((i+o)/2),l=n(t[u]),g=void 0!==l,f=null===l,h=l===l,d=za(l);if(a)var I=r||h;else I=c?h&&(r||g):A?h&&g&&(r||!f):s?h&&g&&!f&&(r||!d):!f&&!d&&(r?l<=e:l<e);I?i=u+1:o=u}return an(o,4294967294)}function Yr(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],A=e?e(a):a;if(!n||!Sa(A,s)){var s=A;o[i++]=0===a?0:a}}return o}function Xr(t){return"number"==typeof t?t:za(t)?NaN:+t}function zr(t){if("string"==typeof t)return t;if(ka(t))return fe(t,zr)+"";if(za(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Kr(t,e,n){var r=-1,i=le,o=t.length,a=!0,A=[],s=A;if(n)a=!1,i=ge;else if(o>=200){var c=e?null:Gi(t);if(c)return Ze(c);a=!1,i=ke,s=new Dn}else s=e?[]:A;t:for(;++r<o;){var u=t[r],l=e?e(u):u;if(u=n||0!==u?u:0,a&&l===l){for(var g=s.length;g--;)if(s[g]===l)continue t;e&&s.push(l),A.push(u)}else i(s,l,n)||(s!==A&&s.push(l),A.push(u))}return A}function qr(t,e){return null==(t=ho(t,e=ai(e,t)))||delete t[Qo(Mo(e))]}function $r(t,e,n,r){return jr(t,e,n(ur(t,e)),r)}function ti(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Pr(t,r?0:o,r?o+1:i):Pr(t,r?o+1:0,r?i:o)}function ei(t,e){var n=t;return n instanceof xn&&(n=n.value()),de(e,(function(t,e){return e.func.apply(e.thisArg,he([t],e.args))}),n)}function ni(t,e,r){var i=t.length;if(i<2)return i?Kr(t[0]):[];for(var o=-1,a=n(i);++o<i;)for(var A=t[o],s=-1;++s<i;)s!=o&&(a[o]=qn(a[o]||A,t[s],e,r));return Kr(ir(a,1),e,r)}function ri(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var A=r<o?e[r]:void 0;n(a,t[r],A)}return a}function ii(t){return Da(t)?t:[]}function oi(t){return"function"==typeof t?t:WA}function ai(t,e){return ka(t)?t:Ao(t,e)?[t]:Eo(aA(t))}var Ai=_r;function si(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Pr(t,e,n)}var ci=Fe||function(t){return Ht.clearTimeout(t)};function ui(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function li(t){var e=new t.constructor(t.byteLength);return new Nt(e).set(new Nt(t)),e}function gi(t,e){var n=e?li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function fi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t===t,o=za(t),a=void 0!==e,A=null===e,s=e===e,c=za(e);if(!A&&!c&&!o&&t>e||o&&a&&s&&!A&&!c||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!c&&t<e||c&&n&&i&&!r&&!o||A&&n&&i||!a&&i||!s)return-1}return 0}function hi(t,e,r,i){for(var o=-1,a=t.length,A=r.length,s=-1,c=e.length,u=on(a-A,0),l=n(c+u),g=!i;++s<c;)l[s]=e[s];for(;++o<A;)(g||o<a)&&(l[r[o]]=t[o]);for(;u--;)l[s++]=t[o++];return l}function di(t,e,r,i){for(var o=-1,a=t.length,A=-1,s=r.length,c=-1,u=e.length,l=on(a-s,0),g=n(l+u),f=!i;++o<l;)g[o]=t[o];for(var h=o;++c<u;)g[h+c]=e[c];for(;++A<s;)(f||o<a)&&(g[h+r[A]]=t[o++]);return g}function Ii(t,e){var r=-1,i=t.length;for(e||(e=n(i));++r<i;)e[r]=t[r];return e}function pi(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var A=e[o],s=r?r(n[A],t[A],A,n,t):void 0;void 0===s&&(s=t[A]),i?Jn(n,A,s):Vn(n,A,s)}return n}function Ci(t,e){return function(n,r){var i=ka(n)?ae:Pn,o=e?e():{};return i(n,t,Xi(r,2),o)}}function yi(t){return _r((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=ht(e);++r<i;){var A=n[r];A&&t(e,A,r,o)}return e}))}function vi(t,e){return function(n,r){if(null==n)return n;if(!Na(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=ht(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Bi(t){return function(e,n,r){for(var i=-1,o=ht(e),a=r(e),A=a.length;A--;){var s=a[t?A:++i];if(!1===n(o[s],s,o))break}return e}}function mi(t){return function(e){var n=Te(e=aA(e))?Je(e):void 0,r=n?n[0]:e.charAt(0),i=n?si(n,1).join(""):e.slice(1);return r[t]()+i}}function bi(t){return function(e){return de(TA(xA(e).replace(kt,"")),t,"")}}function Ei(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Sn(t.prototype),r=t.apply(n,e);return Va(r)?r:n}}function Qi(t){return function(e,n,r){var i=ht(e);if(!Na(e)){var o=Xi(n,3);e=yA(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}function Fi(t){return Zi((function(e){var n=e.length,r=n,i=Un.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new pt(o);if(i&&!A&&"wrapper"==Hi(a))var A=new Un([],!0)}for(r=A?r:n;++r<n;){var s=Hi(a=e[r]),c="wrapper"==s?Ji(a):void 0;A=c&&so(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?A[Hi(c[0])].apply(A,c[3]):1==a.length&&so(a)?A[s]():A.thru(a)}return function(){var t=arguments,r=t[0];if(A&&1==t.length&&ka(r))return A.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function wi(t,e,r,i,o,a,A,s,c,u){var l=128&e,g=1&e,f=2&e,h=24&e,d=512&e,I=f?void 0:Ei(t);return function p(){for(var C=arguments.length,y=n(C),v=C;v--;)y[v]=arguments[v];if(h)var B=Yi(p),m=De(y,B);if(i&&(y=hi(y,i,o,h)),a&&(y=di(y,a,A,h)),C-=m,h&&C<u){var b=Ve(y,B);return Ni(t,e,wi,p.placeholder,r,y,b,s,c,u-C)}var E=g?r:this,Q=f?E[t]:t;return C=y.length,s?y=Io(y,s):d&&C>1&&y.reverse(),l&&c<C&&(y.length=c),this&&this!==Ht&&this instanceof p&&(Q=I||Ei(Q)),Q.apply(E,y)}}function Si(t,e){return function(n,r){return function(t,e,n,r){return Ar(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ri(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=zr(n),r=zr(r)):(n=Xr(n),r=Xr(r)),i=t(n,r)}return i}}function Ui(t){return Zi((function(e){return e=fe(e,Ue(Xi())),_r((function(n){var r=this;return t(e,(function(t){return oe(t,r,n)}))}))}))}function xi(t,e){var n=(e=void 0===e?" ":zr(e)).length;if(n<2)return n?Gr(e,t):e;var r=Gr(e,Ke(t/We(e)));return Te(e)?si(Je(r),0,t).join(""):r.slice(0,t)}function ki(t){return function(e,r,i){return i&&"number"!=typeof i&&ao(e,r,i)&&(r=i=void 0),e=eA(e),void 0===r?(r=e,e=0):r=eA(r),function(t,e,r,i){for(var o=-1,a=on(Ke((e-t)/(r||1)),0),A=n(a);a--;)A[i?a:++o]=t,t+=r;return A}(e,r,i=void 0===i?e<r?1:-1:eA(i),t)}}function Oi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=iA(e),n=iA(n)),t(e,n)}}function Ni(t,e,n,r,i,o,a,A,s,c){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var l=[t,e,i,u?o:void 0,u?a:void 0,u?void 0:o,u?void 0:a,A,s,c],g=n.apply(void 0,l);return so(t)&&Co(g,l),g.placeholder=r,Bo(g,t,e)}function Di(t){var e=ft[t];return function(t,n){if(t=iA(t),(n=null==n?0:an(nA(n),292))&&en(t)){var r=(aA(t)+"e").split("e");return+((r=(aA(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=hn&&1/Ze(new hn([,-0]))[1]==1/0?function(t){return new hn(t)}:zA;function _i(t){return function(e){var n=eo(e);return n==d?je(e):n==y?Pe(e):function(t,e){return fe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Mi(t,e,r,i,A,s,c,u){var l=2&e;if(!l&&"function"!=typeof t)throw new pt(o);var g=i?i.length:0;if(g||(e&=-97,i=A=void 0),c=void 0===c?c:on(nA(c),0),u=void 0===u?u:nA(u),g-=A?A.length:0,64&e){var f=i,h=A;i=A=void 0}var d=l?void 0:Ji(t),I=[t,e,r,i,A,f,h,s,c,u];if(d&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,A=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!A)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var c=t[3];t[3]=c?hi(c,s,e[4]):s,t[4]=c?Ve(t[3],a):e[4]}(s=e[5])&&(c=t[5],t[5]=c?di(c,s,e[6]):s,t[6]=c?Ve(t[5],a):e[6]);(s=e[7])&&(t[7]=s);128&r&&(t[8]=null==t[8]?e[8]:an(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(I,d),t=I[0],e=I[1],r=I[2],i=I[3],A=I[4],!(u=I[9]=void 0===I[9]?l?0:t.length:on(I[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)p=8==e||16==e?function(t,e,r){var i=Ei(t);return function o(){for(var a=arguments.length,A=n(a),s=a,c=Yi(o);s--;)A[s]=arguments[s];var u=a<3&&A[0]!==c&&A[a-1]!==c?[]:Ve(A,c);if((a-=u.length)<r)return Ni(t,e,wi,o.placeholder,void 0,A,u,void 0,void 0,r-a);var l=this&&this!==Ht&&this instanceof o?i:t;return oe(l,this,A)}}(t,e,u):32!=e&&33!=e||A.length?wi.apply(void 0,I):function(t,e,r,i){var o=1&e,a=Ei(t);return function e(){for(var A=-1,s=arguments.length,c=-1,u=i.length,l=n(u+s),g=this&&this!==Ht&&this instanceof e?a:t;++c<u;)l[c]=i[c];for(;s--;)l[c++]=arguments[++A];return oe(g,o?r:this,l)}}(t,e,r,i);else var p=function(t,e,n){var r=1&e,i=Ei(t);return function e(){var o=this&&this!==Ht&&this instanceof e?i:t;return o.apply(r?n:this,arguments)}}(t,e,r);return Bo((d?Lr:Co)(p,I),t,e)}function Ti(t,e,n,r){return void 0===t||Sa(t,vt[n])&&!bt.call(r,n)?e:t}function ji(t,e,n,r,i,o){return Va(t)&&Va(e)&&(o.set(e,t),Rr(t,e,void 0,ji,o),o.delete(e)),t}function Li(t){return Ja(t)?void 0:t}function Vi(t,e,n,r,i,o){var a=1&n,A=t.length,s=e.length;if(A!=s&&!(a&&s>A))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var u=-1,l=!0,g=2&n?new Dn:void 0;for(o.set(t,e),o.set(e,t);++u<A;){var f=t[u],h=e[u];if(r)var d=a?r(h,f,u,e,t,o):r(f,h,u,t,e,o);if(void 0!==d){if(d)continue;l=!1;break}if(g){if(!pe(e,(function(t,e){if(!ke(g,e)&&(f===t||i(f,t,n,r,o)))return g.push(e)}))){l=!1;break}}else if(f!==h&&!i(f,h,n,r,o)){l=!1;break}}return o.delete(t),o.delete(e),l}function Zi(t){return vo(fo(t,void 0,Oo),t+"")}function Pi(t){return lr(t,yA,$i)}function Wi(t){return lr(t,vA,to)}var Ji=pn?function(t){return pn.get(t)}:zA;function Hi(t){for(var e=t.name+"",n=Cn[e],r=bt.call(Cn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function Yi(t){return(bt.call(wn,"placeholder")?wn:t).placeholder}function Xi(){var t=wn.iteratee||JA;return t=t===JA?mr:t,arguments.length?t(arguments[0],arguments[1]):t}function zi(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Ki(t){for(var e=yA(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,lo(i)]}return e}function qi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Br(n)?n:void 0}var $i=$e?function(t){return null==t?[]:(t=ht(t),ue($e(t),(function(e){return Jt.call(t,e)})))}:rs,to=$e?function(t){for(var e=[];t;)he(e,$i(t)),t=Vt(t);return e}:rs,eo=gr;function no(t,e,n){for(var r=-1,i=(e=ai(e,t)).length,o=!1;++r<i;){var a=Qo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&La(i)&&oo(a,i)&&(ka(t)||xa(t))}function ro(t){return"function"!=typeof t.constructor||uo(t)?{}:Sn(Vt(t))}function io(t){return ka(t)||xa(t)||!!(Xt&&t&&t[Xt])}function oo(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&st.test(t))&&t>-1&&t%1==0&&t<e}function ao(t,e,n){if(!Va(n))return!1;var r=typeof e;return!!("number"==r?Na(n)&&oo(e,n.length):"string"==r&&e in n)&&Sa(n[e],t)}function Ao(t,e){if(ka(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!za(t))||(P.test(t)||!Z.test(t)||null!=e&&t in ht(e))}function so(t){var e=Hi(t),n=wn[e];if("function"!=typeof n||!(e in xn.prototype))return!1;if(t===n)return!0;var r=Ji(n);return!!r&&t===r[0]}(ln&&eo(new ln(new ArrayBuffer(1)))!=E||gn&&eo(new gn)!=d||fn&&"[object Promise]"!=eo(fn.resolve())||hn&&eo(new hn)!=y||dn&&eo(new dn)!=m)&&(eo=function(t){var e=gr(t),n=e==p?t.constructor:void 0,r=n?Fo(n):"";if(r)switch(r){case yn:return E;case vn:return d;case Bn:return"[object Promise]";case mn:return y;case bn:return m}return e});var co=Bt?Ta:is;function uo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||vt)}function lo(t){return t===t&&!Va(t)}function go(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in ht(n)))}}function fo(t,e,r){return e=on(void 0===e?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=on(i.length-e,0),A=n(a);++o<a;)A[o]=i[e+o];o=-1;for(var s=n(e+1);++o<e;)s[o]=i[o];return s[e]=r(A),oe(t,this,s)}}function ho(t,e){return e.length<2?t:ur(t,Pr(e,0,-1))}function Io(t,e){for(var n=t.length,r=an(e.length,n),i=Ii(t);r--;){var o=e[r];t[r]=oo(o,n)?i[o]:void 0}return t}function po(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Co=mo(Lr),yo=ze||function(t,e){return Ht.setTimeout(t,e)},vo=mo(Vr);function Bo(t,e,n){var r=e+"";return vo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(K,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(A,(function(n){var r="_."+n[0];e&n[1]&&!le(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(q);return e?e[1].split($):[]}(r),n)))}function mo(t){var e=0,n=0;return function(){var r=An(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function bo(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var o=Dr(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}var Eo=function(t){var e=ma(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(W,(function(t,n,r,i){e.push(r?i.replace(et,"$1"):n||t)})),e}));function Qo(t){if("string"==typeof t||za(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fo(t){if(null!=t){try{return mt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function wo(t){if(t instanceof xn)return t.clone();var e=new Un(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var So=_r((function(t,e){return Da(t)?qn(t,ir(e,1,Da,!0)):[]})),Ro=_r((function(t,e){var n=Mo(e);return Da(n)&&(n=void 0),Da(t)?qn(t,ir(e,1,Da,!0),Xi(n,2)):[]})),Uo=_r((function(t,e){var n=Mo(e);return Da(n)&&(n=void 0),Da(t)?qn(t,ir(e,1,Da,!0),void 0,n):[]}));function xo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:nA(n);return i<0&&(i=on(r+i,0)),ve(t,Xi(e,3),i)}function ko(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=nA(n),i=n<0?on(r+i,0):an(i,r-1)),ve(t,Xi(e,3),i,!0)}function Oo(t){return(null==t?0:t.length)?ir(t,1):[]}function No(t){return t&&t.length?t[0]:void 0}var Do=_r((function(t){var e=fe(t,ii);return e.length&&e[0]===t[0]?Ir(e):[]})),Go=_r((function(t){var e=Mo(t),n=fe(t,ii);return e===Mo(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Ir(n,Xi(e,2)):[]})),_o=_r((function(t){var e=Mo(t),n=fe(t,ii);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Ir(n,void 0,e):[]}));function Mo(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var To=_r(jo);function jo(t,e){return t&&t.length&&e&&e.length?Or(t,e):t}var Lo=Zi((function(t,e){var n=null==t?0:t.length,r=Hn(t,e);return Nr(t,fe(e,(function(t){return oo(t,n)?+t:t})).sort(fi)),r}));function Vo(t){return null==t?t:un.call(t)}var Zo=_r((function(t){return Kr(ir(t,1,Da,!0))})),Po=_r((function(t){var e=Mo(t);return Da(e)&&(e=void 0),Kr(ir(t,1,Da,!0),Xi(e,2))})),Wo=_r((function(t){var e=Mo(t);return e="function"==typeof e?e:void 0,Kr(ir(t,1,Da,!0),void 0,e)}));function Jo(t){if(!t||!t.length)return[];var e=0;return t=ue(t,(function(t){if(Da(t))return e=on(t.length,e),!0})),Re(e,(function(e){return fe(t,Qe(e))}))}function Ho(t,e){if(!t||!t.length)return[];var n=Jo(t);return null==e?n:fe(n,(function(t){return oe(e,void 0,t)}))}var Yo=_r((function(t,e){return Da(t)?qn(t,e):[]})),Xo=_r((function(t){return ni(ue(t,Da))})),zo=_r((function(t){var e=Mo(t);return Da(e)&&(e=void 0),ni(ue(t,Da),Xi(e,2))})),Ko=_r((function(t){var e=Mo(t);return e="function"==typeof e?e:void 0,ni(ue(t,Da),void 0,e)})),qo=_r(Jo);var $o=_r((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ho(t,n)}));function ta(t){var e=wn(t);return e.__chain__=!0,e}function ea(t,e){return e(t)}var na=Zi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Hn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof xn&&oo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new Un(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var ra=Ci((function(t,e,n){bt.call(t,n)?++t[n]:Jn(t,n,1)}));var ia=Qi(xo),oa=Qi(ko);function aa(t,e){return(ka(t)?Ae:$n)(t,Xi(e,3))}function Aa(t,e){return(ka(t)?se:tr)(t,Xi(e,3))}var sa=Ci((function(t,e,n){bt.call(t,n)?t[n].push(e):Jn(t,n,[e])}));var ca=_r((function(t,e,r){var i=-1,o="function"==typeof e,a=Na(t)?n(t.length):[];return $n(t,(function(t){a[++i]=o?oe(e,t,r):pr(t,e,r)})),a})),ua=Ci((function(t,e,n){Jn(t,n,e)}));function la(t,e){return(ka(t)?fe:Fr)(t,Xi(e,3))}var ga=Ci((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var fa=_r((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ao(t,e[0],e[1])?e=[]:n>2&&ao(e[0],e[1],e[2])&&(e=[e[0]]),xr(t,ir(e,1),[])})),ha=Xe||function(){return Ht.Date.now()};function da(t,e,n){return e=n?void 0:e,Mi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function Ia(t,e){var n;if("function"!=typeof e)throw new pt(o);return t=nA(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var pa=_r((function(t,e,n){var r=1;if(n.length){var i=Ve(n,Yi(pa));r|=32}return Mi(t,r,e,n,i)})),Ca=_r((function(t,e,n){var r=3;if(n.length){var i=Ve(n,Yi(Ca));r|=32}return Mi(e,r,t,n,i)}));function ya(t,e,n){var r,i,a,A,s,c,u=0,l=!1,g=!1,f=!0;if("function"!=typeof t)throw new pt(o);function h(e){var n=r,o=i;return r=i=void 0,u=e,A=t.apply(o,n)}function d(t){return u=t,s=yo(p,e),l?h(t):A}function I(t){var n=t-c;return void 0===c||n>=e||n<0||g&&t-u>=a}function p(){var t=ha();if(I(t))return C(t);s=yo(p,function(t){var n=e-(t-c);return g?an(n,a-(t-u)):n}(t))}function C(t){return s=void 0,f&&r?h(t):(r=i=void 0,A)}function y(){var t=ha(),n=I(t);if(r=arguments,i=this,c=t,n){if(void 0===s)return d(c);if(g)return ci(s),s=yo(p,e),h(c)}return void 0===s&&(s=yo(p,e)),A}return e=iA(e)||0,Va(n)&&(l=!!n.leading,a=(g="maxWait"in n)?on(iA(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&ci(s),u=0,r=c=i=s=void 0},y.flush=function(){return void 0===s?A:C(ha())},y}var va=_r((function(t,e){return Kn(t,1,e)})),Ba=_r((function(t,e,n){return Kn(t,iA(e)||0,n)}));function ma(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new pt(o);var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ma.Cache||Nn),n}function ba(t){if("function"!=typeof t)throw new pt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ma.Cache=Nn;var Ea=Ai((function(t,e){var n=(e=1==e.length&&ka(e[0])?fe(e[0],Ue(Xi())):fe(ir(e,1),Ue(Xi()))).length;return _r((function(r){for(var i=-1,o=an(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return oe(t,this,r)}))})),Qa=_r((function(t,e){return Mi(t,32,void 0,e,Ve(e,Yi(Qa)))})),Fa=_r((function(t,e){return Mi(t,64,void 0,e,Ve(e,Yi(Fa)))})),wa=Zi((function(t,e){return Mi(t,256,void 0,void 0,void 0,e)}));function Sa(t,e){return t===e||t!==t&&e!==e}var Ra=Oi(fr),Ua=Oi((function(t,e){return t>=e})),xa=Cr(function(){return arguments}())?Cr:function(t){return Za(t)&&bt.call(t,"callee")&&!Jt.call(t,"callee")},ka=n.isArray,Oa=$t?Ue($t):function(t){return Za(t)&&gr(t)==b};function Na(t){return null!=t&&La(t.length)&&!Ta(t)}function Da(t){return Za(t)&&Na(t)}var Ga=tn||is,_a=te?Ue(te):function(t){return Za(t)&&gr(t)==l};function Ma(t){if(!Za(t))return!1;var e=gr(t);return e==g||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ja(t)}function Ta(t){if(!Va(t))return!1;var e=gr(t);return e==f||e==h||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ja(t){return"number"==typeof t&&t==nA(t)}function La(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Va(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Za(t){return null!=t&&"object"==typeof t}var Pa=ee?Ue(ee):function(t){return Za(t)&&eo(t)==d};function Wa(t){return"number"==typeof t||Za(t)&&gr(t)==I}function Ja(t){if(!Za(t)||gr(t)!=p)return!1;var e=Vt(t);if(null===e)return!0;var n=bt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&mt.call(n)==wt}var Ha=ne?Ue(ne):function(t){return Za(t)&&gr(t)==C};var Ya=re?Ue(re):function(t){return Za(t)&&eo(t)==y};function Xa(t){return"string"==typeof t||!ka(t)&&Za(t)&&gr(t)==v}function za(t){return"symbol"==typeof t||Za(t)&&gr(t)==B}var Ka=ie?Ue(ie):function(t){return Za(t)&&La(t.length)&&!!jt[gr(t)]};var qa=Oi(Qr),$a=Oi((function(t,e){return t<=e}));function tA(t){if(!t)return[];if(Na(t))return Xa(t)?Je(t):Ii(t);if(Kt&&t[Kt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Kt]());var e=eo(t);return(e==d?je:e==y?Ze:SA)(t)}function eA(t){return t?(t=iA(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}function nA(t){var e=eA(t),n=e%1;return e===e?n?e-n:e:0}function rA(t){return t?Yn(nA(t),0,4294967295):0}function iA(t){if("number"==typeof t)return t;if(za(t))return NaN;if(Va(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Va(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Y,"");var n=ot.test(t);return n||At.test(t)?Pt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function oA(t){return pi(t,vA(t))}function aA(t){return null==t?"":zr(t)}var AA=yi((function(t,e){if(uo(e)||Na(e))pi(e,yA(e),t);else for(var n in e)bt.call(e,n)&&Vn(t,n,e[n])})),sA=yi((function(t,e){pi(e,vA(e),t)})),cA=yi((function(t,e,n,r){pi(e,vA(e),t,r)})),uA=yi((function(t,e,n,r){pi(e,yA(e),t,r)})),lA=Zi(Hn);var gA=_r((function(t,e){t=ht(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&ao(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=vA(o),A=-1,s=a.length;++A<s;){var c=a[A],u=t[c];(void 0===u||Sa(u,vt[c])&&!bt.call(t,c))&&(t[c]=o[c])}return t})),fA=_r((function(t){return t.push(void 0,ji),oe(mA,void 0,t)}));function hA(t,e,n){var r=null==t?void 0:ur(t,e);return void 0===r?n:r}function dA(t,e){return null!=t&&no(t,e,dr)}var IA=Si((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),t[e]=n}),VA(WA)),pA=Si((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),bt.call(t,e)?t[e].push(n):t[e]=[n]}),Xi),CA=_r(pr);function yA(t){return Na(t)?_n(t):br(t)}function vA(t){return Na(t)?_n(t,!0):Er(t)}var BA=yi((function(t,e,n){Rr(t,e,n)})),mA=yi((function(t,e,n,r){Rr(t,e,n,r)})),bA=Zi((function(t,e){var n={};if(null==t)return n;var r=!1;e=fe(e,(function(e){return e=ai(e,t),r||(r=e.length>1),e})),pi(t,Wi(t),n),r&&(n=Xn(n,7,Li));for(var i=e.length;i--;)qr(n,e[i]);return n}));var EA=Zi((function(t,e){return null==t?{}:function(t,e){return kr(t,e,(function(e,n){return dA(t,n)}))}(t,e)}));function QA(t,e){if(null==t)return{};var n=fe(Wi(t),(function(t){return[t]}));return e=Xi(e),kr(t,n,(function(t,n){return e(t,n[0])}))}var FA=_i(yA),wA=_i(vA);function SA(t){return null==t?[]:xe(t,yA(t))}var RA=bi((function(t,e,n){return e=e.toLowerCase(),t+(n?UA(e):e)}));function UA(t){return MA(aA(t).toLowerCase())}function xA(t){return(t=aA(t))&&t.replace(ct,Ge).replace(Ot,"")}var kA=bi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),OA=bi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),NA=mi("toLowerCase");var DA=bi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var GA=bi((function(t,e,n){return t+(n?" ":"")+MA(e)}));var _A=bi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),MA=mi("toUpperCase");function TA(t,e,n){return t=aA(t),void 0===(e=n?void 0:e)?function(t){return _t.test(t)}(t)?function(t){return t.match(Dt)||[]}(t):function(t){return t.match(tt)||[]}(t):t.match(e)||[]}var jA=_r((function(t,e){try{return oe(t,void 0,e)}catch(n){return Ma(n)?n:new i(n)}})),LA=Zi((function(t,e){return Ae(e,(function(e){e=Qo(e),Jn(t,e,pa(t[e],t))})),t}));function VA(t){return function(){return t}}var ZA=Fi(),PA=Fi(!0);function WA(t){return t}function JA(t){return mr("function"==typeof t?t:Xn(t,1))}var HA=_r((function(t,e){return function(n){return pr(n,t,e)}})),YA=_r((function(t,e){return function(n){return pr(t,n,e)}}));function XA(t,e,n){var r=yA(e),i=cr(e,r);null!=n||Va(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=cr(e,yA(e)));var o=!(Va(n)&&"chain"in n)||!!n.chain,a=Ta(t);return Ae(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ii(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,he([this.value()],arguments))})})),t}function zA(){}var KA=Ui(fe),qA=Ui(ce),$A=Ui(pe);function ts(t){return Ao(t)?Qe(Qo(t)):function(t){return function(e){return ur(e,t)}}(t)}var es=ki(),ns=ki(!0);function rs(){return[]}function is(){return!1}var os=Ri((function(t,e){return t+e}),0),as=Di("ceil"),As=Ri((function(t,e){return t/e}),1),ss=Di("floor");var cs=Ri((function(t,e){return t*e}),1),us=Di("round"),ls=Ri((function(t,e){return t-e}),0);return wn.after=function(t,e){if("function"!=typeof e)throw new pt(o);return t=nA(t),function(){if(--t<1)return e.apply(this,arguments)}},wn.ary=da,wn.assign=AA,wn.assignIn=sA,wn.assignInWith=cA,wn.assignWith=uA,wn.at=lA,wn.before=Ia,wn.bind=pa,wn.bindAll=LA,wn.bindKey=Ca,wn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ka(t)?t:[t]},wn.chain=ta,wn.chunk=function(t,e,r){e=(r?ao(t,e,r):void 0===e)?1:on(nA(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,A=n(Ke(i/e));o<i;)A[a++]=Pr(t,o,o+=e);return A},wn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},wn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=n(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return he(ka(r)?Ii(r):[r],ir(e,1))},wn.cond=function(t){var e=null==t?0:t.length,n=Xi();return t=e?fe(t,(function(t){if("function"!=typeof t[1])throw new pt(o);return[n(t[0]),t[1]]})):[],_r((function(n){for(var r=-1;++r<e;){var i=t[r];if(oe(i[0],this,n))return oe(i[1],this,n)}}))},wn.conforms=function(t){return function(t){var e=yA(t);return function(n){return zn(n,t,e)}}(Xn(t,1))},wn.constant=VA,wn.countBy=ra,wn.create=function(t,e){var n=Sn(t);return null==e?n:Wn(n,e)},wn.curry=function t(e,n,r){var i=Mi(e,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},wn.curryRight=function t(e,n,r){var i=Mi(e,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},wn.debounce=ya,wn.defaults=gA,wn.defaultsDeep=fA,wn.defer=va,wn.delay=Ba,wn.difference=So,wn.differenceBy=Ro,wn.differenceWith=Uo,wn.drop=function(t,e,n){var r=null==t?0:t.length;return r?Pr(t,(e=n||void 0===e?1:nA(e))<0?0:e,r):[]},wn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Pr(t,0,(e=r-(e=n||void 0===e?1:nA(e)))<0?0:e):[]},wn.dropRightWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3),!0,!0):[]},wn.dropWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3),!0):[]},wn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&ao(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=nA(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:nA(r))<0&&(r+=i),r=n>r?0:rA(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},wn.filter=function(t,e){return(ka(t)?ue:rr)(t,Xi(e,3))},wn.flatMap=function(t,e){return ir(la(t,e),1)},wn.flatMapDeep=function(t,e){return ir(la(t,e),1/0)},wn.flatMapDepth=function(t,e,n){return n=void 0===n?1:nA(n),ir(la(t,e),n)},wn.flatten=Oo,wn.flattenDeep=function(t){return(null==t?0:t.length)?ir(t,1/0):[]},wn.flattenDepth=function(t,e){return(null==t?0:t.length)?ir(t,e=void 0===e?1:nA(e)):[]},wn.flip=function(t){return Mi(t,512)},wn.flow=ZA,wn.flowRight=PA,wn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},wn.functions=function(t){return null==t?[]:cr(t,yA(t))},wn.functionsIn=function(t){return null==t?[]:cr(t,vA(t))},wn.groupBy=sa,wn.initial=function(t){return(null==t?0:t.length)?Pr(t,0,-1):[]},wn.intersection=Do,wn.intersectionBy=Go,wn.intersectionWith=_o,wn.invert=IA,wn.invertBy=pA,wn.invokeMap=ca,wn.iteratee=JA,wn.keyBy=ua,wn.keys=yA,wn.keysIn=vA,wn.map=la,wn.mapKeys=function(t,e){var n={};return e=Xi(e,3),Ar(t,(function(t,r,i){Jn(n,e(t,r,i),t)})),n},wn.mapValues=function(t,e){var n={};return e=Xi(e,3),Ar(t,(function(t,r,i){Jn(n,r,e(t,r,i))})),n},wn.matches=function(t){return wr(Xn(t,1))},wn.matchesProperty=function(t,e){return Sr(t,Xn(e,1))},wn.memoize=ma,wn.merge=BA,wn.mergeWith=mA,wn.method=HA,wn.methodOf=YA,wn.mixin=XA,wn.negate=ba,wn.nthArg=function(t){return t=nA(t),_r((function(e){return Ur(e,t)}))},wn.omit=bA,wn.omitBy=function(t,e){return QA(t,ba(Xi(e)))},wn.once=function(t){return Ia(2,t)},wn.orderBy=function(t,e,n,r){return null==t?[]:(ka(e)||(e=null==e?[]:[e]),ka(n=r?void 0:n)||(n=null==n?[]:[n]),xr(t,e,n))},wn.over=KA,wn.overArgs=Ea,wn.overEvery=qA,wn.overSome=$A,wn.partial=Qa,wn.partialRight=Fa,wn.partition=ga,wn.pick=EA,wn.pickBy=QA,wn.property=ts,wn.propertyOf=function(t){return function(e){return null==t?void 0:ur(t,e)}},wn.pull=To,wn.pullAll=jo,wn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,Xi(n,2)):t},wn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,void 0,n):t},wn.pullAt=Lo,wn.range=es,wn.rangeRight=ns,wn.rearg=wa,wn.reject=function(t,e){return(ka(t)?ue:rr)(t,ba(Xi(e,3)))},wn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Xi(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Nr(t,i),n},wn.rest=function(t,e){if("function"!=typeof t)throw new pt(o);return _r(t,e=void 0===e?e:nA(e))},wn.reverse=Vo,wn.sampleSize=function(t,e,n){return e=(n?ao(t,e,n):void 0===e)?1:nA(e),(ka(t)?Tn:Tr)(t,e)},wn.set=function(t,e,n){return null==t?t:jr(t,e,n)},wn.setWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:jr(t,e,n,r)},wn.shuffle=function(t){return(ka(t)?jn:Zr)(t)},wn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&ao(t,e,n)?(e=0,n=r):(e=null==e?0:nA(e),n=void 0===n?r:nA(n)),Pr(t,e,n)):[]},wn.sortBy=fa,wn.sortedUniq=function(t){return t&&t.length?Yr(t):[]},wn.sortedUniqBy=function(t,e){return t&&t.length?Yr(t,Xi(e,2)):[]},wn.split=function(t,e,n){return n&&"number"!=typeof n&&ao(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=aA(t))&&("string"==typeof e||null!=e&&!Ha(e))&&!(e=zr(e))&&Te(t)?si(Je(t),0,n):t.split(e,n):[]},wn.spread=function(t,e){if("function"!=typeof t)throw new pt(o);return e=null==e?0:on(nA(e),0),_r((function(n){var r=n[e],i=si(n,0,e);return r&&he(i,r),oe(t,this,i)}))},wn.tail=function(t){var e=null==t?0:t.length;return e?Pr(t,1,e):[]},wn.take=function(t,e,n){return t&&t.length?Pr(t,0,(e=n||void 0===e?1:nA(e))<0?0:e):[]},wn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Pr(t,(e=r-(e=n||void 0===e?1:nA(e)))<0?0:e,r):[]},wn.takeRightWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3),!1,!0):[]},wn.takeWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3)):[]},wn.tap=function(t,e){return e(t),t},wn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new pt(o);return Va(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ya(t,e,{leading:r,maxWait:e,trailing:i})},wn.thru=ea,wn.toArray=tA,wn.toPairs=FA,wn.toPairsIn=wA,wn.toPath=function(t){return ka(t)?fe(t,Qo):za(t)?[t]:Ii(Eo(aA(t)))},wn.toPlainObject=oA,wn.transform=function(t,e,n){var r=ka(t),i=r||Ga(t)||Ka(t);if(e=Xi(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Va(t)&&Ta(o)?Sn(Vt(t)):{}}return(i?Ae:Ar)(t,(function(t,r,i){return e(n,t,r,i)})),n},wn.unary=function(t){return da(t,1)},wn.union=Zo,wn.unionBy=Po,wn.unionWith=Wo,wn.uniq=function(t){return t&&t.length?Kr(t):[]},wn.uniqBy=function(t,e){return t&&t.length?Kr(t,Xi(e,2)):[]},wn.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Kr(t,void 0,e):[]},wn.unset=function(t,e){return null==t||qr(t,e)},wn.unzip=Jo,wn.unzipWith=Ho,wn.update=function(t,e,n){return null==t?t:$r(t,e,oi(n))},wn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:$r(t,e,oi(n),r)},wn.values=SA,wn.valuesIn=function(t){return null==t?[]:xe(t,vA(t))},wn.without=Yo,wn.words=TA,wn.wrap=function(t,e){return Qa(oi(e),t)},wn.xor=Xo,wn.xorBy=zo,wn.xorWith=Ko,wn.zip=qo,wn.zipObject=function(t,e){return ri(t||[],e||[],Vn)},wn.zipObjectDeep=function(t,e){return ri(t||[],e||[],jr)},wn.zipWith=$o,wn.entries=FA,wn.entriesIn=wA,wn.extend=sA,wn.extendWith=cA,XA(wn,wn),wn.add=os,wn.attempt=jA,wn.camelCase=RA,wn.capitalize=UA,wn.ceil=as,wn.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=iA(n))===n?n:0),void 0!==e&&(e=(e=iA(e))===e?e:0),Yn(iA(t),e,n)},wn.clone=function(t){return Xn(t,4)},wn.cloneDeep=function(t){return Xn(t,5)},wn.cloneDeepWith=function(t,e){return Xn(t,5,e="function"==typeof e?e:void 0)},wn.cloneWith=function(t,e){return Xn(t,4,e="function"==typeof e?e:void 0)},wn.conformsTo=function(t,e){return null==e||zn(t,e,yA(e))},wn.deburr=xA,wn.defaultTo=function(t,e){return null==t||t!==t?e:t},wn.divide=As,wn.endsWith=function(t,e,n){t=aA(t),e=zr(e);var r=t.length,i=n=void 0===n?r:Yn(nA(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},wn.eq=Sa,wn.escape=function(t){return(t=aA(t))&&T.test(t)?t.replace(_,_e):t},wn.escapeRegExp=function(t){return(t=aA(t))&&H.test(t)?t.replace(J,"\\$&"):t},wn.every=function(t,e,n){var r=ka(t)?ce:er;return n&&ao(t,e,n)&&(e=void 0),r(t,Xi(e,3))},wn.find=ia,wn.findIndex=xo,wn.findKey=function(t,e){return ye(t,Xi(e,3),Ar)},wn.findLast=oa,wn.findLastIndex=ko,wn.findLastKey=function(t,e){return ye(t,Xi(e,3),sr)},wn.floor=ss,wn.forEach=aa,wn.forEachRight=Aa,wn.forIn=function(t,e){return null==t?t:or(t,Xi(e,3),vA)},wn.forInRight=function(t,e){return null==t?t:ar(t,Xi(e,3),vA)},wn.forOwn=function(t,e){return t&&Ar(t,Xi(e,3))},wn.forOwnRight=function(t,e){return t&&sr(t,Xi(e,3))},wn.get=hA,wn.gt=Ra,wn.gte=Ua,wn.has=function(t,e){return null!=t&&no(t,e,hr)},wn.hasIn=dA,wn.head=No,wn.identity=WA,wn.includes=function(t,e,n,r){t=Na(t)?t:SA(t),n=n&&!r?nA(n):0;var i=t.length;return n<0&&(n=on(i+n,0)),Xa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Be(t,e,n)>-1},wn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:nA(n);return i<0&&(i=on(r+i,0)),Be(t,e,i)},wn.inRange=function(t,e,n){return e=eA(e),void 0===n?(n=e,e=0):n=eA(n),function(t,e,n){return t>=an(e,n)&&t<on(e,n)}(t=iA(t),e,n)},wn.invoke=CA,wn.isArguments=xa,wn.isArray=ka,wn.isArrayBuffer=Oa,wn.isArrayLike=Na,wn.isArrayLikeObject=Da,wn.isBoolean=function(t){return!0===t||!1===t||Za(t)&&gr(t)==u},wn.isBuffer=Ga,wn.isDate=_a,wn.isElement=function(t){return Za(t)&&1===t.nodeType&&!Ja(t)},wn.isEmpty=function(t){if(null==t)return!0;if(Na(t)&&(ka(t)||"string"==typeof t||"function"==typeof t.splice||Ga(t)||Ka(t)||xa(t)))return!t.length;var e=eo(t);if(e==d||e==y)return!t.size;if(uo(t))return!br(t).length;for(var n in t)if(bt.call(t,n))return!1;return!0},wn.isEqual=function(t,e){return yr(t,e)},wn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?yr(t,e,void 0,n):!!r},wn.isError=Ma,wn.isFinite=function(t){return"number"==typeof t&&en(t)},wn.isFunction=Ta,wn.isInteger=ja,wn.isLength=La,wn.isMap=Pa,wn.isMatch=function(t,e){return t===e||vr(t,e,Ki(e))},wn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:void 0,vr(t,e,Ki(e),n)},wn.isNaN=function(t){return Wa(t)&&t!=+t},wn.isNative=function(t){if(co(t))throw new i("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Br(t)},wn.isNil=function(t){return null==t},wn.isNull=function(t){return null===t},wn.isNumber=Wa,wn.isObject=Va,wn.isObjectLike=Za,wn.isPlainObject=Ja,wn.isRegExp=Ha,wn.isSafeInteger=function(t){return ja(t)&&t>=-9007199254740991&&t<=9007199254740991},wn.isSet=Ya,wn.isString=Xa,wn.isSymbol=za,wn.isTypedArray=Ka,wn.isUndefined=function(t){return void 0===t},wn.isWeakMap=function(t){return Za(t)&&eo(t)==m},wn.isWeakSet=function(t){return Za(t)&&"[object WeakSet]"==gr(t)},wn.join=function(t,e){return null==t?"":nn.call(t,e)},wn.kebabCase=kA,wn.last=Mo,wn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=nA(n))<0?on(r+i,0):an(i,r-1)),e===e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):ve(t,be,i,!0)},wn.lowerCase=OA,wn.lowerFirst=NA,wn.lt=qa,wn.lte=$a,wn.max=function(t){return t&&t.length?nr(t,WA,fr):void 0},wn.maxBy=function(t,e){return t&&t.length?nr(t,Xi(e,2),fr):void 0},wn.mean=function(t){return Ee(t,WA)},wn.meanBy=function(t,e){return Ee(t,Xi(e,2))},wn.min=function(t){return t&&t.length?nr(t,WA,Qr):void 0},wn.minBy=function(t,e){return t&&t.length?nr(t,Xi(e,2),Qr):void 0},wn.stubArray=rs,wn.stubFalse=is,wn.stubObject=function(){return{}},wn.stubString=function(){return""},wn.stubTrue=function(){return!0},wn.multiply=cs,wn.nth=function(t,e){return t&&t.length?Ur(t,nA(e)):void 0},wn.noConflict=function(){return Ht._===this&&(Ht._=St),this},wn.noop=zA,wn.now=ha,wn.pad=function(t,e,n){t=aA(t);var r=(e=nA(e))?We(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return xi(qe(i),n)+t+xi(Ke(i),n)},wn.padEnd=function(t,e,n){t=aA(t);var r=(e=nA(e))?We(t):0;return e&&r<e?t+xi(e-r,n):t},wn.padStart=function(t,e,n){t=aA(t);var r=(e=nA(e))?We(t):0;return e&&r<e?xi(e-r,n)+t:t},wn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),sn(aA(t).replace(X,""),e||0)},wn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&ao(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=eA(t),void 0===e?(e=t,t=0):e=eA(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=cn();return an(t+i*(e-t+Zt("1e-"+((i+"").length-1))),e)}return Dr(t,e)},wn.reduce=function(t,e,n){var r=ka(t)?de:we,i=arguments.length<3;return r(t,Xi(e,4),n,i,$n)},wn.reduceRight=function(t,e,n){var r=ka(t)?Ie:we,i=arguments.length<3;return r(t,Xi(e,4),n,i,tr)},wn.repeat=function(t,e,n){return e=(n?ao(t,e,n):void 0===e)?1:nA(e),Gr(aA(t),e)},wn.replace=function(){var t=arguments,e=aA(t[0]);return t.length<3?e:e.replace(t[1],t[2])},wn.result=function(t,e,n){var r=-1,i=(e=ai(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[Qo(e[r])];void 0===o&&(r=i,o=n),t=Ta(o)?o.call(t):o}return t},wn.round=us,wn.runInContext=t,wn.sample=function(t){return(ka(t)?Mn:Mr)(t)},wn.size=function(t){if(null==t)return 0;if(Na(t))return Xa(t)?We(t):t.length;var e=eo(t);return e==d||e==y?t.size:br(t).length},wn.snakeCase=DA,wn.some=function(t,e,n){var r=ka(t)?pe:Wr;return n&&ao(t,e,n)&&(e=void 0),r(t,Xi(e,3))},wn.sortedIndex=function(t,e){return Jr(t,e)},wn.sortedIndexBy=function(t,e,n){return Hr(t,e,Xi(n,2))},wn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Jr(t,e);if(r<n&&Sa(t[r],e))return r}return-1},wn.sortedLastIndex=function(t,e){return Jr(t,e,!0)},wn.sortedLastIndexBy=function(t,e,n){return Hr(t,e,Xi(n,2),!0)},wn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Jr(t,e,!0)-1;if(Sa(t[n],e))return n}return-1},wn.startCase=GA,wn.startsWith=function(t,e,n){return t=aA(t),n=null==n?0:Yn(nA(n),0,t.length),e=zr(e),t.slice(n,n+e.length)==e},wn.subtract=ls,wn.sum=function(t){return t&&t.length?Se(t,WA):0},wn.sumBy=function(t,e){return t&&t.length?Se(t,Xi(e,2)):0},wn.template=function(t,e,n){var r=wn.templateSettings;n&&ao(t,e,n)&&(e=void 0),t=aA(t),e=cA({},e,r,Ti);var i,o,a=cA({},e.imports,r.imports,Ti),A=yA(a),s=xe(a,A),c=0,u=e.interpolate||ut,l="__p += '",g=dt((e.escape||ut).source+"|"+u.source+"|"+(u===V?nt:ut).source+"|"+(e.evaluate||ut).source+"|$","g"),f="//# sourceURL="+(bt.call(e,"sourceURL")?(e.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++Tt+"]")+"\n";t.replace(g,(function(e,n,r,a,A,s){return r||(r=a),l+=t.slice(c,s).replace(lt,Me),n&&(i=!0,l+="' +\n__e("+n+") +\n'"),A&&(o=!0,l+="';\n"+A+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=s+e.length,e})),l+="';\n";var h=bt.call(e,"variable")&&e.variable;h||(l="with (obj) {\n"+l+"\n}\n"),l=(o?l.replace(O,""):l).replace(N,"$1").replace(D,"$1;"),l="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var d=jA((function(){return gt(A,f+"return "+l).apply(void 0,s)}));if(d.source=l,Ma(d))throw d;return d},wn.times=function(t,e){if((t=nA(t))<1||t>9007199254740991)return[];var n=4294967295,r=an(t,4294967295);t-=4294967295;for(var i=Re(r,e=Xi(e));++n<t;)e(n);return i},wn.toFinite=eA,wn.toInteger=nA,wn.toLength=rA,wn.toLower=function(t){return aA(t).toLowerCase()},wn.toNumber=iA,wn.toSafeInteger=function(t){return t?Yn(nA(t),-9007199254740991,9007199254740991):0===t?t:0},wn.toString=aA,wn.toUpper=function(t){return aA(t).toUpperCase()},wn.trim=function(t,e,n){if((t=aA(t))&&(n||void 0===e))return t.replace(Y,"");if(!t||!(e=zr(e)))return t;var r=Je(t),i=Je(e);return si(r,Oe(r,i),Ne(r,i)+1).join("")},wn.trimEnd=function(t,e,n){if((t=aA(t))&&(n||void 0===e))return t.replace(z,"");if(!t||!(e=zr(e)))return t;var r=Je(t);return si(r,0,Ne(r,Je(e))+1).join("")},wn.trimStart=function(t,e,n){if((t=aA(t))&&(n||void 0===e))return t.replace(X,"");if(!t||!(e=zr(e)))return t;var r=Je(t);return si(r,Oe(r,Je(e))).join("")},wn.truncate=function(t,e){var n=30,r="...";if(Va(e)){var i="separator"in e?e.separator:i;n="length"in e?nA(e.length):n,r="omission"in e?zr(e.omission):r}var o=(t=aA(t)).length;if(Te(t)){var a=Je(t);o=a.length}if(n>=o)return t;var A=n-We(r);if(A<1)return r;var s=a?si(a,0,A).join(""):t.slice(0,A);if(void 0===i)return s+r;if(a&&(A+=s.length-A),Ha(i)){if(t.slice(A).search(i)){var c,u=s;for(i.global||(i=dt(i.source,aA(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(u);)var l=c.index;s=s.slice(0,void 0===l?A:l)}}else if(t.indexOf(zr(i),A)!=A){var g=s.lastIndexOf(i);g>-1&&(s=s.slice(0,g))}return s+r},wn.unescape=function(t){return(t=aA(t))&&M.test(t)?t.replace(G,He):t},wn.uniqueId=function(t){var e=++Et;return aA(t)+e},wn.upperCase=_A,wn.upperFirst=MA,wn.each=aa,wn.eachRight=Aa,wn.first=No,XA(wn,function(){var t={};return Ar(wn,(function(e,n){bt.call(wn.prototype,n)||(t[n]=e)})),t}(),{chain:!1}),wn.VERSION="4.17.15",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){wn[t].placeholder=wn})),Ae(["drop","take"],(function(t,e){xn.prototype[t]=function(n){n=void 0===n?1:on(nA(n),0);var r=this.__filtered__&&!e?new xn(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},xn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;xn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xi(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");xn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");xn.prototype[t]=function(){return this.__filtered__?new xn(this):this[n](1)}})),xn.prototype.compact=function(){return this.filter(WA)},xn.prototype.find=function(t){return this.filter(t).head()},xn.prototype.findLast=function(t){return this.reverse().find(t)},xn.prototype.invokeMap=_r((function(t,e){return"function"==typeof t?new xn(this):this.map((function(n){return pr(n,t,e)}))})),xn.prototype.reject=function(t){return this.filter(ba(Xi(t)))},xn.prototype.slice=function(t,e){t=nA(t);var n=this;return n.__filtered__&&(t>0||e<0)?new xn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=nA(e))<0?n.dropRight(-e):n.take(e-t)),n)},xn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},Ar(xn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=wn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(wn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,A=e instanceof xn,s=a[0],c=A||ka(e),u=function(t){var e=i.apply(wn,he([t],a));return r&&l?e[0]:e};c&&n&&"function"==typeof s&&1!=s.length&&(A=c=!1);var l=this.__chain__,g=!!this.__actions__.length,f=o&&!l,h=A&&!g;if(!o&&c){e=h?e:new xn(this);var d=t.apply(e,a);return d.__actions__.push({func:ea,args:[u],thisArg:void 0}),new Un(d,l)}return f&&h?t.apply(this,a):(d=this.thru(u),f?r?d.value()[0]:d.value():d)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);wn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ka(i)?i:[],t)}return this[n]((function(n){return e.apply(ka(n)?n:[],t)}))}})),Ar(xn.prototype,(function(t,e){var n=wn[e];if(n){var r=n.name+"";bt.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:e,func:n})}})),Cn[wi(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var t=new xn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},xn.prototype.reverse=function(){if(this.__filtered__){var t=new xn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},xn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ka(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=an(e,t+a);break;case"takeRight":t=on(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,A=o.end,s=A-a,c=r?A:a-1,u=this.__iteratees__,l=u.length,g=0,f=an(s,this.__takeCount__);if(!n||!r&&i==s&&f==s)return ei(t,this.__actions__);var h=[];t:for(;s--&&g<f;){for(var d=-1,I=t[c+=e];++d<l;){var p=u[d],C=p.iteratee,y=p.type,v=C(I);if(2==y)I=v;else if(!v){if(1==y)continue t;break t}}h[g++]=I}return h},wn.prototype.at=na,wn.prototype.chain=function(){return ta(this)},wn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},wn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tA(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},wn.prototype.plant=function(t){for(var e,n=this;n instanceof Rn;){var r=wo(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},wn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof xn){var e=t;return this.__actions__.length&&(e=new xn(this)),(e=e.reverse()).__actions__.push({func:ea,args:[Vo],thisArg:void 0}),new Un(e,this.__chain__)}return this.thru(Vo)},wn.prototype.toJSON=wn.prototype.valueOf=wn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},wn.prototype.first=wn.prototype.head,Kt&&(wn.prototype[Kt]=function(){return this}),wn}();Ht._=Ye,void 0===(i=function(){return Ye}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(56),n(130)(t))},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r,i=n(1),o=n(133),a=n(218),A={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};e.b=(r={},Object(i.a)(r,A.WEBGL2,[!1,!0]),Object(i.a)(r,A.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(i.a)(r,A.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(i.a)(r,A.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(i.a)(r,A.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(i.a)(r,A.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(i.a)(r,A.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(i.a)(r,A.FLOAT_BLEND,["EXT_float_blend"]),Object(i.a)(r,A.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(i.a)(r,A.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(i.a)(r,A.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(i.a)(r,A.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(i.a)(r,A.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(i.a)(r,A.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(i.a)(r,A.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(i.a)(r,A.COLOR_ATTACHMENT_RGBA32F,[function(t){var e=new a.a(t,{format:6408,type:5126,dataFormat:6408}),n=new o.a(t,{id:"test-framebuffer",check:!1,attachments:Object(i.a)({},36064,e)}),r=n.getStatus();return e.delete(),n.delete(),36053===r},"EXT_color_buffer_float"]),Object(i.a)(r,A.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(i.a)(r,A.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),Object(i.a)(r,A.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(i.a)(r,A.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(i.a)(r,A.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(i.a)(r,A.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),r)},function(t,e){},function(t,e,n){"use strict";var r,i,o;i=[],void 0===(o="function"===typeof(r=function(){function t(){return!0}function e(){return!1}function n(){}return function r(){var i=[{name:"number",test:function(t){return"number"===typeof t}},{name:"string",test:function(t){return"string"===typeof t}},{name:"boolean",test:function(t){return"boolean"===typeof t}},{name:"Function",test:function(t){return"function"===typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:function(t){return"object"===typeof t&&null!==t&&t.constructor===Object}},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],o={name:"any",test:t},a=[],A=[],s={types:i,conversions:A,ignore:a};function c(t){var e=T(s.types,(function(e){return e.name===t}));if(e)return e;if("any"===t)return o;var n=T(s.types,(function(e){return e.name.toLowerCase()===t.toLowerCase()}));throw new TypeError('Unknown type "'+t+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function u(t){return t===o?999:s.types.indexOf(t)}function l(t){var e=T(s.types,(function(e){return e.test(t)}));if(e)return e.name;throw new TypeError("Value has unknown type. Value: "+t)}function g(t){return t.map((function(t){var e=t.types.map(v);return(t.restParam?"...":"")+e.join("|")})).join(",")}function f(t,e){var n=0===t.indexOf("..."),r=(n?t.length>3?t.slice(3):"any":t).split("|").map(k).filter(O).filter(x),i=function(t,e){var n={};return t.forEach((function(t){-1!==e.indexOf(t.from)||-1===e.indexOf(t.to)||n[t.from]||(n[t.from]=t)})),Object.keys(n).map((function(t){return n[t]}))}(e,r),o=r.map((function(t){var e=c(t);return{name:t,typeIndex:u(e),test:e.test,conversion:null,conversionIndex:-1}})),a=i.map((function(t){var n=c(t.from);return{name:t.from,typeIndex:u(n),test:n.test,conversion:t,conversionIndex:e.indexOf(t)}}));return{types:o.concat(a),restParam:n}}function h(t){var e=G(t);return!!e&&e.restParam}function d(t){return t.types.some((function(t){return null!=t.conversion}))}function I(e){if(e&&0!==e.types.length){if(1===e.types.length)return c(e.types[0].name).test;if(2===e.types.length){var n=c(e.types[0].name).test,r=c(e.types[1].name).test;return function(t){return n(t)||r(t)}}var i=e.types.map((function(t){return c(t.name).test}));return function(t){for(var e=0;e<i.length;e++)if(i[e](t))return!0;return!1}}return t}function p(t){var e,n,r,i;if(h(t)){var o=(e=(i=t,i.slice(0,i.length-1)).map(I)).length,a=I(G(t));return function(t){for(var n=0;n<e.length;n++)if(!e[n](t[n]))return!1;return function(t){for(var e=o;e<t.length;e++)if(!a(t[e]))return!1;return!0}(t)&&t.length>=o+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(n=I(t[0]),function(t){return n(t[0])&&1===t.length}):2===t.length?(n=I(t[0]),r=I(t[1]),function(t){return n(t[0])&&r(t[1])&&2===t.length}):(e=t.map(I),function(t){for(var n=0;n<e.length;n++)if(!e[n](t[n]))return!1;return t.length===e.length})}function C(t,e){return e<t.params.length?t.params[e]:h(t.params)?G(t.params):null}function y(t,e,n){var r=C(t,e);return(r?n?r.types.filter(B):r.types:[]).map(v)}function v(t){return t.name}function B(t){return null===t.conversion||void 0===t.conversion}function m(t,e){var n=function(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return Object.keys(e)}(j(t,(function(t){return y(t,e,!1)})));return-1!==n.indexOf("any")?["any"]:n}function b(t,e,n){var r,i,o,a=t||"unnamed",A=n;for(o=0;o<e.length;o++){var s=A.filter((function(t){var n=I(C(t,o));return(o<t.params.length||h(t.params))&&n(e[o])}));if(0===s.length){if((i=m(A,o)).length>0){var c=l(e[o]);return(r=new TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+c+", index: "+o+")")).data={category:"wrongType",fn:a,index:o,actual:c,expected:i},r}}else A=s}var u=A.map((function(t){return h(t.params)?1/0:t.params.length}));if(e.length<Math.min.apply(null,u))return i=m(A,o),(r=new TypeError("Too few arguments in function "+a+" (expected: "+i.join(" or ")+", index: "+e.length+")")).data={category:"tooFewArgs",fn:a,index:e.length,expected:i},r;var g=Math.max.apply(null,u);return e.length>g?((r=new TypeError("Too many arguments in function "+a+" (expected: "+g+", actual: "+e.length+")")).data={category:"tooManyArgs",fn:a,index:e.length,expectedLength:g},r):((r=new TypeError('Arguments of type "'+e.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:e.map(l)},r)}function E(t){for(var e=999,n=0;n<t.types.length;n++)B(t.types[n])&&(e=Math.min(e,t.types[n].typeIndex));return e}function Q(t){for(var e=999,n=0;n<t.types.length;n++)B(t.types[n])||(e=Math.min(e,t.types[n].conversionIndex));return e}function F(t,e){var n;return 0!==(n=t.restParam-e.restParam)||0!==(n=d(t)-d(e))||0!==(n=E(t)-E(e))?n:Q(t)-Q(e)}function w(t,e){var n,r,i=Math.min(t.params.length,e.params.length);if(0!==(r=t.params.some(d)-e.params.some(d)))return r;for(n=0;n<i;n++)if(0!==(r=d(t.params[n])-d(e.params[n])))return r;for(n=0;n<i;n++)if(0!==(r=F(t.params[n],e.params[n])))return r;return t.params.length-e.params.length}function S(t){var e,n,r,i,o=[],a=[];switch(t.types.forEach((function(t){t.conversion&&(o.push(c(t.conversion.from).test),a.push(t.conversion.convert))})),a.length){case 0:return function(t){return t};case 1:return e=o[0],r=a[0],function(t){return e(t)?r(t):t};case 2:return e=o[0],n=o[1],r=a[0],i=a[1],function(t){return e(t)?r(t):n(t)?i(t):t};default:return function(t){for(var e=0;e<a.length;e++)if(o[e](t))return a[e](t);return t}}}function R(t,e){return function t(n,r,i){if(r<n.length){var o,a=n[r],A=e?a.types.filter(B):a.types;if(a.restParam){var s=A.filter(B);o=s.length<A.length?[s,A]:[A]}else o=A.map((function(t){return[t]}));return j(o,(function(e){return t(n,r+1,i.concat([e]))}))}return[i.map((function(t,e){return{types:t,restParam:e===n.length-1&&h(n)}}))]}(t,0,[])}function U(t,r){if(0===Object.keys(r).length)throw new SyntaxError("No signatures provided");var i=[];Object.keys(r).map((function(t){return function(t,e,n){var r=[];return""!==t.trim()&&(r=t.split(",").map(k).map((function(t,e,r){var i=f(t,n);if(i.restParam&&e!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+t+'": only allowed for the last parameter');return i}))),r.some(D)?null:{params:r,fn:e}}(t,r[t],s.conversions)})).filter(N).forEach((function(t){var e=T(i,(function(e){return function(t,e){for(var n=Math.max(t.params.length,e.params.length),r=0;r<n;r++)if(!M(y(t,r,!0),y(e,r,!0)))return!1;var i=t.params.length,o=e.params.length,a=h(t.params),A=h(e.params);return a?A?i===o:o>=i:A?i>=o:i===o}(e,t)}));if(e)throw new TypeError('Conflicting signatures "'+g(e.params)+'" and "'+g(t.params)+'".');i.push(t)}));var o=j(i,(function(t){return(t?R(t.params,!1):[]).map((function(e){return{params:e,fn:t.fn}}))})).filter(N);o.sort(w);var a=o[0]&&o[0].params.length<=2&&!h(o[0].params),A=o[1]&&o[1].params.length<=2&&!h(o[1].params),c=o[2]&&o[2].params.length<=2&&!h(o[2].params),u=o[3]&&o[3].params.length<=2&&!h(o[3].params),l=o[4]&&o[4].params.length<=2&&!h(o[4].params),C=o[5]&&o[5].params.length<=2&&!h(o[5].params),v=a&&A&&c&&u&&l&&C,B=o.map((function(t){return p(t.params)})),m=a?I(o[0].params[0]):e,E=A?I(o[1].params[0]):e,Q=c?I(o[2].params[0]):e,F=u?I(o[3].params[0]):e,U=l?I(o[4].params[0]):e,x=C?I(o[5].params[0]):e,O=a?I(o[0].params[1]):e,G=A?I(o[1].params[1]):e,L=c?I(o[2].params[1]):e,V=u?I(o[3].params[1]):e,Z=l?I(o[4].params[1]):e,P=C?I(o[5].params[1]):e,W=o.map((function(t){return function(t,e){var n=e;if(t.some(d)){var r=h(t),i=t.map(S);n=function(){for(var t=[],n=r?arguments.length-1:arguments.length,o=0;o<n;o++)t[o]=i[o](arguments[o]);return r&&(t[n]=arguments[n].map(i[n])),e.apply(this,t)}}var o=n;if(h(t)){var a=t.length-1;o=function(){return n.apply(this,_(arguments,0,a).concat([_(arguments,a)]))}}return o}(t.params,t.fn)})),J=a?W[0]:n,H=A?W[1]:n,Y=c?W[2]:n,X=u?W[3]:n,z=l?W[4]:n,K=C?W[5]:n,q=a?o[0].params.length:-1,$=A?o[1].params.length:-1,tt=c?o[2].params.length:-1,et=u?o[3].params.length:-1,nt=l?o[4].params.length:-1,rt=C?o[5].params.length:-1,it=v?6:0,ot=o.length,at=function(){for(var e=it;e<ot;e++)if(B[e](arguments))return W[e].apply(this,arguments);throw b(t,arguments,o)},At=function t(e,n){return arguments.length===q&&m(e)&&O(n)?J.apply(t,arguments):arguments.length===$&&E(e)&&G(n)?H.apply(t,arguments):arguments.length===tt&&Q(e)&&L(n)?Y.apply(t,arguments):arguments.length===et&&F(e)&&V(n)?X.apply(t,arguments):arguments.length===nt&&U(e)&&Z(n)?z.apply(t,arguments):arguments.length===rt&&x(e)&&P(n)?K.apply(t,arguments):at.apply(t,arguments)};try{Object.defineProperty(At,"name",{value:t})}catch(st){}return At.signatures=function(t){var e={};return t.forEach((function(t){t.params.some(d)||R(t.params,!0).forEach((function(n){e[g(n)]=t.fn}))})),e}(o),At}function x(t){return-1===s.ignore.indexOf(t)}function k(t){return t.trim()}function O(t){return!!t}function N(t){return null!==t}function D(t){return 0===t.types.length}function G(t){return t[t.length-1]}function _(t,e,n){return Array.prototype.slice.call(t,e,n)}function M(t,e){for(var n=0;n<t.length;n++)if(r=e,i=t[n],-1!==r.indexOf(i))return!0;var r,i;return!1}function T(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function j(t,e){return Array.prototype.concat.apply([],t.map(e))}function L(t){for(var e="",n=0;n<t.length;n++){var r=t[n];if(("object"===typeof r.signatures||"string"===typeof r.signature)&&""!==r.name)if(""===e)e=r.name;else if(e!==r.name){var i=new Error("Function names do not match (expected: "+e+", actual: "+r.name+")");throw i.data={actual:r.name,expected:e},i}}return e}function V(t){var e,n={};function r(t,r){if(n.hasOwnProperty(t)&&r!==n[t])throw(e=new Error('Signature "'+t+'" is defined twice')).data={signature:t},e}for(var i=0;i<t.length;i++){var o=t[i];if("object"===typeof o.signatures)for(var a in o.signatures)o.signatures.hasOwnProperty(a)&&(r(a,o.signatures[a]),n[a]=o.signatures[a]);else{if("string"!==typeof o.signature)throw(e=new TypeError("Function is no typed-function (index: "+i+")")).data={index:i},e;r(o.signature,o),n[o.signature]=o}}return n}return(s=U("typed",{"string, Object":U,Object:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return U(L(e),t)},"...Function":function(t){return U(L(t),V(t))},"string, ...Function":function(t,e){return U(t,V(e))}})).create=r,s.types=i,s.conversions=A,s.ignore=a,s.convert=function(t,e){var n=l(t);if(e===n)return t;for(var r=0;r<s.conversions.length;r++){var i=s.conversions[r];if(i.from===n&&i.to===e)return i.convert(t)}throw new Error("Cannot convert from "+n+" to "+e)},s.find=function(t,e){if(!t.signatures)throw new TypeError("Function is no typed-function");var n;if("string"===typeof e){n=e.split(",");for(var r=0;r<n.length;r++)n[r]=n[r].trim()}else{if(!Array.isArray(e))throw new TypeError("String array or a comma separated string expected");n=e}var i=n.join(","),o=t.signatures[i];if(o)return o;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+n.join(", ")+"))")},s.addType=function(t,e){if(!t||"string"!==typeof t.name||"function"!==typeof t.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==e)for(var n=0;n<s.types.length;n++)if("Object"===s.types[n].name)return void s.types.splice(n,0,t);s.types.push(t)},s.addConversion=function(t){if(!t||"string"!==typeof t.from||"string"!==typeof t.to||"function"!==typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");s.conversions.push(t)},s}()})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){var r=n(634),i=n(635),o=n(636),a=n(637),A=n(638),s=n(639),c=n(640);c.alea=r,c.xor128=i,c.xorwow=o,c.xorshift7=a,c.xor4096=A,c.tychei=s,t.exports=c},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(300),a=n(27),A={number:{validate:function(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},array:{validate:function(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function s(t){var e=c(t);return"object"===e?t?"type"in t?Object.assign({},t,A[t.type]):"value"in t?(e=c(t.value),Object.assign({type:e},t,A[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},A[e])}function c(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":Object(a.a)(t)}n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return l}));var u=function(){function t(e){var n=e.name,i=e.vs,a=e.fs,A=e.dependencies,c=void 0===A?[]:A,u=e.uniforms,l=e.getUniforms,g=e.deprecations,f=void 0===g?[]:g,h=e.defines,d=void 0===h?{}:h,I=e.inject,p=void 0===I?{}:I,C=e.vertexShader,y=e.fragmentShader;Object(r.a)(this,t),Object(o.a)("string"===typeof n),this.name=n,this.vs=i||C,this.fs=a||y,this.getModuleUniforms=l,this.dependencies=c,this.deprecations=this._parseDeprecationDefinitions(f),this.defines=d,this.injections=function(t){var e={vs:{},fs:{}};for(var n in t){var r=t[n],i=n.slice(0,2);"string"===typeof r&&(r={injection:r}),e[i][n]=r}return e}(p),u&&(this.uniforms=function(t){var e={};for(var n in t){var r=s(t[n]);e[n]=r}return e}(u))}return Object(i.a)(t,[{key:"getModuleSource",value:function(t){var e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(t,e){this.deprecations.forEach((function(n){n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())}))}},{key:"_parseDeprecationDefinitions",value:function(t){return t.forEach((function(t){switch(t.type){case"function":t.regex=new RegExp("\\b".concat(t.old,"\\("));break;default:t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))}})),t}},{key:"_defaultGetUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=this.uniforms;for(var r in n){var i=n[r];r in t&&!i.private?(i.validate&&Object(o.a)(i.validate(t[r],i),"".concat(this.name,": invalid ").concat(r)),e[r]=t[r]):e[r]=i.value}return e}}]),t}();function l(t){if(!t.normalized&&(t.normalized=!0,t.uniforms&&!t.getUniforms)){var e=new u(t);t.getUniforms=e.getUniforms.bind(e)}return t}},function(t,e,n){"use strict";var r=n(76),i=n(133),o=n(102),a=n(19),A=n(127),s=n(152),c=n(47);function u(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var l=n(473);function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sourceX,r=void 0===n?0:n,i=e.sourceY,o=void 0===i?0:i,a=e.sourceFormat,A=void 0===a?6408:a,u=e.sourceAttachment,l=void 0===u?36064:u,g=e.target,f=void 0===g?null:g,h=e.sourceWidth,d=e.sourceHeight,C=e.sourceType,y=I(t),v=y.framebuffer,B=y.deleteFramebuffer;Object(c.a)(v);var m=v.gl,b=v.handle,E=v.attachments;h=h||v.width,d=d||v.height,36064===l&&null===b&&(l=1028),Object(c.a)(E[l]),f=p(f,C=C||E[l].type,A,h,d),C=C||Object(s.b)(f);var Q=m.bindFramebuffer(36160,b);return m.readPixels(r,o,h,d,A,C,f),m.bindFramebuffer(36160,Q||null),B&&v.delete(),f}function f(t,e){var n=e.sourceX,i=void 0===n?0:n,o=e.sourceY,s=void 0===o?0:o,l=e.sourceFormat,g=void 0===l?6408:l,f=e.target,h=void 0===f?null:f,d=e.targetByteOffset,p=void 0===d?0:d,C=e.sourceWidth,y=e.sourceHeight,v=e.sourceType,B=I(t),m=B.framebuffer,b=B.deleteFramebuffer;Object(c.a)(m);var E=m.gl;if(C=C||m.width,y=y||m.height,Object(A.a)(E),v=v||(h?h.type:5121),!h){var Q=u(g),F=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(v),w=p+C*y*Q*F;h=new r.a(E,{byteLength:w,accessor:{type:v,size:Q}})}return h.bind({target:35051}),Object(a.l)(E,{framebuffer:m},(function(){E.readPixels(i,s,C,y,g,v,p)})),h.unbind({target:35051}),b&&m.delete(),h}function h(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sourceAttachment,r=void 0===n?36064:n,i=e.targetMaxHeight,o=void 0===i?Number.MAX_SAFE_INTEGER:i,a=g(t,{sourceAttachment:r}),A=t.width,c=t.height;c>o;){var u=Object(s.d)({data:a,width:A,height:c});a=u.data,A=u.width,c=u.height}Object(s.a)({data:a,width:A,height:c});var l=document.createElement("canvas");l.width=A,l.height=c;var f=l.getContext("2d"),h=f.createImageData(A,c);return h.data.set(a),f.putImageData(h,0,0),l.toDataURL()}function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.sourceX,i=void 0===r?0:r,a=n.sourceY,A=void 0===a?0:a,s=n.targetX,u=n.targetY,l=n.targetZ,g=n.targetMipmaplevel,f=void 0===g?0:g,h=n.targetInternalFormat,d=void 0===h?6408:h,p=n.width,C=n.height,y=I(t),v=y.framebuffer,B=y.deleteFramebuffer;Object(c.a)(v);var m=v.gl,b=v.handle,E="undefined"!==typeof s||"undefined"!==typeof u||"undefined"!==typeof l;s=s||0,u=u||0,l=l||0;var Q=m.bindFramebuffer(36160,b);Object(c.a)(e);var F=null;if(e instanceof o.a&&(F=e,p=Number.isFinite(p)?p:F.width,C=Number.isFinite(C)?C:F.height,F.bind(0),e=F.target),E)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,f,s,u,i,A,p,C);break;case 35866:case 32879:m.copyTexSubImage3D(e,f,s,u,l,i,A,p,C)}else m.copyTexImage2D(e,f,d,i,A,p,C,0);return F&&F.unbind(),m.bindFramebuffer(36160,Q||null),B&&v.delete(),F}function I(t){return t instanceof i.a?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Object(l.b)(t),deleteFramebuffer:!0}}function p(t,e,n,r,i){return t||(e=e||5121,new(Object(s.c)(e,{clamped:!1}))(r*i*u(n)))}n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return f})),n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d}))},function(t,e,n){"use strict";var r=n(18),i=n(15),o=n(162),a=n.n(o),A=n(245),s=n(934),c=n(167),u=n(11),l=n(14),g=n(61),f=n(74),h=n(90),d=n(24),I=n(25),p=function(){},C=function(t){return t},y=function(t){return Promise.resolve().then(t)};function v(t){throw t}var B=function(t){Object(d.a)(n,t);var e=Object(I.a)(n);function n(t){var r;return Object(u.a)(this,n),(r=e.call(this,(function(e){var n=Object(g.a)(r),i=Object.assign(Object.assign({},e),{complete:function(){e.complete(),n.onCompletion()},error:function(t){e.error(t),n.onError(t)},next:function(t){e.next(t),n.onNext(t)}});try{return r.initHasRun=!0,t(i)}catch(o){i.error(o)}}))).initHasRun=!1,r.fulfillmentCallbacks=[],r.rejectionCallbacks=[],r.firstValueSet=!1,r.state="pending",r}return Object(l.a)(n,[{key:"onNext",value:function(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}},{key:"onError",value:function(t){this.state="rejected",this.rejection=t;var e,n=Object(i.a)(this.rejectionCallbacks);try{var r=function(){var n=e.value;y((function(){return n(t)}))};for(n.s();!(e=n.n()).done;)r()}catch(o){n.e(o)}finally{n.f()}}},{key:"onCompletion",value:function(){var t=this;this.state="fulfilled";var e,n=Object(i.a)(this.fulfillmentCallbacks);try{var r=function(){var n=e.value;y((function(){return n(t.firstValue)}))};for(n.s();!(e=n.n()).done;)r()}catch(o){n.e(o)}finally{n.f()}}},{key:"then",value:function(t,e){var n=this,r=t||C,i=e||v,o=!1;return new Promise((function(t,e){var a=function(n){if(!o){o=!0;try{t(i(n))}catch(r){e(r)}}};return n.initHasRun||n.subscribe({error:a}),"fulfilled"===n.state?t(r(n.firstValue)):"rejected"===n.state?(o=!0,t(i(n.rejection))):(n.fulfillmentCallbacks.push((function(e){try{t(r(e))}catch(n){a(n)}})),void n.rejectionCallbacks.push(a))}))}},{key:"catch",value:function(t){return this.then(void 0,t)}},{key:"finally",value:function(t){var e=t||p;return this.then((function(t){return e(),t}),(function(){return e()}))}}],[{key:"from",value:function(t){return function(t){return t&&"function"===typeof t.then}(t)?new n((function(e){t.then((function(t){e.next(t),e.complete()}),(function(t){e.error(t)}))})):Object(h.a)(Object(f.a)(n),"from",this).call(this,t)}}]),n}(A.a),m=n(469),b=n(220);n.d(e,"a",(function(){return S})),n.d(e,"b",(function(){return R}));var E=a()("threads:master:messages"),Q=1;function F(t,e){return new A.a((function(n){var r,i=function i(o){var a;if(E("Message from worker:",o.data),o.data&&o.data.uid===e)if((a=o.data)&&a.type===b.b.running)r=o.data.resultType;else if(function(t){return t&&t.type===b.b.result}(o.data))"promise"===r?("undefined"!==typeof o.data.payload&&n.next(Object(c.a)(o.data.payload)),n.complete(),t.removeEventListener("message",i)):(o.data.payload&&n.next(Object(c.a)(o.data.payload)),o.data.complete&&(n.complete(),t.removeEventListener("message",i)));else if(function(t){return t&&t.type===b.b.error}(o.data)){var A=Object(c.a)(o.data.error);n.error(A),t.removeEventListener("message",i)}};return t.addEventListener("message",i),function(){if("observable"===r||!r){var n={type:b.a.cancel,uid:e};t.postMessage(n)}t.removeEventListener("message",i)}}))}function w(t){if(0===t.length)return{args:[],transferables:[]};var e,n,o=[],a=[],A=Object(i.a)(t);try{for(A.s();!(e=A.n()).done;){var s=e.value;Object(m.b)(s)?(o.push(Object(c.b)(s.send)),a.push.apply(a,Object(r.a)(s.transferables))):o.push(Object(c.b)(s))}}catch(u){A.e(u)}finally{A.f()}return{args:o,transferables:0===a.length?a:(n=a,Array.from(new Set(n)))}}function S(t,e){return function(){for(var n=Q++,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=w(i),A=a.args,c=a.transferables,u={type:b.a.run,uid:n,method:e,args:A};E("Sending command to run function to worker:",u);try{t.postMessage(u,c)}catch(l){return B.from(Promise.reject(l))}return B.from(Object(s.a)(F(t,n)))}}function R(t,e){var n,r={},o=Object(i.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;r[a]=S(t,a)}}catch(A){o.e(A)}finally{o.f()}return r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(252),u=n(72),l=n(144);function g(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var d=function(t){Object(a.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(t){Object(o.a)(Object(s.a)(n.prototype),"setState",this).call(this,t),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(t){var e=t.info,n=e.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(e,{object:n.__source.object,index:n.__source.index}):e}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(t,e){var n=this.props._subLayerProps;return e&&e.length||n&&n[t]}},{key:"getSubLayerClass",value:function(t,e){var n=this.props._subLayerProps;return n&&n[t]&&n[t].type||e}},{key:"getSubLayerRow",value:function(t,e,n){return t.__source={parent:this,object:e,index:n},t}},{key:"getSubLayerAccessor",value:function(t){if("function"===typeof t){var e={data:this.props.data,target:[]};return function(n,r){return n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,r)}}return t}},{key:"getSubLayerProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.props,n=e.opacity,r=e.pickable,i=e.visible,o=e.parameters,a=e.getPolygonOffset,A=e.highlightedObjectIndex,s=e.autoHighlight,c=e.highlightColor,u=e.coordinateSystem,l=e.coordinateOrigin,f=e.wrapLongitude,h=e.positionFormat,d=e.modelMatrix,I=e.extensions,p=e._subLayerProps,C={opacity:n,pickable:r,visible:i,parameters:o,getPolygonOffset:a,highlightedObjectIndex:A,autoHighlight:s,highlightColor:c,coordinateSystem:u,coordinateOrigin:l,wrapLongitude:f,positionFormat:h,modelMatrix:d,extensions:I},y=p&&p[t.id],v=y&&y.updateTriggers,B=t.id||"sublayer";if(y){var m=this.constructor._propTypes;for(var b in y){var E=m[b];E&&"accessor"===E.type&&(y[b]=this.getSubLayerAccessor(y[b]))}}Object.assign(C,t,y,{id:"".concat(this.props.id,"-").concat(B),updateTriggers:Object.assign({all:this.props.updateTriggers.all},t.updateTriggers,v)});var Q,F=g(I);try{for(F.s();!(Q=F.n()).done;){var w=Q.value,S=w.getSubLayerProps.call(this,w);S&&Object.assign(C,S,{updateTriggers:Object.assign(C.updateTriggers,S.updateTriggers)})}}catch(R){F.e(R)}finally{F.f()}return C}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var t=this.internalState.subLayers,e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=Object(l.b)(t,Boolean),this.internalState.subLayers=t),Object(u.a)("compositeLayer.renderLayers",this,e,t);var n,r=g(t);try{for(r.s();!(n=r.n()).done;){n.value.parent=this}}catch(i){r.e(i)}finally{r.f()}}},{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return Object(o.a)(Object(s.a)(n.prototype),"isLoaded",this)&&this.getSubLayers().every((function(t){return t.isLoaded}))}}]),n}(c.a);d.layerName="CompositeLayer"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(19);function i(t,e,n){var i=n.removedProps,o=void 0===i?{}:i,a=n.deprecatedProps,A=void 0===a?{}:a,s=n.replacedProps,c=void 0===s?{}:s;for(var u in o)if(u in e){var l=o[u]?"".concat(t,".").concat(o[u]):"N/A";r.h.removed("".concat(t,".").concat(u),l)()}for(var g in A)if(g in e){var f=A[g];r.h.deprecated("".concat(t,".").concat(g),"".concat(t,".").concat(f))()}var h=null;for(var d in c)if(d in e){var I=c[d];r.h.deprecated("".concat(t,".").concat(d),"".concat(t,".").concat(I))(),(h=h||Object.assign({},e))[I]=e[d],delete h[d]}return h||e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(13),i=n.n(r),o=n(30),a=n(3),A=n(2),s=n(375),c=function(){function t(e){var n=e.source,r=e.name,i=void 0===r?"unnamed":r,o=e.maxConcurrency,A=void 0===o?1:o,s=e.onMessage,c=e.onDebug,u=void 0===c?function(){}:c;Object(a.a)(this,t),this.source=n,this.name=i,this.maxConcurrency=A,this.onMessage=s,this.onDebug=u,this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1}return Object(A.a)(t,[{key:"destroy",value:function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0}},{key:"process",value:function(t,e){var n=this;return new Promise((function(r,i){n.jobQueue.push({data:t,jobName:e,resolve:r,reject:i}),n._startQueuedJob()}))}},{key:"_startQueuedJob",value:function(){var t=Object(o.a)(i.a.mark((function t(){var e,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(e=this._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:return n=this.jobQueue.shift(),this.onDebug({message:"processing",worker:e.name,job:n.jobName,backlog:this.jobQueue.length}),t.prev=7,t.t0=n,t.next=11,e.process(n.data);case 11:t.t1=t.sent,t.t0.resolve.call(t.t0,t.t1),t.next=18;break;case 15:t.prev=15,t.t2=t.catch(7),n.reject(t.t2);case 18:return t.prev=18,this._onWorkerDone(e),t.finish(18);case 21:case"end":return t.stop()}}),t,this,[[7,15,18,21]])})));return function(){return t.apply(this,arguments)}}()},{key:"_onWorkerDone",value:function(t){this.isDestroyed?t.destroy():(this.idleQueue.push(t),this._startQueuedJob())}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift();if(this.count<this.maxConcurrency){this.count++;var t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new s.a({source:this.source,onMessage:this.onMessage,name:t})}return null}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(27);function i(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,a=n||new Set;if(t){if(o(t))a.add(t);else if(o(t.buffer))a.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===Object(r.a)(t))for(var A in t)i(t[A],e,a)}else;return void 0===n?Array.from(a):[]}function o(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t,e){if(!e)return t;var n=Object.assign({},t,e);if("defines"in e&&(n.defines=Object.assign({},t.defines,e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some((function(t){return"project64"===t.name})))){var o=n.modules.findIndex((function(t){return"project32"===t.name}));o>=0&&n.modules.splice(o,1)}if("inject"in e)if(t.inject){var a=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t.inject);for(var A in e.inject)a[A]=(a[A]||"")+e.inject[A];n.inject=a}else n.inject=e.inject;return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(27);function i(t){if(null===(e=t)||"object"!==Object(r.a)(e))throw new Error("count(): argument not an object");var e;if("function"===typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"===Object(r.a)(t)&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(154),c=n(312),u=n(138),l=n(139);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var f={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new u.a(["target","zoom"]),transitionInterruption:l.a.BREAK},h=function(t){Object(o.a)(n,t);var e=g(n);function n(t){return Object(r.a)(this,n),t.dragMode=t.dragMode||"pan",e.call(this,c.a,t)}return Object(i.a)(n,[{key:"_onPanRotate",value:function(t){return!1}},{key:"_getTransitionProps",value:function(){return f}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(173),c=n(251),u=n(313);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(t){return Object(r.a)(this,n),e.call(this,Object.assign({},t,{type:c.a}))}return Object(i.a)(n,[{key:"controller",get:function(){return this._getControllerProps({type:u.b})}}]),n}(s.a);g.displayName="MapView"},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(3),i=[255,255,255],o=0,a=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.color,a=void 0===n?i:n,A=e.intensity,s=void 0===A?1:A;this.id=e.id||"ambient-".concat(o++),this.color=a,this.intensity=s,this.type="ambient"}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(1),a=n(17),A=n(34),s=n(7),c=n(8),u=n(6),l=n(702),g=n(353),f=n(76);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){Object(o.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var I=function(){function t(e,n){Object(r.a)(this,t),this.opts=n,this.source=e}return Object(i.a)(t,[{key:"getValue",value:function(){var t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];var n=this.source.value,r=e.size,i=n;if(n&&n.length!==r){i=new Float32Array(r);for(var o=e.elementOffset||0,a=0;a<r;++a)i[a]=n[o+a]}return i}},{key:"getAccessor",value:function(){return d(d({},this.source.getAccessor()),this.opts)}},{key:"value",get:function(){return this.source.value}}]),t}();var p=n(123),C=n(86),y=n(44);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){Object(o.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){return t.stride||t.size*t.bytesPerElement}function b(t,e){e.offset&&y.a.removed("shaderAttribute.offset","vertexOffset, elementOffset")();var n=m(t),r=("vertexOffset"in e?e.vertexOffset:t.vertexOffset||0)*n+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return B(B({},e),{},{offset:r,stride:n})}var E=function(){function t(e,n){Object(r.a)(this,t),this.gl=e,this.id=n.id,this.size=n.size;var i=n.logicalType||n.type,o=5130===i,a=n.defaultValue;a=Number.isFinite(a)?[a]:a||new Array(this.size).fill(0),n.defaultValue=a;var A=i;o?A=5126:!A&&n.isIndexed?A=e&&Object(l.b)(e,g.a.ELEMENT_INDEX_UINT32)?5125:5123:A||(A=5126),n.logicalType=i,n.type=A;var s=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(i||A||5126);this.shaderAttributes={},this.doublePrecision=o,o&&!1===n.fp64&&(s=Float32Array),n.bytesPerElement=s.BYTES_PER_ELEMENT,this.defaultType=s,this.value=null,this.settings=n,this.state={externalBuffer:null,bufferAccessor:n,allocatedValue:null,constant:!1},this._buffer=null,this.setData(n)}return Object(i.a)(t,[{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),p.a.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(t,e){if(this.doublePrecision){var n={},r=this.value instanceof Float64Array,i=function(t,e){var n=b(t,e);return{high:n,low:B(B({},n),{},{offset:n.offset+4*t.size})}}(this.getAccessor(),e||{});return n[t]=new I(this,i.high),n["".concat(t,"64Low")]=r?new I(this,i.low):new Float32Array(this.size),n}if(e){var a=b(this.getAccessor(),e);return Object(o.a)({},t,new I(this,a))}return Object(o.a)({},t,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"setData",value:function(t){var e=this.state;ArrayBuffer.isView(t)?t={value:t}:t instanceof f.a&&(t={buffer:t});var n=B(B({},this.settings),t);if(e.bufferAccessor=n,t.constant){var r=t.value;if(r=this._normalizeValue(r,[],0),this.settings.normalized&&(r=this._normalizeConstant(r)),!(!e.constant||!this._areValuesEqual(r,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=r}else if(t.buffer){var i=t.buffer;e.externalBuffer=i,e.constant=!1,this.value=t.value;var o=t.value instanceof Float64Array;n.type=t.type||i.accessor.type,n.bytesPerElement=i.accessor.BYTES_PER_ELEMENT*(o?2:1),n.stride=m(n)}else if(t.value){this._checkExternalBuffer(t);var a=t.value;e.externalBuffer=null,e.constant=!1,this.value=a,n.bytesPerElement=a.BYTES_PER_ELEMENT,n.stride=m(n);var A=this.buffer,s=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=Object(C.f)(a,n));var c=a.byteLength+s+2*n.stride;A.byteLength<c&&A.reallocate(c),A.setAccessor(null),A.subData({data:a,offset:s}),n.type=t.type||A.accessor.type}return!0}},{key:"updateSubBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.value,n=t.startOffset,r=void 0===n?0:n,i=t.endOffset;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?Object(C.f)(e,{size:this.size,startIndex:r,endIndex:i}):e.subarray(r,i),offset:r*e.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(t){var e=t.numInstances,n=t.copy,r=void 0!==n&&n,i=this.state,o=i.allocatedValue,a=p.a.allocate(o,e+1,{size:this.size,type:this.defaultType,copy:r});this.value=a;var A=this.buffer,s=this.byteOffset;return A.byteLength<a.byteLength+s&&(A.reallocate(a.byteLength+s),r&&o&&A.subData({data:o instanceof Float64Array?Object(C.f)(o,this):o,offset:s})),i.allocatedValue=a,i.constant=!1,i.externalBuffer=null,i.bufferAccessor=this.settings,!0}},{key:"_checkExternalBuffer",value:function(t){var e=t.value;if(!t.constant&&e){var n=this.defaultType,r=!1;if(this.doublePrecision&&(r=e.BYTES_PER_ELEMENT<4),r)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof n||!this.settings.normalized||"normalized"in t||y.a.warn("Attribute ".concat(this.id," is normalized"))()}}},{key:"_normalizeConstant",value:function(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((function(t){return(t+128)/255*2-1}));case 5122:return new Float32Array(t).map((function(t){return(t+32768)/65535*2-1}));case 5121:return new Float32Array(t).map((function(t){return t/255}));case 5123:return new Float32Array(t).map((function(t){return t/65535}));default:return t}}},{key:"_normalizeValue",value:function(t,e,n){var r=this.settings,i=r.defaultValue,o=r.size;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(o){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:for(var a=o;--a>=0;)e[n+a]=Number.isFinite(t[a])?t[a]:i[a]}return e}},{key:"_areValuesEqual",value:function(t,e){if(!t||!e)return!1;for(var n=this.size,r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}},{key:"buffer",get:function(){if(!this._buffer){var t=this.settings,e=t.isIndexed,n=t.type;this._buffer=new f.a(this.gl,{id:this.id,target:e?34963:34962,accessor:{type:n}})}return this._buffer}},{key:"byteOffset",get:function(){var t=this.getAccessor();return t.vertexOffset?t.vertexOffset*m(t):0}}]),t}(),Q=n(53),F=n(110),w=n(144),S=[],R=[[0,1/0]];function U(t,e){if(t===R)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;for(var n=[],r=t.length,i=0,o=0;o<r;o++){var a=t[o];a[1]<e[0]?(n.push(a),i=o+1):a[0]>e[1]?n.push(a):e=[Math.min(a[0],e[0]),Math.max(a[1],e[1])]}return n.splice(i,0,e),n}var x=n(89);function k(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function N(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var D=function(t){Object(s.a)(n,t);var e=N(n);function n(t){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,n),i=e.call(this,t,o);var a=o.transition,A=void 0!==a&&a,s=o.noAlloc,c=void 0!==s&&s,u=o.update,l=void 0===u?null:u,g=o.accessor,f=void 0===g?null:g,h=o.transform,d=void 0===h?null:h,I=o.startIndices,p=void 0===I?null:I;return Object.assign(i.settings,{transition:A,noAlloc:c,update:l||f&&i._autoUpdater,accessor:f,transform:d}),Object.assign(i.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:R,startIndices:p}),Object.seal(i.settings),Object.seal(i.state),i._validateAttributeUpdaters(),i}return Object(i.a)(n,[{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.clearChangedFlags,n=void 0!==e&&e,r=this.state.needsRedraw;return this.state.needsRedraw=r&&!n,r}},{key:"getUpdateTriggers",value:function(){var t=this.settings.accessor;return[this.id].concat("function"!==typeof t&&t||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(t){if(!t||!this.supportsTransition())return null;var e=this.settings.accessor,n=this.settings.transition,r=Array.isArray(e)?t[e.find((function(e){return t[e]}))]:t[e];return Object(x.e)(r,n)}},{key:"setNeedsUpdate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){var n=e.startRow,r=void 0===n?0:n,i=e.endRow,o=void 0===i?1/0:i;this.state.updateRanges=U(this.state.updateRanges,[r,o])}else this.state.updateRanges=R}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=S}},{key:"setNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}},{key:"update",value:function(t){this.setData(t)}},{key:"allocate",value:function(t){var e=this.state,r=this.settings;return!r.noAlloc&&(!!r.update&&(Object(Q.a)(Number.isFinite(t)),Object(A.a)(Object(u.a)(n.prototype),"allocate",this).call(this,{numInstances:t,copy:e.updateRanges!==R}),!0))}},{key:"updateBuffer",value:function(t){var e=t.numInstances,r=t.data,i=t.props,o=t.context;if(!this.needsUpdate())return!1;var s=this.state.updateRanges,c=this.settings,l=c.update,g=c.noAlloc,f=!0;if(l){var h,d=k(s);try{for(d.s();!(h=d.n()).done;){var I=Object(a.a)(h.value,2),p=I[0],C=I[1];l.call(o,this,{data:r,startRow:p,endRow:C,props:i,numInstances:e})}}catch(F){d.e(F)}finally{d.f()}if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant});else{var y,v=k(s);try{for(v.s();!(y=v.n()).done;){var B=Object(a.a)(y.value,2),m=B[0],b=B[1],E=Number.isFinite(m)?this.getVertexOffset(m):0,Q=Number.isFinite(b)?this.getVertexOffset(b):g||!Number.isFinite(e)?this.value.length:e*this.size;Object(A.a)(Object(u.a)(n.prototype),"updateSubBuffer",this).call(this,{startOffset:E,endOffset:Q})}}catch(F){v.e(F)}finally{v.f()}}else;this._checkAttributeArray()}else f=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),f}},{key:"setConstantValue",value:function(t){return void 0!==t&&"function"!==typeof t&&(this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0)}},{key:"setExternalBuffer",value:function(t){var e=this.state;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}},{key:"setBinaryValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state,r=this.settings;if(!t)return n.binaryValue=null,n.binaryAccessor=null,!1;if(r.noAlloc)return!1;if(n.binaryValue===t)return this.clearNeedsUpdate(),!0;n.binaryValue=t,this.setNeedsRedraw(),ArrayBuffer.isView(t)&&(t={value:t});var i=r.transform||e!==this.startIndices;if(i){Object(Q.a)(ArrayBuffer.isView(t.value),"invalid ".concat(r.accessor));var o=t.size&&t.size!==this.size;return n.binaryAccessor=Object(F.b)(t.value,{size:t.size||this.size,stride:t.stride,offset:t.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}},{key:"getVertexOffset",value:function(t){var e=this.startIndices;return(e?e[t]:t)*this.size}},{key:"getShaderAttributes",value:function(){var t=this.settings.shaderAttributes||Object(o.a)({},this.id,null),e={};for(var r in t)Object.assign(e,Object(A.a)(Object(u.a)(n.prototype),"getShaderAttributes",this).call(this,r,t[r]));return e}},{key:"_autoUpdater",value:function(t,e){var n=e.data,r=e.startRow,i=e.endRow,o=e.props,a=e.numInstances;if(!t.constant){var A=t.settings,s=t.state,c=t.value,u=t.size,l=t.startIndices,g=A.accessor,f=A.transform,h=s.binaryAccessor||("function"===typeof g?g:o[g]);Object(Q.a)("function"===typeof h,'accessor "'.concat(g,'" is not a function'));var d,I=t.getVertexOffset(r),p=Object(F.a)(n,r,i),C=p.iterable,y=p.objectInfo,v=k(C);try{for(v.s();!(d=v.n()).done;){var B=d.value;y.index++;var m=h(B,y);if(f&&(m=f.call(this,m)),l){var b=(y.index<l.length-1?l[y.index+1]:a)-l[y.index];if(m&&Array.isArray(m[0])){var E,S=I,R=k(m);try{for(R.s();!(E=R.n()).done;){var U=E.value;t._normalizeValue(U,c,S),S+=u}}catch(x){R.e(x)}finally{R.f()}}else m&&m.length>u?c.set(m,I):(t._normalizeValue(m,y.target,0),Object(w.a)({target:c,source:y.target,start:I,count:b}));I+=b*u}else t._normalizeValue(m,c,I),I+=u}}catch(x){v.e(x)}finally{v.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var t=this.settings;if(!(t.noAlloc||"function"===typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var t=this.value,e=Math.min(4,this.size);if(t&&t.length>=e){var n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}},{key:"startIndices",get:function(){return this.state.startIndices},set:function(t){this.state.startIndices=t}}]),n}(E),G=n(72),_=n(930),M=n(134);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){Object(o.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return V(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Z=function(){function t(e){var n=e.gl,i=e.attribute,o=e.timeline;Object(r.a)(this,t),this.gl=n,this.type="interpolation",this.transition=new M.a(o),this.attribute=i,this.attributeInTransition=new D(n,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(t,e){var n=Object(x.c)(e.size);return new _.a(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n  vCurrent = mix(aFrom, aTo, time);\n  gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(n,i);var a={byteLength:0,usage:35050};this.buffers=[new f.a(n,a),new f.a(n,a)]}return Object(i.a)(t,[{key:"start",value:function(t,e){if(t.duration<=0)this.transition.cancel();else{var n=this.gl,r=this.buffers,i=this.attribute;Object(x.a)(r);var o,a={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},A=L(r);try{for(A.s();!(o=A.n()).done;){var s=o.value;Object(x.f)(j({buffer:s},a))}}catch(c){A.e(c)}finally{A.f()}this.currentStartIndices=i.startIndices,this.currentLength=Object(x.b)(i,e),this.attributeInTransition.update({buffer:r[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:r[0],aTo:Object(x.d)(n,i)},feedbackBuffers:{vCurrent:r[1]}})}}},{key:"update",value:function(){var t=this.transition.update();if(t){var e=this.transition,n=e.time,r=e.settings,i=r.duration,o=(0,r.easing)(n/i);this.transform.run({uniforms:{time:o}})}return t}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},{key:"inProgress",get:function(){return this.transition.inProgress}}]),t}();var P=n(358),W=n(218),J=n(133);function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach((function(e){Object(o.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function X(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var K={interpolation:Z,spring:function(){function t(e){var n=e.gl,i=e.attribute,a=e.timeline;Object(r.a)(this,t),this.gl=n,this.type="spring",this.transition=new M.a(a),this.attribute=i,this.attributeInTransition=new D(n,Object.assign({},i.settings,{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(t){return new W.a(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(n),this.framebuffer=function(t,e){return new J.a(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:Object(o.a)({},36064,e)})}(n,this.texture),this.transform=function(t,e,n){var r=Object(x.c)(e.size);return new _.a(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n  ATTRIBUTE_TYPE velocity = cur - prev;\n  ATTRIBUTE_TYPE delta = dest - cur;\n  ATTRIBUTE_TYPE spring = delta * stiffness;\n  ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n  return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n  bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n  vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n  vNext = getNextValue(aCur, aPrev, aTo);\n  gl_Position = vec4(0, 0, 0, 1);\n  gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n  if (vIsTransitioningFlag == 0.0) {\n    discard;\n  }\n  gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:r},varyings:["vNext"]})}(n,i,this.framebuffer);var A={byteLength:0,usage:35050};this.buffers=[new f.a(n,A),new f.a(n,A),new f.a(n,A)]}return Object(i.a)(t,[{key:"start",value:function(t,e){var n,r=this.gl,i=this.buffers,o=this.attribute,a={numInstances:e,attribute:o,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},A=X(i);try{for(A.s();!(n=A.n()).done;){var s=n.value;Object(x.f)(Y({buffer:s},a))}}catch(c){A.e(c)}finally{A.f()}this.currentStartIndices=o.startIndices,this.currentLength=Object(x.b)(o,e),this.attributeInTransition.update({buffer:i[1],value:o.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/o.size),sourceBuffers:{aTo:Object(x.d)(r,o)}})}},{key:"update",value:function(){var t=this.buffers,e=this.transform,n=this.framebuffer,r=this.transition;return!!r.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Object(x.a)(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),Object(P.c)(n)[0]>0||r.end(),!0)}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}},{key:"inProgress",get:function(){return this.transition.inProgress}}]),t}()},q=function(){function t(e,n){var i=n.id,o=n.timeline;Object(r.a)(this,t),this.id=i,this.gl=e,this.timeline=o,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=_.a.isSupported(e)}return Object(i.a)(t,[{key:"finalize",value:function(){for(var t in this.transitions)this._removeTransition(t)}},{key:"update",value:function(t){var e=t.attributes,n=t.transitions,r=t.numInstances;for(var i in this.numInstances=r||1,e){var o=e[i],a=o.getTransitionSetting(n);a&&this._updateAttribute(i,o,a)}for(var A in this.transitions){var s=e[A];s&&s.getTransitionSetting(n)||this._removeTransition(A)}}},{key:"hasAttribute",value:function(t){var e=this.transitions[t];return e&&e.inProgress}},{key:"getAttributes",value:function(){var t={};for(var e in this.transitions){var n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}},{key:"run",value:function(){if(!this.isSupported||0===this.numInstances)return!1;for(var t in this.transitions){this.transitions[t].update()&&(this.needsRedraw=!0)}var e=this.needsRedraw;return this.needsRedraw=!1,e}},{key:"_removeTransition",value:function(t){this.transitions[t].cancel(),delete this.transitions[t]}},{key:"_updateAttribute",value:function(t,e,n){var r=this.transitions[t],i=!r||r.type!==n.type;if(i){if(!this.isSupported)return void y.a.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();r&&this._removeTransition(t);var o=K[n.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(y.a.error("unsupported transition type '".concat(n.type,"'"))(),i=!1)}(i||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}]),t}();n.d(e,"a",(function(){return $}));var $=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,o=void 0===i?"attribute-manager":i,a=n.stats,A=n.timeline;Object(r.a)(this,t),this.id=o,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=a,this.attributeTransitionManager=new q(e,{id:"".concat(o,"-transitions"),timeline:A}),Object.seal(this)}return Object(i.a)(t,[{key:"finalize",value:function(){for(var t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(t,e){this._add(t,e)}},{key:"addInstanced",value:function(t,e){this._add(t,e,{instanced:1})}},{key:"remove",value:function(t){for(var e=0;e<t.length;e++){var n=t[e];void 0!==this.attributes[n]&&(this.attributes[n].delete(),delete this.attributes[n])}}},{key:"invalidate",value:function(t,e){var n=this._invalidateTrigger(t,e);Object(G.a)("attributeManager.invalidate",this,t,n)}},{key:"invalidateAll",value:function(t){for(var e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);Object(G.a)("attributeManager.invalidate",this,"all")}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=t.numInstances,r=t.startIndices,i=void 0===r?null:r,o=t.transitions,a=t.props,A=void 0===a?{}:a,s=t.buffers,c=void 0===s?{}:s,u=t.context,l=void 0===u?{}:u,g=!1;for(var f in Object(G.a)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var h=this.attributes[f],d=h.settings.accessor;h.startIndices=i,A[f]&&y.a.removed("props.".concat(f),"data.attributes.".concat(f))(),h.setExternalBuffer(c[f])||h.setBinaryValue(c[d],e.startIndices)||!c[d]&&h.setConstantValue(A[d])||h.needsUpdate()&&(g=!0,this._updateAttribute({attribute:h,numInstances:n,data:e,props:A,context:l})),this.needsRedraw|=h.needsRedraw()}g&&Object(G.a)("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:o})}},{key:"updateTransition",value:function(){var t=this.attributeTransitionManager.run();return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},e=this.attributes,n=this.attributeTransitionManager,r=Object.assign({},n.getAttributes());for(var i in e){var o=e[i];o.needsRedraw(t)&&!n.hasAttribute(i)&&(r[i]=o)}return r}},{key:"getShaderAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());var n={};for(var r in t)e[r]||Object.assign(n,t[r].getShaderAttributes());return n}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e&&y.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var r={};for(var i in t){var o=t[i],a=this._createAttribute(i,o,n);r[i]=a}Object.assign(this.attributes,r),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(t,e,n){var r={id:t,constant:e.constant||!1,isIndexed:e.isIndexed||e.elements,size:e.elements?1:e.size,value:e.value||null,divisor:e.instanced||n.instanced?1:e.divisor};return new D(this.gl,Object.assign({},e,r))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var t=this,e={},n=function(n){t.attributes[n].getUpdateTriggers().forEach((function(t){e[t]||(e[t]=[]),e[t].push(n)}))};for(var r in this.attributes)n(r);this.updateTriggers=e}},{key:"_invalidateTrigger",value:function(t,e){var n=this.attributes,r=this.updateTriggers[t];return r&&r.forEach((function(t){var r=n[t];r&&r.setNeedsUpdate(r.id,e)})),r}},{key:"_updateAttribute",value:function(t){var e=t.attribute,n=t.numInstances;Object(G.a)("attribute.updateStart",e),e.allocate(n)&&Object(G.a)("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,Object(G.a)("attribute.updateEnd",e,n))}}]),t}()},function(t,e,n){"use strict";var r,i=n(3),o=n(2),a=n(34),A=n(7),s=n(8),c=n(6),u=n(435),l=n(436),g=n(44),f=n(252),h=n(379),d=n(235),I=n(1),p=n(473),C=n(358),y=n(218),v=n(928),B=n(927),m=n(110);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){Object(I.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Q(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var w=function(){},S=(r={},Object(I.a)(r,10241,9987),Object(I.a)(r,10240,9729),Object(I.a)(r,10242,33071),Object(I.a)(r,10243,33071),r);function R(t){return t&&(t.id||t.url)}function U(t,e,n){for(var r=0;r<e.length;r++){var i=e[r],o=i.icon,a=i.xOffset;t[R(o)]=Object.assign({},o,{x:a,y:n})}}var x=function(){function t(e,n){var r=n.onUpdate,o=void 0===r?w:r,a=n.onError,A=void 0===a?w:a;Object(i.a)(this,t),this.gl=e,this.onUpdate=o,this.onError=A,this._loadOptions=null,this._getIcon=null,this._texture=null,this._externalTexture=null,this._mapping={},this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=4,this._canvasWidth=1024,this._canvasHeight=0,this._canvas=null}return Object(o.a)(t,[{key:"finalize",value:function(){this._texture&&this._texture.delete()}},{key:"getTexture",value:function(){return this._texture||this._externalTexture}},{key:"getIconMapping",value:function(t){var e=this._autoPacking?R(t):t;return this._mapping[e]||{}}},{key:"setProps",value:function(t){var e=t.loadOptions,n=t.autoPacking,r=t.iconAtlas,i=t.iconMapping,o=t.data,a=t.getIcon;e&&(this._loadOptions=e),void 0!==n&&(this._autoPacking=n),a&&(this._getIcon=a),i&&(this._mapping=i),r&&this._updateIconAtlas(r),this._autoPacking&&(o||a)&&"undefined"!==typeof document&&(this._canvas=this._canvas||document.createElement("canvas"),this._updateAutoPacking(o))}},{key:"_updateIconAtlas",value:function(t){this._texture&&(this._texture.delete(),this._texture=null),this._externalTexture=t,this.onUpdate()}},{key:"_updateAutoPacking",value:function(t){var e=Object.values(function(t,e,n){if(!t||!e)return null;n=n||{};var r,i={},o=Object(m.a)(t),a=o.iterable,A=o.objectInfo,s=Q(a);try{for(s.s();!(r=s.n()).done;){var c=r.value;A.index++;var u=e(c,A),l=R(u);if(!u)throw new Error("Icon is missing.");if(!u.url)throw new Error("Icon url is missing.");i[l]||n[l]&&u.url===n[l].url||(i[l]=E(E({},u),{},{source:c,sourceIndex:A.index}))}}catch(g){s.e(g)}finally{s.f()}return i}(t,this._getIcon,this._mapping)||{});if(e.length>0){var n=function(t){for(var e,n=t.icons,r=t.buffer,i=t.mapping,o=void 0===i?{}:i,a=t.xOffset,A=void 0===a?0:a,s=t.yOffset,c=void 0===s?0:s,u=t.rowHeight,l=void 0===u?0:u,g=t.canvasWidth,f=[],h=0;h<n.length;h++){var d=n[h];if(!o[R(d)]){var I=d.height,p=d.width;A+p+r>g&&(U(o,f,c),A=0,c=l+c+r,l=0,f=[]),f.push({icon:d,xOffset:A}),A=A+p+r,l=Math.max(l,I)}}return f.length>0&&U(o,f,c),{mapping:o,rowHeight:l,xOffset:A,yOffset:c,canvasWidth:g,canvasHeight:(e=l+c+r,Math.pow(2,Math.ceil(Math.log2(e))))}}({icons:e,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),r=n.mapping,i=n.xOffset,o=n.yOffset,a=n.rowHeight,A=n.canvasHeight;this._rowHeight=a,this._mapping=r,this._xOffset=i,this._yOffset=o,this._canvasHeight=A,this._texture||(this._texture=new y.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:S})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,r){var i=e.width,o=e.height,a=Object(p.a)(e,{width:n,height:r});return Object(C.b)(e,a,{targetY:0,width:i,height:o}),e.delete(),a}(this.gl,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(e)}}},{key:"_loadIcons",value:function(t){var e,n=this,r=this._canvas.getContext("2d"),i=Q(t);try{var o=function(){var t=e.value;n._pendingCount++,Object(B.a)(t.url,v.a,n._loadOptions).then((function(e){var i=R(t),o=n._mapping[i],a=o.x,A=o.y,s=o.width,c=o.height,u=function(t,e,n,r){return n===e.width&&r===e.height?e:(t.canvas.height=r,t.canvas.width=n,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,n,r),t.canvas)}(r,e,s,c);n._texture.setSubImageData({data:u,x:a,y:A,width:s,height:c}),n._texture.generateMipmap(),n.onUpdate()})).catch((function(e){n.onError({url:t.url,source:t.source,sourceIndex:t.sourceIndex,loadOptions:n._loadOptions,error:e})})).finally((function(){n._pendingCount--}))};for(i.s();!(e=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}},{key:"isLoaded",get:function(){return 0===this._pendingCount}}]),t}();function k(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}n.d(e,"a",(function(){return D}));var O=[0,0,0,255],N={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:function(t){return t.position}},getIcon:{type:"accessor",value:function(t){return t.icon}},getColor:{type:"accessor",value:O},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}},D=function(t){Object(A.a)(n,t);var e=k(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"getShaders",value:function(){return Object(a.a)(Object(c.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n  float angle_radian = angle * PI / 180.0;\n  float cos_angle = cos(angle_radian);\n  float sin_angle = sin(angle_radian);\n  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n  return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = positions;\n  geometry.pickingColor = instancePickingColors;\n  uv = positions;\n\n  vec2 iconSize = instanceIconFrames.zw;\n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale), \n    sizeMinPixels, sizeMaxPixels\n  );\n  float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n  vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n  pixelOffset += instancePixelOffset;\n  pixelOffset.y *= -1.0;\n\n  if (billboard)  {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    vec3 offset = vec3(pixelOffset, 0.0);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n  } else {\n    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n    DECKGL_FILTER_SIZE(offset_common, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTextureCoords = mix(\n    instanceIconFrames.xy,\n    instanceIconFrames.xy + iconSize,\n    (positions.xy + 1.0) / 2.0\n  ) / iconsTextureDim;\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n\n  vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n  vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n  float a = texColor.a * opacity * vColor.a;\n\n  if (a < alphaCutoff) {\n    discard;\n  }\n\n  gl_FragColor = vec4(color, a);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[u.a,l.a]})}},{key:"initializeState",value:function(){this.state={iconManager:new x(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:O},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){var e=t.oldProps,r=t.props,i=t.changeFlags;Object(a.a)(Object(c.a)(n.prototype),"updateState",this).call(this,{props:r,oldProps:e,changeFlags:i});var o=this.getAttributeManager(),A=r.iconAtlas,s=r.iconMapping,u=r.data,l=r.getIcon,g=this.state.iconManager;g.setProps({loadOptions:r.loadOptions});var f=!1;if(A||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==r.iconAtlas&&g.setProps({iconAtlas:A,autoPacking:!1}),e.iconMapping!==r.iconMapping&&(g.setProps({iconMapping:s}),f=!0)):g.setProps({autoPacking:!0}),(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&g.setProps({data:u,getIcon:l}),f&&(o.invalidate("instanceOffsets"),o.invalidate("instanceIconFrames"),o.invalidate("instanceColorModes")),i.extensionsChanged){var h=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(h)}),o.invalidateAll()}}},{key:"finalizeState",value:function(){Object(a.a)(Object(c.a)(n.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.sizeScale,i=n.sizeMinPixels,o=n.sizeMaxPixels,a=n.sizeUnits,A=n.billboard,s=n.alphaCutoff,c=this.state.iconManager,u=this.context.viewport,l=c.getTexture();l&&this.state.model.setUniforms(Object.assign({},e,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:r*("pixels"===a?u.metersPerPixel:1),sizeMinPixels:i,sizeMaxPixels:o,billboard:A,alphaCutoff:s})).draw()}},{key:"_getModel",value:function(t){return new h.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new d.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(t){var e=this.getCurrentLayer().props.onIconError;e?e(t):g.a.error(t.error)()}},{key:"getInstanceOffset",value:function(t){var e=this.state.iconManager.getIconMapping(t);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}},{key:"getInstanceColorMode",value:function(t){return this.state.iconManager.getIconMapping(t).mask?1:0}},{key:"getInstanceIconFrame",value:function(t){var e=this.state.iconManager.getIconMapping(t);return[e.x||0,e.y||0,e.width||0,e.height||0]}},{key:"isLoaded",get:function(){return Object(a.a)(Object(c.a)(n.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}}]),n}(f.a);D.layerName="IconLayer",D.defaultProps=N},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(925),a=n(252),A=n(73),s=n(44),c=n(72),u=n(144),l=n(309),g=n(927);function f(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var d=function(){function t(e,n,i){Object(r.a)(this,t),this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(n)}return Object(i.a)(t,[{key:"subscribe",value:function(t){this._subscribers.add(t)}},{key:"unsubscribe",value:function(t){this._subscribers.delete(t)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var t=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((function(){return t.getData()}))}},{key:"setData",value:function(t,e){var n=this;if(t!==this._data||e){this._data=t;var r=++this._loadCount,i=t;"string"===typeof t&&(i=Object(g.a)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((function(t){n._loadCount===r&&(n.isLoaded=!0,n._error=null,n._content=t)})).catch((function(t){n._loadCount===r&&(n.isLoaded=!0,n._error=t||!0)}))):(this.isLoaded=!0,this._error=null,this._content=t);var o,a=f(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(A){a.e(A)}finally{a.f()}}}}]),t}(),I=function(){function t(e){var n=e.gl,i=e.protocol;Object(r.a)(this,t),this.protocol=i||"resource://",this._context={gl:n,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return Object(i.a)(t,[{key:"contains",value:function(t){return!!t.startsWith(this.protocol)||t in this._resources}},{key:"add",value:function(t){var e=t.resourceId,n=t.data,r=t.forceUpdate,i=void 0!==r&&r,o=t.persistent,a=void 0===o||o,A=this._resources[e];A?A.setData(n,i):(A=new d(e,n,this._context),this._resources[e]=A),A.persistent=a}},{key:"remove",value:function(t){var e=this._resources[t];e&&(e.delete(),delete this._resources[t])}},{key:"unsubscribe",value:function(t){var e=t.consumerId,n=this._consumers[e];if(n){for(var r in n){var i=n[r];i.resource&&i.resource.unsubscribe(i)}delete this._consumers[e],this.prune()}}},{key:"subscribe",value:function(t){var e=t.resourceId,n=t.onChange,r=t.consumerId,i=t.requestId,o=void 0===i?"default":i,a=this._resources,A=this.protocol;e.startsWith(A)&&(a[e=e.replace(A,"")]||this.add({resourceId:e,data:null,persistent:!1}));var s=a[e];if(this._track(r,o,s,n),s)return s.getData()}},{key:"prune",value:function(){var t=this;this._pruneRequest||(this._pruneRequest=setTimeout((function(){return t._prune()}),0))}},{key:"finalize",value:function(){for(var t in this._resources)this._resources[t].delete()}},{key:"_track",value:function(t,e,n,r){var i=this._consumers,o=i[t]=i[t]||{},a=o[e]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),n&&(o[e]=a,a.onChange=r,a.resource=n,n.subscribe(a))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var t=0,e=Object.keys(this._resources);t<e.length;t++){var n=e[t],r=this._resources[n];r.persistent||r.inUse()||(r.delete(),delete this._resources[n])}}}]),t}(),p=n(98),C=n(373);function y(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return b}));var B=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}}),m=function(t){return t instanceof a.a?"".concat(t):t?"invalid":"null"},b=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,a=n.stats,A=n.viewport,s=n.timeline;Object(r.a)(this,t),this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new I({gl:e,protocol:"deck://"}),this.context=Object.assign({},B,{layerManager:this,gl:e,deck:i,programManager:e&&Object(C.a)(e),stats:a||new l.a({id:"deck.gl"}),viewport:A||new p.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new o.a,resourceManager:this.resourceManager}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this._onError=null,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}return Object(i.a)(t,[{key:"finalize",value:function(){this.resourceManager.finalize();var t,e=y(this.layers);try{for(e.s();!(t=e.n()).done;){var n=t.value;this._finalizeLayer(n)}}catch(r){e.e(r)}finally{e.f()}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var n,r=y(this.layers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.getNeedsRedraw(t);e=e||o}}catch(a){r.e(a)}finally{r.f()}return e}},{key:"needsUpdate",value:function(){return this._needsUpdate}},{key:"setNeedsRedraw",value:function(t){this._needsRedraw=this._needsRedraw||t}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t}},{key:"getLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.layerIds,n=void 0===e?null:e;return n?this.layers.filter((function(t){return n.find((function(e){return 0===t.id.indexOf(e)}))})):this.layers}},{key:"setProps",value:function(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&this.setLayers(t.layers),"onError"in t&&(this._onError=t.onError)}},{key:"setLayers",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e||t!==this.lastRenderedLayers;if(Object(c.a)("layerManager.setLayers",this,n,t),!n)return this;this.lastRenderedLayers=t;var r,i=y(t=Object(u.b)(t,Boolean));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.context=this.context}}catch(a){i.e(a)}finally{i.f()}return this._updateLayers(this.layers,t),this}},{key:"updateLayers",value:function(){var t=this.needsUpdate();if(t){this.setNeedsRedraw("updating layers: ".concat(t));this.setLayers(this.lastRenderedLayers,!0)}}},{key:"activateViewport",value:function(t){return Object(c.a)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}},{key:"_handleError",value:function(t,e,n){this._onError?this._onError(e,n):s.a.error("error during ".concat(t," of ").concat(m(n)),e)()}},{key:"_updateLayers",value:function(t,e){var n,r={},i=y(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[o.id]?s.a.warn("Multiple old layers with same id ".concat(m(o)))():r[o.id]=o}}catch(l){i.e(l)}finally{i.f()}var a=[];this._updateSublayersRecursively(e,r,a),this._finalizeOldLayers(r);for(var A=!1,c=0,u=a;c<u.length;c++){if(u[c].hasUniformTransition()){A=!0;break}}this._needsUpdate=A,this.layers=a}},{key:"_updateSublayersRecursively",value:function(t,e,n){var r,i=y(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.context=this.context;var a=e[o.id];null===a&&s.a.warn("Multiple new layers with same id ".concat(m(o)))(),e[o.id]=null;var A=null;try{this._debug&&a!==o&&o.validateProps(),a?(this._transferLayerState(a,o),this._updateLayer(o)):this._initializeLayer(o),n.push(o),A=o.isComposite&&o.getSubLayers()}catch(c){this._handleError("matching",c,o)}A&&this._updateSublayersRecursively(A,e,n)}}catch(c){i.e(c)}finally{i.f()}}},{key:"_finalizeOldLayers",value:function(t){for(var e in t){var n=t[e];n&&this._finalizeLayer(n)}}},{key:"_initializeLayer",value:function(t){try{t._initialize(),t.lifecycle=A.a.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}},{key:"_transferLayerState",value:function(t,e){e._transferState(t),e.lifecycle=A.a.MATCHED,e!==t&&(t.lifecycle=A.a.AWAITING_GC)}},{key:"_updateLayer",value:function(t){try{t._update()}catch(e){this._handleError("update",e,t)}}},{key:"_finalizeLayer",value:function(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(m(t)),t.lifecycle=A.a.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=A.a.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}]),t}()},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(370);function u(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return g}));var l=[],g=function(t){Object(a.a)(n,t);var e=u(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object.assign({},Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this),{inject:{"vs:#decl":"\n  uniform float gamma;\n  varying float vGamma;\n","vs:#main-end":"\n  vGamma = gamma / (sizeScale * iconSize.y);\n"},fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform bool shouldDrawBackground;\nuniform vec3 backgroundColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  if (!picking_uActive) {\n    float alpha = texture2D(iconsTexture, vTextureCoords).a;\n    if (sdf) {\n      alpha = smoothstep(buffer - vGamma, buffer + vGamma, alpha);\n    }\n    float a = alpha * vColor.a;\n    \n    if (a < alphaCutoff) {\n      if (shouldDrawBackground) {\n        gl_FragColor = vec4(backgroundColor, vColor.a);\n      } else {\n        discard;\n      }\n    } else {\n      if (shouldDrawBackground) {\n        gl_FragColor = vec4(mix(backgroundColor, vColor.rgb, alpha), vColor.a * opacity);\n      } else {\n        gl_FragColor = vec4(vColor.rgb, a * opacity);\n      }\n      DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n    }\n  } else {\n    DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n  }\n}\n"})}},{key:"initializeState",value:function(){var t=this;Object(o.a)(Object(s.a)(n.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(r,i)}}})}},{key:"updateState",value:function(t){Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,t);var e=t.oldProps,r=t.props;if(r.backgroundColor!==e.backgroundColor){var i=Array.isArray(r.backgroundColor)?r.backgroundColor.map((function(t){return t/255})).slice(0,3):null;this.setState({backgroundColor:i})}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props.sdf,i=this.state.backgroundColor,a=Array.isArray(i);Object(o.a)(Object(s.a)(n.prototype),"draw",this).call(this,{uniforms:Object.assign({},e,{buffer:.75,gamma:.2,sdf:Boolean(r),backgroundColor:i||[0,0,0],shouldDrawBackground:a})})}},{key:"getInstanceOffset",value:function(t){var e=this;return t?Array.from(t).map((function(t){return Object(o.a)(Object(s.a)(n.prototype),"getInstanceOffset",e).call(e,t)})):l}},{key:"getInstanceColorMode",value:function(t){return 1}},{key:"getInstanceIconFrame",value:function(t){var e=this;return t?Array.from(t).map((function(t){return Object(o.a)(Object(s.a)(n.prototype),"getInstanceIconFrame",e).call(e,t)})):l}}]),n}(c.a);g.layerName="MultiIconLayer",g.defaultProps={backgroundColor:{type:"color",value:null,optional:!0},getIconOffsets:{type:"accessor",value:function(t){return t.offsets}},alphaCutoff:.001}},function(t,e,n){"use strict";var r=n(479),i={name:"geometry",vs:"\nstruct VertexGeometry {\n  vec4 position;\n  vec3 worldPosition;\n  vec3 worldPositionAlt;\n  vec3 normal;\n  vec2 uv;\n  vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n  vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},o=n(179);function a(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return u}));var s=[i,o.a],c=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function u(t){var e,n=r.a.getDefaultProgramManager(t),i=a(s);try{for(i.s();!(e=i.n()).done;){var o=e.value;n.addDefaultModule(o)}}catch(g){i.e(g)}finally{i.f()}var A,u=a(c);try{for(u.s();!(A=u.n()).done;){var l=A.value;n.addShaderHook(l)}}catch(g){u.e(g)}finally{u.f()}return n}},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(2),a=n(72),A=n(7),s=n(8),c=n(6);function u(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var l=function(t){Object(A.a)(n,t);var e=u(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return n}(n(191).a),g=n(296),f=n(133);function h(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return C}));var C=function(){function t(e){Object(i.a)(this,t),this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new l(e),this.pickLayersPass=new g.a(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null,this._onError=null}return Object(o.a)(t,[{key:"setProps",value:function(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed"),"onError"in t&&(this._onError=t.onError)}},{key:"renderLayers",value:function(t){var e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=this.layerFilter,t.onError=this._onError,t.effects=t.effects||[],t.target=t.target||f.a.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);var n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,r=e.render(p(p({},t),{},{target:n}));this._postRender(t.effects,t),this.renderCount++,Object(a.a)("deckRenderer.renderLayers",this,r,t)}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"finalize",value:function(){var t,e=this.renderBuffers,n=h(e);try{for(n.s();!(t=n.n()).done;){t.value.delete()}}catch(r){n.e(r)}finally{n.f()}e.length=0}},{key:"_preRender",value:function(t,e){var n,r=null,i=h(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.preRender(this.gl,e),o.postRender&&(r=o)}}catch(a){i.e(a)}finally{i.f()}r&&this._resizeRenderBuffers(),this.lastPostProcessEffect=r}},{key:"_resizeRenderBuffers",value:function(){var t=this.renderBuffers;0===t.length&&t.push(new f.a(this.gl),new f.a(this.gl));var e,n=h(t);try{for(n.s();!(e=n.n()).done;){e.value.resize()}}catch(r){n.e(r)}finally{n.f()}}},{key:"_postRender",value:function(t,e){var n,r=this.renderBuffers,i={inputBuffer:r[0],swapBuffer:r[1],target:null},o=h(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.postRender){if(a===this.lastPostProcessEffect){i.target=e.target,a.postRender(this.gl,i);break}var A=a.postRender(this.gl,i);i.inputBuffer=A,i.swapBuffer=A===r[0]?r[1]:r[0]}}}catch(s){o.e(s)}finally{o.f()}}}]),t}()},function(t,e,n){"use strict";var r=n(13),i=n.n(r),o=n(30),a=n(3),A=n(2),s=n(107),c=new Map;function u(t){return"try {\n  importScripts('".concat(t,"');\n} catch (error) {\n  console.error(error);\n}")}var l=n(363);n.d(e,"a",(function(){return h}));var g=0;function f(t){var e=t.data;(0,t.resolve)(e)}var h=function(){function t(e){var n=e.source,r=e.name,i=void 0===r?"web-worker-".concat(g++):r,o=e.onMessage;Object(a.a)(this,t);var A=function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1],Object(s.a)("string"===typeof t,"worker source"),t.startsWith("url(")&&t.endsWith(")")){var e=t.match(/^url\((.*)\)$/)[1];if(e&&!e.startsWith("http"))return e;t=u(e)}var n=c.get(t);if(!n){var r=new Blob([t],{type:"application/javascript"});n=URL.createObjectURL(r),c.set(t,n)}return n}(n,i);this.worker=new Worker(A,{name:i}),this.name=i,this.onMessage=o||f}return Object(A.a)(t,[{key:"process",value:function(){var t=Object(o.a)(i.a.mark((function t(e){var n=this;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){n.worker.onmessage=function(e){n.onMessage({worker:n.worker,data:e.data,resolve:t,reject:r})},n.worker.onerror=function(t){var e="".concat(n.name,": WorkerThread.process() failed");t.message&&(e+=" ".concat(t.message," ").concat(t.filename,":").concat(t.lineno,":").concat(t.colno));var i=new Error(e);console.error(t),r(i)};var i=Object(l.a)(e);n.worker.postMessage(e,i)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"destroy",value:function(){this.worker.terminate(),this.worker=null}}]),t}()},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GeoJsonEditMode",{enumerable:!0,get:function(){return o.GeoJsonEditMode}}),Object.defineProperty(e,"ModifyMode",{enumerable:!0,get:function(){return a.ModifyMode}}),Object.defineProperty(e,"TranslateMode",{enumerable:!0,get:function(){return A.TranslateMode}}),Object.defineProperty(e,"ScaleMode",{enumerable:!0,get:function(){return s.ScaleMode}}),Object.defineProperty(e,"RotateMode",{enumerable:!0,get:function(){return c.RotateMode}}),Object.defineProperty(e,"DuplicateMode",{enumerable:!0,get:function(){return u.DuplicateMode}}),Object.defineProperty(e,"ExtendLineStringMode",{enumerable:!0,get:function(){return l.ExtendLineStringMode}}),Object.defineProperty(e,"SplitPolygonMode",{enumerable:!0,get:function(){return g.SplitPolygonMode}}),Object.defineProperty(e,"ExtrudeMode",{enumerable:!0,get:function(){return f.ExtrudeMode}}),Object.defineProperty(e,"ElevationMode",{enumerable:!0,get:function(){return h.ElevationMode}}),Object.defineProperty(e,"TransformMode",{enumerable:!0,get:function(){return d.TransformMode}}),Object.defineProperty(e,"DrawPointMode",{enumerable:!0,get:function(){return I.DrawPointMode}}),Object.defineProperty(e,"DrawLineStringMode",{enumerable:!0,get:function(){return p.DrawLineStringMode}}),Object.defineProperty(e,"DrawPolygonMode",{enumerable:!0,get:function(){return C.DrawPolygonMode}}),Object.defineProperty(e,"DrawRectangleMode",{enumerable:!0,get:function(){return y.DrawRectangleMode}}),Object.defineProperty(e,"DrawCircleByDiameterMode",{enumerable:!0,get:function(){return v.DrawCircleByDiameterMode}}),Object.defineProperty(e,"DrawCircleFromCenterMode",{enumerable:!0,get:function(){return B.DrawCircleFromCenterMode}}),Object.defineProperty(e,"DrawEllipseByBoundingBoxMode",{enumerable:!0,get:function(){return m.DrawEllipseByBoundingBoxMode}}),Object.defineProperty(e,"DrawEllipseUsingThreePointsMode",{enumerable:!0,get:function(){return b.DrawEllipseUsingThreePointsMode}}),Object.defineProperty(e,"DrawRectangleUsingThreePointsMode",{enumerable:!0,get:function(){return E.DrawRectangleUsingThreePointsMode}}),Object.defineProperty(e,"Draw90DegreePolygonMode",{enumerable:!0,get:function(){return Q.Draw90DegreePolygonMode}}),Object.defineProperty(e,"DrawPolygonByDraggingMode",{enumerable:!0,get:function(){return F.DrawPolygonByDraggingMode}}),Object.defineProperty(e,"ImmutableFeatureCollection",{enumerable:!0,get:function(){return w.ImmutableFeatureCollection}}),Object.defineProperty(e,"ViewMode",{enumerable:!0,get:function(){return S.ViewMode}}),Object.defineProperty(e,"MeasureDistanceMode",{enumerable:!0,get:function(){return R.MeasureDistanceMode}}),Object.defineProperty(e,"MeasureAreaMode",{enumerable:!0,get:function(){return U.MeasureAreaMode}}),Object.defineProperty(e,"MeasureAngleMode",{enumerable:!0,get:function(){return x.MeasureAngleMode}}),Object.defineProperty(e,"CompositeMode",{enumerable:!0,get:function(){return k.CompositeMode}}),Object.defineProperty(e,"SnappableMode",{enumerable:!0,get:function(){return O.SnappableMode}}),Object.defineProperty(e,"_memoize",{enumerable:!0,get:function(){return N.default}}),e.utils=void 0;var i,o=n(155),a=n(738),A=n(739),s=n(809),c=n(810),u=n(994),l=n(995),g=n(996),f=n(997),h=n(998),d=n(999),I=n(1e3),p=n(1001),C=n(741),y=n(1002),v=n(1003),B=n(1004),m=n(1005),b=n(1006),E=n(1007),Q=n(1008),F=n(1009),w=n(330),S=n(1011),R=n(1012),U=n(1013),x=n(1014),k=n(811),O=n(1016),N=(i=n(742))&&i.__esModule?i:{default:i},D=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var e=G();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=t[o]}n.default=t,e&&e.set(t,n);return n}(n(230));function G(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return G=function(){return t},t}e.utils=D},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(208),i=n(288);function o(t,e,n){return(o=Object(i.a)()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&Object(r.a)(o,n.prototype),o}).apply(null,arguments)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(2),o=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t);var i=n.id,o=void 0===i?"pass":i;this.id=o,this.gl=e,this.props={},Object.assign(this.props,n)}return Object(i.a)(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),t}()},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(2),a=n(19),A=n(479),s=n(197),c=n(47),u=n(301),l=n(929),g=n(115),f=n(76),h=n(8),d=n(54),I=n(6),p=n(34),C=n(7),y=n(82),v=null;function B(t,e){var n;return new t((n=t.BYTES_PER_ELEMENT*e,(!v||v.byteLength<n)&&(v=new ArrayBuffer(n)),v),0,e)}var m=n(114),b=n(286),E=n(287);function Q(t){if(!t&&!Object(b.a)())return"Node";if(Object(E.a)(t))return"Electron";var e="undefined"!==typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var r=-1!==n.indexOf("MSIE "),i=-1!==n.indexOf("Trident/");return r||i?"IE":m.b.chrome?"Chrome":m.b.safari?"Safari":m.b.mozInnerScreenX?"Firefox":"Unknown"}var F="elements must be GL.ELEMENT_ARRAY_BUFFER",w=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var o=r.id||r.program&&r.program.id;return(n=Object(h.a)(this,Object(I.a)(e).call(this,t,Object.assign({},r,{id:o})))).buffer=null,n.bufferValue=null,n.isDefaultArray=r.isDefaultArray||!1,n.initialize(r),Object.seal(Object(d.a)(n)),n}return Object(C.a)(e,t),Object(o.a)(e,null,[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!e.constantAttributeZero||(Object(a.g)(t)||"Chrome"===Q())}},{key:"getDefaultArray",value:function(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new e(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(t){return e.MAX_ATTRIBUTES=e.MAX_ATTRIBUTES||t.getParameter(34921),e.MAX_ATTRIBUTES}},{key:"setConstant",value:function(t,n,r){switch(r.constructor){case Float32Array:e._setConstantFloatArray(t,n,r);break;case Int32Array:e._setConstantIntArray(t,n,r);break;case Uint32Array:e._setConstantUintArray(t,n,r);break;default:Object(c.a)(!1)}}}]),Object(o.a)(e,[{key:"delete",value:function(){Object(p.a)(Object(I.a)(e.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}},{key:"setProps",value:function(t){return this}},{key:"setElementBuffer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(c.a)(!e||34963===e.target,F),this.bind((function(){t.gl.bindBuffer(34963,e?e.handle:null)})),this}},{key:"setBuffer",value:function(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);var r=n.size,i=n.type,o=n.stride,A=n.offset,s=n.normalized,u=n.integer,l=n.divisor,g=this.gl;return t=Number(t),this.bind((function(){g.bindBuffer(34962,e.handle),u?(Object(c.a)(Object(a.g)(g)),g.vertexAttribIPointer(t,r,i,o,A)):g.vertexAttribPointer(t,r,i,s,o,A),g.enableVertexAttribArray(t),g.vertexAttribDivisor(t,l||0)})),this}},{key:"enable",value:function(t){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!r&&0===t&&!e.isSupported(this.gl,{constantAttributeZero:!0});return i||(t=Number(t),this.bind((function(){return r?n.gl.enableVertexAttribArray(t):n.gl.disableVertexAttribArray(t)}))),this}},{key:"getConstantBuffer",value:function(t,e,n){var r=this._normalizeConstantArrayValue(e,n),i=r.byteLength*t,o=r.length*t,a=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,i),a=(a=a||this.buffer.reallocate(i))||!this._compareConstantArrayValues(r,this.bufferValue)){var A=B(e.constructor,o);!function(t){for(var e=t.target,n=t.source,r=t.start,i=void 0===r?0:r,o=t.count,a=void 0===o?1:o,A=n.length,s=a*A,c=0,u=i;c<A;c++)e[u++]=n[c];for(;c<s;)c<s-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+s-c),c=s)}({target:A,source:r,start:0,count:o}),this.buffer.subData(A),this.bufferValue=e}return this.buffer}},{key:"_normalizeConstantArrayValue",value:function(t,e){return Array.isArray(t)?new Float32Array(t):t}},{key:"_compareConstantArrayValues",value:function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(var n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}},{key:"_createHandle",value:function(){return this.gl.createVertexArray()}},{key:"_deleteHandle",value:function(t){return this.gl.deleteVertexArray(t),[this.elements]}},{key:"_bindHandle",value:function(t){this.gl.bindVertexArray(t)}},{key:"_getParameter",value:function(t,e){var n=this,r=e.location;return Object(c.a)(Number.isFinite(r)),this.bind((function(){switch(t){case 34373:return n.gl.getVertexAttribOffset(r,t);default:return n.gl.getVertexAttrib(r,t)}}))}},{key:"MAX_ATTRIBUTES",get:function(){return e.getMaxAttributes(this.gl)}}],[{key:"_setConstantFloatArray",value:function(t,e,n){switch(n.length){case 1:t.vertexAttrib1fv(e,n);break;case 2:t.vertexAttrib2fv(e,n);break;case 3:t.vertexAttrib3fv(e,n);break;case 4:t.vertexAttrib4fv(e,n);break;default:Object(c.a)(!1)}}},{key:"_setConstantIntArray",value:function(t,e,n){switch(Object(c.a)(Object(a.g)(t)),n.length){case 1:t.vertexAttribI1iv(e,n);break;case 2:t.vertexAttribI2iv(e,n);break;case 3:t.vertexAttribI3iv(e,n);break;case 4:t.vertexAttribI4iv(e,n);break;default:Object(c.a)(!1)}}},{key:"_setConstantUintArray",value:function(t,e,n){switch(Object(c.a)(Object(a.g)(t)),n.length){case 1:t.vertexAttribI1uiv(e,n);break;case 2:t.vertexAttribI2uiv(e,n);break;case 3:t.vertexAttribI3uiv(e,n);break;case 4:t.vertexAttribI4uiv(e,n);break;default:Object(c.a)(!1)}}}]),e}(y.a),S=n(701),R=/^(.+)__LOCATION_([0-9]+)$/,U=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new w(e),Object(S.a)(this,"VertexArray","v6.0",U),this.initialize(n),Object.seal(this)}return Object(o.a)(t,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var t=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(t){var e=this;return Object.assign(this.attributes,t),this.vertexArrayObject.bind((function(){for(var n in t){var r=t[n];e._setAttribute(n,r)}e.gl.bindBuffer(34962,null)})),this}},{key:"setElementBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}},{key:"setBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,n);var r=this._resolveLocationAndAccessor(t,e,e.accessor,n),i=r.location,o=r.accessor;return i>=0&&(this.values[i]=e,this.accessors[i]=o,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,o)),this}},{key:"setConstant",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n)),i=r.location,o=r.accessor;return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e,o),this.values[i]=e,this.accessors[i]=o,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}},{key:"unbindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.vertexArrayObject.setElementBuffer(null),t.buffer=t.buffer||new f.a(t.gl,{accessor:{size:4}});for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++)t.values[e]instanceof f.a&&(t.gl.disableVertexAttribArray(e),t.gl.bindBuffer(34962,t.buffer.handle),t.gl.vertexAttribPointer(e,1,5126,!1,0,0))})),this}},{key:"bindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.setElementBuffer(t.elements);for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++){var n=t.values[e];n instanceof f.a&&t.setBuffer(e,n)}})),this}},{key:"bindForDraw",value:function(t,e,n){var r,i=this;return this.vertexArrayObject.bind((function(){i._setConstantAttributes(t,e),r=n()})),r}},{key:"_resolveLocationAndAccessor",value:function(t,e,n,r){var i=this,o=this._getAttributeIndex(t),A=o.location,s=o.name;if(!Number.isFinite(A)||A<0)return this.unused[t]=e,a.h.once(3,(function(){return"unused value ".concat(t," in ").concat(i.id)}))(),this;var u=this._getAttributeInfo(s||A);if(!u)return{location:-1,accessor:null};var l=this.accessors[A]||{},f=g.a.resolve(u.accessor,l,n,r),h=f.size,d=f.type;return Object(c.a)(Number.isFinite(h)&&Number.isFinite(d)),{location:A,accessor:f}}},{key:"_getAttributeInfo",value:function(t){return this.configuration&&this.configuration.getAttributeInfo(t)}},{key:"_getAttributeIndex",value:function(t){var e=Number(t);if(Number.isFinite(e))return{location:e};var n=R.exec(t),r=n?n[1]:t,i=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+i,name:r}:{location:-1}}},{key:"_setAttribute",value:function(t,e){if(e instanceof f.a)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof f.a){var n=e[0],r=e[1];this.setBuffer(t,n,r)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){var i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof f.a))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");var o=e;this.setBuffer(t,o.buffer,o)}}},{key:"_setConstantAttributes",value:function(t,e){var n=Math.max(0|t,0|e),r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,n);for(var i=1;i<this.vertexArrayObject.MAX_ATTRIBUTES;i++)r=this.values[i],ArrayBuffer.isView(r)&&this._setConstantAttribute(i,r)}},{key:"_setConstantAttributeZero",value:function(t,e){if(w.isSupported(this.gl,{constantAttributeZero:!0}))this._setConstantAttribute(0,t);else{var n=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,n,this.accessors[0])}}},{key:"_setConstantAttribute",value:function(t,e){w.setConstant(this.gl,t,e)}},{key:"_updateDrawParams",value:function(){for(var t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0},e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}},{key:"_updateDrawParamsForLocation",value:function(t,e){var n=this.values[e],r=this.accessors[e];if(n){var i=r.divisor>0;if(t.isInstanced=t.isInstanced||i,n instanceof f.a){var o=n;if(i){var a=o.getVertexCount(r);t.instanceCount=Math.min(t.instanceCount,a)}else{var A=o.getVertexCount(r);t.vertexCount=Math.min(t.vertexCount,A)}}}}},{key:"setElements",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.h.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}]),t}(),k=n(924),O=n(168),N=n(148);function D(t,e){for(var n=e.maxElts,r=void 0===n?16:n,i=e.size,o=void 0===i?1:i,a="[",A=0;A<t.length&&A<r;++A)A>0&&(a+=",".concat(A%o===0?" ":"")),a+=G(t[A],e);var s=t.length>r?"...":"]";return"".concat(a).concat(s)}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=1e-16,r=e.isInteger,i=void 0!==r&&r;if(Array.isArray(t)||ArrayBuffer.isView(t))return D(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<n)return i?"0":"0.";if(i)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var o=t.toPrecision(2),a=o.indexOf(".0");return a===o.length-2?o.slice(0,-1):o}function _(t,e,n,i){var o,a,A=t.gl;if(!e)return a={},Object(r.a)(a,i,"null"),Object(r.a)(a,"Format ","N/A"),a;var s,c,u,l="NOT PROVIDED",g="N/A",h="N/A",d="N/A";if(n&&(l=n.type,g=n.size,s=-1!==(l=String(l).replace("Array","")).indexOf("nt")),e instanceof f.a){var I,p,C=e,y=C.getDebugData(),v=y.data;if(c=y.modified?"*":"",u=v,h=(d=C.byteLength)/v.BYTES_PER_ELEMENT/g,n){var B=n.divisor>0;p="".concat(B?"I ":"P "," ").concat(h," (x").concat(g,"=").concat(d," bytes ").concat(Object(O.a)(A,l),")")}else s=!0,p="".concat(d," bytes");return I={},Object(r.a)(I,i,"".concat(c).concat(G(u,{size:g,isInteger:s}))),Object(r.a)(I,"Format ",p),I}return u=e,g=e.length,s=-1!==(l=String(e.constructor.name).replace("Array","")).indexOf("nt"),o={},Object(r.a)(o,i,"".concat(G(u,{size:g,isInteger:s})," (constant)")),Object(r.a)(o,"Format ","".concat(g,"x").concat(l," (constant)")),o}function M(t,e){var n=e.type,r=e.size,i=Object(N.b)(n,r);return i?"".concat(t," (").concat(i.name,")"):t}function T(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.header,n=void 0===e?"Uniforms":e,i=t.program,o=t.uniforms,a=t.undefinedOnly,A=void 0!==a&&a;Object(c.a)(i);var s=".*_.*",u=".*Matrix",l=i._uniformSetters,g={},f=Object.keys(l).sort(),h=0,d=!0,I=!1,p=void 0;try{for(var C,y=f[Symbol.iterator]();!(d=(C=y.next()).done);d=!0){var v=C.value;v.match(s)||v.match(u)||j({table:g,header:n,uniforms:o,uniformName:v,undefinedOnly:A})&&h++}}catch(M){I=!0,p=M}finally{try{d||null==y.return||y.return()}finally{if(I)throw p}}var B=!0,m=!1,b=void 0;try{for(var E,Q=f[Symbol.iterator]();!(B=(E=Q.next()).done);B=!0){var F=E.value;F.match(u)&&j({table:g,header:n,uniforms:o,uniformName:F,undefinedOnly:A})&&h++}}catch(M){m=!0,b=M}finally{try{B||null==Q.return||Q.return()}finally{if(m)throw b}}var w=!0,S=!1,R=void 0;try{for(var U,x=f[Symbol.iterator]();!(w=(U=x.next()).done);w=!0){var k=U.value;g[k]||j({table:g,header:n,uniforms:o,uniformName:k,undefinedOnly:A})&&h++}}catch(M){S=!0,R=M}finally{try{w||null==x.return||x.return()}finally{if(S)throw R}}var O=0,N={};if(!A)for(var D in o){var _=o[D];g[D]||(O++,N[D]=Object(r.a)({Type:"NOT USED: ".concat(_)},n,G(_)))}return{table:g,count:h,unusedTable:N,unusedCount:O}}function j(t){var e,n=t.table,i=t.header,o=t.uniforms,a=t.uniformName,A=t.undefinedOnly,s=o[a],c=function(t){return void 0!==t&&null!==t}(s);return(!A||!c)&&(n[a]=(e={},Object(r.a)(e,i,c?G(s):"N/A"),Object(r.a)(e,"Uniform Type",c?s:"NOT PROVIDED"),e),!0)}function L(t){var e=t.accessor,n=e.type,r=e.size,i=Object(N.b)(n,r);return i?"".concat(i.name," ").concat(t.name):t.name}var V=n(111),Z={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function P(t,e){var n=(e||{}).attributeMap,r=void 0===n?Z:n;return r&&r[t]||t}function W(t,e){var n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Object(c.a)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}n.d(e,"a",(function(){return Y}));var J=function(){},H={},Y=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var r=n.id,o=void 0===r?Object(s.c)("model"):r;Object(c.a)(Object(a.f)(e)),this.id=o,this.gl=e,this.id=n.id||Object(s.c)("Model"),this.lastLogTime=0,this.initialize(n)}return Object(o.a)(t,[{key:"initialize",value:function(t){this.props={},this.programManager=t.programManager||A.a.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var e=t.program,n=void 0===e?null:e,r=t.vs,i=t.fs,o=t.modules,a=t.defines,s=t.inject,u=t.varyings,l=t.bufferMode,g=t.transpileToGLSL100;this.programProps={program:n,vs:r,fs:i,modules:o,defines:a,inject:s,varyings:u,bufferMode:l,transpileToGLSL100:g},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Object(c.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(t){this._setModelProps(t)}},{key:"delete",value:function(){for(var t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(t){var e=t.program,n=t.vs,r=t.fs,i=t.modules,o=t.defines,a=t.inject,A=t.varyings,s=t.bufferMode,c=t.transpileToGLSL100;this.programProps={program:e,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:A,bufferMode:s,transpileToGLSL100:c},this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setDrawMode",value:function(t){return this.drawMode=t,this}},{key:"setVertexCount",value:function(t){return Object(c.a)(Number.isFinite(t)),this.vertexCount=t,this}},{key:"setInstanceCount",value:function(t){return Object(c.a)(Number.isFinite(t)),this.instanceCount=t,this}},{key:"setGeometry",value:function(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){var r={},i=e.indices;for(var o in e.attributes){var a=e.attributes[o],A=P(o,n);if("indices"===o)i=a;else if(a.constant)r[A]=a.value;else{var s=a.value,u=Object(V.a)({},a);delete u.value,r[A]=[new f.a(t,s),u],W(o,u)}}if(i){var l=i.value||i;Object(c.a)(l instanceof Uint16Array||l instanceof Uint32Array,'attribute array for "indices" must be of integer type');var g={size:1,isIndexed:void 0===i.isIndexed||i.isIndexed};r.indices=[new f.a(t,{data:l,target:34963}),g]}return r}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(s.a)(t))return this;var e={};for(var n in t){var r=t[n];e[n]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(e),this}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}},{key:"getModuleUniforms",value:function(t){this._checkProgram();var e=this.programManager.getUniforms(this.program);return e?e(t):{}}},{key:"updateModuleSettings",value:function(t){var e=this.getModuleUniforms(t||{});return this.setUniforms(e)}},{key:"clear",value:function(t){return Object(u.a)(this.program.gl,t),this}},{key:"draw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();var e,n=t.moduleSettings,r=void 0===n?null:n,i=t.framebuffer,o=t.uniforms,A=void 0===o?{}:o,s=t.attributes,c=void 0===s?{}:s,u=t.transformFeedback,l=void 0===u?this.transformFeedback:u,g=t.parameters,f=void 0===g?{}:g,h=t.vertexArray,d=void 0===h?this.vertexArray:h;this.setAttributes(c),this.updateModuleSettings(r),this.setUniforms(A),a.h.priority>=2&&(e=this._logDrawCallStart(2));var I=this.vertexArray.getDrawParams(),p=this.props,C=p.isIndexed,y=void 0===C?I.isIndexed:C,v=p.indexType,B=void 0===v?I.indexType:v,m=p.indexOffset,b=void 0===m?I.indexOffset:m,E=p.vertexArrayInstanced,Q=void 0===E?I.isInstanced:E;Q&&!this.isInstanced&&a.h.warn("Found instanced attributes on non-instanced model",this.id)();var F=this.isInstanced,w=this.instanceCount,S=this.props,R=S.onBeforeRender,U=void 0===R?J:R,x=S.onAfterRender,k=void 0===x?J:x;U(),this.program.setUniforms(this.uniforms);var O=this.program.draw(Object.assign(H,t,{logPriority:e,uniforms:null,framebuffer:i,parameters:f,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:d,transformFeedback:l,isIndexed:y,indexType:B,isInstanced:F,instanceCount:w,offset:y?b:0}));return k(),a.h.priority>=2&&this._logDrawCallEnd(e,d,i),O}},{key:"transform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.discard,n=void 0===e||e,i=t.feedbackBuffers,o=t.unbindModels,a=void 0===o?[]:o,A=t.parameters;i&&this._setFeedbackBuffers(i),n&&(A=Object.assign({},A,Object(r.a)({},35977,n))),a.forEach((function(t){return t.vertexArray.unbindBuffers()}));try{this.draw(Object.assign({},t,{parameters:A}))}finally{a.forEach((function(t){return t.vertexArray.bindBuffers()}))}return this}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.h.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}},{key:"_setModelProps",value:function(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}},{key:"_checkProgram",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t=this._programDirty||this.programManager.stateHash!==this._programManagerState;if(t){var e=this.programProps.program;if(e)this._managedProgram=!1;else{var n=this.programProps,r=n.vs,i=n.fs,o=n.modules,a=n.inject,A=n.defines,s=n.varyings,u=n.bufferMode,g=n.transpileToGLSL100;e=this.programManager.get({vs:r,fs:i,modules:o,inject:a,defines:A,varyings:s,bufferMode:u,transpileToGLSL100:g}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Object(c.a)(e instanceof l.a,"Model needs a program"),this._programDirty=!1,e!==this.program&&(this.program=e,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new x(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_deleteGeometryBuffers",value:function(){for(var t in this.geometryBuffers){var e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof f.a&&e.delete()}}},{key:"_setAnimationProps",value:function(t){if(this.animated){Object(c.a)(t,"Model.draw(): animated uniforms but no animationProps");var e=this._evaluateAnimateUniforms(t);Object.assign(this.uniforms,e)}}},{key:"_setFeedbackBuffers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(s.a)(t))return this;var e=this.program.gl;return this.transformFeedback=this.transformFeedback||new k.a(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}},{key:"_logDrawCallStart",value:function(t){var e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),a.h.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:a.h.level<=2})(),t}},{key:"_logDrawCallEnd",value:function(t,e,n,i){if(void 0!==t){var o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.vertexArray,n=t.header,r=void 0===n?"Attributes":n;if(!e.configuration)return{};var i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=_(e,e.elements,null,r));var o=e.values;for(var a in o){var A=e._getAttributeInfo(a);if(A){var s="".concat(a,": ").concat(A.name),c=e.accessors[A.location];c&&(s="".concat(a,": ").concat(M(A.name,c))),i[s]=_(e,o[a],c,r)}}return i}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),A=T({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),s=A.table,c=A.unusedTable,u=A.unusedCount,l=T({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),g=l.table;l.count>0&&a.h.log("MISSING UNIFORMS",Object.keys(g))(),u>0&&a.h.log("UNUSED UNIFORMS",Object.keys(c))();var f=function(t){var e={},n="Accessors for ".concat(t.id),i=!0,o=!1,a=void 0;try{for(var A,s=t.attributeInfos[Symbol.iterator]();!(i=(A=s.next()).done);i=!0){var c=A.value;if(c){var u=L(c);e["in ".concat(u)]=Object(r.a)({},n,JSON.stringify(c.accessor))}}}catch(C){o=!0,a=C}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}var l=!0,g=!1,f=void 0;try{for(var h,d=t.varyingInfos[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var I=h.value;if(I){var p=L(I);e["out ".concat(p)]=Object(r.a)({},n,JSON.stringify(I.accessor))}}}catch(C){g=!0,f=C}finally{try{l||null==d.return||d.return()}finally{if(g)throw f}}return e}(this.vertexArray.configuration);a.h.table(t,o)(),a.h.table(t,s)(),a.h.table(t+1,f)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),a.h.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),t}()},,function(t,e,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);e.a=i},function(t,e,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;e.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(t){return t.scrollTop};function i(t,e){var n=t.timeout,r=t.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"===typeof n?n:n[e.mode]||0,delay:i.transitionDelay}}},function(t,e,n){"use strict";n.d(e,"f",(function(){return d})),n.d(e,"d",(function(){return I})),n.d(e,"e",(function(){return p})),n.d(e,"b",(function(){return C})),n.d(e,"c",(function(){return y})),n.d(e,"a",(function(){return v}));var r=n(12),i=n(26),o=n(555),a=n.n(o),A=n(481),s=n.n(A),c=n(1363),u=n(1095),l=n(116),g=n(121),f=n(75),h=n(85);function d(t,e){var n=(new a.a).compile(h.c[e].schema);if(!n(t)){var r=JSON.stringify(n.errors,null,2);throw new Error("Tree validation failed: ".concat(r))}if(t.datatype!==e)throw new Error("The data type does not match the expected data type of '".concat(e,"'."));return"0.1.2"===t.version?Object(i.a)({},t,{version:h.c[e].latestVersion,tree:t.tree.map((function(t){return Object(g.i)(t,(function(t){return!t.children&&Array.isArray(t.set)}),(function(t){return Object(i.a)({},t,{set:t.set.map((function(t){return[t,null]}))})}),[])}))}):t}function I(t,e){var n=JSON.parse(t);return n=d(n,e)}function p(t,e){var n=Object(c.a)(h.g).parse(t,(function(t){return{groupName:t.groupName,setName:t.setName,setColor:t.setColor?Object(l.d)(t.setColor):f.b,obsId:t.obsId,predictionScore:s()(t.predictionScore)||t.predictionScore===h.f?null:+t.predictionScore}})),r=(new a.a).compile(h.i[e].schema);if(r(n)){var i={version:h.c[e].latestVersion,datatype:e,tree:[]};return Array.from(new Set(n.map((function(t){return t.groupName})))).forEach((function(t){var e={name:t,children:[]},r=n.filter((function(e){return e.groupName===t}));Array.from(new Set(r.map((function(t){return t.setName})))).forEach((function(t){var n=r.filter((function(e){return e.setName===t})),i=n[0].setColor,o={name:t,color:i,set:n.map((function(t){return[t.obsId,t.predictionScore]}))};e.children.push(o)})),i.tree.push(e)})),i}var o=JSON.stringify(r.errors,null,2);throw new Error("Import validation failed: ".concat(o))}function C(t){var e=JSON.stringify(t);return"data:".concat(h.d,";charset=utf-8,").concat(encodeURIComponent(e))}function y(t){var e=[];t.tree.forEach((function(t){t.children.forEach((function(n){n.set&&n.set.forEach((function(i){var o=Object(r.a)(i,2),a=o[0],A=o[1];e.push({groupName:t.name,setName:n.name,setColor:Object(l.c)(n.color),obsId:a,predictionScore:s()(A)?h.f:A})}))}))}));var n=Object(u.parse)(e,{fields:["groupName","setName","setColor","obsId","predictionScore"],delimiter:h.g});return"data:".concat(h.e,";charset=utf-8,").concat(encodeURIComponent(n))}function v(t,e){var n=document.createElement("a");n.setAttribute("href",t),n.setAttribute("download",e),document.body.appendChild(n),n.click(),n.remove()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r="",i={};function o(t){for(var e in i)if(t.startsWith(e)){var n=i[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(r).concat(t)),t}},function(t,e,n){(function(t){var r=n(131),i=n(678),o=e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,A=a&&a.exports===o?r.Buffer:void 0,s=(A?A.isBuffer:void 0)||i;t.exports=s}).call(this,n(130)(t))},function(t,e,n){"use strict";var r=n(9),i=n(542),o=n(175);e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(t,Object(r.a)({defaultTheme:o.a},e))}},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(137);e.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.red=e.getContrastingColor=e.isValidHex=e.toState=e.simpleCheckForValidColor=void 0;var r=o(n(1289)),i=o(n(411));function o(t){return t&&t.__esModule?t:{default:t}}e.simpleCheckForValidColor=function(t){var e=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],(function(r){if(t[r]&&(e+=1,isNaN(t[r])||(n+=1),"s"===r||"l"===r)){/^\d+%$/.test(t[r])&&(n+=1)}})),e===n&&t};var a=e.toState=function(t,e){var n=t.hex?(0,i.default)(t.hex):(0,i.default)(t),r=n.toHsl(),o=n.toHsv(),a=n.toRgb(),A=n.toHex();return 0===r.s&&(r.h=e||0,o.h=e||0),{hsl:r,hex:"000000"===A&&0===a.a?"transparent":"#"+A,rgb:a,hsv:o,oldHue:t.h||e||r.h,source:t.source}};e.isValidHex=function(t){var e="#"===String(t).charAt(0)?1:0;return t.length!==4+e&&t.length<7+e&&(0,i.default)(t).isValid()},e.getContrastingColor=function(t){if(!t)return"#fff";var e=a(t);return"transparent"===e.hex?"rgba(0,0,0,0.4)":(299*e.rgb.r+587*e.rgb.g+114*e.rgb.b)/1e3>=128?"#000":"#fff"},e.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}};e.default=e},function(t,e,n){var r=n(316);t.exports=function(t,e,n){return new r(t,n).compare(new r(e,n))}},function(t,e,n){var r=n(892),i=n(893),o=function(){"use strict";function t(e,n){var i=this;if(r(this,t),n&&"object"===typeof n||(n={loose:!!n,includePrerelease:!1}),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(e));this.format()}return i(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var e=this,n=this.options.loose;t=t.trim();var r=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];t=t.replace(r,F(this.options.includePrerelease)),A("hyphen replace",t),t=t.replace(u[l.COMPARATORTRIM],g),A("comparator trim",t,u[l.COMPARATORTRIM]),t=(t=(t=t.replace(u[l.TILDETRIM],f)).replace(u[l.CARETTRIM],h)).split(/\s+/).join(" ");var i=n?u[l.COMPARATORLOOSE]:u[l.COMPARATOR];return t.split(" ").map((function(t){return I(t,e.options)})).join(" ").split(/\s+/).map((function(t){return Q(t,e.options)})).filter(this.options.loose?function(t){return!!t.match(i)}:function(){return!0}).map((function(t){return new a(t,e.options)}))}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return d(t,n)&&e.set.some((function(e){return d(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"===typeof t)try{t=new s(t,this.options)}catch(n){return!1}for(var e=0;e<this.set.length;e++)if(w(this.set[e],t,this.options))return!0;return!1}}]),t}();t.exports=o;var a=n(778),A=n(776),s=n(316),c=n(691),u=c.re,l=c.t,g=c.comparatorTrimReplace,f=c.tildeTrimReplace,h=c.caretTrimReplace,d=function(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n},I=function(t,e){return A("comp",t,e),t=v(t,e),A("caret",t),t=C(t,e),A("tildes",t),t=m(t,e),A("xrange",t),t=E(t,e),A("stars",t),t},p=function(t){return!t||"x"===t.toLowerCase()||"*"===t},C=function(t,e){return t.trim().split(/\s+/).map((function(t){return y(t,e)})).join(" ")},y=function(t,e){var n=e.loose?u[l.TILDELOOSE]:u[l.TILDE];return t.replace(n,(function(e,n,r,i,o){var a;return A("tilde",t,e,n,r,i,o),p(n)?a="":p(r)?a=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):p(i)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(A("replaceTilde pr",o),a=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):a=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),A("tilde return",a),a}))},v=function(t,e){return t.trim().split(/\s+/).map((function(t){return B(t,e)})).join(" ")},B=function(t,e){A("caret",t,e);var n=e.loose?u[l.CARETLOOSE]:u[l.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,o,a){var s;return A("caret",t,e,n,i,o,a),p(n)?s="":p(i)?s=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):p(o)?s="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(A("replaceCaret pr",a),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(+n+1,".0.0-0")):(A("no pr"),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),A("caret return",s),s}))},m=function(t,e){return A("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return b(t,e)})).join(" ")},b=function(t,e){t=t.trim();var n=e.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return t.replace(n,(function(n,r,i,o,a,s){A("xRange",t,n,r,i,o,a,s);var c=p(i),u=c||p(o),l=u||p(a),g=l;return"="===r&&g&&(r=""),s=e.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&g?(u&&(o=0),a=0,">"===r?(r=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(s="-0"),n="".concat(r+i,".").concat(o,".").concat(a).concat(s)):u?n=">=".concat(i,".0.0").concat(s," <").concat(+i+1,".0.0-0"):l&&(n=">=".concat(i,".").concat(o,".0").concat(s," <").concat(i,".").concat(+o+1,".0-0")),A("xRange return",n),n}))},E=function(t,e){return A("replaceStars",t,e),t.trim().replace(u[l.STAR],"")},Q=function(t,e){return A("replaceGTE0",t,e),t.trim().replace(u[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},F=function(t){return function(e,n,r,i,o,a,A,s,c,u,l,g,f){return n=p(r)?"":p(i)?">=".concat(r,".0.0").concat(t?"-0":""):p(o)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":""),s=p(c)?"":p(u)?"<".concat(+c+1,".0.0-0"):p(l)?"<".concat(c,".").concat(+u+1,".0-0"):g?"<=".concat(c,".").concat(u,".").concat(l,"-").concat(g):t?"<".concat(c,".").concat(u,".").concat(+l+1,"-0"):"<=".concat(s),"".concat(n," ").concat(s).trim()}},w=function(t,e,n){for(var r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(var i=0;i<t.length;i++)if(A(t[i].semver),t[i].semver!==a.ANY&&t[i].semver.prerelease.length>0){var o=t[i].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(137),i=n(69);e.default=function(t,e){void 0===e&&(e={});var n=0,o=0,a=0;return r.coordEach(t,(function(t){n+=t[0],o+=t[1],a++})),i.point([n/a,o/a],e.properties)}},function(t,e,n){"use strict";var r=n(476),i=n(928),o=n(58),a=n(44),A=n(72);var s={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){var e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse},c="8.4.0-alpha.4",u=o.global.deck&&o.global.deck.VERSION;if(u&&u!==c)throw new Error("deck.gl - multiple versions detected: ".concat(u," vs ").concat(c));u||(o.global.deck=Object.assign(o.global.deck||{},{VERSION:c,version:c,log:a.a,_registerLoggers:A.b}),Object(r.b)([s,[i.a,{imagebitmap:{premultiplyAlpha:"none"}}]]));e.a=o.global.deck},function(t,e,n){"use strict";(function(t){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(n&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();var i=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),r))}};function o(t){return t&&"[object Function]"==={}.toString.call(t)}function a(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function A(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function s(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=a(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?t:s(A(t))}function c(t){return t&&t.referenceNode?t.referenceNode:t}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),l=n&&/MSIE 10/.test(navigator.userAgent);function g(t){return 11===t?u:10===t?l:u||l}function f(t){if(!t)return document.documentElement;for(var e=g(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?f(n):n:t?t.ownerDocument.documentElement:document.documentElement}function h(t){return null!==t.parentNode?h(t.parentNode):t}function d(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(t!==a&&e!==a||r.contains(i))return function(t){var e=t.nodeName;return"BODY"!==e&&("HTML"===e||f(t.firstElementChild)===t)}(a)?a:f(a);var A=h(t);return A.host?d(A.host,e):d(t,h(e).host)}function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",r=t.nodeName;if("BODY"===r||"HTML"===r){var i=t.ownerDocument.documentElement,o=t.ownerDocument.scrollingElement||i;return o[n]}return t[n]}function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=I(e,"top"),i=I(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}function C(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function y(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],g(10)?parseInt(n["offset"+t])+parseInt(r["margin"+("Height"===t?"Top":"Left")])+parseInt(r["margin"+("Height"===t?"Bottom":"Right")]):0)}function v(t){var e=t.body,n=t.documentElement,r=g(10)&&getComputedStyle(n);return{height:y("Height",e,n,r),width:y("Width",e,n,r)}}var B=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},m=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),b=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},E=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function Q(t){return E({},t,{right:t.left+t.width,bottom:t.top+t.height})}function F(t){var e={};try{if(g(10)){e=t.getBoundingClientRect();var n=I(t,"top"),r=I(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch(f){}var i={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},o="HTML"===t.nodeName?v(t.ownerDocument):{},A=o.width||t.clientWidth||i.width,s=o.height||t.clientHeight||i.height,c=t.offsetWidth-A,u=t.offsetHeight-s;if(c||u){var l=a(t);c-=C(l,"x"),u-=C(l,"y"),i.width-=c,i.height-=u}return Q(i)}function w(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(10),i="HTML"===e.nodeName,o=F(t),A=F(e),c=s(t),u=a(e),l=parseFloat(u.borderTopWidth),f=parseFloat(u.borderLeftWidth);n&&i&&(A.top=Math.max(A.top,0),A.left=Math.max(A.left,0));var h=Q({top:o.top-A.top-l,left:o.left-A.left-f,width:o.width,height:o.height});if(h.marginTop=0,h.marginLeft=0,!r&&i){var d=parseFloat(u.marginTop),I=parseFloat(u.marginLeft);h.top-=l-d,h.bottom-=l-d,h.left-=f-I,h.right-=f-I,h.marginTop=d,h.marginLeft=I}return(r&&!n?e.contains(c):e===c&&"BODY"!==c.nodeName)&&(h=p(h,e)),h}function S(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,r=w(t,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:I(n),A=e?0:I(n,"left"),s={top:a-r.top+r.marginTop,left:A-r.left+r.marginLeft,width:i,height:o};return Q(s)}function R(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===a(t,"position"))return!0;var n=A(t);return!!n&&R(n)}function U(t){if(!t||!t.parentElement||g())return document.documentElement;for(var e=t.parentElement;e&&"none"===a(e,"transform");)e=e.parentElement;return e||document.documentElement}function x(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?U(t):d(t,c(e));if("viewport"===r)o=S(a,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=s(A(e))).nodeName&&(u=t.ownerDocument.documentElement):u="window"===r?t.ownerDocument.documentElement:r;var l=w(u,a,i);if("HTML"!==u.nodeName||R(a))o=l;else{var g=v(t.ownerDocument),f=g.height,h=g.width;o.top+=l.top-l.marginTop,o.bottom=f+l.top,o.left+=l.left-l.marginLeft,o.right=h+l.left}}var I="number"===typeof(n=n||0);return o.left+=I?n:n.left||0,o.top+=I?n:n.top||0,o.right-=I?n:n.right||0,o.bottom-=I?n:n.bottom||0,o}function k(t){return t.width*t.height}function O(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=x(n,r,o,i),A={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},s=Object.keys(A).map((function(t){return E({key:t},A[t],{area:k(A[t])})})).sort((function(t,e){return e.area-t.area})),c=s.filter((function(t){var e=t.width,r=t.height;return e>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:s[0].key,l=t.split("-")[1];return u+(l?"-"+l:"")}function N(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?U(e):d(e,c(n));return w(n,i,r)}function D(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),r=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+r,height:t.offsetHeight+n}}function G(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function _(t,e,n){n=n.split("-")[0];var r=D(t),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",A=o?"left":"top",s=o?"height":"width",c=o?"width":"height";return i[a]=e[a]+e[s]/2-r[s]/2,i[A]=n===A?e[A]-r[c]:e[G(A)],i}function M(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function T(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var r=M(t,(function(t){return t[e]===n}));return t.indexOf(r)}(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&o(n)&&(e.offsets.popper=Q(e.offsets.popper),e.offsets.reference=Q(e.offsets.reference),e=n(e,t))})),e}function j(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=O(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=_(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=T(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function L(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function V(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<e.length;r++){var i=e[r],o=i?""+i+n:t;if("undefined"!==typeof document.body.style[o])return o}return null}function Z(){return this.state.isDestroyed=!0,L(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[V("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function P(t){var e=t.ownerDocument;return e?e.defaultView:window}function W(t,e,n,r){n.updateBound=r,P(t).addEventListener("resize",n.updateBound,{passive:!0});var i=s(t);return function t(e,n,r,i){var o="BODY"===e.nodeName,a=o?e.ownerDocument.defaultView:e;a.addEventListener(n,r,{passive:!0}),o||t(s(a.parentNode),n,r,i),i.push(a)}(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function J(){this.state.eventsEnabled||(this.state=W(this.reference,this.options,this.state,this.scheduleUpdate))}function H(){var t,e;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(t=this.reference,e=this.state,P(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach((function(t){t.removeEventListener("scroll",e.updateBound)})),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e))}function Y(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function X(t,e){Object.keys(e).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&Y(e[n])&&(r="px"),t.style[n]=e[n]+r}))}var z=n&&/Firefox/i.test(navigator.userAgent);function K(t,e,n){var r=M(t,(function(t){return t.name===e})),i=!!r&&t.some((function(t){return t.name===n&&t.enabled&&t.order<r.order}));if(!i){var o="`"+e+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var q=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],$=q.slice(3);function tt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=$.indexOf(t),r=$.slice(n+1).concat($.slice(0,n));return e?r.reverse():r}var et="flip",nt="clockwise",rt="counterclockwise";function it(t,e,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=t.split(/(\+|\-)/).map((function(t){return t.trim()})),A=a.indexOf(M(a,(function(t){return-1!==t.search(/,|\s/)})));a[A]&&-1===a[A].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,c=-1!==A?[a.slice(0,A).concat([a[A].split(s)[0]]),[a[A].split(s)[1]].concat(a.slice(A+1))]:[a];return(c=c.map((function(t,r){var i=(1===r?!o:o)?"height":"width",a=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return t;if(0===a.indexOf("%")){var A=void 0;switch(a){case"%p":A=n;break;case"%":case"%r":default:A=r}return Q(A)[e]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(t,i,e,n)}))}))).forEach((function(t,e){t.forEach((function(n,r){Y(n)&&(i[e]+=n*("-"===t[r-1]?-1:1))}))})),i}var ot={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,o=i.reference,a=i.popper,A=-1!==["bottom","top"].indexOf(n),s=A?"left":"top",c=A?"width":"height",u={start:b({},s,o[s]),end:b({},s,o[s]+o[c]-a[c])};t.offsets.popper=E({},a,u[r])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,a=i.reference,A=r.split("-")[0],s=void 0;return s=Y(+n)?[+n,0]:it(n,o,a,A),"left"===A?(o.top+=s[0],o.left-=s[1]):"right"===A?(o.top+=s[0],o.left+=s[1]):"top"===A?(o.left+=s[0],o.top-=s[1]):"bottom"===A&&(o.left+=s[0],o.top+=s[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||f(t.instance.popper);t.instance.reference===n&&(n=f(n));var r=V("transform"),i=t.instance.popper.style,o=i.top,a=i.left,A=i[r];i.top="",i.left="",i[r]="";var s=x(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);i.top=o,i.left=a,i[r]=A,e.boundaries=s;var c=e.priority,u=t.offsets.popper,l={primary:function(t){var n=u[t];return u[t]<s[t]&&!e.escapeWithReference&&(n=Math.max(u[t],s[t])),b({},t,n)},secondary:function(t){var n="right"===t?"left":"top",r=u[n];return u[t]>s[t]&&!e.escapeWithReference&&(r=Math.min(u[n],s[t]-("right"===t?u.width:u.height))),b({},n,r)}};return c.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";u=E({},u,l[e](t))})),t.offsets.popper=u,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),A=a?"right":"bottom",s=a?"left":"top",c=a?"width":"height";return n[A]<o(r[s])&&(t.offsets.popper[s]=o(r[s])-n[c]),n[s]>o(r[A])&&(t.offsets.popper[s]=o(r[A])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!K(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if("string"===typeof r){if(!(r=t.instance.popper.querySelector(r)))return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],o=t.offsets,A=o.popper,s=o.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",l=c?"Top":"Left",g=l.toLowerCase(),f=c?"left":"top",h=c?"bottom":"right",d=D(r)[u];s[h]-d<A[g]&&(t.offsets.popper[g]-=A[g]-(s[h]-d)),s[g]+d>A[h]&&(t.offsets.popper[g]+=s[g]+d-A[h]),t.offsets.popper=Q(t.offsets.popper);var I=s[g]+s[u]/2-d/2,p=a(t.instance.popper),C=parseFloat(p["margin"+l]),y=parseFloat(p["border"+l+"Width"]),v=I-t.offsets.popper[g]-C-y;return v=Math.max(Math.min(A[u]-d,v),0),t.arrowElement=r,t.offsets.arrow=(b(n={},g,Math.round(v)),b(n,f,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(L(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=x(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],i=G(r),o=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case et:a=[r,i];break;case nt:a=tt(r);break;case rt:a=tt(r,!0);break;default:a=e.behavior}return a.forEach((function(A,s){if(r!==A||a.length===s+1)return t;r=t.placement.split("-")[0],i=G(r);var c=t.offsets.popper,u=t.offsets.reference,l=Math.floor,g="left"===r&&l(c.right)>l(u.left)||"right"===r&&l(c.left)<l(u.right)||"top"===r&&l(c.bottom)>l(u.top)||"bottom"===r&&l(c.top)<l(u.bottom),f=l(c.left)<l(n.left),h=l(c.right)>l(n.right),d=l(c.top)<l(n.top),I=l(c.bottom)>l(n.bottom),p="left"===r&&f||"right"===r&&h||"top"===r&&d||"bottom"===r&&I,C=-1!==["top","bottom"].indexOf(r),y=!!e.flipVariations&&(C&&"start"===o&&f||C&&"end"===o&&h||!C&&"start"===o&&d||!C&&"end"===o&&I),v=!!e.flipVariationsByContent&&(C&&"start"===o&&h||C&&"end"===o&&f||!C&&"start"===o&&I||!C&&"end"===o&&d),B=y||v;(g||p||B)&&(t.flipped=!0,(g||p)&&(r=a[s+1]),B&&(o=function(t){return"end"===t?"start":"start"===t?"end":t}(o)),t.placement=r+(o?"-"+o:""),t.offsets.popper=E({},t.offsets.popper,_(t.instance.popper,t.offsets.reference,t.placement)),t=T(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),A=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(A?i[a?"width":"height"]:0),t.placement=G(e),t.offsets.popper=Q(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!K(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=M(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var n=e.x,r=e.y,i=t.offsets.popper,o=M(t.instance.modifiers,(function(t){return"applyStyle"===t.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:e.gpuAcceleration,A=f(t.instance.popper),s=F(A),c={position:i.position},u=function(t,e){var n=t.offsets,r=n.popper,i=n.reference,o=Math.round,a=Math.floor,A=function(t){return t},s=o(i.width),c=o(r.width),u=-1!==["left","right"].indexOf(t.placement),l=-1!==t.placement.indexOf("-"),g=e?u||l||s%2===c%2?o:a:A,f=e?o:A;return{left:g(s%2===1&&c%2===1&&!l&&e?r.left-1:r.left),top:f(r.top),bottom:f(r.bottom),right:g(r.right)}}(t,window.devicePixelRatio<2||!z),l="bottom"===n?"top":"bottom",g="right"===r?"left":"right",h=V("transform"),d=void 0,I=void 0;if(I="bottom"===l?"HTML"===A.nodeName?-A.clientHeight+u.bottom:-s.height+u.bottom:u.top,d="right"===g?"HTML"===A.nodeName?-A.clientWidth+u.right:-s.width+u.right:u.left,a&&h)c[h]="translate3d("+d+"px, "+I+"px, 0)",c[l]=0,c[g]=0,c.willChange="transform";else{var p="bottom"===l?-1:1,C="right"===g?-1:1;c[l]=I*p,c[g]=d*C,c.willChange=l+", "+g}var y={"x-placement":t.placement};return t.attributes=E({},y,t.attributes),t.styles=E({},c,t.styles),t.arrowStyles=E({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){var e,n;return X(t.instance.popper,t.styles),e=t.instance.popper,n=t.attributes,Object.keys(n).forEach((function(t){!1!==n[t]?e.setAttribute(t,n[t]):e.removeAttribute(t)})),t.arrowElement&&Object.keys(t.arrowStyles).length&&X(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,n,r,i){var o=N(i,e,t,n.positionFixed),a=O(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",a),X(e,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},at=function(){function t(e,n){var r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};B(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=E({},t.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(E({},t.Defaults.modifiers,a.modifiers)).forEach((function(e){r.options.modifiers[e]=E({},t.Defaults.modifiers[e]||{},a.modifiers?a.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return E({name:t},r.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&o(t.onLoad)&&t.onLoad(r.reference,r.popper,r.options,t,r.state)})),this.update();var A=this.options.eventsEnabled;A&&this.enableEventListeners(),this.state.eventsEnabled=A}return m(t,[{key:"update",value:function(){return j.call(this)}},{key:"destroy",value:function(){return Z.call(this)}},{key:"enableEventListeners",value:function(){return J.call(this)}},{key:"disableEventListeners",value:function(){return H.call(this)}}]),t}();at.Utils=("undefined"!==typeof window?window:t).PopperUtils,at.placements=q,at.Defaults=ot,e.a=at}).call(this,n(56))},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{transform:"scale(1.2, 1.2)",d:"M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Settings");e.default=o},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"}),"CloudDownload");e.default=o},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(Object.is(t,e))return!0;if("object"!==typeof t||null===t||"object"!==typeof e||null===e)return!1;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(var r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(e,n[r])||!Object.is(t[n[r]],e[n[r]]))return!1;return!0}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o}));var r=n(0),i=r.createContext();function o(){return r.useContext(i)}e.a=i},,function(t,e,n){var r=n(192),i=n(491),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=A.test(t);return n||s.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function A(t,e,n,r){var i=e&&e.prototype instanceof u?e:u,o=Object.create(i.prototype),a=new m(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var A=y(a,n);if(A){if(A===c)continue;return A}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}t.wrap=A;var c={};function u(){}function l(){}function g(){}var f={};f[i]=function(){return this};var h=Object.getPrototypeOf,d=h&&h(h(b([])));d&&d!==e&&n.call(d,i)&&(f=d);var I=g.prototype=u.prototype=Object.create(f);function p(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function C(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,A){var c=s(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"===typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,A)}),(function(t){r("throw",t,a,A)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,A)}))}A(c.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function y(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,y(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,c;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function v(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function m(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(v,this),this.reset(!0)}function b(t){if(t){var e=t[i];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return l.prototype=I.constructor=g,g.constructor=l,g[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},p(C.prototype),C.prototype[o]=function(){return this},t.AsyncIterator=C,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new C(A(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},p(I),I[a]="Generator",I[i]=function(){return this},I.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=b,m.prototype={constructor:m,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var A=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(A&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(A){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;B(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:b(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r=n(229),i=n(192);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(657),i=n(664),o=n(666),a=n(667),A=n(668);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=A,t.exports=s},function(t,e,n){var r=n(679),i=n(494),o=n(509),a=o&&o.isTypedArray,A=a?i(a):r;t.exports=A},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(533),i=n(680),o=n(345);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){var r;!function(i){var o=/^\s+/,a=/\s+$/,A=0,s=i.round,c=i.min,u=i.max,l=i.random;function g(t,e){if(e=e||{},(t=t||"")instanceof g)return t;if(!(this instanceof g))return new g(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,A=null,s=null,l=!1,g=!1;"string"==typeof t&&(t=function(t){t=t.replace(o,"").replace(a,"").toLowerCase();var e,n=!1;if(U[t])t=U[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:T(e[4]),format:n?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:n?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:T(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==typeof t&&(L(t.r)&&L(t.g)&&L(t.b)?(f=t.r,h=t.g,d=t.b,e={r:255*O(f,255),g:255*O(h,255),b:255*O(d,255)},l=!0,g="%"===String(t.r).substr(-1)?"prgb":"rgb"):L(t.h)&&L(t.s)&&L(t.v)?(r=_(t.s),A=_(t.v),e=function(t,e,n){t=6*O(t,360),e=O(e,100),n=O(n,100);var r=i.floor(t),o=t-r,a=n*(1-e),A=n*(1-o*e),s=n*(1-(1-o)*e),c=r%6;return{r:255*[n,A,a,a,s,n][c],g:255*[s,n,n,A,a,a][c],b:255*[a,a,s,n,n,A][c]}}(t.h,r,A),l=!0,g="hsv"):L(t.h)&&L(t.s)&&L(t.l)&&(r=_(t.s),s=_(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=O(t,360),e=O(e,100),n=O(n,100),0===e)r=i=o=n;else{var A=n<.5?n*(1+e):n+e-n*e,s=2*n-A;r=a(s,A,t+1/3),i=a(s,A,t),o=a(s,A,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,s),l=!0,g="hsl"),t.hasOwnProperty("a")&&(n=t.a));var f,h,d;return n=k(n),{ok:l,format:t.format||g,r:c(255,u(e.r,0)),g:c(255,u(e.g,0)),b:c(255,u(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=s(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=s(this._r)),this._g<1&&(this._g=s(this._g)),this._b<1&&(this._b=s(this._b)),this._ok=n.ok,this._tc_id=A++}function f(t,e,n){t=O(t,255),e=O(e,255),n=O(n,255);var r,i,o=u(t,e,n),a=c(t,e,n),A=(o+a)/2;if(o==a)r=i=0;else{var s=o-a;switch(i=A>.5?s/(2-o-a):s/(o+a),o){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:r,s:i,l:A}}function h(t,e,n){t=O(t,255),e=O(e,255),n=O(n,255);var r,i,o=u(t,e,n),a=c(t,e,n),A=o,s=o-a;if(i=0===o?0:s/o,o==a)r=0;else{switch(o){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:r,s:i,v:A}}function d(t,e,n,r){var i=[G(s(t).toString(16)),G(s(e).toString(16)),G(s(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function I(t,e,n,r){return[G(M(r)),G(s(t).toString(16)),G(s(e).toString(16)),G(s(n).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var n=g(t).toHsl();return n.s-=e/100,n.s=N(n.s),g(n)}function C(t,e){e=0===e?0:e||10;var n=g(t).toHsl();return n.s+=e/100,n.s=N(n.s),g(n)}function y(t){return g(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var n=g(t).toHsl();return n.l+=e/100,n.l=N(n.l),g(n)}function B(t,e){e=0===e?0:e||10;var n=g(t).toRgb();return n.r=u(0,c(255,n.r-s(-e/100*255))),n.g=u(0,c(255,n.g-s(-e/100*255))),n.b=u(0,c(255,n.b-s(-e/100*255))),g(n)}function m(t,e){e=0===e?0:e||10;var n=g(t).toHsl();return n.l-=e/100,n.l=N(n.l),g(n)}function b(t,e){var n=g(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,g(n)}function E(t){var e=g(t).toHsl();return e.h=(e.h+180)%360,g(e)}function Q(t){var e=g(t).toHsl(),n=e.h;return[g(t),g({h:(n+120)%360,s:e.s,l:e.l}),g({h:(n+240)%360,s:e.s,l:e.l})]}function F(t){var e=g(t).toHsl(),n=e.h;return[g(t),g({h:(n+90)%360,s:e.s,l:e.l}),g({h:(n+180)%360,s:e.s,l:e.l}),g({h:(n+270)%360,s:e.s,l:e.l})]}function w(t){var e=g(t).toHsl(),n=e.h;return[g(t),g({h:(n+72)%360,s:e.s,l:e.l}),g({h:(n+216)%360,s:e.s,l:e.l})]}function S(t,e,n){e=e||6,n=n||30;var r=g(t).toHsl(),i=360/n,o=[g(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(g(r));return o}function R(t,e){e=e||6;for(var n=g(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],A=1/e;e--;)a.push(g({h:r,s:i,v:o})),o=(o+A)%1;return a}g.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=k(t),this._roundA=s(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=s(360*t.h),n=s(100*t.s),r=s(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=f(this._r,this._g,this._b),e=s(360*t.h),n=s(100*t.s),r=s(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[G(s(t).toString(16)),G(s(e).toString(16)),G(s(n).toString(16)),G(M(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:s(this._r),g:s(this._g),b:s(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+s(this._r)+", "+s(this._g)+", "+s(this._b)+")":"rgba("+s(this._r)+", "+s(this._g)+", "+s(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:s(100*O(this._r,255))+"%",g:s(100*O(this._g,255))+"%",b:s(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+s(100*O(this._r,255))+"%, "+s(100*O(this._g,255))+"%, "+s(100*O(this._b,255))+"%)":"rgba("+s(100*O(this._r,255))+"%, "+s(100*O(this._g,255))+"%, "+s(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(x[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+I(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=g(t);n="#"+I(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return g(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(B,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(C,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(R,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(Q,arguments)},tetrad:function(){return this._applyCombination(F,arguments)}},g.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:_(t[r]));t=n}return g(t,e)},g.equals=function(t,e){return!(!t||!e)&&g(t).toRgbString()==g(e).toRgbString()},g.random=function(){return g.fromRatio({r:l(),g:l(),b:l()})},g.mix=function(t,e,n){n=0===n?0:n||50;var r=g(t).toRgb(),i=g(e).toRgb(),o=n/100;return g({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},g.readability=function(t,e){var n=g(t),r=g(e);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},g.isReadable=function(t,e,n){var r,i,o=g.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},g.mostReadable=function(t,e,n){var r,i,o,a,A=null,s=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<e.length;c++)(r=g.readability(t,e[c]))>s&&(s=r,A=g(e[c]));return g.isReadable(t,A,{level:o,size:a})||!i?A:(n.includeFallbackColors=!1,g.mostReadable(t,["#fff","#000"],n))};var U=g.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},x=g.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(U);function k(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"===typeof t&&-1!=t.indexOf("%")}(t);return t=c(e,u(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function N(t){return c(1,u(0,t))}function D(t){return parseInt(t,16)}function G(t){return 1==t.length?"0"+t:""+t}function _(t){return t<=1&&(t=100*t+"%"),t}function M(t){return i.round(255*parseFloat(t)).toString(16)}function T(t){return D(t)/255}var j=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function L(t){return!!j.CSS_UNIT.exec(t)}t.exports?t.exports=g:void 0===(r=function(){return g}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(56))},function(t,e,n){"use strict";(function(t){var r=n(55),i=n(457);n.d(e,"a",(function(){return i.a}));var o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(o.global||o.self||o.window).mathgl={config:r.a}}).call(this,n(56))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";(function(e,r){var i;t.exports=Q,Q.ReadableState=E;n(250).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=n(416),A=n(96).Buffer,s=e.Uint8Array||function(){};var c,u=n(586);c=u&&u.debuglog?u.debuglog("stream"):function(){};var l,g,f,h=n(587),d=n(417),I=n(418).getHighWaterMark,p=n(203).codes,C=p.ERR_INVALID_ARG_TYPE,y=p.ERR_STREAM_PUSH_AFTER_EOF,v=p.ERR_METHOD_NOT_IMPLEMENTED,B=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(101)(Q,a);var m=d.errorOrDestroy,b=["error","close","destroy","pause","resume"];function E(t,e,r){i=i||n(204),t=t||{},"boolean"!==typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=I(this,t,"readableHighWaterMark",r),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=n(276).StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function Q(t){if(i=i||n(204),!(this instanceof Q))return new Q(t);var e=this instanceof i;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function F(t,e,n,r,i){c("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,U(t)))}(t,a);else if(i||(o=function(t,e){var n;r=e,A.isBuffer(r)||r instanceof s||"string"===typeof e||void 0===e||t.objectMode||(n=new C("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(a,e)),o)m(t,o);else if(a.objectMode||e&&e.length>0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===A.prototype||(e=function(t){return A.from(t)}(e)),r)a.endEmitted?m(t,new B):w(t,a,e,!0);else if(a.ended)m(t,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):x(t,a)):w(t,a,e,!1)}else r||(a.reading=!1,x(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function w(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),x(t,e)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),Q.prototype.destroy=d.destroy,Q.prototype._undestroy=d.undestroy,Q.prototype._destroy=function(t,e){e(t)},Q.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"===typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=A.from(t,e),e=""),n=!0),F(this,t,e,!1,n)},Q.prototype.unshift=function(t){return F(this,t,null,!0,!1)},Q.prototype.isPaused=function(){return!1===this._readableState.flowing},Q.prototype.setEncoding=function(t){l||(l=n(276).StringDecoder);var e=new l(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(U,t))}function U(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,G(t)}function x(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(k,t,e))}function k(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(c("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function O(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),G(t),e.flowing&&!e.reading&&t.read(0)}function G(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function _(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function M(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(T,e,t))}function T(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function j(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}Q.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):R(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&M(this),null;var r,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(n,e))),null===(r=t>0?_(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&M(this)),null!==r&&this.emit("data",r),r},Q.prototype._read=function(t){m(this,new v("_read()"))},Q.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?s:I;function A(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",A),n.removeListener("end",s),n.removeListener("end",I),n.removeListener("data",g),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function s(){c("onend"),t.end()}i.endEmitted?r.nextTick(a):n.once("end",a),t.on("unpipe",A);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,G(t))}}(n);t.on("drain",u);var l=!1;function g(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){c("onerror",e),I(),t.removeListener("error",f),0===o(t,"error")&&m(t,e)}function h(){t.removeListener("finish",d),I()}function d(){c("onfinish"),t.removeListener("close",h),I()}function I(){c("unpipe"),n.unpipe(t)}return n.on("data",g),function(t,e,n){if("function"===typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",h),t.once("finish",d),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},Q.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=j(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},Q.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(N,this))),n},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},Q.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},Q.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},Q.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Q.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!==i&&void 0!==i)&&((n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"===typeof Symbol&&(Q.prototype[Symbol.asyncIterator]=function(){return void 0===g&&(g=n(590)),g(this)}),Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),Q._fromList=_,Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(Q.from=function(t,e){return void 0===f&&(f=n(591)),f(Q,t,e)})}).call(this,n(56),n(68))},function(t,e,n){t.exports=n(250).EventEmitter},function(t,e,n){"use strict";(function(e){function n(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,o){var a=this,A=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return A||s?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(r,a):(a._writableState.errorEmitted=!0,e.nextTick(n,a,t)):e.nextTick(n,a,t):o?(e.nextTick(r,a),o(t)):e.nextTick(r,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,n(68))},function(t,e,n){"use strict";var r=n(203).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var o=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=Q,Q.WritableState=E;var a={deprecate:n(420)},A=n(416),s=n(96).Buffer,c=e.Uint8Array||function(){};var u,l=n(417),g=n(418).getHighWaterMark,f=n(203).codes,h=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,I=f.ERR_MULTIPLE_CALLBACK,p=f.ERR_STREAM_CANNOT_PIPE,C=f.ERR_STREAM_DESTROYED,y=f.ERR_STREAM_NULL_VALUES,v=f.ERR_STREAM_WRITE_AFTER_END,B=f.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;function b(){}function E(t,e,a){o=o||n(204),t=t||{},"boolean"!==typeof a&&(a=e instanceof o),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=g(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var A=!1===t.decodeStrings;this.decodeStrings=!A,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,o=n.writecb;if("function"!==typeof o)throw new I;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,o){--e.pendingcb,n?(r.nextTick(o,i),r.nextTick(x,t,e),t._writableState.errorEmitted=!0,m(t,i)):(o(i),t._writableState.errorEmitted=!0,m(t,i),x(t,e))}(t,n,i,e,o);else{var a=R(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||S(t,n),i?r.nextTick(w,t,n,a,o):w(t,n,a,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function Q(t){var e=this instanceof(o=o||n(204));if(!e&&!u.call(Q,this))return new Q(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),A.call(this)}function F(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new C("write")):n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),x(t,e)}function S(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,o=new Array(r),a=e.corkedRequestsFree;a.entry=n;for(var A=0,s=!0;n;)o[A]=n,n.isBuf||(s=!1),n=n.next,A+=1;o.allBuffers=s,F(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,l=n.callback;if(F(t,e,!1,e.objectMode?1:c.length,c,u,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function U(t,e){t._final((function(n){e.pendingcb--,n&&m(t,n),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var n=R(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!==typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(U,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}n(101)(Q,A),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(Q,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===Q&&(t&&t._writableState instanceof E)}})):u=function(t){return t instanceof this},Q.prototype.pipe=function(){m(this,new p)},Q.prototype.write=function(t,e,n){var i,o=this._writableState,a=!1,A=!o.objectMode&&(i=t,s.isBuffer(i)||i instanceof c);return A&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"===typeof e&&(n=e,e=null),A?e="buffer":e||(e=o.defaultEncoding),"function"!==typeof n&&(n=b),o.ending?function(t,e){var n=new v;m(t,n),r.nextTick(e,n)}(this,n):(A||function(t,e,n,i){var o;return null===n?o=new y:"string"===typeof n||e.objectMode||(o=new h("chunk",["string","Buffer"],n)),!o||(m(t,o),r.nextTick(i,o),!1)}(this,o,t,n))&&(o.pendingcb++,a=function(t,e,n,r,i,o){if(!n){var a=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=s.from(e,n));return e}(e,r,i);r!==a&&(n=!0,i="buffer",r=a)}var A=e.objectMode?1:r.length;e.length+=A;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else F(t,e,!1,A,r,i,o);return c}(this,o,A,t,e,n)),a},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||S(this,t))},Q.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new B(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(Q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Q.prototype._write=function(t,e,n){n(new d("_write()"))},Q.prototype._writev=null,Q.prototype.end=function(t,e,n){var i=this._writableState;return"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,x(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(Q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),Q.prototype.destroy=l.destroy,Q.prototype._undestroy=l.undestroy,Q.prototype._destroy=function(t,e){e(t)}}).call(this,n(56),n(68))},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,n(56))},function(t,e,n){"use strict";t.exports=u;var r=n(203).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,A=r.ERR_TRANSFORM_WITH_LENGTH_0,s=n(204);function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);s.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"===typeof t.transform&&(this._transform=t.transform),"function"===typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function l(){var t=this;"function"!==typeof this._flush||this._readableState.destroyed?g(this,null,null):this._flush((function(e,n){g(t,e,n)}))}function g(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new A;if(t._transformState.transforming)throw new a;return t.push(null)}n(101)(u,s),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Q}));var r=n(16),i=n(12),o=n(5),a=n.n(o),A=n(162),s=n.n(A),c=n(245),u=n(167),l=n(468),g=n(104),f=n(246),h=n(359),d=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(e){o(e)}}function A(t){try{s(r.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,A)}s((r=r.apply(t,e||[])).next())}))},I=s()("threads:master:messages"),p=s()("threads:master:spawn"),C=s()("threads:master:thread-utils"),y="undefined"!==typeof t&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).THREADS_WORKER_INIT_TIMEOUT,10):1e4;function v(t,e,n){return d(this,void 0,void 0,a.a.mark((function r(){var i,o,A;return a.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=new Promise((function(t,r){i=setTimeout((function(){return r(Error(n))}),e)})),r.next=3,Promise.race([t,o]);case 3:return A=r.sent,clearTimeout(i),r.abrupt("return",A);case 6:case"end":return r.stop()}}),r)})))}function B(t){return new Promise((function(e,n){t.addEventListener("message",(function r(i){var o;I("Message from worker before finishing initialization:",i.data),(o=i.data)&&"init"===o.type?(t.removeEventListener("message",r),e(i.data)):function(t){return t&&"uncaughtError"===t.type}(i.data)&&(t.removeEventListener("message",r),n(Object(u.a)(i.data.error)))}))}))}function m(t,e){return new c.a((function(n){var r=function(t){var e={type:f.a.message,data:t.data};n.next(e)},i=function(t){C("Unhandled promise rejection event in thread:",t);var e={type:f.a.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r),t.addEventListener("unhandledrejection",i),e.then((function(){var e={type:f.a.termination};t.removeEventListener("message",r),t.removeEventListener("unhandledrejection",i),n.next(e),n.complete()}))}))}function b(t){var e=this,n=Object(l.a)(),r=Object(i.a)(n,2),o=r[0],A=r[1];return{terminate:function(){return d(e,void 0,void 0,a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C("Terminating worker"),e.next=3,t.terminate();case 3:A();case 4:case"end":return e.stop()}}),e)})))},termination:o}}function E(t,e,n,i){var o,a=n.filter((function(t){return t.type===f.a.internalError})).map((function(t){return t.error}));return Object.assign(t,(o={},Object(r.a)(o,g.a,a),Object(r.a)(o,g.b,n),Object(r.a)(o,g.c,i),Object(r.a)(o,g.e,e),o))}function Q(t,e){return d(this,void 0,void 0,a.a.mark((function n(){var r,i,o,A,s,c,u,l,g;return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return p("Initializing new thread"),n.next=3,v(B(t),e&&e.timeout?e.timeout:y,"Timeout: Did not receive an init message from worker after ".concat(y,"ms. Make sure the worker calls expose()."));case 3:if(r=n.sent,i=r.exposed,o=b(t),A=o.termination,s=o.terminate,c=m(t,A),"function"!==i.type){n.next=12;break}return u=Object(h.a)(t),n.abrupt("return",E(u,t,c,s));case 12:if("module"!==i.type){n.next=17;break}return l=Object(h.b)(t,i.methods),n.abrupt("return",E(l,t,c,s));case 17:throw g=i.type,Error("Worker init message states unexpected type of expose(): ".concat(g));case 19:case"end":return n.stop()}}),n)})))}}).call(this,n(68))},function(t,e,n){(function(t){e.fetch=A(t.fetch)&&A(t.ReadableStream),e.writableStream=A(t.WritableStream),e.abortController=A(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(s){}var n;function r(){if(void 0!==n)return n;if(t.XMLHttpRequest){n=new t.XMLHttpRequest;try{n.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(s){n=null}}else n=null;return n}function i(t){var e=r();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(s){}return!1}var o="undefined"!==typeof t.ArrayBuffer,a=o&&A(t.ArrayBuffer.prototype.slice);function A(t){return"function"===typeof t}e.arraybuffer=e.fetch||o&&i("arraybuffer"),e.msstream=!e.fetch&&a&&i("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&i("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!r()&&A(r().overrideMimeType),e.vbArray=A(t.VBArray),n=null}).call(this,n(56))},function(t,e,n){(function(t,r,i){var o=n(424),a=n(101),A=n(426),s=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,n,a,s){var c=this;if(A.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){t.nextTick((function(){c.emit("close")}))})),"fetch"===a){if(c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach((function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)})),o.writableStream){var u=new WritableStream({write:function(t){return new Promise((function(e,n){c._destroyed?n():c.push(new r(t))?e():c._resumeFetch=e}))},close:function(){i.clearTimeout(s),c._destroyed||c.push(null)},abort:function(t){c._destroyed||c.emit("error",t)}});try{return void n.body.pipeTo(u).catch((function(t){i.clearTimeout(s),c._destroyed||c.emit("error",t)}))}catch(h){}}var l=n.body.getReader();!function t(){l.read().then((function(e){if(!c._destroyed){if(e.done)return i.clearTimeout(s),void c.push(null);c.push(new r(e.value)),t()}})).catch((function(t){i.clearTimeout(s),c._destroyed||c.emit("error",t)}))}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(e[2])):void 0!==c.headers[n]?c.headers[n]+=", "+e[2]:c.headers[n]=e[2],c.rawHeaders.push(e[1],e[2])}})),c._charset="x-user-defined",!o.overrideMimeType){var g=c.rawHeaders["mime-type"];if(g){var f=g.match(/;\s*charset=([^;])(;|$)/);f&&(c._charset=f[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};a(c,A.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text:vbarray":if(e.readyState!==s.DONE)break;try{n=new i.VBArray(e.responseBody).toArray()}catch(u){}if(null!==n){t.push(new r(n));break}case"text":try{n=e.responseText}catch(u){t._mode="text:vbarray";break}if(n.length>t._pos){var o=n.substr(t._pos);if("x-user-defined"===t._charset){for(var a=new r(o.length),A=0;A<o.length;A++)a[A]=255&o.charCodeAt(A);t.push(a)}else t.push(o,t._charset);t._pos=n.length}break;case"arraybuffer":if(e.readyState!==s.DONE||!e.response)break;n=e.response,t.push(new r(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=e.response,e.readyState!==s.LOADING||!n)break;t.push(new r(new Uint8Array(n)));break;case"ms-stream":if(n=e.response,e.readyState!==s.LOADING)break;var c=new i.MSStreamReader;c.onprogress=function(){c.result.byteLength>t._pos&&(t.push(new r(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(n)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,n(68),n(96).Buffer,n(56))},function(t,e,n){(e=t.exports=n(427)).Stream=e,e.Readable=e,e.Writable=n(430),e.Duplex=n(205),e.Transform=n(431),e.PassThrough=n(616)},function(t,e,n){"use strict";(function(e,r){var i=n(278);t.exports=y;var o,a=n(414);y.ReadableState=C;n(250).EventEmitter;var A=function(t,e){return t.listeners(e).length},s=n(428),c=n(342).Buffer,u=e.Uint8Array||function(){};var l=Object.create(n(237));l.inherits=n(101);var g=n(611),f=void 0;f=g&&g.debuglog?g.debuglog("stream"):function(){};var h,d=n(612),I=n(429);l.inherits(y,s);var p=["error","close","destroy","pause","resume"];function C(t,e){t=t||{};var r=e instanceof(o=o||n(205));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,A=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:A,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(276).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function y(t){if(o=o||n(205),!(this instanceof y))return new y(t);this._readableState=new C(t,this),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function v(t,e,n,r,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,b(t)}(t,a)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof u||"string"===typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):B(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(e=a.decoder.write(e),a.objectMode||0!==e.length?B(t,a,e,!1):Q(t,a)):B(t,a,e,!1))):r||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function B(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&b(t)),Q(t,e)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),y.prototype.destroy=I.destroy,y.prototype._undestroy=I.undestroy,y.prototype._destroy=function(t,e){this.push(null),e(t)},y.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"===typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=c.from(t,e),e=""),n=!0),v(this,t,e,!1,n)},y.prototype.unshift=function(t){return v(this,t,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(t){return h||(h=n(276).StringDecoder),this._readableState.decoder=new h(t),this._readableState.encoding=t,this};function m(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function b(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(E,t):E(t))}function E(t){f("emit readable"),t.emit("readable"),R(t)}function Q(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(F,t,e))}function F(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(f("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function w(t){f("readable nexttick read 0"),t.read(0)}function S(t,e){e.reading||(f("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function U(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;t-=i.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,a),0===(t-=a)){a===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function x(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(k,e,t))}function k(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}y.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?x(this):b(this),null;if(0===(t=m(t,e))&&e.ended)return 0===e.length&&x(this),null;var r,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",i=!0),e.ended||e.reading?f("reading or ended",i=!1):i&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=m(n,e))),null===(r=t>0?U(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&x(this)),null!==r&&this.emit("data",r),r},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?u:y;function c(e,r){f("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),t.removeListener("close",p),t.removeListener("finish",C),t.removeListener("drain",l),t.removeListener("error",I),t.removeListener("unpipe",c),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",d),g=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function u(){f("onend"),t.end()}o.endEmitted?i.nextTick(s):n.once("end",s),t.on("unpipe",c);var l=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&A(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",l);var g=!1;var h=!1;function d(e){f("ondata"),h=!1,!1!==t.write(e)||h||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==O(o.pipes,t))&&!g&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function I(e){f("onerror",e),y(),t.removeListener("error",I),0===A(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",C),y()}function C(){f("onfinish"),t.removeListener("close",p),y()}function y(){f("unpipe"),n.unpipe(t)}return n.on("data",d),function(t,e,n){if("function"===typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",I),t.once("close",p),t.once("finish",C),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=O(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},y.prototype.on=function(t,e){var n=s.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&b(this):i.nextTick(w,this))}return n},y.prototype.addListener=y.prototype.on,y.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(S,t,e))}(this,t)),this},y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},y.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(f("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!==i&&void 0!==i)&&((n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<p.length;o++)t.on(p[o],this.emit.bind(this,p[o]));return this._read=function(e){f("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),y._fromList=U}).call(this,n(56),n(68))},function(t,e,n){t.exports=n(250).EventEmitter},function(t,e,n){"use strict";var r=n(278);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){"use strict";(function(e,r,i){var o=n(278);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=C;var A,s=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;C.WritableState=p;var c=Object.create(n(237));c.inherits=n(101);var u={deprecate:n(420)},l=n(428),g=n(342).Buffer,f=i.Uint8Array||function(){};var h,d=n(429);function I(){}function p(t,e){A=A||n(205),t=t||{};var r=e instanceof A;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),E(t,e))}(t,n,r,e,i);else{var a=m(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||B(t,n),r?s(v,t,n,a,i):v(t,n,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function C(t){if(A=A||n(205),!h.call(C,this)&&!(this instanceof A))return new C(t);this._writableState=new p(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),l.call(this)}function y(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function v(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),E(t,e)}function B(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var A=0,s=!0;n;)i[A]=n,n.isBuf||(s=!1),n=n.next,A+=1;i.allBuffers=s,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,l=n.callback;if(y(t,e,!1,e.objectMode?1:c.length,c,u,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function m(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function b(t,e){t._final((function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),E(t,e)}))}function E(t,e){var n=m(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"===typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(b,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(C,l),p.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(p.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===C&&(t&&t._writableState instanceof p)}})):h=function(t){return t instanceof this},C.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},C.prototype.write=function(t,e,n){var r,i=this._writableState,a=!1,A=!i.objectMode&&(r=t,g.isBuffer(r)||r instanceof f);return A&&!g.isBuffer(t)&&(t=function(t){return g.from(t)}(t)),"function"===typeof e&&(n=e,e=null),A?e="buffer":e||(e=i.defaultEncoding),"function"!==typeof n&&(n=I),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(A||function(t,e,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,t,n))&&(i.pendingcb++,a=function(t,e,n,r,i,o){if(!n){var a=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=g.from(e,n));return e}(e,r,i);r!==a&&(n=!0,i="buffer",r=a)}var A=e.objectMode?1:r.length;e.length+=A;var s=e.length<e.highWaterMark;s||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else y(t,e,!1,A,r,i,o);return s}(this,i,A,t,e,n)),a},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||B(this,t))},C.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},C.prototype._writev=null,C.prototype.end=function(t,e,n){var r=this._writableState;"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,E(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(C.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),C.prototype.destroy=d.destroy,C.prototype._undestroy=d.undestroy,C.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(68),n(614).setImmediate,n(56))},function(t,e,n){"use strict";t.exports=a;var r=n(205),i=Object.create(n(237));function o(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);r.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"===typeof t.transform&&(this._transform=t.transform),"function"===typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",A)}function A(){var t=this;"function"===typeof this._flush?this._flush((function(e,n){s(t,e,n)})):s(this,null,null)}function s(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=n(101),i.inherits(a,r),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},a.prototype._destroy=function(t,e){var n=this;r.prototype._destroy.call(this,t,(function(t){e(t),n.emit("close")}))}},function(t,e,n){"use strict";(function(t){var e=n(472),r=n(41),i=n(221);function o(t,e){var n=e.extension,o=e.target,a=e.target2,A=i.b[n];Object(r.a)(A);for(var s=A.meta,c=(void 0===s?{}:s).suffix,u=void 0===c?"":c,l=t.getExtension(n),g=function(){var e=h[f],n="".concat(e).concat(u),r=null;"meta"===e||"function"===typeof t[e]||(l&&"function"===typeof l[n]?r=function(){return l[n].apply(l,arguments)}:"function"===typeof A[e]&&(r=A[e].bind(o))),r&&(o[e]=r,a[e]=r)},f=0,h=Object.keys(A);f<h.length;f++)g()}("undefined"!==typeof t?t:window).polyfillContext=function(t){return t.luma=t.luma||{},t.luma.polyfilled||(Object(e.a)(t),function(t){t.luma.extensions={};var e=t.getSupportedExtensions()||[],n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var A=o.value;t.luma[A]=t.getExtension(A)}}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(t),function(t,e){var n=!0,r=!1,i=void 0;try{for(var a,A=Object.getOwnPropertyNames(e)[Symbol.iterator]();!(n=(a=A.next()).done);n=!0){var s=a.value;"overrides"!==s&&o(t,{extension:s,target:t.luma,target2:t})}}catch(c){r=!0,i=c}finally{try{n||null==A.return||A.return()}finally{if(r)throw i}}}(t,i.b),function(t,e){var n=e.target,r=e.target2;Object.keys(i.a).forEach((function(e){if("function"===typeof i.a[e]){var o=t[e]?t[e].bind(t):function(){},a=i.a[e].bind(null,t,o);n[e]=a,r[e]=a}}))}(t,{target:t.luma,target2:t}),t.luma.polyfilled=!0),t}}).call(this,n(56))},function(t,e,n){"use strict";(function(t,r){var i=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var o=i(n(266)),a={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t,document:"undefined"!==typeof document&&document,process:"object"===("undefined"===typeof r?"undefined":(0,o.default)(r))&&r},A=a.self||a.window||a.global;e.self=A;var s=a.window||a.self||a.global;e.window=s;var c=a.global||a.self||a.window;e.global=c;var u=a.document||{};e.document=u;var l=a.process||{};e.process=l;var g=console;e.console=g}).call(this,n(56),n(68))},function(t,e,n){"use strict";(function(t){var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a,e.isBrowserMainThread=function(){return a()&&"undefined"!==typeof document};var i=r(n(266)),o=r(n(343));function a(){return!("object"===("undefined"===typeof t?"undefined":(0,i.default)(t))&&"[object process]"===String(t)&&!t.browser)||(0,o.default)()}}).call(this,n(68))},function(t,e,n){"use strict";var r=n(179);e.a={name:"project32",dependencies:[r.a],vs:"\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n  vec3 projectedPosition = project_position(position, position64Low);\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    // offset is specified as ENU\n    // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n    mat3 rotation = project_get_orientation_matrix(projectedPosition);\n    offset = rotation * offset;\n  }\n  commonPosition = vec4(projectedPosition + offset, 1.0);\n  return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset\n) {\n  vec4 commonPosition;\n  return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},function(t,e,n){"use strict";var r=n(700);e.a=Object.assign({inject:{"vs:DECKGL_FILTER_COLOR":"\n    picking_setPickingColor(geometry.pickingColor);\n    // for picking depth values\n    picking_setPickingAttribute(geometry.position.z);\n    ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n    // use highlight color if this fragment belongs to the selected object.\n    color = picking_filterHighlightColor(color);\n\n    // use picking color if rendering to picking FBO.\n    color = picking_filterPickingColor(color);\n      "}}},r.a)},function(t,e,n){"use strict";(function(t){var r=n(38),i=n(438);n.d(e,"b",(function(){return i.a}));var o=n(285);n.d(e,"c",(function(){return o.a}));var a=n(458);n.d(e,"a",(function(){return a.a})),n.d(e,"f",(function(){return r.d})),n.d(e,"e",(function(){return r.a})),n.d(e,"g",(function(){return r.g}));var A=n(439);n.d(e,"d",(function(){return A.a}));var s={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(s.global||s.self||s.window).mathgl={config:r.b}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(291),c=n(38),u=n(62),l=n(36),g=n(163);function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var h=function(t){Object(o.a)(n,t);var e=f(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(r.a)(this,n),t=e.call(this,2),Object(c.f)(i)&&1===arguments.length?t.copy(i):(c.b.debug&&(Object(u.a)(i),Object(u.a)(o)),t[0]=i,t[1]=o),t}return Object(i.a)(n,[{key:"set",value:function(t,e){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return c.b.debug&&(Object(u.a)(t.x),Object(u.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return l.j(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(g.a)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return l.i(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return l.h(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return l.g(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 2}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(17),i=n(3),o=n(2),a=n(38),A=n(285),s=n(22),c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.phi,r=void 0===n?0:n,o=e.theta,a=void 0===o?0:o,A=e.radius,s=void 0===A?1:A,c=e.bearing,u=void 0===c?void 0:c,l=e.pitch,g=void 0===l?void 0:l,f=e.altitude,h=void 0===f?void 0:f,d=e.radiusScale,I=void 0===d?6371e3:d;Object(i.a)(this,t),this.phi=r,this.theta=a,this.radius=s||h||1,this.radiusScale=I||1,void 0!==u&&(this.bearing=u),void 0!==g&&(this.pitch=g),this.check()}return Object(o.a)(t,[{key:"toString",value:function(){return this.formatString(a.b)}},{key:"formatString",value:function(t){var e=t.printTypes,n=void 0!==e&&e,r=a.e;return"".concat(n?"Spherical":"","[rho:").concat(r(this.radius),",theta:").concat(r(this.theta),",phi:").concat(r(this.phi),"]")}},{key:"equals",value:function(t){return Object(a.d)(this.radius,t.radius)&&Object(a.d)(this.theta,t.theta)&&Object(a.d)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"set",value:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this.check()}},{key:"clone",value:function(){return(new t).copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];this.radius=1+o/this.radiusScale,this.phi=Object(a.h)(i),this.theta=Object(a.h)(n)}},{key:"fromVector3",value:function(t){return this.radius=s.g(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(Object(a.a)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new A.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}},{key:"check",value:function(){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(){return 180-Object(a.c)(this.phi)},set:function(t){this.phi=Math.PI-Object(a.h)(t)}},{key:"pitch",get:function(){return Object(a.c)(this.theta)},set:function(t){this.theta=Object(a.h)(t)}},{key:"longitude",get:function(){return Object(a.c)(this.phi)}},{key:"latitude",get:function(){return Object(a.c)(this.theta)}},{key:"lng",get:function(){return Object(a.c)(this.phi)}},{key:"lat",get:function(){return Object(a.c)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),t}()},function(t,e,n){"use strict";(function(t){var r=n(140),i=n(441);n.d(e,"d",(function(){return i.a}));var o=n(178);n.d(e,"e",(function(){return o.a}));var a=n(442);n.d(e,"f",(function(){return a.a}));var A=n(443);n.d(e,"a",(function(){return A.a}));var s=n(213);n.d(e,"b",(function(){return s.a}));var c=n(240);n.d(e,"c",(function(){return c.a}));var u=n(31);n.d(e,"t",(function(){return u.f})),n.d(e,"u",(function(){return u.g})),n.d(e,"z",(function(){return u.l})),n.d(e,"A",(function(){return u.m})),n.d(e,"s",(function(){return u.e})),n.d(e,"x",(function(){return u.j})),n.d(e,"y",(function(){return u.k})),n.d(e,"G",(function(){return u.s})),n.d(e,"F",(function(){return u.r})),n.d(e,"C",(function(){return u.o})),n.d(e,"w",(function(){return u.i})),n.d(e,"D",(function(){return u.p})),n.d(e,"v",(function(){return u.h})),n.d(e,"E",(function(){return u.q})),n.d(e,"n",(function(){return u.b})),n.d(e,"m",(function(){return u.a})),n.d(e,"p",(function(){return u.c})),n.d(e,"r",(function(){return u.d})),n.d(e,"B",(function(){return u.n})),n.d(e,"l",(function(){return u.t}));var l=n(35);n.d(e,"q",(function(){return l.a}));var g=n(444);n.d(e,"h",(function(){return g.a}));var f=n(445);n.d(e,"k",(function(){return f.a}));var h=n(446);n.d(e,"j",(function(){return h.a}));var d=n(214);n.d(e,"g",(function(){return d.a}));var I=n(447);n.d(e,"i",(function(){return I.a}));var p=n(135);n.d(e,"o",(function(){return p.a}));var C={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(C.global||C.self||C.window).mathgl={config:r.config}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(212),c=n(31),u=n(35),l=n(36),g=n(103),f=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(r.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,2)),Object(c.m)(n)&&1===arguments.length?t.copy(n):(c.f.debug&&(Object(u.a)(n),Object(u.a)(i)),t[0]=n,t[1]=i),t}return Object(A.a)(e,t),Object(i.a)(e,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return c.f.debug&&(Object(u.a)(t.x),Object(u.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return l.j(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(g.a)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return l.i(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return l.h(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return l.g(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 2}}]),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(3),i=n(2),o=n(8),a=n(6),A=n(7),s=n(212),c=n(31),u=n(35),l=n(22),g=n(103),f=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(r.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,-0,-0,-0,-0)),Object(c.m)(n)&&1===arguments.length?t.copy(n):(c.f.debug&&(Object(u.a)(n),Object(u.a)(i),Object(u.a)(A),Object(u.a)(s)),t[0]=n,t[1]=i,t[2]=A,t[3]=s),t}return Object(A.a)(e,t),Object(i.a)(e,[{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"fromObject",value:function(t){return c.f.debug&&(Object(u.a)(t.x),Object(u.a)(t.y),Object(u.a)(t.z),Object(u.a)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}},{key:"transform",value:function(t){return l.q(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Object(g.e)(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Object(g.d)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return l.r(this,this,t),this.check()}},{key:"applyMatrix4",value:function(t){return t.transform(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(t){return this[2]=Object(u.a)(t)}},{key:"w",get:function(){return this[3]},set:function(t){return this[3]=Object(u.a)(t)}}]),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var r=n(3),i=n(8),o=n(6),a=n(2),A=n(7),s=n(293),c=n(35),u=n(103),l=n(48),g=n(36),f=n(22),h=Object.freeze([1,0,0,0,1,0,0,0,1]),d=Object.freeze([0,0,0,0,0,0,0,0,0]),I=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),p={},C=function(t){function e(t){var n;return Object(r.a)(this,e),n=Object(i.a)(this,Object(o.a)(e).call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0)),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Object(A.a)(e,t),Object(a.a)(e,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return I}}],[{key:"IDENTITY",get:function(){return p.IDENTITY=p.IDENTITY||Object.freeze(new e(h)),p.IDENTITY}},{key:"ZERO",get:function(){return p.ZERO=p.ZERO||Object.freeze(new e(d)),p.ZERO}}]),Object(a.a)(e,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=A,this[6]=n,this[7]=o,this[8]=s,this.check()}},{key:"determinant",value:function(){return l.b(this)}},{key:"identity",value:function(){return this.copy(h)}},{key:"fromQuaternion",value:function(t){return l.c(this,t),this.check()}},{key:"transpose",value:function(){return l.i(this,this),this.check()}},{key:"invert",value:function(){return l.d(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return l.e(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return l.e(this,this,t),this.check()}},{key:"rotate",value:function(t){return l.f(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?l.g(this,this,t):l.g(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return l.h(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=g.i(e||[-0,-0],t,this);break;case 3:e=f.p(e||[-0,-0,-0],t,this);break;case 4:e=Object(u.e)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}}]),e}(s.a)},function(t,e,n){"use strict";e.a={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(17),i=n(3),o=n(2),a=n(31),A=n(178),s=n(22),c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.phi,r=e.theta,o=e.radius,a=e.bearing,A=e.pitch,s=(e.altitude,e.radiusScale),c=void 0===s?6371e3:s;Object(i.a)(this,t),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(r)?(this.phi=n||0,this.theta=r||0):(Number.isFinite(a)||Number.isFinite(A))&&(this.bearing=a||0,this.pitch=A||0),this.radius=o||1,this.radiusScale=c||1,this.check()}return Object(o.a)(t,[{key:"toString",value:function(){return this.formatString(a.f)}},{key:"formatString",value:function(t){var e=t.printTypes,n=(t.printDegrees,a.l);return"".concat(e?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(t){return Object(a.j)(this.radius,t.radius)&&Object(a.j)(this.theta,t.theta)&&Object(a.j)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"set",value:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];this.radius=1+o/this.radiusScale,this.phi=Object(a.o)(i),this.theta=Object(a.o)(n)}},{key:"fromVector3",value:function(t){return this.radius=s.g(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(Object(a.d)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new A.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{key:"check",value:function(){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(){return 180-Object(a.i)(this.phi)},set:function(t){this.phi=Math.PI-Object(a.o)(t)}},{key:"pitch",get:function(){return Object(a.i)(this.theta)},set:function(t){this.theta=Object(a.o)(t)}},{key:"longitude",get:function(){return Object(a.i)(this.phi)}},{key:"latitude",get:function(){return Object(a.i)(this.theta)}},{key:"lng",get:function(){return Object(a.i)(this.phi)}},{key:"lat",get:function(){return Object(a.i)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(2),o=n(213),a=n(178),A=n(214),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,i=void 0===n?0:n,o=e.y,s=void 0===o?0:o,c=e.z,u=void 0===c?0:c,l=e.roll,g=void 0===l?0:l,f=e.pitch,h=void 0===f?0:f,d=e.yaw,I=void 0===d?0:d,p=e.position,C=e.orientation;Object(r.a)(this,t),Array.isArray(p)&&3===p.length?this.position=new a.a(p):this.position=new a.a(i,s,u),Array.isArray(C)&&4===C.length?this.orientation=new A.a(C,C[3]):this.orientation=new A.a(g,h,I,A.a.RollPitchYaw)}return Object(i.a)(t,[{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(t){return!!t&&(this.position.equals(t.position)&&this.orientation.equals(t.orientation))}},{key:"exactEquals",value:function(t){return!!t&&(this.position.exactEquals(t.position)&&this.orientation.exactEquals(t.orientation))}},{key:"getTransformationMatrix",value:function(){var t=Math.sin(this.roll),e=Math.sin(this.pitch),n=Math.sin(this.yaw),r=Math.cos(this.roll),i=Math.cos(this.pitch),a=Math.cos(this.yaw);return(new o.a).setRowMajor(a*i,-n*r+a*e*t,n*t+a*e*r,this.x,n*i,a*r+n*e*t,-a*t+n*e*r,this.y,-e,i*t,i*r,this.z,0,0,0,1)}},{key:"getTransformationMatrixFromPose",value:function(t){return(new o.a).multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return(new o.a).multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}},{key:"x",get:function(){return this.position.x},set:function(t){return this.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){return this.position.y=t}},{key:"z",get:function(){return this.position.z},set:function(t){return this.position.z=t}},{key:"roll",get:function(){return this.orientation.roll},set:function(t){return this.orientation.roll=t}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(t){return this.orientation.pitch=t}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(t){return this.orientation.yaw=t}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(3),i=n(2),o=n(31),a=function(){function t(e){Object(r.a)(this,t),this.points=e,this.isClosed=Object(o.j)(this.points[this.points.length-1],this.points[0]),Object.freeze(this)}return Object(i.a)(t,[{key:"getSignedArea",value:function(){var t=0;return this.forEachSegment((function(e,n){t+=(e[0]+n[0])*(e[1]-n[1])})),t/2}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(t){for(var e=this.points.length,n=0;n<e-1;n++)t(this.points[n],this.points[n+1],n,n+1);this.isClosed||t(this.points[e-1],this.points[0],e-1,0)}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(294),c=n(51),u=n(164),l=n(48),g=n(36),f=n(22);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var d=Object.freeze([1,0,0,0,1,0,0,0,1]),I=Object.freeze([0,0,0,0,0,0,0,0,0]),p=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),C={},y=function(t){Object(o.a)(n,t);var e=h(n);function n(t){var i;return Object(r.a)(this,n),i=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?i.copy(t):i.identity(),i}return Object(i.a)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return p}}],[{key:"IDENTITY",get:function(){return C.IDENTITY=C.IDENTITY||Object.freeze(new n(d)),C.IDENTITY}},{key:"ZERO",get:function(){return C.ZERO=C.ZERO||Object.freeze(new n(I)),C.ZERO}}]),Object(i.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=A,this[6]=n,this[7]=o,this[8]=s,this.check()}},{key:"determinant",value:function(){return l.b(this)}},{key:"identity",value:function(){return this.copy(d)}},{key:"fromQuaternion",value:function(t){return l.c(this,t),this.check()}},{key:"transpose",value:function(){return l.i(this,this),this.check()}},{key:"invert",value:function(){return l.d(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return l.e(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return l.e(this,this,t),this.check()}},{key:"rotate",value:function(t){return l.f(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?l.g(this,this,t):l.g(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return l.h(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=g.i(e||[-0,-0],t,this);break;case 3:e=f.p(e||[-0,-0,-0],t,this);break;case 4:e=Object(u.d)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return Object(c.c)("Matrix3.transformVector"),this.transform(t,e)}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(215),c=n(51),u=n(95),l=n(33),g=n(45);function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var h=[0,0,0,1],d=function(t){Object(o.a)(n,t);var e=f(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0,-0),Array.isArray(i)&&1===arguments.length?t.copy(i):t.set(i,o,a,A),t}return Object(i.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromMatrix3",value:function(t){return l.e(this,t),this.check()}},{key:"identity",value:function(){return l.f(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return l.p(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"len",value:function(){return l.h(this)}},{key:"lengthSquared",value:function(){return l.r(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return l.d(this,t)}},{key:"rotationTo",value:function(t,e){return l.n(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return l.a(this,this,t),this.check()}},{key:"calculateW",value:function(){return l.b(this,this),this.check()}},{key:"conjugate",value:function(){return l.c(this,this),this.check()}},{key:"invert",value:function(){return l.g(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return l.i(this,t,e,n),this.check()}},{key:"multiplyRight",value:function(t,e){return Object(u.a)(!e),l.j(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Object(u.a)(!e),l.j(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return l.k(this,this,t),this.check()}},{key:"rotateY",value:function(t){return l.l(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return l.m(this,this,t),this.check()}},{key:"scale",value:function(t){return l.o(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){switch(arguments.length){case 1:var r=arguments[0],i=r.start;t=void 0===i?h:i,e=r.target,n=r.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],n=o[1],t=this}return l.q(this,t,e,n),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return g.o(e,t,this),Object(c.b)(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(c.a)(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(c.a)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=Object(c.a)(t)}}]),n}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return B}));var r=n(17),i=n(3),o=n(2),a=n(7),A=n(8),s=n(6),c=n(51),u=n(294),l=n(164),g=n(10),f=n(36),h=n(22),d=n(45);function I(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var p=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),C=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),y=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}),v={},B=function(t){Object(a.a)(n,t);var e=I(n);function n(t){var r;return Object(i.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(o.a)(n,[{key:"INDICES",get:function(){return y}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return v.IDENTITY=v.IDENTITY||Object.freeze(new n(p)),v.IDENTITY}},{key:"ZERO",get:function(){return v.ZERO=v.ZERO||Object.freeze(new n(C)),v.ZERO}}]),Object(o.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(p)}},{key:"fromQuaternion",value:function(t){return g.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):g.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],g.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return g.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return g.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return g.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return g.q(this,this),this.check()}},{key:"invert",value:function(){return g.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return g.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return g.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return g.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return g.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return g.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];return this.rotateX(n).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return g.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?g.o(this,this,t):g.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return g.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=d.n(e||[-0,-0,-0,-0],t,this),Object(c.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=f.j(e||[-0,-0],t,this);break;case 3:e=h.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=Object(l.a)(e||[-0,-0],t,this);break;case 3:e=Object(l.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(c.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(c.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(u.a)},function(t,e,n){"use strict";e.a={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(e){}try{return t+""}catch(e){}}return""}},function(t,e,n){var r=n(504),i=n(671),o=n(505);t.exports=function(t,e,n,a,A,s){var c=1&n,u=t.length,l=e.length;if(u!=l&&!(c&&l>u))return!1;var g=s.get(t);if(g&&s.get(e))return g==e;var f=-1,h=!0,d=2&n?new r:void 0;for(s.set(t,e),s.set(e,t);++f<u;){var I=t[f],p=e[f];if(a)var C=c?a(p,I,f,e,t,s):a(I,p,f,t,e,s);if(void 0!==C){if(C)continue;h=!1;break}if(d){if(!i(e,(function(t,e){if(!o(d,e)&&(I===t||A(I,t,n,a,s)))return d.push(e)}))){h=!1;break}}else if(I!==p&&!A(I,p,n,a,s)){h=!1;break}}return s.delete(t),s.delete(e),h}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69),i=n(109);e.default=function(t,e,n,o){void 0===o&&(o={});var a=i.getCoord(t),A=r.degreesToRadians(a[0]),s=r.degreesToRadians(a[1]),c=r.degreesToRadians(n),u=r.lengthToRadians(e,o.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(c)),g=A+Math.atan2(Math.sin(c)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l)),f=r.radiansToDegrees(g),h=r.radiansToDegrees(l);return r.point([f,h],o.properties)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(238);function i(t){return t+3&-4}function o(t,e,n){return Object(r.c)(t,e,n)}function a(t,e,n){var r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{var o=t.byteOffset,a=t.byteLength;r=new Uint8Array(t.buffer,o,a)}return e.set(r,n),n+i(r.byteLength)}},function(t,e,n){"use strict";var r=n(289);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function A(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}var s=n(209);function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Object(s.a)(t,e)}var u=n(242);function l(t,e){return!e||"object"!==Object(u.a)(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=n(124);var h=n(297);function d(t){var e="function"===typeof Map?new Map:void 0;return(d=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Object(h.a)(t,arguments,g(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object(s.a)(r,t)})(t)}var I=n(55),p=n(177);function C(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}var v=function(t){c(n,t);var e=y(n);function n(){return o(this,n),e.apply(this,arguments)}return A(n,[{key:"toString",value:function(){var t="[";if(I.a.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(f.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(function(t){c(n,t);var e=C(n);function n(){return o(this,n),e.apply(this,arguments)}return A(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(I.d)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(I.a)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(I.c)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(I.b)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(I.a.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(p.a)(!1),0}},{key:"RANK",get:function(){return Object(p.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(d(Array)));var B=n(10),m=n(36),b=n(22),E=n(45);function Q(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}n.d(e,"a",(function(){return U}));var F=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),w=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),S=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}),R={},U=function(t){c(n,t);var e=Q(n);function n(t){var r;return o(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return A(n,[{key:"INDICES",get:function(){return S}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return R.IDENTITY=R.IDENTITY||Object.freeze(new n(F)),R.IDENTITY}},{key:"ZERO",get:function(){return R.ZERO=R.ZERO||Object.freeze(new n(w)),R.ZERO}}]),A(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(F)}},{key:"fromQuaternion",value:function(t){return B.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):B.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],B.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return B.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return B.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return B.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return B.q(this,this),this.check()}},{key:"invert",value:function(){return B.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return B.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return B.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return B.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return B.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return B.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=i(t,3),n=e[0],r=e[1],o=e[2];return this.rotateX(n).rotateY(r).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return B.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?B.o(this,this,t):B.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return B.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=E.n(e||[-0,-0,-0,-0],t,this),Object(f.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=m.j(e||[-0,-0],t,this);break;case 3:e=b.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(f.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(f.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(f.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(f.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(f.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(v)},function(t,e,n){"use strict";var r=n(17),i=n(3),o=n(2),a=n(7),A=n(8),s=n(6),c=n(62),u=n(292),l=n(38);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var f=function(t){Object(a.a)(n,t);var e=g(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"toString",value:function(){var t="[";if(l.b.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(c.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(u.a),h=n(163),d=n(10),I=n(36),p=n(22),C=n(45);function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return E}));var v=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),B=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),m=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}),b={},E=function(t){Object(a.a)(n,t);var e=y(n);function n(t){var r;return Object(i.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(o.a)(n,[{key:"INDICES",get:function(){return m}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return b.IDENTITY=b.IDENTITY||Object.freeze(new n(v)),b.IDENTITY}},{key:"ZERO",get:function(){return b.ZERO=b.ZERO||Object.freeze(new n(B)),b.ZERO}}]),Object(o.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(v)}},{key:"fromQuaternion",value:function(t){return d.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):d.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],d.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return d.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return d.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return d.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return d.q(this,this),this.check()}},{key:"invert",value:function(){return d.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return d.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return d.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return d.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return d.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return d.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];return this.rotateX(n).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return d.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?d.o(this,this,t):d.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return d.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=C.n(e||[-0,-0,-0,-0],t,this),Object(c.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=I.j(e||[-0,-0],t,this);break;case 3:e=p.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=Object(h.a)(e||[-0,-0],t,this);break;case 3:e=Object(h.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(c.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(c.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(f)},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(215),c=n(51),u=n(95);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"copy",value:function(t){return Object(u.a)(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(c.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(c.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(c.a)(this[t])}},{key:"setComponent",value:function(t,e){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(c.a)(t)}}]),n}(s.a),f=n(49),h=n(22),d=n(164);function I(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}n.d(e,"a",(function(){return y}));var p=[0,0,0],C={},y=function(t){Object(o.a)(n,t);var e=I(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&Object(f.d)(i)?t.copy(i):(f.a.debug&&(Object(c.a)(i),Object(c.a)(o),Object(c.a)(a)),t[0]=i,t[1]=o,t[2]=a),t}return Object(i.a)(n,null,[{key:"ZERO",get:function(){return C.ZERO=C.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(i.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return f.a.debug&&(Object(c.a)(t.x),Object(c.a)(t.y),Object(c.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return h.a(this,t)}},{key:"cross",value:function(t){return h.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return h.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(d.c)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return h.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Object(d.b)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return h.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(c.a)(t)}}]),n}(g)},function(t,e,n){!function(t){"use strict";function e(t,e){return t>e?1:t<e?-1:0}var n=function(t,n){void 0===t&&(t=e),void 0===n&&(n=!1),this._compare=t,this._root=null,this._size=0,this._noDuplicates=!!n},r={size:{configurable:!0}};function i(t,e,n){null===e?(t.inOut=!1,t.otherInOut=!0):(t.isSubject===e.isSubject?(t.inOut=!e.inOut,t.otherInOut=e.otherInOut):(t.inOut=!e.otherInOut,t.otherInOut=e.isVertical()?!e.inOut:e.inOut),e&&(t.prevInResult=!o(e,n)||e.isVertical()?e.prevInResult:e)),t.inResult=o(t,n)}function o(t,e){switch(t.type){case 0:switch(e){case 0:return!t.otherInOut;case 1:return t.otherInOut;case 2:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case 3:return!0}break;case 2:return 0===e||1===e;case 3:return 2===e;case 1:return!1}return!1}n.prototype.rotateLeft=function(t){var e=t.right;e&&(t.right=e.left,e.left&&(e.left.parent=t),e.parent=t.parent),t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.left=t),t.parent=e},n.prototype.rotateRight=function(t){var e=t.left;e&&(t.left=e.right,e.right&&(e.right.parent=t),e.parent=t.parent),t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.right=t),t.parent=e},n.prototype._splay=function(t){for(;t.parent;){var e=t.parent;e.parent?e.left===t&&e.parent.left===e?(this.rotateRight(e.parent),this.rotateRight(e)):e.right===t&&e.parent.right===e?(this.rotateLeft(e.parent),this.rotateLeft(e)):e.left===t&&e.parent.right===e?(this.rotateRight(e),this.rotateLeft(e)):(this.rotateLeft(e),this.rotateRight(e)):e.left===t?this.rotateRight(e):this.rotateLeft(e)}},n.prototype.splay=function(t){for(var e,n,r,i,o;t.parent;)(n=(e=t.parent).parent)&&n.parent?((r=n.parent).left===n?r.left=t:r.right=t,t.parent=r):(t.parent=null,this._root=t),i=t.left,o=t.right,t===e.left?(n&&(n.left===e?(e.right?(n.left=e.right,n.left.parent=n):n.left=null,e.right=n,n.parent=e):(i?(n.right=i,i.parent=n):n.right=null,t.left=n,n.parent=t)),o?(e.left=o,o.parent=e):e.left=null,t.right=e,e.parent=t):(n&&(n.right===e?(e.left?(n.right=e.left,n.right.parent=n):n.right=null,e.left=n,n.parent=e):(o?(n.left=o,o.parent=n):n.left=null,t.right=n,n.parent=t)),i?(e.right=i,i.parent=e):e.right=null,t.left=e,e.parent=t)},n.prototype.replace=function(t,e){t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.parent=t.parent)},n.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.insert=function(t,e){var n=this._root,r=null,i=this._compare;if(this._noDuplicates)for(;n;){if(r=n,0===i(n.key,t))return;n=i(n.key,t)<0?n.right:n.left}else for(;n;)r=n,n=i(n.key,t)<0?n.right:n.left;return n={key:t,data:e,left:null,right:null,parent:r},r?i(r.key,n.key)<0?r.right=n:r.left=n:this._root=n,this.splay(n),this._size++,n},n.prototype.find=function(t){for(var e=this._root,n=this._compare;e;){var r=n(e.key,t);if(r<0)e=e.right;else{if(!(r>0))return e;e=e.left}}return null},n.prototype.contains=function(t){for(var e=this._root,n=this._compare;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},n.prototype.remove=function(t){var e=this.find(t);if(!e)return!1;if(this.splay(e),e.left)if(e.right){var n=this.minNode(e.right);n.parent!==e&&(this.replace(n,n.right),n.right=e.right,n.right.parent=n),this.replace(e,n),n.left=e.left,n.left.parent=n}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},n.prototype.removeNode=function(t){if(!t)return!1;if(this.splay(t),t.left)if(t.right){var e=this.minNode(t.right);e.parent!==t&&(this.replace(e,e.right),e.right=t.right,e.right.parent=e),this.replace(t,e),e.left=t.left,e.left.parent=e}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0},n.prototype.erase=function(t){var e=this.find(t);if(e){this.splay(e);var n=e.left,r=e.right,i=null;n&&(n.parent=null,i=this.maxNode(n),this.splay(i),this._root=i),r&&(n?i.right=r:this._root=r,r.parent=i),this._size--}},n.prototype.pop=function(){var t=this._root,e=null;if(t){for(;t.left;)t=t.left;e={key:t.key,data:t.data},this.remove(t.key)}return e},n.prototype.next=function(t){var e=t;if(e)if(e.right)for(e=e.right;e&&e.left;)e=e.left;else for(e=t.parent;e&&e.right===t;)t=e,e=e.parent;return e},n.prototype.prev=function(t){var e=t;if(e)if(e.left)for(e=e.left;e&&e.right;)e=e.right;else for(e=t.parent;e&&e.left===t;)t=e,e=e.parent;return e},n.prototype.forEach=function(t){for(var e=this._root,n=[],r=!1,i=0;!r;)e?(n.push(e),e=e.left):n.length>0?(t(e=n.pop(),i++),e=e.right):r=!0;return this},n.prototype.range=function(t,e,n,r){for(var i=[],o=this._compare,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this},n.prototype.keys=function(){for(var t=this._root,e=[],n=[],r=!1;!r;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),n.push(t.key),t=t.right):r=!0;return n},n.prototype.values=function(){for(var t=this._root,e=[],n=[],r=!1;!r;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),n.push(t.data),t=t.right):r=!0;return n},n.prototype.at=function(t){for(var e=this._root,n=[],r=!1,i=0;!r;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.load=function(t,e,n){if(void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===n&&(n=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var r=t.length;return n&&function t(e,n,r,i,o){if(!(r>=i)){for(var a=e[r+i>>1],A=r-1,s=i+1;;){do{A++}while(o(e[A],a)<0);do{s--}while(o(e[s],a)>0);if(A>=s)break;var c=e[A];e[A]=e[s],e[s]=c,c=n[A],n[A]=n[s],n[s]=c}t(e,n,r,s,o),t(e,n,s+1,i,o)}}(t,e,0,r-1,this._compare),this._root=function t(e,n,r,i,o){var a=o-i;if(a>0){var A=i+Math.floor(a/2),s={key:n[A],data:r[A],parent:e};return s.left=t(s,n,r,i,A),s.right=t(s,n,r,A+1,o),s}return null}(null,t,e,0,r),this._size=r,this},n.prototype.min=function(){var t=this.minNode(this._root);return t?t.key:null},n.prototype.max=function(){var t=this.maxNode(this._root);return t?t.key:null},n.prototype.isEmpty=function(){return null===this._root},r.size.get=function(){return this._size},n.createTree=function(t,e,r,i,o){return new n(r,o).load(t,e,i)},Object.defineProperties(n.prototype,r);var a=function(t,e,n,r,i){this.left=e,this.point=t,this.otherEvent=n,this.isSubject=r,this.type=i||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.inResult=!1,this.resultInOut=!1,this.isExteriorRing=!0};function A(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(t,e,n){return(t[0]-n[0])*(e[1]-n[1])-(e[0]-n[0])*(t[1]-n[1])}function c(t,e){var n=t.point,r=e.point;return n[0]>r[0]?1:n[0]<r[0]?-1:n[1]!==r[1]?n[1]>r[1]?1:-1:function(t,e,n,r){return t.left!==e.left?t.left?1:-1:0!==s(n,t.otherEvent.point,e.otherEvent.point)?t.isBelow(e.otherEvent.point)?-1:1:!t.isSubject&&e.isSubject?1:-1}(t,e,n)}function u(t,e,n){var r=new a(e,!1,t,t.isSubject),i=new a(e,!0,t.otherEvent,t.isSubject);return A(t.point,t.otherEvent.point)&&console.warn("what is that, a collapsed segment?",t),r.contourId=i.contourId=t.contourId,c(i,t.otherEvent)>0&&(t.otherEvent.left=!0,i.left=!1),t.otherEvent.otherEvent=i,t.otherEvent=r,n.push(i),n.push(r),n}function l(t,e){return t[0]*e[1]-t[1]*e[0]}function g(t,e){return t[0]*e[0]+t[1]*e[1]}function f(t,e,n){var r=function(t,e,n,r,i){var o=[e[0]-t[0],e[1]-t[1]],a=[r[0]-n[0],r[1]-n[1]];function A(t,e,n){return[t[0]+e*n[0],t[1]+e*n[1]]}var s=[n[0]-t[0],n[1]-t[1]],c=l(o,a),u=c*c,f=g(o,o);if(u>0){var h=l(s,a)/c;if(h<0||h>1)return null;var d=l(s,o)/c;return d<0||d>1?null:0===h||1===h?i?null:[A(t,h,o)]:0===d||1===d?i?null:[A(n,d,a)]:[A(t,h,o)]}if((u=(c=l(s,o))*c)>0)return null;var I=g(o,s)/f,p=I+g(o,a)/f,C=Math.min(I,p),y=Math.max(I,p);return C<=1&&y>=0?1===C?i?null:[A(t,C>0?C:0,o)]:0===y?i?null:[A(t,y<1?y:1,o)]:i&&0===C&&1===y?null:[A(t,C>0?C:0,o),A(t,y<1?y:1,o)]:null}(t.point,t.otherEvent.point,e.point,e.otherEvent.point),i=r?r.length:0;if(0===i)return 0;if(1===i&&(A(t.point,e.point)||A(t.otherEvent.point,e.otherEvent.point)))return 0;if(2===i&&t.isSubject===e.isSubject)return 0;if(1===i)return A(t.point,r[0])||A(t.otherEvent.point,r[0])||u(t,r[0],n),A(e.point,r[0])||A(e.otherEvent.point,r[0])||u(e,r[0],n),1;var o=[],a=!1,s=!1;return A(t.point,e.point)?a=!0:1===c(t,e)?o.push(e,t):o.push(t,e),A(t.otherEvent.point,e.otherEvent.point)?s=!0:1===c(t.otherEvent,e.otherEvent)?o.push(e.otherEvent,t.otherEvent):o.push(t.otherEvent,e.otherEvent),a&&s||a?(e.type=1,t.type=e.inOut===t.inOut?2:3,a&&!s&&u(o[1].otherEvent,o[0].point,n),2):s?(u(o[0],o[1].point,n),3):o[0]!==o[3].otherEvent?(u(o[0],o[1].point,n),u(o[1],o[2].point,n),3):(u(o[0],o[1].point,n),u(o[3].otherEvent,o[2].point,n),3)}function h(t,e){if(t===e)return 0;if(0!==s(t.point,t.otherEvent.point,e.point)||0!==s(t.point,t.otherEvent.point,e.otherEvent.point))return A(t.point,e.point)?t.isBelow(e.otherEvent.point)?-1:1:t.point[0]===e.point[0]?t.point[1]<e.point[1]?-1:1:1===c(t,e)?e.isAbove(t.point)?-1:1:t.isBelow(e.point)?-1:1;if(t.isSubject!==e.isSubject)return t.isSubject?-1:1;var n=t.point,r=e.point;return n[0]===r[0]&&n[1]===r[1]?(n=t.otherEvent.point,r=e.otherEvent.point,n[0]===r[0]&&n[1]===r[1]?0:t.contourId>e.contourId?1:-1):1===c(t,e)?1:-1}function d(t,e,n,r){var i=t+1,o=e.length;if(i>o-1)return t-1;for(var a=e[t].point,A=e[i].point;i<o&&A[0]===a[0]&&A[1]===a[1];){if(!n[i])return i;A=e[++i].point}for(i=t-1;n[i]&&i>=r;)i--;return i}function I(t,e){var n,r,i,o=function(t){var e,n,r,i,o=[];for(n=0,r=t.length;n<r;n++)((e=t[n]).left&&e.inResult||!e.left&&e.otherEvent.inResult)&&o.push(e);for(var a=!1;!a;)for(a=!0,n=0,r=o.length;n<r;n++)n+1<r&&1===c(o[n],o[n+1])&&(i=o[n],o[n]=o[n+1],o[n+1]=i,a=!1);for(n=0,r=o.length;n<r;n++)(e=o[n]).pos=n;for(n=0,r=o.length;n<r;n++)(e=o[n]).left||(i=e.pos,e.pos=e.otherEvent.pos,e.otherEvent.pos=i);return o}(t),a={},A=[];for(n=0,r=o.length;n<r;n++)if(!a[n]){var s=[[]];o[n].isExteriorRing?2===e&&!o[n].isSubject&&A.length>1?A[A.length-1].push(s[0]):A.push(s):2!==e||o[n].isSubject||0!==A.length?0===A.length?A.push([[s]]):A[A.length-1].push(s[0]):A.push(s);var u=A.length-1,l=n,g=o[n].point;for(s[0].push(g);l>=n;)i=o[l],a[l]=!0,i.left?(i.resultInOut=!1,i.contourId=u):(i.otherEvent.resultInOut=!0,i.otherEvent.contourId=u),a[l=i.pos]=!0,s[0].push(o[l].point),l=d(l,o,a,n);i=o[l=-1===l?n:l],a[l]=a[i.pos]=!0,i.otherEvent.resultInOut=!0,i.otherEvent.contourId=u}return A}a.prototype.isBelow=function(t){var e=this.point,n=this.otherEvent.point;return this.left?(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])>0:(n[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(n[1]-t[1])>0},a.prototype.isAbove=function(t){return!this.isBelow(t)},a.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},a.prototype.clone=function(){var t=new a(this.point,this.left,this.otherEvent,this.isSubject,this.type);return t.inResult=this.inResult,t.prevInResult=this.prevInResult,t.isExteriorRing=this.isExteriorRing,t.inOut=this.inOut,t.otherInOut=this.otherInOut,t};var p=y,C=y;function y(t,e){if(!(this instanceof y))return new y(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||v,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function v(t,e){return t<e?-1:t>e?1:0}y.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),a=o+1,A=e[o];if(a<this.length&&n(e[a],A)<0&&(o=a,A=e[a]),n(A,i)>=0)break;e[t]=A,t=o}e[t]=i}},p.default=C;var B=Math.max,m=Math.min,b=0;function E(t,e,n,r,i,o){var A,s,u,l,g,f;for(A=0,s=t.length-1;A<s;A++)if(u=t[A],l=t[A+1],g=new a(u,!1,void 0,e),f=new a(l,!1,g,e),g.otherEvent=f,u[0]!==l[0]||u[1]!==l[1]){g.contourId=f.contourId=n,o||(g.isExteriorRing=!1,f.isExteriorRing=!1),c(g,f)>0?f.left=!0:g.left=!0;var h=u[0],d=u[1];i[0]=m(i[0],h),i[1]=m(i[1],d),i[2]=B(i[2],h),i[3]=B(i[3],d),r.push(g),r.push(f)}}var Q=[];function F(t,e,r){"number"===typeof t[0][0][0]&&(t=[t]),"number"===typeof e[0][0][0]&&(e=[e]);var o=function(t,e,n){var r=null;return t.length*e.length===0&&(0===n?r=Q:2===n?r=t:1!==n&&3!==n||(r=0===t.length?e:t)),r}(t,e,r);if(o)return o===Q?null:o;var a=[1/0,1/0,-1/0,-1/0],A=[1/0,1/0,-1/0,-1/0],s=function(t,e,n,r,i){var o,a,A,s,u,l,g=new p(null,c);for(A=0,s=t.length;A<s;A++)for(u=0,l=(o=t[A]).length;u<l;u++)(a=0===u)&&b++,E(o[u],!0,b,g,n,a);for(A=0,s=e.length;A<s;A++)for(u=0,l=(o=e[A]).length;u<l;u++)a=0===u,2===i&&(a=!1),a&&b++,E(o[u],!1,b,g,r,a);return g}(t,e,a,A,r);return(o=function(t,e,n,r,i){var o=null;return(n[0]>r[2]||r[0]>n[2]||n[1]>r[3]||r[1]>n[3])&&(0===i?o=Q:2===i?o=t:1!==i&&3!==i||(o=t.concat(e))),o}(t,e,a,A,r))?o===Q?null:o:I(function(t,e,r,o,a,A){for(var s,c,u,l=new n(h),g=[],d=Math.min(o[2],a[2]);0!==t.length;){var I=t.pop();if(g.push(I),0===A&&I.point[0]>d||2===A&&I.point[0]>o[2])break;if(I.left){c=s=l.insert(I),s=s!==(u=l.minNode())?l.prev(s):null,c=l.next(c);var p=s?s.key:null;if(i(I,p,A),c&&2===f(I,c.key,t)&&(i(I,p,A),i(I,c.key,A)),s&&2===f(s.key,I,t)){var C=s;i(p,(C=C!==u?l.prev(C):null)?C.key:null,A),i(I,p,A)}}else I=I.otherEvent,c=s=l.find(I),s&&c&&(s=s!==u?l.prev(s):null,c=l.next(c),l.remove(I),c&&s&&f(s.key,c.key,t))}return g}(s,0,0,a,A,r),r)}var w={UNION:1,DIFFERENCE:2,INTERSECTION:0,XOR:3};t.union=function(t,e){return F(t,e,1)},t.diff=function(t,e){return F(t,e,2)},t.xor=function(t,e){return F(t,e,3)},t.intersection=function(t,e){return F(t,e,0)},t.operations=w,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(137);function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]))}return e}function o(t){var e,n,r,i,o,A,s=0,c=t.length;if(c>2){for(A=0;A<c;A++)A===c-2?(r=c-2,i=c-1,o=0):A===c-1?(r=c-1,i=0,o=1):(r=A,i=A+1,o=A+2),e=t[r],n=t[i],s+=(a(t[o][0])-a(e[0]))*Math.sin(a(n[1]));s=6378137*s*6378137/2}return s}function a(t){return t*Math.PI/180}e.default=function(t){return r.geomReduce(t,(function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=i(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#cell-sets-tabular","title":"Vitessce cell sets data, tabular format","definitions":{"colorArray":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"minItems":3,"maxItems":3}},"type":"array","items":{"type":"object","additionalProperties":false,"required":["groupName","setName","obsId"],"properties":{"groupName":{"type":"string"},"setName":{"type":"string"},"setColor":{"$ref":"#/definitions/colorArray"},"obsId":{"type":"string"},"predictionScore":{"oneOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}}}}')},function(t,e,n){t.exports=function(t){"use strict";return function(t){if("number"!==typeof t)throw new TypeError("Expected a number");if(t>1e19)throw new RangeError("Input expected to be < 1e19");if(t<-1e19)throw new RangeError("Input expected to be > 1e19");if(Math.abs(t)<1e3)return t;var e,n,r,i=t<0?"-":"",o={K:6,M:9,B:12,T:16};for(var a in t=Math.abs(t),n=(r=Math.floor(t).toString().length)%3===0?r-3:r-r%3,e=Math.round(t/Math.pow(10,n)*10)/10,o)if(n<o[a]){e+=a;break}return i+e}}()},function(t,e,n){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}},function(t,e,n){function r(t,e){"use strict";var n=(e=e||{}).pos||0,i="<".charCodeAt(0),o=">".charCodeAt(0),a="-".charCodeAt(0),A="/".charCodeAt(0),s="!".charCodeAt(0),c="'".charCodeAt(0),u='"'.charCodeAt(0),l="[".charCodeAt(0);"]".charCodeAt(0);function g(){for(var e=[];t[n];)if(t.charCodeAt(n)==i){if(t.charCodeAt(n+1)===A)return(n=t.indexOf(">",n))+1&&(n+=1),e;if(t.charCodeAt(n+1)===s){if(t.charCodeAt(n+2)==a){for(;-1!==n&&(t.charCodeAt(n)!==o||t.charCodeAt(n-1)!=a||t.charCodeAt(n-2)!=a||-1==n);)n=t.indexOf(">",n+1);-1===n&&(n=t.length)}else{if(t.charCodeAt(n+2)===l&&t.charCodeAt(n+8)===l&&"cdata"===t.substr(n+3,5).toLowerCase()){var r=t.indexOf("]]>",n);-1==r?(e.push(t.substr(n+8)),n=t.length):(e.push(t.substring(n+9,r)),n=r+3);continue}for(n+=2;t.charCodeAt(n)!==o&&t[n];)n++}n++;continue}var c=I();e.push(c)}else{var u=f();u.trim().length>0&&e.push(u),n++}return e}function f(){var e=n;return-2===(n=t.indexOf("<",n)-1)&&(n=t.length),t.slice(e,n+1)}function h(){for(var e=n;-1==="\r\n\t>/= ".indexOf(t[n])&&t[n];)n++;return t.slice(e,n)}var d=e.noChildNodes||["img","br","input","meta","link"];function I(){n++;for(var e=h(),r={},i=[];t.charCodeAt(n)!==o&&t[n];){var a=t.charCodeAt(n);if(a>64&&a<91||a>96&&a<123){for(var s=h(),l=t.charCodeAt(n);l&&l!==c&&l!==u&&!(l>64&&l<91||l>96&&l<123)&&l!==o;)n++,l=t.charCodeAt(n);if(l===c||l===u){var f=p();if(-1===n)return{tagName:e,attributes:r,children:i}}else f=null,n--;r[s]=f}n++}if(t.charCodeAt(n-1)!==A)if("script"==e){var I=n+1;n=t.indexOf("<\/script>",n),i=[t.slice(I,n)],n+=9}else if("style"==e){I=n+1;n=t.indexOf("</style>",n),i=[t.slice(I,n)],n+=8}else-1==d.indexOf(e)&&(n++,i=g());else n++;return{tagName:e,attributes:r,children:i}}function p(){var e=t[n],r=n+1;return n=t.indexOf(e,r),t.slice(r,n)}function C(){var n=new RegExp("\\s"+e.attrName+"\\s*=['\"]"+e.attrValue+"['\"]").exec(t);return n?n.index:-1}var y=null;if(void 0!==e.attrValue){e.attrName=e.attrName||"id";for(y=[];-1!==(n=C());)-1!==(n=t.lastIndexOf("<",n))&&y.push(I()),t=t.substr(n),n=0}else y=e.parseNode?I():g();return e.filter&&(y=r.filter(y,e.filter)),e.setPos&&(y.pos=n),y}r.simplify=function(t){var e={};if(!t.length)return"";if(1===t.length&&"string"==typeof t[0])return t[0];for(var n in t.forEach((function(t){if("object"===typeof t){e[t.tagName]||(e[t.tagName]=[]);var n=r.simplify(t.children);e[t.tagName].push(n),Object.keys(t.attributes).length&&(n._attributes=t.attributes)}})),e)1==e[n].length&&(e[n]=e[n][0]);return e},r.simplifyLostLess=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t.length?1===t.length&&"string"==typeof t[0]?Object.keys(e).length?{_attributes:e,value:t[0]}:t[0]:(t.forEach((function(t){if("object"===typeof t){n[t.tagName]||(n[t.tagName]=[]);var e=r.simplifyLostLess(t.children||[],t.attributes);n[t.tagName].push(e),Object.keys(t.attributes).length&&(e._attributes=t.attributes)}})),n):""},r.filter=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=[];return t.forEach((function(t,a){if("object"===typeof t&&e(t,a,n,i)&&o.push(t),t.children){var A=r.filter(t.children,e,n+1,(i?i+".":"")+a+"."+t.tagName);o=o.concat(A)}})),o},r.stringify=function(t){var e="";function n(t){if(t)for(var n=0;n<t.length;n++)"string"==typeof t[n]?e+=t[n].trim():r(t[n])}function r(t){for(var r in e+="<"+t.tagName,t.attributes)null===t.attributes[r]?e+=" "+r:-1===t.attributes[r].indexOf('"')?e+=" "+r+'="'+t.attributes[r].trim()+'"':e+=" "+r+"='"+t.attributes[r].trim()+"'";e+=">",n(t.children),e+="</"+t.tagName+">"}return n(t),e},r.toContentString=function(t){if(Array.isArray(t)){var e="";return t.forEach((function(t){e=(e+=" "+r.toContentString(t)).trim()})),e}return"object"===typeof t?r.toContentString(t.children):" "+t},r.getElementById=function(t,e,n){var i=r(t,{attrValue:e});return n?r.simplify(i):i[0]},r.getElementsByClassName=function(t,e,n){var i=r(t,{attrName:"class",attrValue:"[a-zA-Z0-9- ]*"+e+"[a-zA-Z0-9- ]*"});return n?r.simplify(i):i},r.parseStream=function(t,e){if("string"===typeof e&&(e=e.length+2),"string"===typeof t){var i=n(583);t=i.createReadStream(t,{start:e}),e=0}var o=e,a="";return t.on("data",(function(e){a+=e;for(var n=0;;){if(!(o=a.indexOf("<",o)+1))return void(o=n);if("/"!==a[o+1]){var i=r(a,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>a.length-1||o<n)return a=a.slice(n),o=0,void(n=0);t.emit("xml",i),n=o}else o+=1,n=pos}})),t},r.transformStream=function(t){var e=n(584);"string"===typeof t&&(t=t.length+2);var i=t||0,o="";return e({readableObjectMode:!0},(function(t,e,n){o+=t;for(var a=0;;){if(!(i=o.indexOf("<",i)+1))return i=a,n();if("/"!==o[i+1]){var A=r(o,{pos:i-1,parseNode:!0,setPos:!0});if((i=A.pos)>o.length-1||i<a)return o=o.slice(a),i=0,n();this.push(A),a=i}else i+=1,a=pos}n()}))},t.exports=r,r.xml=r},function(t,e,n){"use strict";var r=n(594),i=n(277),o=n(599),a=n(600),A=n(601),s=n(602),c=n(603),u=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==a.Z_OK)throw new Error(A[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"===typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(A[n])}function g(t,e){var n=new l(e);if(n.push(t,!0),n.err)throw n.msg||A[n.err];return n.result}l.prototype.push=function(t,e){var n,A,s,c,l,g=this.strm,f=this.options.chunkSize,h=this.options.dictionary,d=!1;if(this.ended)return!1;A=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"===typeof t?g.input=o.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?g.input=new Uint8Array(t):g.input=t,g.next_in=0,g.avail_in=g.input.length;do{if(0===g.avail_out&&(g.output=new i.Buf8(f),g.next_out=0,g.avail_out=f),(n=r.inflate(g,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&h&&(n=r.inflateSetDictionary(this.strm,h)),n===a.Z_BUF_ERROR&&!0===d&&(n=a.Z_OK,d=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;g.next_out&&(0!==g.avail_out&&n!==a.Z_STREAM_END&&(0!==g.avail_in||A!==a.Z_FINISH&&A!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(s=o.utf8border(g.output,g.next_out),c=g.next_out-s,l=o.buf2string(g.output,s),g.next_out=c,g.avail_out=f-c,c&&i.arraySet(g.output,g.output,s,c,0),this.onData(l)):this.onData(i.shrinkBuf(g.output,g.next_out)))),0===g.avail_in&&0===g.avail_out&&(d=!0)}while((g.avail_in>0||0===g.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(A=a.Z_FINISH),A===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):A!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),g.avail_out=0,!0)},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=l,e.inflate=g,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,g(t,e)},e.ungzip=g},function(t,e,n){"use strict";var r=n(15),i=n(11),o=n(14),a=n(24),A=n(25),s=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.call(this,(function(e){return t._observers.add(e),function(){return t._observers.delete(e)}})))._observers=new Set,t}return Object(o.a)(n,[{key:"next",value:function(t){var e,n=Object(r.a)(this._observers);try{for(n.s();!(e=n.n()).done;){e.value.next(t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"error",value:function(t){var e,n=Object(r.a)(this._observers);try{for(n.s();!(e=n.n()).done;){e.value.error(t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"complete",value:function(){var t,e=Object(r.a)(this._observers);try{for(e.s();!(t=e.n()).done;){t.value.complete()}}catch(n){e.e(n)}finally{e.f()}}}]),n}(n(245).a);e.a=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){};function i(){var t,e=!1,n=r;return[new Promise((function(r){e?r(t):n=r})),function(r){e=!0,t=r,n()}]}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(16),i=n(104);function o(t){return t&&"object"===typeof t&&t[i.d]}function a(t,e){var n,o;if(!e){if(!(o=t)||"object"!==typeof o)throw Error();e=[t]}return n={},Object(r.a)(n,i.d,!0),Object(r.a)(n,"send",t),Object(r.a)(n,"transferables",e),n}},function(t,e,n){var r=n(290),i=n(284),o=t.exports;for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);function A(t){if("string"===typeof t&&(t=i.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}o.request=function(t,e){return t=A(t),r.request.call(this,t,e)},o.get=function(t,e){return t=A(t),r.get.call(this,t,e)}},function(t,e,n){"use strict";var r=n(625),i=n(279),o=n(279),a=n(147).buildOptions,A=n(627);e.parse=function(t,e,n){if(n){!0===n&&(n={});var s=A.validate(t,n);if(!0!==s)throw Error(s.err.msg)}e=a(e,o.defaultOptions,o.props);var c=i.getTraversalObj(t,e);return r.convertToJson(c,e)},e.convertTonimn=n(628).convert2nimn,e.getTraversalObj=i.getTraversalObj,e.convertToJson=r.convertToJson,e.convertToJsonString=n(629).convertToJsonString,e.validate=A.validate,e.j2xParser=n(630),e.parseToNimn=function(t,n,r){return e.convertTonimn(e.getTraversalObj(t,r),n,r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(58),i={};function o(t,e){var n;i[t]=!0,void 0!==e&&(n=e,r.global.console&&r.global.console.error&&r.global.console.error(n))}var a=function t(e){var n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var r=0;r<this.attribs.length;r++){var i=new t.VertexAttrib(n);this.attribs[r]=i}this.maxAttrib=0};(a.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var A=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var n;do{0!==(n=e.apply(t))&&(i[n]=!0)}while(0!==n);for(n in i)if(i[n])return delete i[n],parseInt(n,10);return 0}}(t);var n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){var r=e.currentVertexArrayObject;r.maxAttrib=Math.max(r.maxAttrib,t);var i=r.attribs[t];return i.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var r=e.currentVertexArrayObject;r.maxAttrib=Math.max(r.maxAttrib,t);var i=r.attribs[t];return i.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,r){switch(t){case 34962:e.currentArrayBuffer=r;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=r}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,r){var i=e.currentVertexArrayObject,o=i.attribs[t];switch(r){case 34975:return o.buffer;case 34338:return o.enabled;case 34339:return o.size;case 34340:return o.stride;case 34341:return o.type;case 34922:return o.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,r,i,o,a,A){var s=e.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,t);var c=s.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=r,c.type=i,c.normalized=o,c.stride=a,c.offset=A,c.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",r.global.console&&r.global.console.log&&r.global.console.log(t),e.reset_()}),!0),this.reset_()};function s(t){if("function"!==typeof t.createVertexArray){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var n=t.getExtension;t.getExtension=function(e){var r=n.call(this,e);return r||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new A(this)),this.__OESVertexArrayObject))}}}A.prototype.VERTEX_ARRAY_BINDING_OES=34229,A.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=new a(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},A.prototype.createVertexArrayOES=function(){var t=new a(this);return this.vertexArrayObjects.push(t),t},A.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},A.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof a&&t.hasBeenBound&&t.ext===this)},A.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var n=this.original,r=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(r!==i){r&&i.elementArrayBuffer===r.elementArrayBuffer||n.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,A=Math.max(r?r.maxAttrib:0,i.maxAttrib),s=0;s<=A;s++){var c=i.attribs[s],u=r?r.attribs[s]:null;if(r&&c.enabled===u.enabled||(c.enabled?n.enableVertexAttribArray.call(e,s):n.disableVertexAttribArray.call(e,s)),c.enabled){var l=!1;r&&c.buffer===u.buffer||(a!==c.buffer&&(n.bindBuffer.call(e,34962,c.buffer),a=c.buffer),l=!0),(l||c.cached!==u.cached)&&n.vertexAttribPointer.call(e,s,c.size,c.type,c.normalized,c.stride,c.offset)}}this.currentArrayBuffer!==a&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else o(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r=n(1),i=n(218),o=n(474),a=n(475),A=n(133),s=n(47);function c(t,e){Object(s.a)(t instanceof i.a||t instanceof o.a||t instanceof a.a);var n=t.constructor,r=t.gl,A=t.width,c=t.height,u=t.format,l=t.type,g=t.dataFormat,f=t.border,h=t.mipmaps;return new n(r,Object.assign({width:A,height:c,format:u,type:l,dataFormat:g,border:f,mipmaps:h},e))}function u(t,e){var n=t.gl,i=t.width,o=t.height,a=t.id;return new A.a(n,Object.assign({},e,{id:"framebuffer-for-".concat(a),width:i,height:o,attachments:Object(r.a)({},36064,t)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(13),i=n.n(r),o=n(30),a=n(3),A=n(2),s=n(8),c=n(6),u=n(54),l=n(7),g=n(19),f=n(102),h=n(127),d=[34069,34070,34071,34072,34073,34074],I=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,e),Object(h.b)(t),(n=Object(s.a)(this,Object(c.a)(e).call(this,t,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(u.a)(n)),n}return Object(l.a)(e,t),Object(A.a)(e,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.mipmaps,r=void 0===n||n,i=e.parameters,o=void 0===i?{}:i;this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,r&&t.generateMipmap(e),t.setParameters(o)}))}},{key:"subImage",value:function(t){var e=t.face,n=t.data,r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,A=t.mipmapLevel,s=void 0===A?0:A;return this._subImage({target:e,data:n,x:i,y:a,mipmapLevel:s})}},{key:"setCubeMapImageData",value:function(){var t=Object(o.a)(i.a.mark((function t(e){var n,r,o,a,A,s,c,u,l,f,h,I,p,C=this;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.width,r=e.height,o=e.pixels,a=e.data,A=e.border,s=void 0===A?0:A,c=e.format,u=void 0===c?6408:c,l=e.type,f=void 0===l?5121:l,h=this.gl,I=o||a,t.next=5,Promise.all(d.map((function(t){var e=I[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:p=t.sent,this.bind(),d.forEach((function(t,e){p[e].length>1&&!1!==C.opts.mipmaps&&g.h.warn("".concat(C.id," has mipmap and multiple LODs."))(),p[e].forEach((function(e,i){n&&r?h.texImage2D(t,i,u,n,r,s,u,f,e):h.texImage2D(t,i,u,u,f,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(t){var e=this,n=t.face,r=t.width,i=t.height,o=t.pixels,a=t.data,A=t.border,s=void 0===A?0:A,c=t.format,u=void 0===c?6408:c,l=t.type,g=void 0===l?5121:l,f=this.gl,h=o||a;return this.bind(),h instanceof Promise?h.then((function(r){return e.setImageDataForFace(Object.assign({},t,{face:n,data:r,pixels:r}))})):this.width||this.height?f.texImage2D(n,0,u,r,i,s,u,g,h):f.texImage2D(n,0,u,u,g,h),this}}]),e}(f.a);I.FACES=d},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(8),o=n(6),a=n(54),A=n(2),s=n(7),c=n(19),u=n(127),l=n(102),g=n(151),f=n(76),h=function(t){function e(t){var n,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,e),Object(u.a)(t),A=Object.assign({depth:1},A,{target:32879,unpackFlipY:!1}),(n=Object(i.a)(this,Object(o.a)(e).call(this,t,A))).initialize(A),Object.seal(Object(a.a)(n)),n}return Object(s.a)(e,t),Object(A.a)(e,null,[{key:"isSupported",value:function(t){return Object(c.g)(t)}}]),Object(A.a)(e,[{key:"setImageData",value:function(t){var e=this,n=t.level,r=void 0===n?0:n,i=t.dataFormat,o=void 0===i?6408:i,a=t.width,A=t.height,s=t.depth,u=void 0===s?1:s,l=t.border,h=void 0===l?0:l,d=t.format,I=t.type,p=void 0===I?5121:I,C=t.offset,y=void 0===C?0:C,v=t.data,B=t.parameters,m=void 0===B?{}:B;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.l)(this.gl,m,(function(){ArrayBuffer.isView(v)&&e.gl.texImage3D(e.target,r,o,a,A,u,h,d,p,v),v instanceof f.a&&(e.gl.bindBuffer(35052,v.handle),e.gl.texImage3D(e.target,r,o,a,A,u,h,d,p,y))})),v&&v.byteLength)this._trackAllocatedMemory(v.byteLength,"Texture");else{var b=g.a[this.dataFormat]||4,E=g.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*b*E,"Texture")}return this.loaded=!0,this}}]),e}(l.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c}));var r=n(149),i=n(150);function o(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,A=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return A=t.done,t},e:function(t){s=!0,o=t},f:function(){try{A||null==n.return||n.return()}finally{if(s)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var A=function(){var t=Object(i.b)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){var e,n=A(),i=o(t=Array.isArray(t)?t:[t]);try{var a=function(){var t=e.value,i=Object(r.b)(t);n.find((function(t){return i===t}))||n.unshift(i)};for(i.s();!(e=i.n()).done;)a()}catch(s){i.e(s)}finally{i.f()}}function c(){return A()}},function(t,e,n){"use strict";function r(t,e,n){n=n||2;var r,A,s,c,u,f,h,I=e&&e.length,p=I?e[0]*n:t.length,C=i(t,0,p,n,!0),y=[];if(!C||C.next===C.prev)return y;if(I&&(C=function(t,e,n,r){var a,A,s,c,u,f=[];for(a=0,A=e.length;a<A;a++)s=e[a]*r,c=a<A-1?e[a+1]*r:t.length,(u=i(t,s,c,r,!1))===u.next&&(u.steiner=!0),f.push(d(u));for(f.sort(l),a=0;a<f.length;a++)g(f[a],n),n=o(n,n.next);return n}(t,e,C,n)),t.length>80*n){r=s=t[0],A=c=t[1];for(var v=n;v<p;v+=n)(u=t[v])<r&&(r=u),(f=t[v+1])<A&&(A=f),u>s&&(s=u),f>c&&(c=f);h=0!==(h=Math.max(s-r,c-A))?1/h:0}return a(C,y,n,r,A,h),y}function i(t,e,n,r,i){var o,a;if(i===S(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Q(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Q(o,t[o],t[o+1],a);return a&&y(a,a.next)&&(F(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!y(r,r.next)&&0!==C(r.prev,r,r.next))r=r.next;else{if(F(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,l,g){if(t){!g&&l&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=h(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,A,s,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,A=0,e=0;e<c&&(A++,r=r.nextZ);e++);for(s=c;A>0||s>0&&r;)0!==A&&(0===s||!r||n.z<=r.z)?(i=n,n=n.nextZ,A--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(t,r,i,l);for(var f,d,I=t;t.prev!==t.next;)if(f=t.prev,d=t.next,l?s(t,r,i,l):A(t))e.push(f.i/n),e.push(t.i/n),e.push(d.i/n),F(t),t=d.next,I=d.next;else if((t=d)===I){g?1===g?a(t=c(o(t),e,n),e,n,r,i,l,2):2===g&&u(t,e,n,r,i,l):a(o(t),e,n,r,i,l,1);break}}}function A(t){var e=t.prev,n=t,r=t.next;if(C(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(I(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&C(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function s(t,e,n,r){var i=t.prev,o=t,a=t.next;if(C(i,o,a)>=0)return!1;for(var A=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,s=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=h(A,s,e,n,r),g=h(c,u,e,n,r),f=t.prevZ,d=t.nextZ;f&&f.z>=l&&d&&d.z<=g;){if(f!==t.prev&&f!==t.next&&I(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&I(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&C(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&I(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=g;){if(d!==t.prev&&d!==t.next&&I(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&C(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function c(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!y(i,a)&&v(i,r,r.next,a)&&b(i,a)&&b(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),F(r),F(r.next),r=t=a),r=r.next}while(r!==t);return o(r)}function u(t,e,n,r,i,A){var s=t;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var u=E(s,c);return s=o(s,s.next),u=o(u,u.next),a(s,e,n,r,i,A),void a(u,e,n,r,i,A)}c=c.next}s=s.next}while(s!==t)}function l(t,e){return t.x-e.x}function g(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var A=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(A<=i&&A>a){if(a=A,A===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var s,c=n,u=n.x,l=n.y,g=1/0;r=n;do{i>=r.x&&r.x>=u&&i!==r.x&&I(o<l?i:a,o,u,l,o<l?a:i,o,r.x,r.y)&&(s=Math.abs(o-r.y)/(i-r.x),b(r,t)&&(s<g||s===g&&(r.x>n.x||r.x===n.x&&f(n,r)))&&(n=r,g=s)),r=r.next}while(r!==c);return n}(t,e)){var n=E(e,t);o(e,e.next),o(n,n.next)}}function f(t,e){return C(t.prev,t,e.prev)<0&&C(e.next,t,t.next)<0}function h(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function I(t,e,n,r,i,o,a,A){return(i-a)*(e-A)-(t-a)*(o-A)>=0&&(t-a)*(r-A)-(n-a)*(e-A)>=0&&(n-a)*(o-A)-(i-a)*(r-A)>=0}function p(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&v(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(C(t.prev,t,e.prev)||C(t,e.prev,e))||y(t,e)&&C(t.prev,t,t.next)>0&&C(e.prev,e,e.next)>0)}function C(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,n,r){var i=m(C(t,e,n)),o=m(C(t,e,r)),a=m(C(n,r,t)),A=m(C(n,r,e));return i!==o&&a!==A||(!(0!==i||!B(t,n,e))||(!(0!==o||!B(t,r,e))||(!(0!==a||!B(n,t,r))||!(0!==A||!B(n,e,r)))))}function B(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function m(t){return t>0?1:t<0?-1:0}function b(t,e){return C(t.prev,t,t.next)<0?C(t,e,t.next)>=0&&C(t,t.prev,e)>=0:C(t,e,t.prev)<0||C(t,t.next,e)<0}function E(t,e){var n=new w(t.i,t.x,t.y),r=new w(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Q(t,e,n,r){var i=new w(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function F(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function w(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}t.exports=r,t.exports.default=r,r.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(S(t,0,o,n));if(i)for(var A=0,s=e.length;A<s;A++){var c=e[A]*n,u=A<s-1?e[A+1]*n:t.length;a-=Math.abs(S(t,c,u,n))}var l=0;for(A=0;A<r.length;A+=3){var g=r[A]*n,f=r[A+1]*n,h=r[A+2]*n;l+=Math.abs((t[g]-t[h])*(t[f+1]-t[g+1])-(t[g]-t[f])*(t[h+1]-t[g+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},r.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}},function(t,e,n){"use strict";t.exports=i,t.exports.default=i;var r=1e20;function i(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function o(t,e,n,r,i,o,A){for(var s=0;s<e;s++){for(var c=0;c<n;c++)r[c]=t[c*e+s];for(a(r,i,o,A,n),c=0;c<n;c++)t[c*e+s]=i[c]}for(c=0;c<n;c++){for(s=0;s<e;s++)r[s]=t[c*e+s];for(a(r,i,o,A,e),s=0;s<e;s++)t[c*e+s]=Math.sqrt(i[s])}}function a(t,e,n,i,o){n[0]=0,i[0]=-r,i[1]=+r;for(var a=1,A=0;a<o;a++){for(var s=(t[a]+a*a-(t[n[A]]+n[A]*n[A]))/(2*a-2*n[A]);s<=i[A];)A--,s=(t[a]+a*a-(t[n[A]]+n[A]*n[A]))/(2*a-2*n[A]);n[++A]=a,i[A]=s,i[A+1]=+r}for(a=0,A=0;a<o;a++){for(;i[A+1]<a;)A++;e[a]=(a-n[A])*(a-n[A])+t[n[A]]}}i.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var a=e.data[4*i+3]/255;this.gridOuter[i]=1===a?0:0===a?r:Math.pow(Math.max(0,.5-a),2),this.gridInner[i]=1===a?r:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(o(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),o(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++){var A=this.gridOuter[i]-this.gridInner[i];n[i]=Math.max(0,Math.min(255,Math.round(255-255*(A/this.radius+this.cutoff))))}return n}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(17),a=n(1),A=n(136),s=n(357),c=n(300);function u(t){return l(function t(e,n){return e.map((function(e){return e instanceof s.a||(Object(c.a)("string"!==typeof e,"Shader module use by name is deprecated. Import shader module '".concat(e,"' and use it directly.")),Object(c.a)(e.name,"shader module has no name"),(e=new s.a(e)).dependencies=t(e.dependencies)),e}))}(t))}function l(t){var e={},n={};return g({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((function(t,e){return n[e]-n[t]})).map((function(t){return e[t]}))}function g(t){var e=t.modules,n=t.level,r=t.moduleMap,i=t.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var o=!0,a=!1,A=void 0;try{for(var s,c=e[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var u=s.value;r[u.name]=u,(void 0===i[u.name]||i[u.name]<n)&&(i[u.name]=n)}}catch(C){a=!0,A=C}finally{try{o||null==c.return||c.return()}finally{if(a)throw A}}var l=!0,f=!1,h=void 0;try{for(var d,I=e[Symbol.iterator]();!(l=(d=I.next()).done);l=!0){var p=d.value;p.dependencies&&g({modules:p.dependencies,level:n+1,moduleMap:r,moduleDepth:i})}}catch(C){f=!0,h=C}finally{try{l||null==I.return||I.return()}finally{if(f)throw h}}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="undefined"!==typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",r=-1!==n.indexOf("MSIE "),i=-1!==n.indexOf("Trident/");return r||i}var h={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},d={};Object.keys(h).forEach((function(t){d[t]=t}));var I={};function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=h[e];if(Object(c.a)(r,e),!f(n))return!0;if(e in I)return I[e];var i=r[0],o=n.behavior||"enable",a="#extension GL_".concat(i," : ").concat(o,"\nvoid main(void) {}"),A=t.createShader(35633);t.shaderSource(A,a),t.compileShader(A);var s=t.getShaderParameter(A,35713);return t.deleteShader(A),I[e]=s,s}function C(t,e){var n=h[e];Object(c.a)(n,e);var r=function(t){return Boolean(t&&2===t._version)}(t)&&n[1]||n[0],i="string"===typeof r?Boolean(t.getExtension(r)):r;return Object(c.a)(!1===i||!0===i),i}function y(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return C(t,e)}))}var v=n(302);function B(t,e,n){switch(e){case 300:return n?function(t){return t.replace(/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n").replace(/^[ \t]*attribute[ \t]+(.+;)/gm,"in $1").replace(/^[ \t]*varying[ \t]+(.+;)/gm,"out $1").replace(/\btexture2D\(/g,"texture(").replace(/\btextureCube\(+/g,"texture(").replace(/\btexture2DLodEXT\(/g,"textureLod(").replace(/\btextureCubeLodEXT\(/g,"textureLod(")}(t):function(t){return t.replace(/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n").replace(/^[ \t]*varying[ \t]+(.+;)/gm,"in $1").replace(/\btexture2D\(/g,"texture(").replace(/\btextureCube\(/g,"texture(").replace(/\btexture2DLodEXT\(/g,"textureLod(").replace(/\btextureCubeLodEXT\(/g,"textureLod(")}(t);case 100:return n?function(t){return t.replace(/^#version[ \t]+300[ \t]+es/,"#version 100").replace(/^[ \t]*in[ \t]+(.+;)/gm,"attribute $1").replace(/^[ \t]*out[ \t]+(.+;)/gm,"varying $1").replace(/\btexture\(/g,"texture2D(").replace(/\btextureLod\(/g,"texture2DLodEXT(")}(t):function(t){var e=(t=t.replace(/^#version[ \t]+300[ \t]+es/,"#version 100").replace(/^[ \t]*in[ \t]+/gm,"varying ").replace(/\btexture\(/g,"texture2D(").replace(/\btextureLod\(/g,"texture2DLodEXT(")).match(b);if(e){var n=e[1];t=t.replace(b,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),"gl_FragColor")}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}var m,b=/^[ \t]*out[ \t]+vec4[ \t]+(\w+)[ \t]*;\s+/m;var E="\n\n".concat(v.a,"\n\n"),Q=(m={},Object(a.a)(m,A.b,"vertex"),Object(a.a)(m,A.a,"fragment"),m);function F(t,e){var n=e.vs,r=e.fs,i=u(e.modules||[]);return{gl:t,vs:w(t,Object.assign({},e,{source:n,type:A.b,modules:i})),fs:w(t,Object.assign({},e,{source:r,type:A.a,modules:i})),getUniforms:S(i)}}function w(t,e){var n=e.id,r=e.source,i=e.type,a=e.modules,s=e.defines,u=void 0===s?{}:s,l=e.hookFunctions,g=void 0===l?[]:l,f=e.inject,h=void 0===f?{}:f,I=e.transpileToGLSL100,C=void 0!==I&&I,m=e.prologue,b=void 0===m||m,F=e.log;Object(c.a)("string"===typeof r,"shader source must be a string");var w=i===A.b,S=r.split("\n"),R=100,U="",x=r;0===S[0].indexOf("#version ")?(R=300,U=S[0],x=S.slice(1).join("\n")):U="#version ".concat(R);var k={};a.forEach((function(t){Object.assign(k,t.getDefines())})),Object.assign(k,u);var O=b?"".concat(U,"\n").concat(function(t){var e=t.id,n=t.source,r=t.type;return e&&"string"===typeof e&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(e,"_").concat(Q[r],"\n\n"):""}({id:n,source:r,type:i}),"\n").concat(function(t){var e=t.type;return"\n#define SHADER_TYPE_".concat(Q[e].toUpperCase(),"\n")}({type:i}),"\n").concat(function(t){switch(function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),r=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:function(t,e){if(t.match(/NVIDIA/i)||e.match(/NVIDIA/i))return"NVIDIA";if(t.match(/INTEL/i)||e.match(/INTEL/i))return"INTEL";if(t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i))return"AMD";return"UNKNOWN GPU"}(n,r),vendor:n,renderer:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}(t),"\n").concat(function(t,e,n){var r="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return y(t,d.GLSL_FRAG_DEPTH)&&(r+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),y(t,d.GLSL_DERIVATIVES)&&p(t,d.GLSL_DERIVATIVES)&&(r+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),y(t,d.GLSL_FRAG_DATA)&&p(t,d.GLSL_FRAG_DATA,{behavior:"require"})&&(r+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),y(t,d.GLSL_TEXTURE_LOD)&&(r+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),r}(t),"\n").concat(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,n="";for(var r in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;var i=t[r];(i||Number.isFinite(i))&&(n+="#define ".concat(r.toUpperCase()," ").concat(t[r],"\n"))}0===e&&(n+="\n");return n}(k),"\n").concat(w?"":"precision highp float;\n\n","\n"):"".concat(U,"\n");g=function(t){var e={vs:{},fs:{}};return t.forEach((function(t){var n;"string"!==typeof t?t=(n=t).hook:n={};var r=(t=t.trim()).split(":"),i=Object(o.a)(r,2),a=i[0],A=i[1],s=t.replace(/\(.+/,"");e[a][s]=Object.assign(n,{signature:A})})),e}(g);var N={},D={},G={};for(var _ in h){var M="string"===typeof h[_]?{injection:h[_],order:0}:h[_],T=_.match(/^(v|f)s:(#)?([\w-]+)$/);if(T){var j=T[2],L=T[3];j?"decl"===L?D[_]=[M]:G[_]=[M]:N[_]=[M]}else G[_]=[M]}var V=!0,Z=!1,P=void 0;try{for(var W,J=a[Symbol.iterator]();!(V=(W=J.next()).done);V=!0){var H=W.value;F&&H.checkDeprecations(x,F),O+=H.getModuleSource(i,R);var Y=H.injections[i];for(var X in Y){var z=X.match(/^(v|f)s:#([\w-]+)$/);if(z){var K="decl"===z[2]?D:G;K[X]=K[X]||[],K[X].push(Y[X])}else N[X]=N[X]||[],N[X].push(Y[X])}}}catch(q){Z=!0,P=q}finally{try{V||null==J.return||J.return()}finally{if(Z)throw P}}return O+=E,O=Object(v.c)(O,i,D),O+=function(t,e){var n="";for(var r in t){var i=t[r];if(n+="void ".concat(i.signature," {\n"),i.header&&(n+="  ".concat(i.header)),e[r]){var o=e[r];o.sort((function(t,e){return t.order-e.order}));var a=!0,A=!1,s=void 0;try{for(var c,u=o[Symbol.iterator]();!(a=(c=u.next()).done);a=!0){var l=c.value;n+="  ".concat(l.injection,"\n")}}catch(q){A=!0,s=q}finally{try{a||null==u.return||u.return()}finally{if(A)throw s}}}i.footer&&(n+="  ".concat(i.footer)),n+="}\n"}return n}(g[i],N),O+=x,O=B(O=Object(v.c)(O,i,G),C?100:R,w)}function S(t){return function(e){var n={},r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done);r=!0){var s=a.value.getUniforms(e,n);Object.assign(n,s)}}catch(c){i=!0,o=c}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}var R=n(929);n.d(e,"a",(function(){return U}));var U=function(){function t(e){Object(r.a)(this,t),this.gl=e,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}return Object(i.a)(t,null,[{key:"getDefaultProgramManager",value:function(e){return e.luma=e.luma||{},e.luma.defaultProgramManager=e.luma.defaultProgramManager||new t(e),e.luma.defaultProgramManager}}]),Object(i.a)(t,[{key:"addDefaultModule",value:function(t){this._defaultModules.find((function(e){return e.name===t.name}))||this._defaultModules.push(t),this.stateHash++}},{key:"removeDefaultModule",value:function(t){var e="string"===typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((function(t){return t.name!==e})),this.stateHash++}},{key:"addShaderHook",value:function(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}},{key:"get",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.defines,A=void 0===a?{}:a,s=e.inject,c=void 0===s?{}:s,u=e.varyings,l=void 0===u?[]:u,g=e.bufferMode,f=void 0===g?35981:g,h=e.transpileToGLSL100,d=void 0!==h&&h,I=this._getModuleList(e.modules),p=this._getHash(r),C=this._getHash(o),y=I.map((function(e){return t._getHash(e.name)})).sort(),v=l.map((function(e){return t._getHash(e)})),B=Object.keys(A).sort(),m=Object.keys(c).sort(),b=[],E=[],Q=!0,w=!1,S=void 0;try{for(var U,x=B[Symbol.iterator]();!(Q=(U=x.next()).done);Q=!0){var k=U.value;b.push(this._getHash(k)),b.push(this._getHash(A[k]))}}catch(L){w=!0,S=L}finally{try{Q||null==x.return||x.return()}finally{if(w)throw S}}var O=!0,N=!1,D=void 0;try{for(var G,_=m[Symbol.iterator]();!(O=(G=_.next()).done);O=!0){var M=G.value;E.push(this._getHash(M)),E.push(this._getHash(c[M]))}}catch(L){N=!0,D=L}finally{try{O||null==_.return||_.return()}finally{if(N)throw D}}var T="".concat(p,"/").concat(C,"D").concat(b.join("/"),"M").concat(y.join("/"),"I").concat(E.join("/"),"V").concat(v.join("/"),"H").concat(this.stateHash,"B").concat(f).concat(d?"T":"");if(!this._programCache[T]){var j=F(this.gl,{vs:r,fs:o,modules:I,inject:c,defines:A,hookFunctions:this._hookFunctions,transpileToGLSL100:d});this._programCache[T]=new R.a(this.gl,{hash:T,vs:j.vs,fs:j.fs,varyings:l,bufferMode:f}),this._getUniforms[T]=j.getUniforms||function(t){},this._useCounts[T]=0}return this._useCounts[T]++,this._programCache[T]}},{key:"getUniforms",value:function(t){return this._getUniforms[t.hash]||null}},{key:"release",value:function(t){var e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}},{key:"_getHash",value:function(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}},{key:"_getModuleList",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new Array(this._defaultModules.length+t.length),n={},r=0,i=0,o=this._defaultModules.length;i<o;++i){var a=this._defaultModules[i],A=a.name;e[r++]=a,n[A]=!0}for(var s=0,c=t.length;s<c;++s){var u=t[s],l=u.name;n[l]||(e[r++]=u,n[l]=!0)}return e.length=r,e}}]),t}()},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(2),a=n(34),A=n(7),s=n(8),c=n(6),u=n(40),l=n(435),g=n(436),f=n(252),h=n(379),d=n(235),I=n(259),p=n(140),C=new Uint16Array([0,2,1,0,3,2]),y=new Float32Array([0,1,0,0,1,0,1,1]);function v(t,e){if(!e)return function(t){for(var e=new Float64Array(12),n=0;n<t.length;n++)e[3*n+0]=t[n][0],e[3*n+1]=t[n][1],e[3*n+2]=t[n][2]||0;return{vertexCount:6,positions:e,indices:C,texCoords:y}}(t);for(var n=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),r=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),i=Math.ceil(n/e)+1,o=Math.ceil(r/e)+1,a=(i-1)*(o-1)*6,A=new Uint32Array(a),s=new Float32Array(i*o*2),c=new Float64Array(i*o*3),u=0,l=0,g=0;g<i;g++)for(var f=g/(i-1),h=0;h<o;h++){var d=h/(o-1),I=B(t,f,d);c[3*u+0]=I[0],c[3*u+1]=I[1],c[3*u+2]=I[2]||0,s[2*u+0]=f,s[2*u+1]=1-d,g>0&&h>0&&(A[l++]=u-o,A[l++]=u-o-1,A[l++]=u-1,A[l++]=u-o,A[l++]=u-1,A[l++]=u),u++}return{vertexCount:a,positions:c,indices:A,texCoords:s}}function B(t,e,n){return Object(p.lerp)(Object(p.lerp)(t[0],t[1],n),Object(p.lerp)(t[3],t[2],n),e)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}n.d(e,"a",(function(){return Q}));var E={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:u.a.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}},Q=function(t){Object(A.a)(n,t);var e=b(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"getShaders",value:function(){return Object(a.a)(Object(c.a)(n.prototype),"getShaders",this).call(this,{vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n  geometry.worldPosition = positions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = pickingColor;\n\n  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTexCoord = texCoords;\n\n  if (coordinateConversion < -0.5) {\n    vTexPos = geometry.position.xy;\n  } else if (coordinateConversion > 0.5) {\n    vTexPos = geometry.worldPosition.xy;\n  }\n\n  vec4 color = vec4(0.0);\n  DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:"\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n  float x = lnglat.x;\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n  xy /= WORLD_SCALE;\n  return degrees(vec2(\n    xy.x - PI,\n    atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n  ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n  float luminance = (color.r + color.g + color.b) * 0.333333333;\n  return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n  return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n  return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n  return vec2(\n    (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n    (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n  );\n}\n\nvoid main(void) {\n  vec2 uv = vTexCoord;\n  if (coordinateConversion < -0.5) {\n    vec2 lnglat = mercator_to_lnglat(vTexPos);\n    uv = getUV(lnglat);\n  } else if (coordinateConversion > 0.5) {\n    vec2 commonPos = lnglat_to_mercator(vTexPos);\n    uv = getUV(commonPos);\n  }\n  vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n  gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n  geometry.uv = uv;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[l.a,g.a]})}},{key:"initializeState",value:function(){var t=this,e=this.getAttributeManager();e.remove(["instancePickingColors"]);e.add({indices:{size:1,isIndexed:!0,update:function(e){return e.value=t.state.mesh.indices},noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:function(e){return e.value=t.state.mesh.positions},noAlloc:!0},texCoords:{size:2,update:function(e){return e.value=t.state.mesh.texCoords},noAlloc:!0}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps;if(t.changeFlags.extensionsChanged){var i=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(i)}),this.getAttributeManager().invalidateAll()}var o=this.getAttributeManager();if(e.bounds!==n.bounds){var a=this.state.mesh,A=this._createMesh();for(var s in this.state.model.setVertexCount(A.vertexCount),A)a&&a[s]!==A[s]&&o.invalidate(s);this.setState(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({mesh:A},this._getCoordinateUniforms()))}else e._imageCoordinateSystem!==n._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}},{key:"_createMesh",value:function(){var t=this.props.bounds,e=t;return Number.isFinite(t[0])&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),v(e,this.context.viewport.resolution)}},{key:"_getModel",value:function(t){return t?new h.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new d.a({drawMode:4,vertexCount:6}),isInstanced:!1})):null}},{key:"draw",value:function(t){var e=t.uniforms,n=this.state,r=n.model,i=n.coordinateConversion,o=n.bounds,a=this.props,A=a.image,s=a.desaturate,c=a.transparentColor,u=a.tintColor;A&&r&&r.setUniforms(e).setUniforms({bitmapTexture:A,desaturate:s,transparentColor:c.map((function(t){return t/255})),tintColor:u.slice(0,3).map((function(t){return t/255})),coordinateConversion:i,bounds:o}).draw()}},{key:"_getCoordinateUniforms",value:function(){var t=u.a.LNGLAT,e=u.a.CARTESIAN,n=u.a.DEFAULT,r=this.props._imageCoordinateSystem;if(r!==n){var i=this.props.bounds;if(!Number.isFinite(i[0]))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var o=this.context.viewport.resolution?t:e;if((r=r===t?t:e)===t&&o===e)return{coordinateConversion:-1,bounds:i};if(r===e&&o===t){var a=Object(I.l)([i[0],i[1]]),A=Object(I.l)([i[2],i[3]]);return{coordinateConversion:1,bounds:[a[0],a[1],A[0],A[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}]),n}(f.a);Q.layerName="BitmapLayer",Q.defaultProps=E},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(105),c=n(91),u=n(231);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(c.d)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(c.a)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(c.c)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(c.b)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(c.a.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(u.a)(!1),0}},{key:"RANK",get:function(){return Object(u.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(s.a)(Array))},function(t,e,n){"use strict";var r=n(0),i=r.createContext();e.a=i},function(t,e,n){var r,i,o;i=[],void 0===(o="function"===typeof(r=function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var n={},r={};function i(t,e){var i,o,A;return e?(A=0<=(t>>>=0)&&t<256)&&(o=r[t])?o:(i=a(t,(0|t)<0?-1:0,!0),A&&(r[t]=i),i):(A=-128<=(t|=0)&&t<128)&&(o=n[t])?o:(i=a(t,t<0?-1:0,!1),A&&(n[t]=i),i)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?d:h;if(e){if(t<0)return d;if(t>=l)return v}else{if(t<=-g)return B;if(t+1>=g)return y}return t<0?o(-t,e).neg():a(t%u|0,t/u|0,e)}function a(e,n,r){return new t(e,n,r)}t.fromInt=i,t.fromNumber=o,t.fromBits=a;var A=Math.pow;function s(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return h;if("number"===typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return s(t.substring(1),e,n).neg();for(var i=o(A(n,8)),a=h,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),l=parseInt(t.substring(c,c+u),n);if(u<8){var g=o(A(n,u));a=a.mul(g).add(o(l))}else a=(a=a.mul(i)).add(o(l))}return a.unsigned=e,a}function c(e){return e instanceof t?e:"number"===typeof e?o(e):"string"===typeof e?s(e):a(e.low,e.high,e.unsigned)}t.fromString=s,t.fromValue=c;var u=4294967296,l=u*u,g=l/2,f=i(1<<24),h=i(0);t.ZERO=h;var d=i(0,!0);t.UZERO=d;var I=i(1);t.ONE=I;var p=i(1,!0);t.UONE=p;var C=i(-1);t.NEG_ONE=C;var y=a(-1,2147483647,!1);t.MAX_VALUE=y;var v=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=v;var B=a(0,-2147483648,!1);t.MIN_VALUE=B;var m=t.prototype;return m.toInt=function(){return this.unsigned?this.low>>>0:this.low},m.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},m.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var e=o(t),n=this.div(e),r=n.mul(e).sub(this);return n.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=o(A(t,6),this.unsigned),a=this,s="";;){var c=a.div(i),u=(a.sub(c.mul(i)).toInt()>>>0).toString(t);if((a=c).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},m.getHighBits=function(){return this.high},m.getHighBitsUnsigned=function(){return this.high>>>0},m.getLowBits=function(){return this.low},m.getLowBitsUnsigned=function(){return this.low>>>0},m.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},m.isZero=function(){return 0===this.high&&0===this.low},m.isNegative=function(){return!this.unsigned&&this.high<0},m.isPositive=function(){return this.unsigned||this.high>=0},m.isOdd=function(){return 1===(1&this.low)},m.isEven=function(){return 0===(1&this.low)},m.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&this.high===t.high&&this.low===t.low},m.eq=m.equals,m.notEquals=function(t){return!this.eq(t)},m.neq=m.notEquals,m.lessThan=function(t){return this.comp(t)<0},m.lt=m.lessThan,m.lessThanOrEqual=function(t){return this.comp(t)<=0},m.lte=m.lessThanOrEqual,m.greaterThan=function(t){return this.comp(t)>0},m.gt=m.greaterThan,m.greaterThanOrEqual=function(t){return this.comp(t)>=0},m.gte=m.greaterThanOrEqual,m.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},m.comp=m.compare,m.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(I)},m.neg=m.negate,m.add=function(t){e(t)||(t=c(t));var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,A=t.high>>>16,s=65535&t.high,u=t.low>>>16,l=0,g=0,f=0,h=0;return f+=(h+=o+(65535&t.low))>>>16,g+=(f+=i+u)>>>16,l+=(g+=r+s)>>>16,l+=n+A,a((f&=65535)<<16|(h&=65535),(l&=65535)<<16|(g&=65535),this.unsigned)},m.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},m.sub=m.subtract,m.multiply=function(t){if(this.isZero())return h;if(e(t)||(t=c(t)),t.isZero())return h;if(this.eq(B))return t.isOdd()?B:h;if(t.eq(B))return this.isOdd()?B:h;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(f)&&t.lt(f))return o(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,A=65535&this.low,s=t.high>>>16,u=65535&t.high,l=t.low>>>16,g=65535&t.low,d=0,I=0,p=0,C=0;return p+=(C+=A*g)>>>16,I+=(p+=i*g)>>>16,p&=65535,I+=(p+=A*l)>>>16,d+=(I+=r*g)>>>16,I&=65535,d+=(I+=i*l)>>>16,I&=65535,d+=(I+=A*u)>>>16,d+=n*g+r*l+i*u+A*s,a((p&=65535)<<16|(C&=65535),(d&=65535)<<16|(I&=65535),this.unsigned)},m.mul=m.multiply,m.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?d:h;var n,r,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return d;if(t.gt(this.shru(1)))return p;i=d}else{if(this.eq(B))return t.eq(I)||t.eq(C)?B:t.eq(B)?I:(n=this.shr(1).div(t).shl(1)).eq(h)?t.isNegative()?I:C:(r=this.sub(t.mul(n)),i=n.add(r.div(t)));if(t.eq(B))return this.unsigned?d:h;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=h}for(r=this;r.gte(t);){n=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),s=a<=48?1:A(2,a-48),u=o(n),l=u.mul(t);l.isNegative()||l.gt(r);)l=(u=o(n-=s,this.unsigned)).mul(t);u.isZero()&&(u=I),i=i.add(u),r=r.sub(l)}return i},m.div=m.divide,m.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},m.mod=m.modulo,m.not=function(){return a(~this.low,~this.high,this.unsigned)},m.and=function(t){return e(t)||(t=c(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},m.or=function(t){return e(t)||(t=c(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},m.xor=function(t){return e(t)||(t=c(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},m.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},m.shl=m.shiftLeft,m.shiftRight=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},m.shr=m.shiftRight,m.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;return t<32?a(this.low>>>t|n<<32-t,n>>>t,this.unsigned):a(32===t?n:n>>>t-32,0,this.unsigned)},m.shru=m.shiftRightUnsigned,m.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},m.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},m.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},m.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},m.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return f}));var r=n(110),i=n(40);function o(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,A=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return A=t.done,t},e:function(t){s=!0,o=t},f:function(){try{A||null==n.return||n.return()}finally{if(s)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var A=Math.PI/180,s=new Float32Array(16),c=new Float32Array(12);function u(t,e,n){var r=e[0]*A,i=e[1]*A,o=e[2]*A,a=Math.sin(o),s=Math.sin(r),c=Math.sin(i),u=Math.cos(o),l=Math.cos(r),g=Math.cos(i),f=n[0],h=n[1],d=n[2];t[0]=f*g*l,t[1]=f*c*l,t[2]=f*-s,t[3]=h*(-c*u+g*s*a),t[4]=h*(g*u+c*s*a),t[5]=h*l*a,t[6]=d*(c*a+g*s*u),t[7]=d*(-g*a+c*s*u),t[8]=d*l*u}function l(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}var g={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update:function(t,e){var n=e.startRow,i=e.endRow,a=this.props,A=a.data,g=a.getOrientation,f=a.getScale,h=a.getTranslation,d=a.getTransformMatrix,I=Array.isArray(d),p=I&&16===d.length,C=Array.isArray(f),y=Array.isArray(g),v=Array.isArray(h),B=p||!I&&Boolean(d(A[0]));t.constant=B?p:y&&C&&v;var m=t.value;if(t.constant){var b;if(B)s.set(d),b=l(s);else u(b=c,g,f),b.set(h,9);t.value=new Float32Array(b)}else{var E,Q=n*t.size,F=Object(r.a)(A,n,i),w=F.iterable,S=F.objectInfo,R=o(w);try{for(R.s();!(E=R.n()).done;){var U=E.value;S.index++;var x=void 0;if(B)s.set(p?d:d(U,S)),x=l(s);else u(x=c,y?g:g(U,S),C?f:f(U,S)),x.set(v?h:h(U,S),9);m[Q++]=x[0],m[Q++]=x[1],m[Q++]=x[2],m[Q++]=x[3],m[Q++]=x[4],m[Q++]=x[5],m[Q++]=x[6],m[Q++]=x[7],m[Q++]=x[8],m[Q++]=x[9],m[Q++]=x[10],m[Q++]=x[11]}}catch(k){R.e(k)}finally{R.f()}}}};function f(t,e){return e===i.a.CARTESIAN||e===i.a.METER_OFFSETS||e===i.a.DEFAULT&&!t.isGeospatial}},function(t,e,n){"use strict";function r(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function o(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}))},,,,function(t,e,n){"use strict";n.r(e);var r=n(317);n.d(e,"default",(function(){return r.a}))},function(t,e,n){var r=n(229),i=n(193);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(280),i=n(648),o=n(649),a=n(650),A=n(651),s=n(652);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=A,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(677),i=n(193),o=Object.prototype,a=o.hasOwnProperty,A=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!A.call(t,"callee")};t.exports=s},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var r=n(682),i=n(344),o=n(683),a=n(535),A=n(684),s=n(229),c=n(452),u=c(r),l=c(i),g=c(o),f=c(a),h=c(A),d=s;(r&&"[object DataView]"!=d(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=d(new i)||o&&"[object Promise]"!=d(o.resolve())||a&&"[object Set]"!=d(new a)||A&&"[object WeakMap]"!=d(new A))&&(d=function(t){var e=s(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case u:return"[object DataView]";case l:return"[object Map]";case g:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return e}),t.exports=d},function(t,e,n){"use strict";function r(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};if(!e)return n;return Object.keys(e).forEach((function(r){var i=e[r];"object"===typeof i?null===i?n[r]=null:Array.isArray(i)?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n}(t.properties),e.geometry=i(t.geometry),e}function i(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return i(t)})),e):(e.coordinates=function t(e){var n=e;if("object"!==typeof n[0])return n.slice();return n.map((function(e){return t(e)}))}(t.coordinates),e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return r(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(t);default:throw new Error("unknown GeoJSON type")}}},function(t,e,n){"use strict";t.exports=function(t,e){e||(e={}),"function"===typeof e&&(e={cmp:e});var n,r="boolean"===typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!==typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var A=o.push(e)-1,s=Object.keys(e).sort(i&&i(e));for(a="",n=0;n<s.length;n++){var c=s[n],u=t(e[c]);u&&(a&&(a+=","),a+=JSON.stringify(c)+":"+u)}return o.splice(A,1),"{"+a+"}"}}(t)}},function(t,e,n){(function(e){for(var r=n(1227),i="undefined"===typeof window?e:window,o=["moz","webkit"],a="AnimationFrame",A=i["request"+a],s=i["cancel"+a]||i["cancelRequest"+a],c=0;!A&&c<o.length;c++)A=i[o[c]+"Request"+a],s=i[o[c]+"Cancel"+a]||i[o[c]+"CancelRequest"+a];if(!A||!s){var u=0,l=0,g=[];A=function(t){if(0===g.length){var e=r(),n=Math.max(0,1e3/60-(e-u));u=n+e,setTimeout((function(){var t=g.slice(0);g.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(u)}catch(n){setTimeout((function(){throw n}),0)}}),Math.round(n))}return g.push({handle:++l,callback:t,cancelled:!1}),l},s=function(t){for(var e=0;e<g.length;e++)g[e].handle===t&&(g[e].cancelled=!0)}}t.exports=function(t){return A.call(i,t)},t.exports.cancel=function(){s.apply(i,arguments)},t.exports.polyfill=function(t){t||(t=i),t.requestAnimationFrame=A,t.cancelAnimationFrame=s}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(522);function a(t){var e=t.parentUuid,n=t.sourceUuid,r=t.x,a=t.y,A=t.parentWidth,s=t.parentHeight,c=t.children;if(r<0||r>A||a<0||a>s)return null;var u=e===n;return i.a.createElement(i.a.Fragment,null,u?i.a.createElement(o.a,{x:r,y:a,parentWidth:A,parentHeight:s},c):i.a.createElement(i.a.Fragment,null,null!==r?i.a.createElement("div",{className:"cell-emphasis-crosshair",style:{left:"".concat(r-.5,"px"),top:0,width:"".concat(1,"px"),height:"".concat(s,"px")}}):null,null!==a?i.a.createElement("div",{className:"cell-emphasis-crosshair",style:{left:0,top:"".concat(a-.5,"px"),width:"".concat(A,"px"),height:"".concat(1,"px")}}):null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(12),i=n(0),o=n.n(i);function a(t){var e=t.info;return o.a.createElement("table",null,o.a.createElement("tbody",null,Object.entries(e).map((function(t){var e=Object(r.a)(t,2),n=e[0],i=e[1];return o.a.createElement("tr",{key:n},o.a.createElement("th",null,n),o.a.createElement("td",null,i))}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(387),i=Object(r.a)((function(t){return{box:{boxSizing:"border-box"},checkbox:{padding:"3px",color:t.palette.primaryForeground,"&:checked":{color:t.palette.primaryForeground},"& input":{height:"100%"}},slider:{color:t.palette.primaryForeground,minWidth:"60px",padding:"10px 0 6px 0"},sliderValueLabel:{"& span":{"& span":{color:t.palette.primaryBackground}}},tableContainer:{overflow:"hidden"},labelCell:{padding:"2px 8px 2px 16px"},inputCell:{padding:"2px 16px 2px 8px",overflow:"visible"},select:{"& select":{fontSize:".875rem"}}}}))},function(t,e,n){var r=n(422);t.exports=function(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e,n){var r=n(642),i=n(193);t.exports=function t(e,n,o,a,A){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!==e&&n!==n:r(e,n,o,a,t,A))}},function(t,e,n){var r=n(407),i=n(669),o=n(670);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(675),i=n(532),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,A=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=A},function(t,e,n){(function(t){var r=n(412),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,A=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=A}).call(this,n(130)(t))},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69);e.default=function(t,e){void 0===e&&(e={});var n=Number(t[0]),i=Number(t[1]),o=Number(t[2]),a=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var A=[n,i],s=[n,a],c=[o,a],u=[o,i];return r.polygon([[A,u,c,s,A]],e.properties,{bbox:t,id:e.id})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(250)),i=o(n(1085));function o(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(h,t);var e,n,r,o,a=(e=h,function(){var t,n=l(e);if(u()){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function h(t){var e,n=t.getData,r=t.on,o=t.toNebulaFeature;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),f(c(e=a.call(this)),"getData",void 0),f(c(e),"toNebulaFeature",void 0),f(c(e),"id",void 0),f(c(e),"helperLayers",void 0),f(c(e),"usesMapEvents",!1),f(c(e),"enablePicking",!1),f(c(e),"enableSelection",!1),e.id=i.default.v4(),e.getData=n,e.toNebulaFeature=o,e.helperLayers=[],r&&Object.keys(r).forEach((function(t){return e.on(t,r[t])})),e}return n=h,(r=[{key:"render",value:function(t){return null}}])&&A(n.prototype,r),o&&A(n,o),h}(r.default.EventEmitter);e.default=h},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(t,e,n){t.exports=!n(748)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(824),i=n(1232),o=n(1249),a=n(200);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(109);function i(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i][0],A=e[i][1],s=e[o][0],c=e[o][1];if(t[1]*(a-s)+A*(s-t[0])+c*(t[0]-a)===0&&(a-t[0])*(s-t[0])<=0&&(A-t[1])*(c-t[1])<=0)return!n;A>t[1]!==c>t[1]&&t[0]<(s-a)*(t[1]-A)/(c-A)+a&&(r=!r)}return r}e.default=function(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=r.getCoord(t),a=r.getGeom(e),A=a.type,s=e.bbox,c=a.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(o,s))return!1;"Polygon"===A&&(c=[c]);for(var u=!1,l=0;l<c.length&&!u;l++)if(i(o,c[l][0],n.ignoreBoundary)){for(var g=!1,f=1;f<c[l].length&&!g;)i(o,c[l][f],!n.ignoreBoundary)&&(g=!0),f++;g||(u=!0)}return u}},function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return i(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var n=0;return i(t,n,e)}return""}function i(t,e,n){if(t.byteLength<=e+n)return"";for(var r=new DataView(t),i="",o=0;o<n;o++)i+=String.fromCharCode(r.getUint8(e+o));return i}n.d(e,"a",(function(){return r}))},function(t,e){},,function(t,e){e.read=function(t,e,n,r,i){var o,a,A=8*i-r-1,s=(1<<A)-1,c=s>>1,u=-7,l=n?i-1:0,g=n?-1:1,f=t[e+l];for(l+=g,o=f&(1<<-u)-1,f>>=-u,u+=A;u>0;o=256*o+t[e+l],l+=g,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+t[e+l],l+=g,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,A,s,c=8*o-i-1,u=(1<<c)-1,l=u>>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(A=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+l>=1?g/s:g*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=u?(A=0,a=u):a+l>=1?(A=(e*s-1)*Math.pow(2,i),a+=l):(A=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&A,f+=h,A/=256,i-=8);for(a=a<<i|A,c+=i;c>0;t[n+f]=255&a,f+=h,a/=256,c-=8);t[n+f-h]|=128*d}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n.n(r);function o(t){var e=t.x,n=t.y,o=t.parentWidth,a=t.parentHeight,A=t.children,s=Object(r.useRef)(null),c=o<500;return Object(r.useEffect)((function(){var t=s.current,r=c?-5:10,i=e>o/2?-(100+r):r,A=n>a/2?-(100+r):r,u=c?.75:1;t.style.transform="translateX(".concat(i,"%) translateY(").concat(A,"%) scale(").concat(u,")"),t.style.whiteSpace=c?"normal":"nowrap"})),i.a.createElement("div",{ref:s,className:"cell-tooltip bg-primary",style:{left:"".concat(e,"px"),top:"".concat(n,"px")}},A)}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return et})),n.d(r,"deepClone",(function(){return nt})),n.d(r,"getValueByPointer",(function(){return ot})),n.d(r,"applyOperation",(function(){return at})),n.d(r,"applyPatch",(function(){return At})),n.d(r,"applyReducer",(function(){return st})),n.d(r,"validator",(function(){return ct})),n.d(r,"validate",(function(){return ut})),n.d(r,"_areEquals",(function(){return lt}));var i={};n.r(i),n.d(i,"unobserve",(function(){return dt})),n.d(i,"observe",(function(){return It})),n.d(i,"generate",(function(){return pt})),n.d(i,"compare",(function(){return yt}));var o={};n.r(o),n.d(o,"aggregate",(function(){return TA})),n.d(o,"bin",(function(){return LA})),n.d(o,"collect",(function(){return PA})),n.d(o,"compare",(function(){return WA})),n.d(o,"countpattern",(function(){return HA})),n.d(o,"cross",(function(){return XA})),n.d(o,"density",(function(){return KA})),n.d(o,"dotbin",(function(){return ns})),n.d(o,"expression",(function(){return rs})),n.d(o,"extent",(function(){return os})),n.d(o,"facet",(function(){return ss})),n.d(o,"field",(function(){return us})),n.d(o,"filter",(function(){return gs})),n.d(o,"flatten",(function(){return fs})),n.d(o,"fold",(function(){return hs})),n.d(o,"formula",(function(){return ds})),n.d(o,"generate",(function(){return Is})),n.d(o,"impute",(function(){return Fs})),n.d(o,"joinaggregate",(function(){return ws})),n.d(o,"kde",(function(){return Rs})),n.d(o,"key",(function(){return Us})),n.d(o,"load",(function(){return ks})),n.d(o,"lookup",(function(){return Ns})),n.d(o,"multiextent",(function(){return Ds})),n.d(o,"multivalues",(function(){return _s})),n.d(o,"params",(function(){return Ts})),n.d(o,"pivot",(function(){return js})),n.d(o,"prefacet",(function(){return Vs})),n.d(o,"project",(function(){return Zs})),n.d(o,"proxy",(function(){return Ps})),n.d(o,"quantile",(function(){return Js})),n.d(o,"relay",(function(){return Ys})),n.d(o,"sample",(function(){return Xs})),n.d(o,"sequence",(function(){return zs})),n.d(o,"sieve",(function(){return Ks})),n.d(o,"subflow",(function(){return as})),n.d(o,"timeunit",(function(){return qs})),n.d(o,"tupleindex",(function(){return ec})),n.d(o,"values",(function(){return nc})),n.d(o,"window",(function(){return sc}));var a={};n.r(a),n.d(a,"interpolate",(function(){return Sd})),n.d(a,"interpolateArray",(function(){return vd})),n.d(a,"interpolateBasis",(function(){return Ad})),n.d(a,"interpolateBasisClosed",(function(){return sd})),n.d(a,"interpolateDate",(function(){return md})),n.d(a,"interpolateDiscrete",(function(){return OI})),n.d(a,"interpolateHue",(function(){return NI})),n.d(a,"interpolateNumber",(function(){return bd})),n.d(a,"interpolateNumberArray",(function(){return Cd})),n.d(a,"interpolateObject",(function(){return Ed})),n.d(a,"interpolateRound",(function(){return Rd})),n.d(a,"interpolateString",(function(){return wd})),n.d(a,"interpolateTransformCss",(function(){return TI})),n.d(a,"interpolateTransformSvg",(function(){return jI})),n.d(a,"interpolateZoom",(function(){return ZI})),n.d(a,"interpolateRgb",(function(){return hd})),n.d(a,"interpolateRgbBasis",(function(){return Id})),n.d(a,"interpolateRgbBasisClosed",(function(){return pd})),n.d(a,"interpolateHsl",(function(){return WI})),n.d(a,"interpolateHslLong",(function(){return JI})),n.d(a,"interpolateLab",(function(){return ap})),n.d(a,"interpolateHcl",(function(){return sp})),n.d(a,"interpolateHclLong",(function(){return cp})),n.d(a,"interpolateCubehelix",(function(){return Cp})),n.d(a,"interpolateCubehelixLong",(function(){return yp})),n.d(a,"piecewise",(function(){return cI})),n.d(a,"quantize",(function(){return vp}));var A={};n.r(A),n.d(A,"bound",(function(){return TC})),n.d(A,"identifier",(function(){return LC})),n.d(A,"mark",(function(){return VC})),n.d(A,"overlap",(function(){return ZC})),n.d(A,"render",(function(){return KC})),n.d(A,"viewlayout",(function(){return yy}));var s={};n.r(s),n.d(s,"axisticks",(function(){return vy})),n.d(s,"datajoin",(function(){return By})),n.d(s,"encode",(function(){return by})),n.d(s,"legendentries",(function(){return Ey})),n.d(s,"linkpath",(function(){return Uy})),n.d(s,"pie",(function(){return Dy})),n.d(s,"scale",(function(){return My})),n.d(s,"sortitems",(function(){return Vy})),n.d(s,"stack",(function(){return Py}));var c={};n.r(c),n.d(c,"contour",(function(){return Iv})),n.d(c,"geojson",(function(){return pv})),n.d(c,"geopath",(function(){return HE})),n.d(c,"geopoint",(function(){return YE})),n.d(c,"geoshape",(function(){return XE})),n.d(c,"graticule",(function(){return oQ})),n.d(c,"heatmap",(function(){return DQ})),n.d(c,"isocontour",(function(){return ov})),n.d(c,"kde2d",(function(){return gv})),n.d(c,"projection",(function(){return _Q}));var u={};n.r(u),n.d(u,"force",(function(){return KQ}));var l={};n.r(l),n.d(l,"nest",(function(){return uF})),n.d(l,"pack",(function(){return MF})),n.d(l,"partition",(function(){return ZF})),n.d(l,"stratify",(function(){return zF})),n.d(l,"tree",(function(){return sw})),n.d(l,"treelinks",(function(){return uw})),n.d(l,"treemap",(function(){return Cw}));var g={};n.r(g),n.d(g,"loess",(function(){return Bw})),n.d(g,"regression",(function(){return bw}));var f={};n.r(f),n.d(f,"voronoi",(function(){return Yw}));var h={};n.r(h),n.d(h,"wordcloud",(function(){return sS}));var d={};n.r(d),n.d(d,"crossfilter",(function(){return yS})),n.d(d,"resolvefilter",(function(){return BS}));var I={};n.r(I),n.d(I,"version",(function(){return mS.a})),n.d(I,"bandwidthNRD",(function(){return Wa})),n.d(I,"bin",(function(){return Ja})),n.d(I,"bootstrapCI",(function(){return Xa})),n.d(I,"dotbin",(function(){return za})),n.d(I,"quantiles",(function(){return Va})),n.d(I,"quartiles",(function(){return Za})),n.d(I,"random",(function(){return Ha})),n.d(I,"setRandom",(function(){return Ya})),n.d(I,"randomLCG",(function(){return Ka})),n.d(I,"randomInteger",(function(){return qa})),n.d(I,"randomKDE",(function(){return AA})),n.d(I,"randomLogNormal",(function(){return gA})),n.d(I,"sampleLogNormal",(function(){return sA})),n.d(I,"densityLogNormal",(function(){return cA})),n.d(I,"cumulativeLogNormal",(function(){return uA})),n.d(I,"quantileLogNormal",(function(){return lA})),n.d(I,"randomMixture",(function(){return fA})),n.d(I,"randomNormal",(function(){return aA})),n.d(I,"sampleNormal",(function(){return nA})),n.d(I,"densityNormal",(function(){return rA})),n.d(I,"cumulativeNormal",(function(){return iA})),n.d(I,"quantileNormal",(function(){return oA})),n.d(I,"randomUniform",(function(){return CA})),n.d(I,"sampleUniform",(function(){return hA})),n.d(I,"densityUniform",(function(){return dA})),n.d(I,"cumulativeUniform",(function(){return IA})),n.d(I,"quantileUniform",(function(){return pA})),n.d(I,"regressionLinear",(function(){return bA})),n.d(I,"regressionLog",(function(){return EA})),n.d(I,"regressionExp",(function(){return FA})),n.d(I,"regressionPow",(function(){return wA})),n.d(I,"regressionQuad",(function(){return SA})),n.d(I,"regressionPoly",(function(){return RA})),n.d(I,"regressionLoess",(function(){return xA})),n.d(I,"sampleCurve",(function(){return DA})),n.d(I,"TIME_UNITS",(function(){return vn})),n.d(I,"YEAR",(function(){return cn})),n.d(I,"QUARTER",(function(){return un})),n.d(I,"MONTH",(function(){return ln})),n.d(I,"WEEK",(function(){return gn})),n.d(I,"DATE",(function(){return fn})),n.d(I,"DAY",(function(){return hn})),n.d(I,"DAYOFYEAR",(function(){return dn})),n.d(I,"HOURS",(function(){return In})),n.d(I,"MINUTES",(function(){return pn})),n.d(I,"SECONDS",(function(){return Cn})),n.d(I,"MILLISECONDS",(function(){return yn})),n.d(I,"timeUnitSpecifier",(function(){return En})),n.d(I,"timeUnits",(function(){return mn})),n.d(I,"dayofyear",(function(){return tr})),n.d(I,"week",(function(){return er})),n.d(I,"utcdayofyear",(function(){return ar})),n.d(I,"utcweek",(function(){return Ar})),n.d(I,"timeFloor",(function(){return Ir})),n.d(I,"utcFloor",(function(){return yr})),n.d(I,"timeInterval",(function(){return Pr})),n.d(I,"timeOffset",(function(){return Hr})),n.d(I,"timeSequence",(function(){return zr})),n.d(I,"utcInterval",(function(){return Wr})),n.d(I,"utcOffset",(function(){return Yr})),n.d(I,"utcSequence",(function(){return Kr})),n.d(I,"timeBin",(function(){return li})),n.d(I,"accessor",(function(){return x.f})),n.d(I,"accessorName",(function(){return x.h})),n.d(I,"accessorFields",(function(){return x.g})),n.d(I,"id",(function(){return x.w})),n.d(I,"identity",(function(){return x.x})),n.d(I,"zero",(function(){return x.kb})),n.d(I,"one",(function(){return x.O})),n.d(I,"truthy",(function(){return x.gb})),n.d(I,"falsy",(function(){return x.r})),n.d(I,"logger",(function(){return x.K})),n.d(I,"None",(function(){return x.d})),n.d(I,"Error",(function(){return x.b})),n.d(I,"Warn",(function(){return x.e})),n.d(I,"Info",(function(){return x.c})),n.d(I,"Debug",(function(){return x.a})),n.d(I,"mergeConfig",(function(){return x.N})),n.d(I,"writeConfig",(function(){return x.jb})),n.d(I,"panLinear",(function(){return x.Q})),n.d(I,"panLog",(function(){return x.R})),n.d(I,"panPow",(function(){return x.S})),n.d(I,"panSymlog",(function(){return x.T})),n.d(I,"zoomLinear",(function(){return x.lb})),n.d(I,"zoomLog",(function(){return x.mb})),n.d(I,"zoomPow",(function(){return x.nb})),n.d(I,"zoomSymlog",(function(){return x.ob})),n.d(I,"quarter",(function(){return x.V})),n.d(I,"utcquarter",(function(){return x.hb})),n.d(I,"array",(function(){return x.i})),n.d(I,"clampRange",(function(){return x.j})),n.d(I,"compare",(function(){return x.k})),n.d(I,"constant",(function(){return x.l})),n.d(I,"debounce",(function(){return x.m})),n.d(I,"error",(function(){return x.n})),n.d(I,"extend",(function(){return x.o})),n.d(I,"extent",(function(){return x.p})),n.d(I,"extentIndex",(function(){return x.q})),n.d(I,"fastmap",(function(){return x.s})),n.d(I,"field",(function(){return x.t})),n.d(I,"flush",(function(){return x.u})),n.d(I,"hasOwnProperty",(function(){return x.v})),n.d(I,"inherits",(function(){return x.y})),n.d(I,"inrange",(function(){return x.z})),n.d(I,"isArray",(function(){return x.A})),n.d(I,"isBoolean",(function(){return x.B})),n.d(I,"isDate",(function(){return x.C})),n.d(I,"isFunction",(function(){return x.D})),n.d(I,"isNumber",(function(){return x.E})),n.d(I,"isObject",(function(){return x.F})),n.d(I,"isRegExp",(function(){return x.G})),n.d(I,"isString",(function(){return x.H})),n.d(I,"key",(function(){return x.I})),n.d(I,"lerp",(function(){return x.J})),n.d(I,"lruCache",(function(){return x.L})),n.d(I,"merge",(function(){return x.M})),n.d(I,"pad",(function(){return x.P})),n.d(I,"peek",(function(){return x.U})),n.d(I,"repeat",(function(){return x.W})),n.d(I,"span",(function(){return x.X})),n.d(I,"splitAccessPath",(function(){return x.Y})),n.d(I,"stringValue",(function(){return x.Z})),n.d(I,"toBoolean",(function(){return x.ab})),n.d(I,"toDate",(function(){return x.bb})),n.d(I,"toNumber",(function(){return x.cb})),n.d(I,"toString",(function(){return x.eb})),n.d(I,"toSet",(function(){return x.db})),n.d(I,"truncate",(function(){return x.fb})),n.d(I,"visitArray",(function(){return x.ib})),n.d(I,"loader",(function(){return Po})),n.d(I,"read",(function(){return Zo})),n.d(I,"inferType",(function(){return fe})),n.d(I,"inferTypes",(function(){return he})),n.d(I,"typeParsers",(function(){return ue})),n.d(I,"format",(function(){return xe})),n.d(I,"formats",(function(){return ke})),n.d(I,"responseType",(function(){return Oe})),n.d(I,"Bounds",(function(){return wl})),n.d(I,"Gradient",(function(){return mc})),n.d(I,"GroupItem",(function(){return Ul})),n.d(I,"ResourceLoader",(function(){return Ol})),n.d(I,"Item",(function(){return Rl})),n.d(I,"Scenegraph",(function(){return Ef})),n.d(I,"Handler",(function(){return Of})),n.d(I,"Renderer",(function(){return Gf})),n.d(I,"CanvasHandler",(function(){return Hf})),n.d(I,"CanvasRenderer",(function(){return $f})),n.d(I,"SVGHandler",(function(){return nh})),n.d(I,"SVGRenderer",(function(){return cC})),n.d(I,"SVGStringRenderer",(function(){return bC})),n.d(I,"RenderType",(function(){return wC})),n.d(I,"renderModule",(function(){return RC})),n.d(I,"intersect",(function(){return UC})),n.d(I,"Marks",(function(){return pf})),n.d(I,"boundClip",(function(){return DC})),n.d(I,"boundContext",(function(){return Vl})),n.d(I,"boundStroke",(function(){return _l})),n.d(I,"boundItem",(function(){return Cf})),n.d(I,"boundMark",(function(){return vf})),n.d(I,"pathCurves",(function(){return Iu})),n.d(I,"pathSymbols",(function(){return Nu})),n.d(I,"pathRectangle",(function(){return Xu})),n.d(I,"pathTrail",(function(){return zu})),n.d(I,"pathParse",(function(){return yu})),n.d(I,"pathRender",(function(){return Uu})),n.d(I,"point",(function(){return kf})),n.d(I,"domCreate",(function(){return wf})),n.d(I,"domFind",(function(){return Sf})),n.d(I,"domChild",(function(){return Rf})),n.d(I,"domClear",(function(){return Uf})),n.d(I,"openTag",(function(){return iC})),n.d(I,"closeTag",(function(){return oC})),n.d(I,"font",(function(){return lf})),n.d(I,"fontFamily",(function(){return uf})),n.d(I,"fontSize",(function(){return of})),n.d(I,"lineHeight",(function(){return af})),n.d(I,"multiLineOffset",(function(){return sf})),n.d(I,"textMetrics",(function(){return qg})),n.d(I,"sceneEqual",(function(){return GC})),n.d(I,"pathEqual",(function(){return _C})),n.d(I,"sceneToJSON",(function(){return mf})),n.d(I,"sceneFromJSON",(function(){return bf})),n.d(I,"intersectPath",(function(){return $l})),n.d(I,"intersectPoint",(function(){return tg})),n.d(I,"intersectRule",(function(){return ng})),n.d(I,"intersectBoxLine",(function(){return rg})),n.d(I,"sceneZOrder",(function(){return gg})),n.d(I,"sceneVisit",(function(){return fg})),n.d(I,"scenePickVisit",(function(){return hg})),n.d(I,"resetSVGClipId",(function(){return Ql})),n.d(I,"resetSVGDefIds",(function(){return MC})),n.d(I,"Dataflow",(function(){return la})),n.d(I,"EventStream",(function(){return Yt})),n.d(I,"Parameters",(function(){return jt})),n.d(I,"Pulse",(function(){return qo})),n.d(I,"MultiPulse",(function(){return ra})),n.d(I,"Operator",(function(){return Pt})),n.d(I,"Transform",(function(){return ha})),n.d(I,"changeset",(function(){return Mt})),n.d(I,"ingest",(function(){return kt})),n.d(I,"isTuple",(function(){return Rt})),n.d(I,"definition",(function(){return pa})),n.d(I,"transform",(function(){return Ca})),n.d(I,"transforms",(function(){return Ia})),n.d(I,"tupleid",(function(){return Ut})),n.d(I,"scale",(function(){return vI})),n.d(I,"scheme",(function(){return Up})),n.d(I,"interpolate",(function(){return Fp})),n.d(I,"interpolateColors",(function(){return bp})),n.d(I,"interpolateRange",(function(){return mp})),n.d(I,"quantizeInterpolator",(function(){return Ep})),n.d(I,"projection",(function(){return ZE})),n.d(I,"View",(function(){return RO})),n.d(I,"formatLocale",(function(){return sn})),n.d(I,"timeFormatLocale",(function(){return Mo})),n.d(I,"locale",(function(){return jo})),n.d(I,"defaultLocale",(function(){return Lo})),n.d(I,"resetDefaultLocale",(function(){return Vo})),n.d(I,"expressionFunction",(function(){return oO})),n.d(I,"parse",(function(){return e_})),n.d(I,"runtimeContext",(function(){return pO}));var p={};n.r(p),n.d(p,"invalidSpec",(function(){return MT})),n.d(p,"FIT_NON_SINGLE",(function(){return TT})),n.d(p,"containerSizeNonSingle",(function(){return jT})),n.d(p,"containerSizeNotCompatibleWithAutosize",(function(){return LT})),n.d(p,"droppingFit",(function(){return VT})),n.d(p,"cannotProjectOnChannelWithoutField",(function(){return ZT})),n.d(p,"cannotProjectAggregate",(function(){return PT})),n.d(p,"nearestNotSupportForContinuous",(function(){return WT})),n.d(p,"selectionNotSupported",(function(){return JT})),n.d(p,"selectionNotFound",(function(){return HT})),n.d(p,"SCALE_BINDINGS_CONTINUOUS",(function(){return YT})),n.d(p,"LEGEND_BINDINGS_PROJECT_LENGTH",(function(){return XT})),n.d(p,"noSameUnitLookup",(function(){return zT})),n.d(p,"noSuchRepeatedValue",(function(){return KT})),n.d(p,"columnsNotSupportByRowCol",(function(){return qT})),n.d(p,"CONCAT_CANNOT_SHARE_AXIS",(function(){return $T})),n.d(p,"unrecognizedParse",(function(){return tj})),n.d(p,"differentParse",(function(){return ej})),n.d(p,"invalidTransformIgnored",(function(){return nj})),n.d(p,"NO_FIELDS_NEEDS_AS",(function(){return rj})),n.d(p,"customFormatTypeNotAllowed",(function(){return ij})),n.d(p,"encodingOverridden",(function(){return oj})),n.d(p,"projectionOverridden",(function(){return aj})),n.d(p,"REPLACE_ANGLE_WITH_THETA",(function(){return Aj})),n.d(p,"primitiveChannelDef",(function(){return sj})),n.d(p,"invalidFieldType",(function(){return cj})),n.d(p,"invalidFieldTypeForCountAggregate",(function(){return uj})),n.d(p,"invalidAggregate",(function(){return lj})),n.d(p,"missingFieldType",(function(){return gj})),n.d(p,"droppingColor",(function(){return fj})),n.d(p,"emptyFieldDef",(function(){return hj})),n.d(p,"latLongDeprecated",(function(){return dj})),n.d(p,"LINE_WITH_VARYING_SIZE",(function(){return Ij})),n.d(p,"incompatibleChannel",(function(){return pj})),n.d(p,"invalidEncodingChannel",(function(){return Cj})),n.d(p,"facetChannelShouldBeDiscrete",(function(){return yj})),n.d(p,"facetChannelDropped",(function(){return vj})),n.d(p,"discreteChannelCannotEncode",(function(){return Bj})),n.d(p,"lineWithRange",(function(){return mj})),n.d(p,"orientOverridden",(function(){return bj})),n.d(p,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return Ej})),n.d(p,"RANGE_STEP_DEPRECATED",(function(){return Qj})),n.d(p,"cannotUseScalePropertyWithNonColor",(function(){return Fj})),n.d(p,"unaggregateDomainHasNoEffectForRawField",(function(){return wj})),n.d(p,"unaggregateDomainWithNonSharedDomainOp",(function(){return Sj})),n.d(p,"unaggregatedDomainWithLogScale",(function(){return Rj})),n.d(p,"cannotApplySizeToNonOrientedMark",(function(){return Uj})),n.d(p,"scaleTypeNotWorkWithChannel",(function(){return xj})),n.d(p,"scaleTypeNotWorkWithFieldDef",(function(){return kj})),n.d(p,"scalePropertyNotWorkWithScaleType",(function(){return Oj})),n.d(p,"scaleTypeNotWorkWithMark",(function(){return Nj})),n.d(p,"stepDropped",(function(){return Dj})),n.d(p,"mergeConflictingProperty",(function(){return Gj})),n.d(p,"mergeConflictingDomainProperty",(function(){return _j})),n.d(p,"independentScaleMeansIndependentGuide",(function(){return Mj})),n.d(p,"domainSortDropped",(function(){return Tj})),n.d(p,"MORE_THAN_ONE_SORT",(function(){return jj})),n.d(p,"FACETED_INDEPENDENT_DIFFERENT_SOURCES",(function(){return Lj})),n.d(p,"FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES",(function(){return Vj})),n.d(p,"FACETED_INDEPENDENT_SAME_SOURCE",(function(){return Zj})),n.d(p,"INVALID_CHANNEL_FOR_AXIS",(function(){return Pj})),n.d(p,"cannotStackRangedMark",(function(){return Wj})),n.d(p,"cannotStackNonLinearScale",(function(){return Jj})),n.d(p,"stackNonSummativeAggregate",(function(){return Hj})),n.d(p,"invalidTimeUnit",(function(){return Yj})),n.d(p,"droppedDay",(function(){return Xj})),n.d(p,"errorBarCenterAndExtentAreNotNeeded",(function(){return zj})),n.d(p,"errorBarCenterIsUsedWithWrongExtent",(function(){return Kj})),n.d(p,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return qj})),n.d(p,"errorBarCenterIsNotNeeded",(function(){return $j})),n.d(p,"errorBand1DNotSupport",(function(){return tL})),n.d(p,"channelRequiredForBinned",(function(){return eL})),n.d(p,"domainRequiredForThresholdScale",(function(){return nL}));var C={};n.r(C),n.d(C,"compile",(function(){return yK})),n.d(C,"extractTransforms",(function(){return bK})),n.d(C,"normalize",(function(){return PW})),n.d(C,"version",(function(){return QK}));var y={};n.r(y),n.d(y,"dark",(function(){return RK})),n.d(y,"excel",(function(){return UK})),n.d(y,"fivethirtyeight",(function(){return xK})),n.d(y,"ggplot2",(function(){return kK})),n.d(y,"latimes",(function(){return DK})),n.d(y,"quartz",(function(){return GK})),n.d(y,"vox",(function(){return _K})),n.d(y,"urbaninstitute",(function(){return TK})),n.d(y,"googlecharts",(function(){return jK})),n.d(y,"version",(function(){return LK}));var v=n(16),B=n(18),m=n(26),b=n(0),E=n.n(b),Q=n(1106),F=n(11),w=n(14),S="vg-tooltip-element",R={offsetX:10,offsetY:10,id:S,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};var U=n(15),x=n(4),k=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function O(t,e){return JSON.stringify(t,function(t){var e=[];return function(n,r){if("object"!==typeof r||null===r)return r;var i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}var N=function(){function t(e){Object(F.a)(this,t),this.options=Object.assign(Object.assign({},R),e);var n=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){var r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n  visibility: hidden;\n  padding: 8px;\n  position: fixed;\n  z-index: 1000;\n  font-family: sans-serif;\n  font-size: 11px;\n  border-radius: 3px;\n  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n  /* The default theme is the light theme. */\n  background-color: rgba(255, 255, 255, 0.95);\n  border: 1px solid #d9d9d9;\n  color: black; }\n  #vg-tooltip-element.visible {\n    visibility: visible; }\n  #vg-tooltip-element h2 {\n    margin-top: 0;\n    margin-bottom: 10px;\n    font-size: 13px; }\n  #vg-tooltip-element img {\n    max-width: 200px;\n    max-height: 200px; }\n  #vg-tooltip-element table {\n    border-spacing: 0; }\n    #vg-tooltip-element table tr {\n      border: none; }\n      #vg-tooltip-element table tr td {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        padding-top: 2px;\n        padding-bottom: 2px; }\n        #vg-tooltip-element table tr td.key {\n          color: #808080;\n          max-width: 150px;\n          text-align: right;\n          padding-right: 4px; }\n        #vg-tooltip-element table tr td.value {\n          display: block;\n          max-width: 300px;\n          max-height: 7em;\n          text-align: left; }\n  #vg-tooltip-element.dark-theme {\n    background-color: rgba(32, 32, 32, 0.9);\n    border: 1px solid #f5f5f5;\n    color: white; }\n    #vg-tooltip-element.dark-theme td.key {\n      color: #bfbfbf; }\n".toString().replace(S,t)}(n);var i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}this.el=document.getElementById(n),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",n),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}return Object(w.a)(t,[{key:"tooltipHandler",value:function(t,e,n,r){if(null!=r&&""!==r){this.el.innerHTML=function(t,e,n){if(Object(x.A)(t))return"[".concat(t.map((function(t){return e(Object(x.H)(t)?t:O(t,n))})).join(", "),"]");if(Object(x.F)(t)){var r="",i=t,o=i.title,a=i.image,A=k(i,["title","image"]);o&&(r+="<h2>".concat(e(o),"</h2>")),a&&(r+='<img src="'.concat(e(a),'">'));var s=Object.keys(A);if(s.length>0){r+="<table>";var c,u=Object(U.a)(s);try{for(u.s();!(c=u.n()).done;){var l=c.value,g=A[l];void 0!==g&&(Object(x.F)(g)&&(g=O(g,n)),r+='<tr><td class="key">'.concat(e(l),':</td><td class="value">').concat(e(g),"</td></tr>"))}}catch(f){u.e(f)}finally{u.f()}r+="</table>"}return r||"{}"}return e(t)}(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));var i=function(t,e,n,r){var i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);var o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),o=i.x,a=i.y;this.el.setAttribute("style","top: ".concat(a,"px; left: ").concat(o,"px"))}else this.el.classList.remove("visible","".concat(this.options.theme,"-theme"))}}]),t}(),D=(Q.version,n(61)),G=n(24),_=n(25),M=n(20),T=n.n(M),j={};function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,n=Object.keys(t),r=Object.keys(e);return t===e||n.length===r.length&&n.every((function(n){return t[n]===e[n]}))}var V=n(5),Z=n.n(V);function P(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(e){o(e)}}function A(t){try{s(r.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,A)}s((r=r.apply(t,e||[])).next())}))}var W=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),J=Object.prototype.hasOwnProperty;function H(t,e){return J.call(t,e)}function Y(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);e=[];for(var r in t)H(t,r)&&e.push(r);return e}function X(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function z(t){for(var e,n=0,r=t.length;n<r;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function K(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function q(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function $(t,e){var n=[t];for(var r in e){var i="object"===typeof e[r]?JSON.stringify(e[r],null,2):e[r];"undefined"!==typeof i&&n.push(r+": "+i)}return n.join("\n")}var tt=function(t){function e(e,n,r,i,o){var a=this.constructor,A=t.call(this,$(e,{name:n,index:r,operation:i,tree:o}))||this;return A.name=n,A.index=r,A.operation=i,A.tree=o,Object.setPrototypeOf(A,a.prototype),A.message=$(e,{name:n,index:r,operation:i,tree:o}),A}return W(e,t),e}(Error),et=tt,nt=X,rt={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=ot(n,this.path);r&&(r=X(r));var i=at(n,{op:"remove",path:this.from}).removed;return at(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=ot(n,this.from);return at(n,{op:"add",path:this.path,value:X(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:lt(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},it={add:function(t,e,n){return z(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:rt.move,copy:rt.copy,test:rt.test,_get:rt._get};function ot(t,e){if(""==e)return t;var n={op:"_get",path:e};return at(t,n),n.value}function at(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):ct(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=ot(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=lt(t,e.value),!1===a.test)throw new et("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new et("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}r||(t=X(t));var A=(e.path||"").split("/"),s=t,c=1,u=A.length,l=void 0,g=void 0,f=void 0;for(f="function"==typeof n?n:ct;;){if(g=A[c],i&&"__proto__"==g)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===l&&(void 0===s[g]?l=A.slice(0,c).join("/"):c==u-1&&(l=e.path),void 0!==l&&f(e,0,t,l)),c++,Array.isArray(s)){if("-"===g)g=s.length;else{if(n&&!z(g))throw new et("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);z(g)&&(g=~~g)}if(c>=u){if(n&&"add"===e.op&&g>s.length)throw new et("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=it[e.op].call(e,s,g,t)).test)throw new et("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(g&&-1!=g.indexOf("~")&&(g=q(g)),c>=u){if(!1===(a=rt[e.op].call(e,s,g,t)).test)throw new et("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}s=s[g]}}function At(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new et("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=X(t));for(var o=new Array(e.length),a=0,A=e.length;a<A;a++)o[a]=at(t,e[a],n,!0,i,a),t=o[a].newDocument;return o.newDocument=t,o}function st(t,e,n){var r=at(t,e);if(!1===r.test)throw new et("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return r.newDocument}function ct(t,e,n,r){if("object"!==typeof t||null===t||Array.isArray(t))throw new et("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!rt[t.op])throw new et("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!==typeof t.path)throw new et("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new et('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!==typeof t.from)throw new et("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new et("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&function t(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return!0}else if("object"===typeof e){var i=Y(e),o=i.length;for(n=0;n<o;n++)if(t(e[i[n]]))return!0}return!1}(t.value))throw new et("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new et("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==r)throw new et("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=ut([{op:"_get",path:t.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new et("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function ut(t,e,n){try{if(!Array.isArray(t))throw new et("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)At(X(e),X(t),n||!0);else{n=n||ct;for(var r=0;r<t.length;r++)n(t[r],r,e,void 0)}}catch(i){if(i instanceof et)return i;throw i}}function lt(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,r,i,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((r=t.length)!=e.length)return!1;for(n=r;0!==n--;)if(!lt(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var A=Object.keys(t);if((r=A.length)!==Object.keys(e).length)return!1;for(n=r;0!==n--;)if(!e.hasOwnProperty(A[n]))return!1;for(n=r;0!==n--;)if(!lt(t[i=A[n]],e[i]))return!1;return!0}return t!==t&&e!==e}var gt=new WeakMap,ft=function(t){this.observers=new Map,this.obj=t},ht=function(t,e){this.callback=t,this.observer=e};function dt(t,e){e.unobserve()}function It(t,e){var n,r=function(t){return gt.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new ft(t),gt.set(t,r);if(n)return n;if(n={},r.value=X(t),e){n.callback=e,n.next=null;var o=function(){pt(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!==typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=t,n.unobserve=function(){pt(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new ht(e,n)),n}function pt(t,e){void 0===e&&(e=!1);var n=gt.get(t.object);Ct(n.value,t.object,t.patches,"",e),t.patches.length&&At(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Ct(t,e,n,r,i){if(e!==t){"function"===typeof e.toJSON&&(e=e.toJSON());for(var o=Y(e),a=Y(t),A=!1,s=a.length-1;s>=0;s--){var c=t[l=a[s]];if(!H(e,l)||void 0===e[l]&&void 0!==c&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+K(l),value:X(c)}),n.push({op:"remove",path:r+"/"+K(l)}),A=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var u=e[l];"object"==typeof c&&null!=c&&"object"==typeof u&&null!=u?Ct(c,u,n,r+"/"+K(l),i):c!==u&&(!0,i&&n.push({op:"test",path:r+"/"+K(l),value:X(c)}),n.push({op:"replace",path:r+"/"+K(l),value:X(u)}))}}if(A||o.length!=a.length)for(s=0;s<o.length;s++){var l;H(t,l=o[s])||void 0===e[l]||n.push({op:"add",path:r+"/"+K(l),value:X(e[l])})}}}function yt(t,e,n){void 0===n&&(n=!1);var r=[];return Ct(t,e,r,"",n),r}Object.assign({},r,i,{JsonPatchError:tt,deepClone:X,escapePathComponent:K,unescapePathComponent:q});var vt=n(791),Bt=n.n(vt),mt=n(913);function bt(t){var e=t||x.x,n=[],r={};return n.add=function(t){var i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=function(t){var i,o=e(t);return r[o]&&(r[o]=0,(i=n.indexOf(t))>=0&&n.splice(i,1)),n},n}var Et=n(21),Qt=function(t,e){return Ft.apply(this,arguments)};function Ft(){return(Ft=Object(Et.a)(Z.a.mark((function t(e,n){return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n(e);case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),e.error(t.t0);case 8:case"end":return t.stop()}}),t,null,[[0,5]])})))).apply(this,arguments)}var wt=Symbol("vega_id"),St=1;function Rt(t){return!(!t||!Ut(t))}function Ut(t){return t[wt]}function xt(t,e){return t[wt]=e,t}function kt(t){var e=t===Object(t)?t:{data:t};return Ut(e)?e:xt(e,St++)}function Ot(t){return Nt(t,kt({}))}function Nt(t,e){for(var n in t)e[n]=t[n];return e}function Dt(t,e){return xt(e,Ut(t))}function Gt(t,e){return t?e?function(n,r){return t(n,r)||Ut(e(n))-Ut(e(r))}:function(e,n){return t(e,n)||Ut(e)-Ut(n)}:null}function _t(t){return t&&t.constructor===Mt}function Mt(){var t=[],e=[],n=[],r=[],i=[],o=null,a=!1;return{constructor:Mt,insert:function(e){for(var n=Object(x.i)(e),r=0,i=n.length;r<i;++r)t.push(n[r]);return this},remove:function(t){for(var n=Object(x.D)(t)?r:e,i=Object(x.i)(t),o=0,a=i.length;o<a;++o)n.push(i[o]);return this},modify:function(t,e,r){var o={field:e,value:Object(x.l)(r)};return Object(x.D)(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode:function(t,e){return Object(x.D)(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean:function(t){return o=t,this},reflow:function(){return a=!0,this},pulse:function(A,s){var c,u,l,g,f,h,d={},I={};for(c=0,u=s.length;c<u;++c)d[Ut(s[c])]=1;for(c=0,u=e.length;c<u;++c)d[Ut(f=e[c])]=-1;for(c=0,u=r.length;c<u;++c)g=r[c],s.forEach((function(t){g(t)&&(d[Ut(t)]=-1)}));for(c=0,u=t.length;c<u;++c)h=Ut(f=t[c]),d[h]?d[h]=1:A.add.push(kt(t[c]));for(c=0,u=s.length;c<u;++c)f=s[c],d[Ut(f)]<0&&A.rem.push(f);function p(t,e,n){n?t[e]=n(t):A.encode=e,a||(I[Ut(t)]=t)}for(c=0,u=n.length;c<u;++c)f=(l=n[c]).tuple,g=l.field,(h=d[Ut(f)])>0&&(p(f,g,l.value),A.modifies(g));for(c=0,u=i.length;c<u;++c)l=i[c],g=l.filter,s.forEach((function(t){g(t)&&d[Ut(t)]>0&&p(t,l.field,l.value)})),A.modifies(l.field);if(a)A.mod=e.length||r.length?s.filter((function(t){return d[Ut(t)]>0})):s.slice();else for(h in I)A.mod.push(I[h]);return(o||null==o&&(e.length||r.length))&&A.clean(!0),A}}}var Tt="_:mod:_";function jt(){Object.defineProperty(this,Tt,{writable:!0,value:{}})}var Lt=jt.prototype;Lt.set=function(t,e,n,r){var i=this,o=i[t],a=i[Tt];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=Object(x.A)(n)?1+n.length:-1),i},Lt.modified=function(t,e){var n,r=this[Tt];if(!arguments.length){for(n in r)if(r[n])return!0;return!1}if(Object(x.A)(t)){for(n=0;n<t.length;++n)if(r[t[n]])return!0;return!1}return null!=e&&e>=0?e+1<r[t]||!!r[e+":"+t]:!!r[t]},Lt.clear=function(){return this[Tt]={},this};var Vt=0,Zt=new jt;function Pt(t,e,n,r){this.id=++Vt,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}var Wt=Pt.prototype;function Jt(t){return function(e){var n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Wt.targets=function(){return this._targets||(this._targets=bt(x.w))},Wt.set=function(t){return this.value!==t?(this.value=t,1):0},Wt.skip=Jt(1),Wt.modified=Jt(2),Wt.parameters=function(t,e,n){e=!1!==e;var r,i,o,a,A=this,s=A._argval=A._argval||new jt,c=A._argops=A._argops||[],u=[];function l(t,n,r){r instanceof Pt?(r!==A&&(e&&r.targets().add(A),u.push(r)),c.push({op:r,name:t,index:n})):s.set(t,n,r)}for(r in t)if(i=t[r],"pulse"===r)Object(x.i)(i).forEach((function(t){t instanceof Pt?t!==A&&(t.targets().add(A),u.push(t)):Object(x.n)("Pulse parameters must be operator instances.")})),A.source=i;else if(Object(x.A)(i))for(s.set(r,-1,Array(o=i.length)),a=0;a<o;++a)l(r,a,i[a]);else l(r,-1,i);return this.marshall().clear(),n&&(c.initonly=!0),u},Wt.marshall=function(t){var e,n,r,i,o,a=this._argval||Zt,A=this._argops;if(A){for(n=0,r=A.length;n<r;++n)o=(i=(e=A[n]).op).modified()&&i.stamp===t,a.set(e.name,e.index,i.value,o);if(A.initonly){for(n=0;n<r;++n)(e=A[n]).op.targets().remove(this);this._argops=null,this._update=null}}return a},Wt.detach=function(){var t,e,n,r=this._argops;if(r)for(t=0,e=r.length;t<e;++t)(n=r[t].op)._targets&&n._targets.remove(this)},Wt.evaluate=function(t){var e=this._update;if(e){var n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},Wt.run=function(t){return t.stamp<this.stamp?t.StopPropagation:(this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t);var e};var Ht=0;function Yt(t,e,n){this.id=++Ht,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Xt(t,e,n){return new Yt(t,e,n)}var zt=Yt.prototype;zt._filter=x.gb,zt._apply=x.x,zt.targets=function(){return this._targets||(this._targets=bt(x.w))},zt.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},zt.receive=function(t){if(this._filter(t)){for(var e=this.value=this._apply(t),n=this._targets,r=n?n.length:0,i=0;i<r;++i)n[i].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},zt.filter=function(t){var e=Xt(t);return this.targets().add(e),e},zt.apply=function(t){var e=Xt(null,t);return this.targets().add(e),e},zt.merge=function(){var t=Xt();this.targets().add(t);for(var e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},zt.throttle=function(t){var e=-1;return this.filter((function(){var n=Date.now();return n-e>t?(e=n,1):0}))},zt.debounce=function(t){var e=Xt();return this.targets().add(Xt(null,null,Object(x.m)(t,(function(t){var n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},zt.between=function(t,e){var n=!1;return t.targets().add(Xt(null,null,(function(){n=!0}))),e.targets().add(Xt(null,null,(function(){n=!1}))),this.filter((function(){return n}))};var Kt=/^([A-Za-z]+:)?\/\//,qt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,$t=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;function te(t,e){return ee.apply(this,arguments)}function ee(){return(ee=Object(Et.a)(Z.a.mark((function t(e,n){var r,i;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sanitize(e,n);case 2:return r=t.sent,i=r.href,t.abrupt("return",r.localFile?this.file(i):this.http(i,n));case 5:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function ne(t,e){return re.apply(this,arguments)}function re(){return(re=Object(Et.a)(Z.a.mark((function t(e,n){var r,i,o,a,A,s,c;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(x.o)({},this.options,n),r=this.fileAccess,i={href:null},s=qt.test(e.replace($t,"")),null!=e&&"string"===typeof e&&s||Object(x.n)("Sanitize failure, invalid URI: "+Object(x.Z)(e)),c=Kt.test(e),(A=n.baseURL)&&!c&&(e.startsWith("/")||"/"===A[A.length-1]||(e="/"+e),e=A+e),a=(o=e.startsWith("file://"))||"file"===n.mode||"http"!==n.mode&&!c&&r,o?e=e.slice("file://".length):e.startsWith("//")&&("file"===n.defaultProtocol?(e=e.slice(2),a=!0):e=(n.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!a}),i.href=e,n.target&&(i.target=n.target+""),n.rel&&(i.rel=n.rel+""),"image"===n.context&&n.crossOrigin&&(i.crossOrigin=n.crossOrigin+""),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function ie(t){return t?function(e){return new Promise((function(n,r){t.readFile(e,(function(t,e){t?r(t):n(e)}))}))}:oe}function oe(){return ae.apply(this,arguments)}function ae(){return(ae=Object(Et.a)(Z.a.mark((function t(){return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Object(x.n)("No file system access.");case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ae(t){return t?function(){var e=Object(Et.a)(Z.a.mark((function e(n,r){var i,o,a;return Z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(x.o)({},this.options.http,r),o=r&&r.response,e.next=4,t(n,i);case 4:return a=e.sent,e.abrupt("return",a.ok?Object(x.D)(a[o])?a[o]():a.text():Object(x.n)(a.status+""+a.statusText));case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}():se}function se(){return ce.apply(this,arguments)}function ce(){return(ce=Object(Et.a)(Z.a.mark((function t(){return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Object(x.n)("No HTTP fetch method available.");case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ue={boolean:x.ab,integer:x.cb,number:x.cb,date:x.bb,string:x.eb,unknown:x.x},le=[function(t){return"true"===t||"false"===t||!0===t||!1===t},function(t){return de(t)&&Number.isInteger(+t)},de,function(t){return!Number.isNaN(Date.parse(t))}],ge=["boolean","integer","number","date"];function fe(t,e){if(!t||!t.length)return"unknown";for(var n,r,i,o=t.length,a=le.length,A=le.map((function(t,e){return e+1})),s=0,c=0;s<o;++s)for(r=e?t[s][e]:t[s],n=0;n<a;++n)if(A[n]&&(null!=(i=r)&&i===i)&&!le[n](r)&&(A[n]=0,++c===le.length))return"string";return ge[A.reduce((function(t,e){return 0===t?e:t}),0)-1]}function he(t,e){return e.reduce((function(e,n){return e[n]=fe(t,n),e}),{})}function de(t){return!Number.isNaN(+t)&&!(t instanceof Date)}var Ie=n(1363);function pe(t){var e=function(e,n){var r={delimiter:t};return Ce(e,n?Object(x.o)(n,r):r)};return e.responseType="text",e}function Ce(t,e){return e.header&&(t=e.header.map(x.Z).join(e.delimiter)+"\n"+t),Object(Ie.a)(e.delimiter).parse(t+"")}Ce.responseType="text";var ye=n(790),ve=function(t){return t},Be=function(t){if(null==t)return ve;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,A){A||(e=n=0);var s=2,c=t.length,u=new Array(c);for(u[0]=(e+=t[0])*r+o,u[1]=(n+=t[1])*i+a;s<c;)u[s]=t[s],++s;return u}},me=function(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return be(t,e)}))}:be(t,e)};function be(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=Ee(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function Ee(t,e){var n=Be(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function A(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(A)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:r,coordinates:n}}(e)}var Qe=function(t,e){var n={},r={},i={},o=[],a=-1;function A(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),A=a[0],s=a[1];if(n=i[A])if(delete i[n.end],n.push(e),n.end=s,o=r[s]){delete r[o.start];var c=o===n?n:n.concat(o);r[c.start=n.start]=i[c.end=o.end]=c}else r[n.start]=i[n.end]=n;else if(n=r[s])if(delete r[n.start],n.unshift(e),n.start=A,o=i[A]){delete i[o.end];var u=o===n?n:o.concat(n);r[u.start=o.start]=i[u.end=n.end]=u}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=A]=i[n.end=s]=n})),A(i,r),A(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o},Fe=function(t){return Ee(t,we.apply(this,arguments))};function we(t,e,n){var r,i,o;if(arguments.length>1)r=Se(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:Qe(t,r)}}function Se(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function A(t){t.forEach(a)}function s(t){t.forEach(A)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":A(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(s)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}var Re={interior:function(t,e){return t!==e},exterior:function(t,e){return t===e}};function Ue(t,e){var n,r,i,o;return t=Object(ye.a)(t,e),e&&e.feature?(n=me,i=e.feature):e&&e.mesh?(n=Fe,i=e.mesh,o=Re[e.filter]):Object(x.n)("Missing TopoJSON feature or mesh parameter."),(r=(r=t.objects[i])?n(t,r,o):Object(x.n)("Invalid TopoJSON object: "+i))&&r.features||[r]}Ue.responseType="json";var xe={dsv:Ce,csv:pe(","),tsv:pe("\t"),json:ye.a,topojson:Ue};function ke(t,e){return arguments.length>1?(xe[t]=e,this):Object(x.v)(xe,t)?xe[t]:null}function Oe(t){var e=ke(t);return e&&e.responseType||"text"}var Ne=function(t){var e={};return function(n){return e[n]||(e[n]=t(n))}},De=Math.sqrt(50),Ge=Math.sqrt(10),_e=Math.sqrt(2);var Me=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Te(t){if(!(e=Me.exec(t)))throw new Error("invalid format: "+t);var e;return new je({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function je(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Te.prototype=je.prototype,je.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Le,Ve,Ze,Pe,We,Je,He=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},Ye=function(t){return(t=He(Math.abs(t)))?t[1]:NaN},Xe=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ye(e)/3)))-Ye(Math.abs(t)))},ze=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ye(e)-Ye(t))+1},Ke=function(t){return Math.max(0,-Ye(Math.abs(t)))},qe=function(t,e){var n=He(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},$e={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return qe(100*t,e)},r:qe,s:function(t,e){var n=He(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Le=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+He(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},tn=function(t){return t},en=Array.prototype.map,nn=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"],rn=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?tn:(e=en.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,A=e[0],s=0;i>0&&A>0&&(s+A+1>r&&(A=Math.max(1,r-s)),o.push(t.substring(i-=A,i+A)),!((s+=A+1)>r));)A=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",A=void 0===t.numerals?tn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(en.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function l(t){var e=(t=Te(t)).fill,n=t.align,l=t.sign,g=t.symbol,f=t.zero,h=t.width,d=t.comma,I=t.precision,p=t.trim,C=t.type;"n"===C?(d=!0,C="g"):$e[C]||(void 0===I&&(I=12),p=!0,C="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var y="$"===g?i:"#"===g&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",v="$"===g?o:/[%p]/.test(C)?s:"",B=$e[C],m=/[defgprs%]/.test(C);function b(t){var i,o,s,g=y,b=v;if("c"===C)b=B(t)+b,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:B(Math.abs(t),I),p&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0===+t&&"+"!==l&&(E=!1),g=(E?"("===l?l:c:"-"===l||"("===l?"":l)+g,b=("s"===C?nn[8+Le/3]:"")+b+(E&&"("===l?")":""),m)for(i=-1,o=t.length;++i<o;)if(48>(s=t.charCodeAt(i))||s>57){b=(46===s?a+t.slice(i+1):t.slice(i))+b,t=t.slice(0,i);break}}d&&!f&&(t=r(t,1/0));var Q=g.length+t.length+b.length,F=Q<h?new Array(h-Q+1).join(e):"";switch(d&&f&&(t=r(F+t,F.length?h-b.length:1/0),F=""),n){case"<":t=g+t+b+F;break;case"=":t=g+F+t+b;break;case"^":t=F.slice(0,Q=F.length>>1)+g+t+b+F.slice(Q);break;default:t=F+g+t+b}return A(t)}return I=void 0===I?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,I)):Math.max(0,Math.min(20,I)),b.toString=function(){return t+""},b}return{format:l,formatPrefix:function(t,e){var n=l(((t=Te(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ye(e)/3))),i=Math.pow(10,-r),o=nn[8+r/3];return function(t){return n(i*t)+o}}}};function on(t){var e=Ne(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat:function(t){var n=Te(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(t,e){return function(n){var r,i,o=t(n),a=o.indexOf(e);if(a<0)return o;for(i=(r=function(t,e){var n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if((n=t.charCodeAt(r))>=48&&n<=57)return r+1}(o,a))<o.length?o.slice(r):"";--r>a;)if("0"!==o[r]){++r;break}return o.slice(0,r)+i}}(e(n),e(".1f")(1)[1])}return e(n)},formatSpan:function(t,r,i,o){o=Te(null==o?",f":o);var a,A=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=De?i*=10:o>=Ge?i*=5:o>=_e&&(i*=2),e<t?-i:i}(t,r,i),s=Math.max(Math.abs(t),Math.abs(r));if(null==o.precision)switch(o.type){case"s":return isNaN(a=Xe(A,s))||(o.precision=a),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(a=ze(A,s))||(o.precision=a-("e"===o.type));break;case"f":case"%":isNaN(a=Ke(A))||(o.precision=a-2*("%"===o.type))}return e(o)}}}function an(){return We=on({format:Ze,formatPrefix:Pe})}function An(t){return on(rn(t))}function sn(t){return arguments.length?We=An(t):We}Ve=rn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Ze=Ve.format,Pe=Ve.formatPrefix,an();var cn="year",un="quarter",ln="month",gn="week",fn="date",hn="day",dn="dayofyear",In="hours",pn="minutes",Cn="seconds",yn="milliseconds",vn=[cn,un,ln,gn,fn,hn,dn,In,pn,Cn,yn],Bn=vn.reduce((function(t,e,n){return t[e]=1+n,t}),{});function mn(t){var e=Object(x.i)(t).slice(),n={};return e.length||Object(x.n)("Missing time unit."),e.forEach((function(t){Object(x.v)(Bn,t)?n[t]=1:Object(x.n)("Invalid time unit: ".concat(t,"."))})),(n[gn]||n[hn]?1:0)+(n[un]||n[ln]||n[fn]?1:0)+(n[dn]?1:0)>1&&Object(x.n)("Incompatible time units: ".concat(t)),e.sort((function(t,e){return Bn[t]-Bn[e]})),e}var bn=(Je={},Object(v.a)(Je,cn,"%Y "),Object(v.a)(Je,un,"Q%q "),Object(v.a)(Je,ln,"%b "),Object(v.a)(Je,fn,"%d "),Object(v.a)(Je,gn,"W%U "),Object(v.a)(Je,hn,"%a "),Object(v.a)(Je,dn,"%j "),Object(v.a)(Je,In,"%H:00"),Object(v.a)(Je,pn,"00:%M"),Object(v.a)(Je,Cn,":%S"),Object(v.a)(Je,yn,".%L"),Object(v.a)(Je,"".concat(cn,"-").concat(ln),"%Y-%m "),Object(v.a)(Je,"".concat(cn,"-").concat(ln,"-").concat(fn),"%Y-%m-%d "),Object(v.a)(Je,"".concat(In,"-").concat(pn),"%H:%M"),Je);function En(t,e){var n,r,i=Object(x.o)({},bn,e),o=mn(t),a=o.length,A="",s=0;for(s=0;s<a;)for(n=o.length;n>s;--n)if(null!=i[r=o.slice(s,n).join("-")]){A+=i[r],s=n;break}return A.trim()}var Qn=new Date,Fn=new Date;function wn(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,A=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return A;do{A.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return A},i.filter=function(n){return wn((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Qn.setTime(+e),Fn.setTime(+r),t(Qn),t(Fn),Math.floor(n(Qn,Fn))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t===0}:function(e){return i.count(0,e)%t===0}):i:null}),i}var Sn=wn((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),Rn=Sn;Sn.range;function Un(t){return wn((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var xn=Un(0),kn=Un(1),On=Un(2),Nn=Un(3),Dn=Un(4),Gn=Un(5),_n=Un(6),Mn=(xn.range,kn.range,On.range,Nn.range,Dn.range,Gn.range,_n.range,wn((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Tn=Mn;Mn.range;function jn(t){return wn((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Ln,Vn,Zn,Pn,Wn=jn(0),Jn=jn(1),Hn=jn(2),Yn=jn(3),Xn=jn(4),zn=jn(5),Kn=jn(6),qn=(Wn.range,Jn.range,Hn.range,Yn.range,Xn.range,zn.range,Kn.range,new Date);function $n(t){return qn.setFullYear(t),qn.setMonth(0),qn.setDate(1),qn.setHours(0,0,0,0),qn}function tr(t){return nr(new Date(t))}function er(t){return rr(new Date(t))}function nr(t){return Rn.count($n(t.getFullYear())-1,t)}function rr(t){return xn.count($n(t.getFullYear())-1,t)}function ir(t){return $n(t).getDay()}function or(t,e,n,r,i,o,a){if(0<=t&&t<100){var A=new Date(-1,e,n,r,i,o,a);return A.setFullYear(t),A}return new Date(t,e,n,r,i,o,a)}function ar(t){return sr(new Date(t))}function Ar(t){return cr(new Date(t))}function sr(t){var e=Date.UTC(t.getUTCFullYear(),0,1);return Tn.count(e-1,t)}function cr(t){var e=Date.UTC(t.getUTCFullYear(),0,1);return Wn.count(e-1,t)}function ur(t){return qn.setTime(Date.UTC(t,0,1)),qn.getUTCDay()}function lr(t,e,n,r,i,o,a){if(0<=t&&t<100){var A=new Date(Date.UTC(-1,e,n,r,i,o,a));return A.setUTCFullYear(n.y),A}return new Date(Date.UTC(t,e,n,r,i,o,a))}function gr(t,e,n,r,i){var o=e||1,a=Object(x.U)(t),A=function(t,e,i){return function(t,e,n,r){var i=n<=1?t:r?function(e,i){return r+n*Math.floor((t(e,i)-r)/n)}:function(e,r){return n*Math.floor(t(e,r)/n)};return e?function(t,n){return e(i(t,n),n)}:i}(n[i=i||t],r[i],t===a&&o,e)},s=new Date,c=Object(x.db)(t),u=c[cn]?A(cn):Object(x.l)(2012),l=c[ln]?A(ln):c[un]?A(un):x.kb,g=c[gn]&&c[hn]?A(hn,1,gn+hn):c[gn]?A(gn,1):c[hn]?A(hn,1):c[fn]?A(fn,1):c[dn]?A(dn,1):x.O,f=c[In]?A(In):x.kb,h=c[pn]?A(pn):x.kb,d=c[Cn]?A(Cn):x.kb,I=c[yn]?A(yn):x.kb;return function(t){s.setTime(+t);var e=u(s);return i(e,l(s),g(s,e),f(s),h(s),d(s),I(s))}}function fr(t,e,n){return e+7*t-(n+6)%7}var hr=(Ln={},Object(v.a)(Ln,cn,(function(t){return t.getFullYear()})),Object(v.a)(Ln,un,(function(t){return Math.floor(t.getMonth()/3)})),Object(v.a)(Ln,ln,(function(t){return t.getMonth()})),Object(v.a)(Ln,fn,(function(t){return t.getDate()})),Object(v.a)(Ln,In,(function(t){return t.getHours()})),Object(v.a)(Ln,pn,(function(t){return t.getMinutes()})),Object(v.a)(Ln,Cn,(function(t){return t.getSeconds()})),Object(v.a)(Ln,yn,(function(t){return t.getMilliseconds()})),Object(v.a)(Ln,dn,(function(t){return nr(t)})),Object(v.a)(Ln,gn,(function(t){return rr(t)})),Object(v.a)(Ln,gn+hn,(function(t,e){return fr(rr(t),t.getDay(),ir(e))})),Object(v.a)(Ln,hn,(function(t,e){return fr(1,t.getDay(),ir(e))})),Ln),dr=(Vn={},Object(v.a)(Vn,un,(function(t){return 3*t})),Object(v.a)(Vn,gn,(function(t,e){return fr(t,0,ir(e))})),Vn);function Ir(t,e){return gr(t,e||1,hr,dr,or)}var pr=(Zn={},Object(v.a)(Zn,cn,(function(t){return t.getUTCFullYear()})),Object(v.a)(Zn,un,(function(t){return Math.floor(t.getUTCMonth()/3)})),Object(v.a)(Zn,ln,(function(t){return t.getUTCMonth()})),Object(v.a)(Zn,fn,(function(t){return t.getUTCDate()})),Object(v.a)(Zn,In,(function(t){return t.getUTCHours()})),Object(v.a)(Zn,pn,(function(t){return t.getUTCMinutes()})),Object(v.a)(Zn,Cn,(function(t){return t.getUTCSeconds()})),Object(v.a)(Zn,yn,(function(t){return t.getUTCMilliseconds()})),Object(v.a)(Zn,dn,(function(t){return sr(t)})),Object(v.a)(Zn,gn,(function(t){return cr(t)})),Object(v.a)(Zn,hn,(function(t,e){return fr(1,t.getUTCDay(),ur(e))})),Object(v.a)(Zn,gn+hn,(function(t,e){return fr(cr(t),t.getUTCDay(),ur(e))})),Zn),Cr=(Pn={},Object(v.a)(Pn,un,(function(t){return 3*t})),Object(v.a)(Pn,gn,(function(t,e){return fr(t,0,ur(e))})),Pn);function yr(t,e){return gr(t,e||1,pr,Cr,lr)}var vr=wn((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));vr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?wn((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Br=vr,mr=(vr.range,wn((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),br=mr,Er=(mr.range,wn((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Qr=Er,Fr=(Er.range,wn((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),wr=Fr,Sr=(Fr.range,wn((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),Rr=Sr,Ur=(Sr.range,wn((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));Ur.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?wn((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Ur:null};var xr=Ur,kr=(Ur.range,wn((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));kr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?wn((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Or,Nr,Dr=kr,Gr=(kr.range,wn((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),_r=Gr,Mr=(Gr.range,wn((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),Tr=Mr,jr=(Mr.range,wn((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}))),Lr=jr,Vr=(jr.range,Or={},Object(v.a)(Or,cn,Br),Object(v.a)(Or,un,br.every(3)),Object(v.a)(Or,ln,br),Object(v.a)(Or,gn,xn),Object(v.a)(Or,fn,Rn),Object(v.a)(Or,hn,Rn),Object(v.a)(Or,dn,Rn),Object(v.a)(Or,In,Qr),Object(v.a)(Or,pn,wr),Object(v.a)(Or,Cn,Rr),Object(v.a)(Or,yn,xr),Or),Zr=(Nr={},Object(v.a)(Nr,cn,Dr),Object(v.a)(Nr,un,_r.every(3)),Object(v.a)(Nr,ln,_r),Object(v.a)(Nr,gn,Wn),Object(v.a)(Nr,fn,Tn),Object(v.a)(Nr,hn,Tn),Object(v.a)(Nr,dn,Tn),Object(v.a)(Nr,In,Tr),Object(v.a)(Nr,pn,Lr),Object(v.a)(Nr,Cn,Rr),Object(v.a)(Nr,yn,xr),Nr);function Pr(t){return Vr[t]}function Wr(t){return Zr[t]}function Jr(t,e,n){return t?t.offset(e,n):void 0}function Hr(t,e,n){return Jr(Pr(t),e,n)}function Yr(t,e,n){return Jr(Wr(t),e,n)}function Xr(t,e,n,r){return t?t.range(e,n,r):void 0}function zr(t,e,n,r){return Xr(Pr(t),e,n,r)}function Kr(t,e,n,r){return Xr(Wr(t),e,n,r)}var qr=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return(r=e(t))<(i=n)?-1:r>i?1:r>=i?0:NaN;var r,i}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var $r=Math.sqrt(50),ti=Math.sqrt(10),ei=Math.sqrt(2);function ni(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=$r?i*=10:o>=ti?i*=5:o>=ei&&(i*=2),e<t?-i:i}var ri=[cn,ln,fn,In,pn,Cn,yn],ii=ri.slice(0,-1),oi=ii.slice(0,-1),ai=oi.slice(0,-1),Ai=ai.slice(0,-1),si=[cn,ln],ci=[cn],ui=[[ii,1,1e3],[ii,5,5e3],[ii,15,15e3],[ii,30,3e4],[oi,1,6e4],[oi,5,3e5],[oi,15,9e5],[oi,30,18e5],[ai,1,36e5],[ai,3,108e5],[ai,6,216e5],[ai,12,432e5],[Ai,1,864e5],[[cn,gn],1,6048e5],[si,1,2592e6],[si,3,7776e6],[ci,1,31536e6]],li=function(t){var e,n,r=t.extent,i=t.maxbins||40,o=Math.abs(Object(x.X)(r))/i,a=qr((function(t){return t[2]})).right(ui,o);return a===ui.length?(e=ci,n=ni(r[0]/31536e6,r[1]/31536e6,i)):a?(e=(a=ui[o/ui[a-1][2]<ui[a][2]/o?a-1:a])[0],n=a[1]):(e=ri,n=Math.max(ni(r[0],r[1],i),1)),{units:e,step:n}};function gi(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fi(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function di(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,A=t.months,s=t.shortMonths,c=Si(i),u=Ri(i),l=Si(o),g=Ri(o),f=Si(a),h=Ri(a),d=Si(A),I=Ri(A),p=Si(s),C=Ri(s),y={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return A[t.getMonth()]},c:null,d:zi,e:zi,f:eo,H:Ki,I:qi,j:$i,L:to,m:no,M:ro,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ko,s:Oo,S:io,u:oo,U:ao,V:Ao,w:so,W:co,x:null,X:null,y:uo,Y:lo,Z:go,"%":xo},v={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return A[t.getUTCMonth()]},c:null,d:fo,e:fo,f:yo,H:ho,I:Io,j:po,L:Co,m:vo,M:Bo,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ko,s:Oo,S:mo,u:bo,U:Eo,V:Qo,w:Fo,W:wo,x:null,X:null,y:So,Y:Ro,Z:Uo,"%":xo},B={a:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.w=g[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=C[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.m=I[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:ji,e:ji,f:Ji,H:Vi,I:Vi,j:Li,L:Wi,m:Ti,M:Zi,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:Mi,Q:Yi,s:Xi,S:Pi,u:xi,U:ki,V:Oi,w:Ui,W:Ni,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:Gi,Y:Di,Z:_i,"%":Hi};function m(t,e){return function(n){var r,i,o,a=[],A=-1,s=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++A<c;)37===t.charCodeAt(A)&&(a.push(t.slice(s,A)),null!=(i=mi[r=t.charAt(++A)])?r=t.charAt(++A):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),s=A+1);return a.push(t.slice(s,A)),a.join("")}}function b(t,e){return function(n){var r,i,o=hi(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=fi(hi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Jn.ceil(r):Jn(r),r=Tn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=gi(hi(o.y,0,1))).getDay(),r=i>4||0===i?kn.ceil(r):kn(r),r=Rn.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?fi(hi(o.y,0,1)).getUTCDay():gi(hi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fi(o)):gi(o)}}function E(t,e,n,r){for(var i,o,a=0,A=e.length,s=n.length;a<A;){if(r>=s)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=B[i in mi?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return y.x=m(n,y),y.X=m(r,y),y.c=m(e,y),v.x=m(n,v),v.X=m(r,v),v.c=m(e,v),{format:function(t){var e=m(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=b(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=m(t+="",v);return e.toString=function(){return t},e},utcParse:function(t){var e=b(t+="",!0);return e.toString=function(){return t},e}}}var Ii,pi,Ci,yi,vi,Bi,mi={"-":"",_:" ",0:"0"},bi=/^\s*\d+/,Ei=/^%/,Qi=/[\\^$*+?|[\]().{}]/g;function Fi(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function wi(t){return t.replace(Qi,"\\$&")}function Si(t){return new RegExp("^(?:"+t.map(wi).join("|")+")","i")}function Ri(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function Ui(t,e,n){var r=bi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function xi(t,e,n){var r=bi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function ki(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Oi(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Ni(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Di(t,e,n){var r=bi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Gi(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _i(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Mi(t,e,n){var r=bi.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Ti(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ji(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Li(t,e,n){var r=bi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Vi(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Zi(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Pi(t,e,n){var r=bi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Wi(t,e,n){var r=bi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Ji(t,e,n){var r=bi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Hi(t,e,n){var r=Ei.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Yi(t,e,n){var r=bi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xi(t,e,n){var r=bi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function zi(t,e){return Fi(t.getDate(),e,2)}function Ki(t,e){return Fi(t.getHours(),e,2)}function qi(t,e){return Fi(t.getHours()%12||12,e,2)}function $i(t,e){return Fi(1+Rn.count(Br(t),t),e,3)}function to(t,e){return Fi(t.getMilliseconds(),e,3)}function eo(t,e){return to(t,e)+"000"}function no(t,e){return Fi(t.getMonth()+1,e,2)}function ro(t,e){return Fi(t.getMinutes(),e,2)}function io(t,e){return Fi(t.getSeconds(),e,2)}function oo(t){var e=t.getDay();return 0===e?7:e}function ao(t,e){return Fi(xn.count(Br(t)-1,t),e,2)}function Ao(t,e){var n=t.getDay();return t=n>=4||0===n?Dn(t):Dn.ceil(t),Fi(Dn.count(Br(t),t)+(4===Br(t).getDay()),e,2)}function so(t){return t.getDay()}function co(t,e){return Fi(kn.count(Br(t)-1,t),e,2)}function uo(t,e){return Fi(t.getFullYear()%100,e,2)}function lo(t,e){return Fi(t.getFullYear()%1e4,e,4)}function go(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Fi(e/60|0,"0",2)+Fi(e%60,"0",2)}function fo(t,e){return Fi(t.getUTCDate(),e,2)}function ho(t,e){return Fi(t.getUTCHours(),e,2)}function Io(t,e){return Fi(t.getUTCHours()%12||12,e,2)}function po(t,e){return Fi(1+Tn.count(Dr(t),t),e,3)}function Co(t,e){return Fi(t.getUTCMilliseconds(),e,3)}function yo(t,e){return Co(t,e)+"000"}function vo(t,e){return Fi(t.getUTCMonth()+1,e,2)}function Bo(t,e){return Fi(t.getUTCMinutes(),e,2)}function mo(t,e){return Fi(t.getUTCSeconds(),e,2)}function bo(t){var e=t.getUTCDay();return 0===e?7:e}function Eo(t,e){return Fi(Wn.count(Dr(t)-1,t),e,2)}function Qo(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Xn(t):Xn.ceil(t),Fi(Xn.count(Dr(t),t)+(4===Dr(t).getUTCDay()),e,2)}function Fo(t){return t.getUTCDay()}function wo(t,e){return Fi(Jn.count(Dr(t)-1,t),e,2)}function So(t,e){return Fi(t.getUTCFullYear()%100,e,2)}function Ro(t,e){return Fi(t.getUTCFullYear()%1e4,e,4)}function Uo(){return"+0000"}function xo(){return"%"}function ko(t){return+t}function Oo(t){return Math.floor(+t/1e3)}function No(t,e,n){n=n||{},Object(x.F)(n)||Object(x.n)("Invalid time multi-format specifier: ".concat(n));var r=e(Cn),i=e(pn),o=e(In),a=e(fn),A=e(gn),s=e(ln),c=e(un),u=e(cn),l=t(n[yn]||".%L"),g=t(n[Cn]||":%S"),f=t(n[pn]||"%I:%M"),h=t(n[In]||"%I %p"),d=t(n[fn]||n[hn]||"%a %d"),I=t(n[gn]||"%b %d"),p=t(n[ln]||"%B"),C=t(n[un]||"%B"),y=t(n[cn]||"%Y");return function(t){return(r(t)<t?l:i(t)<t?g:o(t)<t?f:a(t)<t?h:s(t)<t?A(t)<t?d:I:u(t)<t?c(t)<t?p:C:y)(t)}}function Do(t){var e=Ne(t.format),n=Ne(t.utcFormat);return{timeFormat:function(t){return Object(x.H)(t)?e(t):No(e,Pr,t)},utcFormat:function(t){return Object(x.H)(t)?n(t):No(n,Wr,t)},timeParse:Ne(t.parse),utcParse:Ne(t.utcParse)}}function Go(){return Bi=Do({format:pi,parse:Ci,utcFormat:yi,utcParse:vi})}function _o(t){return Do(di(t))}function Mo(t){return arguments.length?Bi=_o(t):Bi}!function(t){Ii=di(t),pi=Ii.format,Ci=Ii.parse,yi=Ii.utcFormat,vi=Ii.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Go();var To=function(t,e){return Object(x.o)({},t,e)};function jo(t,e){var n=t?An(t):sn(),r=e?_o(e):Mo();return To(n,r)}function Lo(t,e){var n=arguments.length;return n&&2!==n&&Object(x.n)("defaultLocale expects either zero or two arguments."),n?To(sn(t),Mo(e)):To(sn(),Mo())}function Vo(){return an(),Go(),Lo()}var Zo=function(t,e,n,r){var i=ke((e=e||{}).type||"json");return i||Object(x.n)("Unknown data format type: "+e.type),t=i(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;var i=Mo();n=n||i.timeParse,r=r||i.utcParse;var o,a,A,s,c,u,l,g=t.columns||Object.keys(t[0]);"auto"===e&&(e=he(t,g));for(g=Object.keys(e),o=g.map((function(t){var i,o,a=e[t];if(a&&(a.startsWith("date:")||a.startsWith("utc:")))return("'"===(o=(i=a.split(/:(.+)?/,2))[1])[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1)),("utc"===i[0]?r:n)(o);if(!ue[a])throw Error("Illegal format pattern: "+t+":"+a);return ue[a]})),s=0,u=t.length,l=g.length;s<u;++s)for(a=t[s],c=0;c<l;++c)A=g[c],a[A]=o[c](a[A])}(t,e.parse,n,r),Object(x.v)(t,"columns")&&delete t.columns,t};var Po=function(t,e){return function(n){return{options:n||{},sanitize:ne,load:te,fileAccess:!!e,file:ie(e),http:Ae(t)}}}("undefined"!==typeof fetch&&fetch,null);function Wo(){return(Wo=Object(Et.a)(Z.a.mark((function t(e,n){var r,i,o;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,i=0,t.prev=2,t.next=5,r.loader().load(e,{context:"dataflow",response:Oe(n&&n.type)});case 5:o=t.sent;try{o=r.parse(o,n)}catch(a){i=-2,r.warn("Data ingestion failed",e,a)}t.next=13;break;case 9:t.prev=9,t.t0=t.catch(2),i=-1,r.warn("Loading failed",e,t.t0);case 13:return t.abrupt("return",{data:o,status:i});case 14:case"end":return t.stop()}}),t,this,[[2,9]])})))).apply(this,arguments)}function Jo(){return(Jo=Object(Et.a)(Z.a.mark((function t(e,n,r){var i,o,a;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=(i=this)._pending||Ho(i)).requests+=1,t.next=4,i.request(n,r);case 4:return a=t.sent,i.pulse(e,i.changeset().remove(x.gb).insert(a.data||[])),o.done(),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Ho(t){var e,n=new Promise((function(t){e=t}));return n.requests=0,n.done=function(){0===--n.requests&&(t._pending=null,e(t))},t._pending=n}var Yo={skip:!0};function Xo(t,e,n,r,i,o){var a,A,s=Object(x.o)({},o,Yo);Object(x.D)(n)||(n=Object(x.l)(n)),void 0===r?a=function(e){return t.touch(n(e))}:Object(x.D)(r)?(A=new Pt(null,r,i,!1),a=function(e){A.evaluate(e);var r=n(e),i=A.value;_t(i)?t.pulse(r,i,o):t.update(r,i,s)}):a=function(e){return t.update(n(e),r,s)},e.apply(a)}function zo(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{var a=o||{},A=new Pt(null,function(t,e){return e=Object(x.D)(e)?e:Object(x.l)(e),t?function(n,r){var i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);A.modified(a.force),A.rank=e.rank,e.targets().add(A),n&&(A.skip(!0),A.value=n.value,A.targets().add(n),t.connect(n,[A]))}}var Ko={};function qo(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}var $o=qo.prototype;function ta(t,e){return t?function(n,r){return t(n,r)&&e(n,r)}:e}function ea(t,e){var n=[];return Object(x.ib)(t,e,(function(t){return n.push(t)})),n}function na(t,e){var n={};return t.visit(e,(function(t){n[Ut(t)]=1})),function(t){return n[Ut(t)]?null:t}}function ra(t,e,n,r){var i,o,a,A,s,c=this,u=0;for(this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n,a=0,A=n.length;a<A;++a)if((i=n[a]).stamp===e){if(i.fields)for(s in o=c.fields||(c.fields={}),i.fields)o[s]=1;i.changed(c.ADD)&&(u|=c.ADD),i.changed(c.REM)&&(u|=c.REM),i.changed(c.MOD)&&(u|=c.MOD)}this.changes=u}$o.StopPropagation=Ko,$o.ADD=1,$o.REM=2,$o.MOD=4,$o.ADD_REM=3,$o.ADD_MOD=5,$o.ALL=7,$o.REFLOW=8,$o.SOURCE=16,$o.NO_SOURCE=32,$o.NO_FIELDS=64,$o.fork=function(t){return new qo(this.dataflow).init(this,t)},$o.clone=function(){var t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},$o.addAll=function(){var t=this;return t.source&&t.source.length!==t.add.length?((t=new qo(this.dataflow).init(this)).add=t.source,t):t},$o.init=function(t,e){var n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},$o.runAfter=function(t){this.dataflow.runAfter(t)},$o.changed=function(t){var e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},$o.reflow=function(t){if(t)return this.fork(7).reflow();var e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,na(this,1))),this},$o.clean=function(t){return arguments.length?(this.cleans=!!t,this):this.cleans},$o.modifies=function(t){var e=this.fields||(this.fields={});return Object(x.A)(t)?t.forEach((function(t){return e[t]=!0})):e[t]=!0,this},$o.modified=function(t,e){var n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?Object(x.A)(t)?t.some((function(t){return n[t]})):n[t]:!!n)},$o.filter=function(t,e){var n=this;return 1&t&&(n.addF=ta(n.addF,e)),2&t&&(n.remF=ta(n.remF,e)),4&t&&(n.modF=ta(n.modF,e)),16&t&&(n.srcF=ta(n.srcF,e)),n},$o.materialize=function(t){var e=this;return 1&(t=t||7)&&e.addF&&(e.add=ea(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=ea(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=ea(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},$o.visit=function(t,e){var n,r,i=this,o=e;return 16&t?(Object(x.ib)(i.source,i.srcF,o),i):(1&t&&Object(x.ib)(i.add,i.addF,o),2&t&&Object(x.ib)(i.rem,i.remF,o),4&t&&Object(x.ib)(i.mod,i.modF,o),8&t&&(n=i.source)&&((r=i.add.length+i.mod.length)===n.length||(r?Object(x.ib)(n,na(i,5),o):Object(x.ib)(n,i.srcF,o))),i)};var ia=Object(x.y)(ra,qo);function oa(){return(oa=Object(Et.a)(Z.a.mark((function t(e,n,r){var i,o,a,A,s,c,u,l,g;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=[],!(i=this)._pulse){t.next=3;break}return t.abrupt("return",Aa(i));case 3:if(!i._pending){t.next=6;break}return t.next=6,i._pending;case 6:if(!n){t.next=9;break}return t.next=9,Qt(i,n);case 9:if(i._touched.length){t.next=12;break}return i.debug("Dataflow invoked, but nothing to do."),t.abrupt("return",i);case 12:a=++i._clock,i._pulse=new qo(i,a,e),i._touched.forEach((function(t){return i._enqueue(t,!0)})),i._touched=bt(x.w),A=0,t.prev=17;case 18:if(!(i._heap.size()>0)){t.next=35;break}if((s=i._heap.pop()).rank===s.qrank){t.next=23;break}return i._enqueue(s,!0),t.abrupt("continue",18);case 23:if(!(c=s.run(i._getPulse(s,e))).then){t.next=30;break}return t.next=27,c;case 27:c=t.sent,t.next=31;break;case 30:c.async&&(o.push(c.async),c=Ko);case 31:c!==Ko&&s._targets&&s._targets.forEach((function(t){return i._enqueue(t)})),++A,t.next=18;break;case 35:t.next=41;break;case 37:t.prev=37,t.t0=t.catch(17),i._heap.clear(),u=t.t0;case 41:if(i._input={},i._pulse=null,i.debug("Pulse ".concat(a,": ").concat(A," operators")),u&&(i._postrun=[],i.error(u)),!i._postrun.length){t.next=55;break}l=i._postrun.sort((function(t,e){return e.priority-t.priority})),i._postrun=[],g=0;case 49:if(!(g<l.length)){t.next=55;break}return t.next=52,Qt(i,l[g].callback);case 52:++g,t.next=49;break;case 55:if(!r){t.next=58;break}return t.next=58,Qt(i,r);case 58:return o.length&&Promise.all(o).then((function(t){return i.runAsync(null,(function(){t.forEach((function(t){try{t(i)}catch(e){i.error(e)}}))}))})),t.abrupt("return",i);case 60:case"end":return t.stop()}}),t,this,[[17,37]])})))).apply(this,arguments)}function aa(){return(aa=Object(Et.a)(Z.a.mark((function t(e,n,r){var i,o=this;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._running){t.next=5;break}return t.next=3,this._running;case 3:t.next=0;break;case 5:return i=function(){return o._running=null},(this._running=this.evaluate(e,n,r)).then(i,i),t.abrupt("return",this._running);case 8:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Aa(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}ia.fork=function(t){var e=new qo(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(function(t){return e.add.push(t)})),t&e.REM&&this.visit(e.REM,(function(t){return e.rem.push(t)})),t&e.MOD&&this.visit(e.MOD,(function(t){return e.mod.push(t)}))),e},ia.changed=function(t){return this.changes&t},ia.modified=function(t){var e=this,n=e.fields;return n&&e.changes&e.MOD?Object(x.A)(t)?t.some((function(t){return n[t]})):n[t]:0},ia.filter=function(){Object(x.n)("MultiPulse does not support filtering.")},ia.materialize=function(){Object(x.n)("MultiPulse does not support materialization.")},ia.visit=function(t,e){var n=this,r=n.pulses,i=r.length,o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n};var sa={skip:!1,force:!1};function ca(t){var e=[];return{clear:function(){return e=[]},size:function(){return e.length},peek:function(){return e[0]},push:function(n){return e.push(n),ua(e,0,e.length-1,t)},pop:function(){var n,r=e.pop();return e.length?(n=e[0],e[0]=r,function(t,e,n){var r,i=e,o=t.length,a=t[e],A=1+(e<<1);for(;A<o;)(r=A+1)<o&&n(t[A],t[r])>=0&&(A=r),t[e]=t[A],A=1+((e=A)<<1);t[e]=a,ua(t,i,e,n)}(e,0,t)):n=r,n}}}function ua(t,e,n,r){var i,o,a;for(i=t[n];n>e&&r(i,o=t[a=n-1>>1])<0;)t[n]=o,n=a;return t[n]=i}function la(){this.logger(Object(x.K)()),this.logLevel(x.b),this._clock=0,this._rank=0,this._locale=Lo();try{this._loader=Po()}catch(t){}this._touched=bt(x.w),this._input={},this._pulse=null,this._heap=ca((function(t,e){return t.qrank-e.qrank})),this._postrun=[]}var ga=la.prototype;function fa(t){return function(){return this._log[t].apply(this,arguments)}}function ha(t,e){Pt.call(this,t,null,e)}ga.stamp=function(){return this._clock},ga.loader=function(t){return arguments.length?(this._loader=t,this):this._loader},ga.locale=function(t){return arguments.length?(this._locale=t,this):this._locale},ga.cleanThreshold=1e4,ga.add=function(t,e,n,r){var i,o=1;return t instanceof Pt?i=t:t&&t.prototype instanceof Pt?i=new t:Object(x.D)(t)?i=new Pt(null,t):(o=0,i=new Pt(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},ga.connect=function(t,e){var n,r,i=t.rank;for(n=0,r=e.length;n<r;++n)if(i<e[n].rank)return void this.rerank(t)},ga.rank=function(t){t.rank=++this._rank},ga.rerank=function(t){for(var e,n,r,i=[t];i.length;)if(this.rank(e=i.pop()),n=e._targets)for(r=n.length;--r>=0;)i.push(e=n[r]),e===t&&Object(x.n)("Cycle detected in dataflow graph.")},ga.pulse=function(t,e,n){this.touch(t,n||sa);var r=new qo(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},ga.touch=function(t,e){var n=e||sa;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},ga.update=function(t,e,n){var r=n||sa;return(t.set(e)||r.force)&&this.touch(t,r),this},ga.changeset=Mt,ga.ingest=function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},ga.parse=function(t,e){var n=this.locale();return Zo(t,e,n.timeParse,n.utcParse)},ga.preload=function(t,e,n){return Jo.apply(this,arguments)},ga.request=function(t,e){return Wo.apply(this,arguments)},ga.events=function(t,e,n,r){for(var i,o=this,a=Xt(n,r),A=function(t){t.dataflow=o;try{a.receive(t)}catch(e){o.error(e)}finally{o.run()}},s=0,c=(i="string"===typeof t&&"undefined"!==typeof document?document.querySelectorAll(t):Object(x.i)(t)).length;s<c;++s)i[s].addEventListener(e,A);return a},ga.on=function(t,e,n,r,i){return(t instanceof Pt?zo:Xo)(this,t,e,n,r,i),this},ga.evaluate=function(t,e,n){return oa.apply(this,arguments)},ga.run=function(t,e,n){return this._pulse?Aa(this):(this.evaluate(t,e,n),this)},ga.runAsync=function(t,e,n){return aa.apply(this,arguments)},ga.runAfter=function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}},ga._enqueue=function(t,e){var n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},ga._getPulse=function(t,e){var n=t.source,r=this._clock;return n&&Object(x.A)(n)?new ra(this,r,n.map((function(t){return t.pulse})),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Ko&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)},ga.logger=function(t){return arguments.length?(this._log=t,this):this._log},ga.error=fa("error"),ga.warn=fa("warn"),ga.info=fa("info"),ga.debug=fa("debug"),ga.logLevel=fa("level");var da=Object(x.y)(ha,Pt);da.run=function(t){var e,n=this;return t.stamp<this.stamp?t.StopPropagation:(this.skip()?this.skip(!1):e=this.evaluate(t),(e=e||t).then?e=e.then((function(t){return n.pulse=t})):e!==t.StopPropagation&&(this.pulse=e),e)},da.evaluate=function(t){var e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},da.transform=function(){};var Ia={};function pa(t){var e=Ca(t);return e&&e.Definition||null}function Ca(t){return t=t&&t.toLowerCase(),Object(x.v)(Ia,t)?Ia[t]:null}function ya(t){return t&&t.length?1===t.length?t[0]:(e=t,function(t){for(var n=e.length,r=1,i=String(e[0](t));r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function va(t,e,n){return n||t+(e?"_"+e:"")}var Ba=function(){},ma={init:Ba,add:Ba,rem:Ba,idx:0},ba={values:{init:function(t){return t.cell.store=!0},value:function(t){return t.cell.data.values()},idx:-1},count:{value:function(t){return t.cell.num}},__count__:{value:function(t){return t.missing+t.valid}},missing:{value:function(t){return t.missing}},valid:{value:function(t){return t.valid}},sum:{init:function(t){return t.sum=0},value:function(t){return t.sum},add:function(t,e){return t.sum+=+e},rem:function(t,e){return t.sum-=e}},product:{init:function(t){return t.product=1},value:function(t){return t.valid?t.product:void 0},add:function(t,e){return t.product*=e},rem:function(t,e){return t.product/=e}},mean:{init:function(t){return t.mean=0},value:function(t){return t.valid?t.mean:void 0},add:function(t,e){return t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid},rem:function(t,e){return t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean}},average:{value:function(t){return t.valid?t.mean:void 0},req:["mean"],idx:1},variance:{init:function(t){return t.dev=0},value:function(t){return t.valid>1?t.dev/(t.valid-1):void 0},add:function(t,e){return t.dev+=t.mean_d*(e-t.mean)},rem:function(t,e){return t.dev-=t.mean_d*(e-t.mean)},req:["mean"],idx:1},variancep:{value:function(t){return t.valid>1?t.dev/t.valid:void 0},req:["variance"],idx:2},stdev:{value:function(t){return t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0},req:["variance"],idx:2},stdevp:{value:function(t){return t.valid>1?Math.sqrt(t.dev/t.valid):void 0},req:["variance"],idx:2},stderr:{value:function(t){return t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0},req:["variance"],idx:2},distinct:{value:function(t){return t.cell.data.distinct(t.get)},req:["values"],idx:3},ci0:{value:function(t){return t.cell.data.ci0(t.get)},req:["values"],idx:3},ci1:{value:function(t){return t.cell.data.ci1(t.get)},req:["values"],idx:3},median:{value:function(t){return t.cell.data.q2(t.get)},req:["values"],idx:3},q1:{value:function(t){return t.cell.data.q1(t.get)},req:["values"],idx:3},q3:{value:function(t){return t.cell.data.q3(t.get)},req:["values"],idx:3},min:{init:function(t){return t.min=void 0},value:function(t){return t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min},add:function(t,e){(e<t.min||void 0===t.min)&&(t.min=e)},rem:function(t,e){e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:function(t){return t.max=void 0},value:function(t){return t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max},add:function(t,e){(e>t.max||void 0===t.max)&&(t.max=e)},rem:function(t,e){e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:function(t){return t.argmin=void 0},value:function(t){return t.argmin||t.cell.data.argmin(t.get)},add:function(t,e,n){e<t.min&&(t.argmin=n)},rem:function(t,e){e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:function(t){return t.argmax=void 0},value:function(t){return t.argmax||t.cell.data.argmax(t.get)},add:function(t,e,n){e>t.max&&(t.argmax=n)},rem:function(t,e){e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Ea=Object.keys(ba);function Qa(t,e){return ba[t](e)}function Fa(t,e){return t.idx-e.idx}function wa(){var t=this;this.valid=0,this.missing=0,this._ops.forEach((function(e){return e.init(t)}))}function Sa(t,e){var n=this;null!=t&&""!==t?t===t&&(++this.valid,this._ops.forEach((function(r){return r.add(n,t,e)}))):++this.missing}function Ra(t,e){var n=this;null!=t&&""!==t?t===t&&(--this.valid,this._ops.forEach((function(r){return r.rem(n,t,e)}))):--this.missing}function Ua(t){var e=this;return this._out.forEach((function(n){return t[n.out]=n.value(e)})),t}function xa(t,e){var n=e||x.x,r=function(t){var e={};return t.forEach((function(t){return e[t.name]=t})),t.forEach((function t(n){n.req&&n.req.forEach((function(n){e[n]||t(e[n]=ba[n]())}))})),Object.values(e).sort(Fa)}(t),i=t.slice().sort(Fa);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=wa,o.prototype.add=Sa,o.prototype.rem=Ra,o.prototype.set=Ua,o.prototype.get=n,o.fields=t.map((function(t){return t.out})),o}Ea.forEach((function(t){ba[t]=function(t,e){return function(n){return Object(x.o)({name:t,out:n||t},ma,e)}}(t,ba[t])}));var ka=Z.a.mark(Oa);function Oa(t,e){var n,r,i,o,a,A,s;return Z.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(null!=e){c.next=21;break}n=Object(U.a)(t),c.prev=2,n.s();case 4:if((r=n.n()).done){c.next=11;break}if(!(null!=(i=r.value)&&""!==i&&(i=+i)>=i)){c.next=9;break}return c.next=9,i;case 9:c.next=4;break;case 11:c.next=16;break;case 13:c.prev=13,c.t0=c.catch(2),n.e(c.t0);case 16:return c.prev=16,n.f(),c.finish(16);case 19:c.next=41;break;case 21:o=-1,a=Object(U.a)(t),c.prev=23,a.s();case 25:if((A=a.n()).done){c.next=33;break}if(s=A.value,!(null!=(s=e(s,++o,t))&&""!==s&&(s=+s)>=s)){c.next=31;break}return c.next=31,s;case 31:c.next=25;break;case 33:c.next=38;break;case 35:c.prev=35,c.t1=c.catch(23),a.e(c.t1);case 38:return c.prev=38,a.f(),c.finish(38);case 41:case"end":return c.stop()}}),ka,null,[[2,13,16,19],[23,35,38,41]])}var Na=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};function Da(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n<o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n<c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function Ga(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n>o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n>c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function _a(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}var Ma=Z.a.mark(ja),Ta=function(t){return null===t?NaN:+t};function ja(t,e){var n,r,i,o,a,A,s;return Z.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==e){c.next=21;break}n=Object(U.a)(t),c.prev=2,n.s();case 4:if((r=n.n()).done){c.next=11;break}if(!(null!=(i=r.value)&&(i=+i)>=i)){c.next=9;break}return c.next=9,i;case 9:c.next=4;break;case 11:c.next=16;break;case 13:c.prev=13,c.t0=c.catch(2),n.e(c.t0);case 16:return c.prev=16,n.f(),c.finish(16);case 19:c.next=40;break;case 21:o=-1,a=Object(U.a)(t),c.prev=23,a.s();case 25:if((A=a.n()).done){c.next=32;break}if(s=A.value,!(null!=(s=e(s,++o,t))&&(s=+s)>=s)){c.next=30;break}return c.next=30,s;case 30:c.next=25;break;case 32:c.next=37;break;case 34:c.prev=34,c.t1=c.catch(23),a.e(c.t1);case 37:return c.prev=37,a.f(),c.finish(37);case 40:case"end":return c.stop()}}),Ma,null,[[2,13,16,19],[23,34,37,40]])}function La(t,e,n){if(r=(t=Float64Array.from(ja(t,n))).length){if((e=+e)<=0||r<2)return Ga(t);if(e>=1)return Da(t);var r,i=(r-1)*e,o=Math.floor(i),a=Da(function t(e,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Na;i>r;){if(i-r>600){var a=i-r+1,A=n-r+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(A-a/2<0?-1:1),l=Math.max(r,Math.floor(n-A*c/a+u)),g=Math.min(i,Math.floor(n+(a-A)*c/a+u));t(e,n,l,g,o)}var f=e[n],h=r,d=i;for(_a(e,r,n),o(e[i],f)>0&&_a(e,r,i);h<d;){for(_a(e,h,d),++h,--d;o(e[h],f)<0;)++h;for(;o(e[d],f)>0;)--d}0===o(e[r],f)?_a(e,r,d):_a(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}return e}(t,o).subarray(0,o+1));return a+(Ga(t.subarray(o+1))-a)*(i-o)}}var Va=function(t,e,n){var r=Float64Array.from(Oa(t,n));return r.sort(Na),e.map((function(t){return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ta;if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),A=+n(t[o+1],o+1,t);return a+(A-a)*(i-o)}}(r,t)}))},Za=function(t,e){return Va(t,[.25,.5,.75],e)};function Pa(t,e){var n=function(t,e){var n,r=0,i=0,o=0;if(void 0===e){var a,A=Object(U.a)(t);try{for(A.s();!(a=A.n()).done;){var s=a.value;null!=s&&(s=+s)>=s&&(o+=(n=s-i)*(s-(i+=n/++r)))}}catch(f){A.e(f)}finally{A.f()}}else{var c,u=-1,l=Object(U.a)(t);try{for(l.s();!(c=l.n()).done;){var g=c.value;null!=(g=e(g,++u,t))&&(g=+g)>=g&&(o+=(n=g-i)*(g-(i+=n/++r)))}}catch(f){l.e(f)}finally{l.f()}}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}var Wa=function(t,e){var n=t.length,r=Pa(t,e),i=Za(t,e),o=(i[2]-i[0])/1.34;return 1.06*(r=Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)},Ja=function(t){var e,n,r,i,o,a,A,s,c=t.maxbins||20,u=t.base||10,l=Math.log(u),g=t.divide||[5,2],f=t.extent[0],h=t.extent[1],d=t.span||h-f||Math.abs(f)||1;if(t.step)e=t.step;else if(t.steps){for(o=d/c,a=0,A=t.steps.length;a<A&&t.steps[a]<o;++a);e=t.steps[Math.max(0,a-1)]}else{for(n=Math.ceil(Math.log(c)/l),r=t.minstep||0,e=Math.max(r,Math.pow(u,Math.round(Math.log(d)/l)-n));Math.ceil(d/e)>c;)e*=u;for(a=0,A=g.length;a<A;++a)(o=e/g[a])>=r&&d/o<=c&&(e=o)}return i=(o=Math.log(e))>=0?0:1+~~(-o/l),s=Math.pow(u,-i-1),(t.nice||void 0===t.nice)&&(f=f<(o=Math.floor(f/e+s)*e)?o-e:o,h=Math.ceil(h/e)*e),{start:f,stop:h===f?f+e:h,step:e}},Ha=Math.random;function Ya(t){Ha=t}var Xa=function(t,e,n,r){if(!t.length)return[void 0,void 0];var i,o,a,A,s=Float64Array.from(Oa(t,r)),c=s.length,u=e;for(a=0,A=Array(u);a<u;++a){for(i=0,o=0;o<c;++o)i+=s[~~(Ha()*c)];A[a]=i/c}return A.sort(Na),[La(A,n/2),La(A,1-n/2)]},za=function(t,e,n,r){r=r||function(t){return t};for(var i,o=0,a=1,A=t.length,s=new Float64Array(A),c=r(t[0]),u=c,l=c+e;a<A;++a){if((i=r(t[a]))>=l){for(u=(c+u)/2;o<a;++o)s[o]=u;l=i+e,c=i}u=i}for(u=(c+u)/2;o<a;++o)s[o]=u;return n?function(t,e){var n,r,i=t.length,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<i;){for(n=a+1;t[a]===t[n];)++n;if(t[a]-t[a-1]<e){for(r=a+(o+n-a-a>>1);r<a;)t[r++]=t[a];for(;r>a;)t[r--]=t[o]}o=a,a=n}return t}(s,e+e/4):s};var Ka=function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},qa=function(t,e){null==e&&(e=t,t=0);var n,r,i,o={};return o.min=function(t){return arguments.length?(i=r-(n=t||0),o):n},o.max=function(t){return arguments.length?(i=(r=t||0)-n,o):r},o.sample=function(){return n+Math.floor(i*Ha())},o.pdf=function(t){return t===Math.floor(t)&&t>=n&&t<r?1/i:0},o.cdf=function(t){var e=Math.floor(t);return e<n?0:e>=r?1:(e-n+1)/i},o.icdf=function(t){return t>=0&&t<=1?n-1+Math.floor(t*i):NaN},o.min(t).max(e)},$a=Math.sqrt(2*Math.PI),tA=Math.SQRT2,eA=NaN;function nA(t,e){t=t||0,e=null==e?1:e;var n,r,i=0,o=0;if(eA===eA)i=eA,eA=NaN;else{do{n=(i=2*Ha()-1)*i+(o=2*Ha()-1)*o}while(0===n||n>1);i*=r=Math.sqrt(-2*Math.log(n)/n),eA=o*r}return t+i*e}function rA(t,e,n){var r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*$a)}function iA(t,e,n){var r,i=(t-(e=e||0))/(n=null==n?1:n),o=Math.abs(i);if(o>37)r=0;else{var a=Math.exp(-o*o/2);o<7.07106781186547?(r=a*((((((.0352624965998911*o+.700383064443688)*o+6.37396220353165)*o+33.912866078383)*o+112.079291497871)*o+221.213596169931)*o+220.206867912376),r/=((((((.0883883476483184*o+1.75566716318264)*o+16.064177579207)*o+86.7807322029461)*o+296.564248779674)*o+637.333633378831)*o+793.826512519948)*o+440.413735824752):r=a/(o+1/(o+2/(o+3/(o+4/(o+.65)))))/2.506628274631}return i>0?1-r:r}function oA(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*tA*function(t){var e,n=-Math.log((1-t)*(1+t));n<6.25?e=1.6536545626831027+(e=.24015818242558962+(e=(e=(e=.00018673420803405714+(e=(e=(e=4.2347877827932404e-7+(e=(e=(e=1.0512122733215323e-9+(e=(e=(e=26335093153082323e-28+(e=(e=(e=6637638134358324e-30+(e=20972767875968562e-33+(e=(e=11157877678025181e-33+(e=128584807152564e-32+(e=(e=-364441206401782e-35)*(n-=3.125)-16850591381820166e-35)*n)*n)*n-1333171662854621e-31)*n)*n)*n-4054566272975207e-29)*n-8151934197605472e-29)*n)*n-12975133253453532e-27)*n-5415412054294628e-26)*n)*n-4.112633980346984e-9)*n-2.9070369957882005e-8)*n)*n-13654692000834679e-22)*n-13882523362786469e-21)*n)*n-.000740702534166267)*n-.006033670871430149)*n)*n:n<16?(n=Math.sqrt(n)-3.25,e=3.0838856104922208+(e=1.0052589676941592+(e=.005370914553590064+(e=(e=.002491442096107851+(e=(e=.0009532893797373805+(e=(e=24031110387097894e-21+(e=6828485145957318e-20+(e=(e=12475304481671779e-21+(e=29234449089955446e-22+(e=(e=15027403968909828e-22+(e=1.8239629214389228e-8+(e=(e=9.075656193888539e-8+(e=2.2137376921775787e-9)*n)*n-2.7517406297064545e-7)*n)*n)*n-4013867526981546e-21)*n)*n)*n-47318229009055734e-21)*n)*n)*n-.0003550375203628475)*n)*n-.0016882755560235047)*n)*n-.003751208507569241)*n)*n)*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=4.849906401408584+(e=1.0103004648645344+(e=(e=(e=7599527703001776e-20+(e=(e=4526062597223154e-21+(e=(e=2.2900482228026655e-7+(e=(e=2.914795345090108e-8+(e=(e=7.61570120807834e-9+(e=(e=1.5076572693500548e-9+(e=(e=-27109920616438573e-27)*n-2.555641816996525e-10)*n)*n-3.789465440126737e-9)*n)*n-1.496002662714924e-8)*n)*n-6.771199775845234e-8)*n)*n-9.9298272942317e-7)*n)*n-1968177810553167e-20)*n)*n-.00021503011930044477)*n-.00013871931833623122)*n)*n):e=1/0;return e*t}(2*t-1)}var aA=function(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:function(){return nA(n,r)},pdf:function(t){return rA(t,n,r)},cdf:function(t){return iA(t,n,r)},icdf:function(t){return oA(t,n,r)}};return i.mean(t).stdev(e)},AA=function(t,e){var n=aA(),r={},i=0;return r.data=function(n){return arguments.length?(t=n,i=n?n.length:0,r.bandwidth(e)):t},r.bandwidth=function(n){return arguments.length?(!(e=n)&&t&&(e=Wa(t)),r):e},r.sample=function(){return t[~~(Ha()*i)]+e*n.sample()},r.pdf=function(r){for(var o=0,a=0;a<i;++a)o+=n.pdf((r-t[a])/e);return o/e/i},r.cdf=function(r){for(var o=0,a=0;a<i;++a)o+=n.cdf((r-t[a])/e);return o/i},r.icdf=function(){throw Error("KDE icdf not supported.")},r.data(t)};function sA(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+nA()*e)}function cA(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;var r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*$a*t)}function uA(t,e,n){return iA(Math.log(t),e,n)}function lA(t,e,n){return Math.exp(oA(t,e,n))}var gA=function(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:function(){return sA(n,r)},pdf:function(t){return cA(t,n,r)},cdf:function(t){return uA(t,n,r)},icdf:function(t){return lA(t,n,r)}};return i.mean(t).stdev(e)},fA=function(t,e){var n,r={},i=0;function o(t){var e,n=[],r=0;for(e=0;e<i;++e)r+=n[e]=null==t[e]?1:+t[e];for(e=0;e<i;++e)n[e]/=r;return n}return r.weights=function(t){return arguments.length?(n=o(e=t||[]),r):e},r.distributions=function(n){return arguments.length?(n?(i=n.length,t=n):(i=0,t=[]),r.weights(e)):t},r.sample=function(){for(var e=Ha(),r=t[i-1],o=n[0],a=0;a<i-1;o+=n[++a])if(e<o){r=t[a];break}return r.sample()},r.pdf=function(e){for(var r=0,o=0;o<i;++o)r+=n[o]*t[o].pdf(e);return r},r.cdf=function(e){for(var r=0,o=0;o<i;++o)r+=n[o]*t[o].cdf(e);return r},r.icdf=function(){throw Error("Mixture icdf not supported.")},r.distributions(t).weights(e)};function hA(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*Ha()}function dA(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function IA(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function pA(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}var CA=function(t,e){var n,r,i={min:function(t){return arguments.length?(n=t||0,i):n},max:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:function(){return hA(n,r)},pdf:function(t){return dA(t,n,r)},cdf:function(t){return IA(t,n,r)},icdf:function(t){return pA(t,n,r)}};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)},yA=function(t,e,n,r){var i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]};function vA(t,e,n,r){t=t.filter((function(t){var r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort((function(t,n){return e(t)-e(n)}));var i,o,a,A,s=t.length,c=new Float64Array(s),u=new Float64Array(s),l=0,g=0,f=0,h=Object(U.a)(t);try{for(h.s();!(A=h.n()).done;)a=A.value,c[l]=i=+e(a),u[l]=o=+n(a),g+=(i-g)/++l,f+=(o-f)/l}catch(d){h.e(d)}finally{h.f()}for(l=0;l<s;++l)c[l]-=g,u[l]-=f;return[c,u,g,f]}function BA(t,e,n,r){var i,o,a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;i=e(c),o=n(c),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++A)}}catch(u){s.e(u)}finally{s.f()}}var mA=function(t,e,n,r,i){var o=0,a=0;return BA(t,e,n,(function(t,e){var n=e-i(t),A=e-r;o+=n*n,a+=A*A})),1-o/a},bA=function(t,e,n){var r=0,i=0,o=0,a=0,A=0;BA(t,e,n,(function(t,e){++A,r+=(t-r)/A,i+=(e-i)/A,o+=(t*e-o)/A,a+=(t*t-a)/A}));var s=yA(r,i,o,a),c=function(t){return s[0]+s[1]*t};return{coef:s,predict:c,rSquared:mA(t,e,n,i,c)}},EA=function(t,e,n){var r=0,i=0,o=0,a=0,A=0;BA(t,e,n,(function(t,e){++A,t=Math.log(t),r+=(t-r)/A,i+=(e-i)/A,o+=(t*e-o)/A,a+=(t*t-a)/A}));var s=yA(r,i,o,a),c=function(t){return s[0]+s[1]*Math.log(t)};return{coef:s,predict:c,rSquared:mA(t,e,n,i,c)}},QA=n(12),FA=function(t,e,n){var r,i,o,a=vA(t,e,n),A=Object(QA.a)(a,4),s=A[0],c=(A[1],A[2]),u=A[3],l=0,g=0,f=0,h=0,d=0;BA(t,e,n,(function(t,e){r=s[d++],i=Math.log(e),l+=(e*i-l)/d,g+=((o=r*e)-g)/d,f+=(o*i-f)/d,h+=(r*o-h)/d}));var I=yA(g/u,l/u,f/u,h/u),p=Object(QA.a)(I,2),C=p[0],y=p[1],v=function(t){return Math.exp(C+y*(t-c))};return{coef:[Math.exp(C-y*c),y],predict:v,rSquared:mA(t,e,n,u,v)}},wA=function(t,e,n){var r=0,i=0,o=0,a=0,A=0,s=0;BA(t,e,n,(function(t,e){var n=Math.log(t),c=Math.log(e);++s,r+=(n-r)/s,i+=(c-i)/s,o+=(n*c-o)/s,a+=(n*n-a)/s,A+=(e-A)/s}));var c=yA(r,i,o,a),u=function(t){return c[0]*Math.pow(t,c[1])};return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:mA(t,e,n,A,u)}},SA=function(t,e,n){var r,i,o,a,A=vA(t,e,n),s=Object(QA.a)(A,4),c=s[0],u=s[1],l=s[2],g=s[3],f=c.length,h=0,d=0,I=0,p=0,C=0;for(r=0;r<f;)i=c[r],o=u[r++],h+=((a=i*i)-h)/r,d+=(a*i-d)/r,I+=(a*a-I)/r,p+=(i*o-p)/r,C+=(a*o-C)/r;var y=I-h*h,v=h*y-d*d,B=(C*h-p*d)/v,m=(p*y-C*d)/v,b=-B*h,E=function(t){return B*(t-=l)*t+m*t+b+g};return{coef:[b-m*l+B*l*l+g,m-2*B*l,B],predict:E,rSquared:mA(t,e,n,g,E)}},RA=function(t,e,n,r){if(1===r)return bA(t,e,n);if(2===r)return SA(t,e,n);var i,o,a,A,s,c=vA(t,e,n),u=Object(QA.a)(c,4),l=u[0],g=u[1],f=u[2],h=u[3],d=l.length,I=[],p=[],C=r+1;for(i=0;i<C;++i){for(a=0,A=0;a<d;++a)A+=Math.pow(l[a],i)*g[a];for(I.push(A),s=new Float64Array(C),o=0;o<C;++o){for(a=0,A=0;a<d;++a)A+=Math.pow(l[a],i+o);s[o]=A}p.push(s)}p.push(I);var y=function(t){var e,n,r,i,o,a=t.length-1,A=[];for(e=0;e<a;++e){for(i=e,n=e+1;n<a;++n)Math.abs(t[e][n])>Math.abs(t[e][i])&&(i=n);for(r=e;r<a+1;++r)o=t[r][e],t[r][e]=t[r][i],t[r][i]=o;for(n=e+1;n<a;++n)for(r=a;r>=e;r--)t[r][n]-=t[r][e]*t[e][n]/t[e][e]}for(n=a-1;n>=0;--n){for(o=0,r=n+1;r<a;++r)o+=t[r][n]*A[r];A[n]=(t[a][n]-o)/t[n][n]}return A}(p),v=function(t){t-=f;var e=h+y[0]+y[1]*t+y[2]*t*t;for(i=3;i<C;++i)e+=y[i]*Math.pow(t,i);return e};return{coef:UA(C,y,-f,h),predict:v,rSquared:mA(t,e,n,h,v)}};function UA(t,e,n,r){var i,o,a,A,s=Array(t);for(i=0;i<t;++i)s[i]=0;for(i=t-1;i>=0;--i)for(a=e[i],A=1,s[i]+=a,o=1;o<=i;++o)A*=(i+1-o)/o,s[i-o]+=a*Math.pow(n,o)*A;return s[0]+=r,s}var xA=function(t,e,n,r){for(var i=vA(t,e,n,!0),o=Object(QA.a)(i,4),a=o[0],A=o[1],s=o[2],c=o[3],u=a.length,l=Math.max(2,~~(r*u)),g=new Float64Array(u),f=new Float64Array(u),h=new Float64Array(u).fill(1),d=-1;++d<=2;){for(var I=[0,l-1],p=0;p<u;++p){for(var C=a[p],y=I[0],v=I[1],B=C-a[y]>a[v]-C?y:v,m=0,b=0,E=0,Q=0,F=0,w=1/Math.abs(a[B]-C||1),S=y;S<=v;++S){var R=a[S],U=A[S],x=kA(Math.abs(C-R)*w)*h[S],k=R*x;m+=x,b+=k,E+=U*x,Q+=U*k,F+=R*k}var O=yA(b/m,E/m,Q/m,F/m),N=Object(QA.a)(O,2),D=N[0],G=N[1];g[p]=D+G*C,f[p]=Math.abs(A[p]-g[p]),OA(a,p+1,I)}if(2===d)break;var _=La(f,.5,void 0);if(Math.abs(_)<1e-12)break;for(var M,T,j=0;j<u;++j)M=f[j]/(6*_),h[j]=M>=1?1e-12:(T=1-M*M)*T}return function(t,e,n,r){for(var i,o=t.length,a=[],A=0,s=0,c=[];A<o;++A)i=t[A]+n,c[0]===i?c[1]+=(e[A]-c[1])/++s:(s=0,c[1]+=r,c=[i,e[A]],a.push(c));return c[1]+=r,a}(a,g,s,c)};function kA(t){return(t=1-t*t*t)*t*t}function OA(t,e,n){var r=t[e],i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}var NA=.1*Math.PI/180,DA=function(t,e,n,r){n=n||25,r=Math.max(n,r||200);var i=function(e){return[e,t(e)]},o=e[0],a=e[1],A=a-o,s=A/r,c=[i(o)],u=[];if(n===r){for(var l=1;l<r;++l)c.push(i(o+l/n*A));return c.push(i(a)),c}u.push(i(a));for(var g=n;--g>0;)u.push(i(o+g/n*A));for(var f=c[0],h=u[u.length-1];h;){var d=i((f[0]+h[0])/2);d[0]-f[0]>=s&&GA(f,d,h)>NA?u.push(d):(f=h,c.push(h),u.pop()),h=u[u.length-1]}return c};function GA(t,e,n){var r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}function _A(t){this._key=t?Object(x.t)(t):Ut,this.reset()}var MA=_A.prototype;function TA(t){ha.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}MA.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},MA.add=function(t){this._add.push(t)},MA.rem=function(t){this._rem.push(t)},MA.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,e,n,r=this._add,i=this._rem,o=this._key,a=r.length,A=i.length,s=Array(a-A),c={};for(t=0;t<A;++t)c[o(i[t])]=1;for(t=0,e=0;t<a;++t)c[o(n=r[t])]?c[o(n)]=0:s[e++]=n;return this._rem=[],this._add=s},MA.distinct=function(t){for(var e,n=this.values(),r=n.length,i={},o=0;--r>=0;)e=t(n[r])+"",Object(x.v)(i,e)||(i[e]=1,++o);return o},MA.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=Object(x.q)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},MA.argmin=function(t){return this.extent(t)[0]||{}},MA.argmax=function(t){return this.extent(t)[1]||{}},MA.min=function(t){var e=this.extent(t)[0];return null!=e?t(e):void 0},MA.max=function(t){var e=this.extent(t)[1];return null!=e?t(e):void 0},MA.quartile=function(t){return this._get===t&&this._q||(this._q=Za(this.values(),t),this._get=t),this._q},MA.q1=function(t){return this.quartile(t)[0]},MA.q2=function(t){return this.quartile(t)[1]},MA.q3=function(t){return this.quartile(t)[2]},MA.ci=function(t){return this._get===t&&this._ci||(this._ci=Xa(this.values(),1e3,.05,t),this._get=t),this._ci},MA.ci0=function(t){return this.ci(t)[0]},MA.ci1=function(t){return this.ci(t)[1]},TA.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ea},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};var jA=Object(x.y)(TA,ha);jA.transform=function(t,e){var n=this,r=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=t.modified();return r.stamp=i.stamp,r.value&&(o||e.modified(r._inputs,!0))?(r._prev=r.value,r.value=o?r.init(t):{},e.visit(e.SOURCE,(function(t){return r.add(t)}))):(r.value=r.value||r.init(t),e.visit(e.REM,(function(t){return r.rem(t)})),e.visit(e.ADD,(function(t){return r.add(t)}))),i.modifies(r._outputs),r._drop=!1!==t.drop,t.cross&&r._dims.length>1&&(r._drop=!1,r.cross()),e.clean()&&r._drop&&i.clean(!0).runAfter((function(){return n.clean()})),r.changes(i)},jA.cross=function(){var t=this,e=t.value,n=t._dnames,r=n.map((function(){return{}})),i=n.length;function o(t){var e,o,a,A;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][A=a[n[o]]]=A}o(t._prev),o(e),function o(a,A,s){var c,u,l=n[s],g=r[s++];for(c in g)A[l]=g[c],u=a?a+"|"+c:c,s<i?o(u,A,s):e[u]||t.cell(u,A)}("",{},0)},jA.init=function(t){var e=this._inputs=[],n=this._outputs=[],r={};function i(t){for(var n,i=Object(x.i)(Object(x.g)(t)),o=0,a=i.length;o<a;++o)r[n=i[o]]||(r[n]=1,e.push(n))}this._dims=Object(x.i)(t.groupby),this._dnames=this._dims.map((function(t){var e=Object(x.h)(t);return i(t),n.push(e),e})),this.cellkey=t.key?t.key:ya(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var o,a,A,s,c,u,l=t.fields||[null],g=t.ops||["count"],f=t.as||[],h=l.length,d={};for(h!==g.length&&Object(x.n)("Unmatched number of fields and aggregate ops."),u=0;u<h;++u)o=l[u],a=g[u],null==o&&"count"!==a&&Object(x.n)("Null aggregate field specified."),c=va(a,s=Object(x.h)(o),f[u]),n.push(c),"count"!==a?((A=d[s])||(i(o),(A=d[s]=[]).field=o,this._measures.push(A)),"count"!==a&&(this._countOnly=!1),A.push(Qa(a,c))):this._counts.push(c);return this._measures=this._measures.map((function(t){return xa(t,t.field)})),{}},jA.cellkey=ya(),jA.cell=function(t,e){var n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},jA.newcell=function(t,e){var n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){var r,i=this._measures,o=i.length;for(n.agg=Array(o),r=0;r<o;++r)n.agg[r]=new i[r](n)}return n.store&&(n.data=new _A),n},jA.newtuple=function(t,e){var n,r,i=this._dnames,o=this._dims,a={};for(n=0,r=o.length;n<r;++n)a[i[n]]=o[n](t);return e?Dt(e.tuple,a):kt(a)},jA.clean=function(){var t=this.value;for(var e in t)0===t[e].num&&delete t[e]},jA.add=function(t){var e,n,r,i=this.cellkey(t),o=this.cell(i,t);if(o.num+=1,!this._countOnly)for(o.store&&o.data.add(t),n=0,r=(e=o.agg).length;n<r;++n)e[n].add(e[n].get(t),t)},jA.rem=function(t){var e,n,r,i=this.cellkey(t),o=this.cell(i,t);if(o.num-=1,!this._countOnly)for(o.store&&o.data.rem(t),n=0,r=(e=o.agg).length;n<r;++n)e[n].rem(e[n].get(t),t)},jA.celltuple=function(t){var e,n,r,i=t.tuple,o=this._counts;for(t.store&&t.data.values(),n=0,r=o.length;n<r;++n)i[o[n]]=t.num;if(!this._countOnly)for(n=0,r=(e=t.agg).length;n<r;++n)e[n].set(i);return i},jA.changes=function(t){var e,n,r,i,o=this._adds,a=this._mods,A=this._prev,s=this._drop,c=t.add,u=t.rem,l=t.mod;if(A)for(n in A)e=A[n],s&&!e.num||u.push(e.tuple);for(r=0,i=this._alen;r<i;++r)c.push(this.celltuple(o[r])),o[r]=null;for(r=0,i=this._mlen;r<i;++r)(0===(e=a[r]).num&&s?u:l).push(this.celltuple(e)),a[r]=null;return this._alen=this._mlen=0,this._prev=null,t};function LA(t){ha.call(this,null,t)}LA.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};var VA=Object(x.y)(LA,ha);VA.transform=function(t,e){var n,r=!1!==t.interval,i=this._bins(t),o=i.start,a=i.step,A=t.as||["bin0","bin1"],s=A[0],c=A[1];return n=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(Object(x.g)(t.field))?e.ADD_MOD:e.ADD,e.visit(n,r?function(t){var e=i(t);t[s]=e,t[c]=null==e?null:o+a*(1+(e-o)/a)}:function(t){t[s]=i(t)}),e.modifies(r?A:s)},VA._bins=function(t){if(this.value&&!t.modified())return this.value;var e,n,r=t.field,i=Ja(t),o=i.step,a=i.start,A=a+Math.ceil((i.stop-a)/o)*o;null!=(e=t.anchor)&&(n=e-(a+o*Math.floor((e-a)/o)),a+=n,A+=n);var s=function(t){var e=Object(x.cb)(r(t));return null==e?null:e<a?-1/0:e>A?1/0:(e=Math.max(a,Math.min(e,A-o)),a+o*Math.floor(1e-14+(e-a)/o))};return s.start=a,s.stop=i.stop,s.step=o,this.value=Object(x.f)(s,Object(x.g)(r),t.name||"bin_"+Object(x.h)(r))};var ZA=function(t,e,n){var r=t,i=e||[],o=n||[],a={},A=0;return{add:function(t){o.push(t)},remove:function(t){a[r(t)]=++A},size:function(){return i.length},data:function(t,e){return A&&(i=i.filter((function(t){return!a[r(t)]})),a={},A=0),e&&t&&i.sort(t),o.length&&(i=t?Object(x.M)(t,i,o.sort(t)):i.concat(o),o=[]),i}}};function PA(t){ha.call(this,[],t)}function WA(t){Pt.call(this,null,JA,t)}function JA(t){return this.value&&!t.modified()?this.value:Object(x.k)(t.fields,t.orders)}function HA(t){ha.call(this,null,t)}PA.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(x.y)(PA,ha).transform=function(t,e){var n=e.fork(e.ALL),r=ZA(Ut,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(Gt(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n},Object(x.y)(WA,Pt),HA.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};var YA=Object(x.y)(HA,ha);function XA(t){ha.call(this,null,t)}YA.transform=function(t,e){function n(e){return function(n){for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(A(n),t.case,o)||[],s=0,c=i.length;s<c;++s)a.test(r=i[s])||e(r)}}var r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,A=t.field,s=t.as||["text","count"],c=n((function(t){i[t]=1+(i[t]||0)})),u=n((function(t){i[t]-=1}));return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,s)},YA._parameterCheck=function(t,e){var n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},YA._finish=function(t,e){var n,r,i,o=this._counts,a=this._tuples||(this._tuples={}),A=e[0],s=e[1],c=t.fork(t.NO_SOURCE|t.NO_FIELDS);for(n in o)r=a[n],i=o[n]||0,!r&&i?(a[n]=r=kt({}),r[A]=n,r[s]=i,c.add.push(r)):0===i?(r&&c.rem.push(r),o[n]=null,a[n]=null):r[s]!==i&&(r[s]=i,c.mod.push(r));return c.modifies(e)},XA.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(x.y)(XA,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=this.value,i=t.as||["a","b"],o=i[0],a=i[1];return!r||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter")?(r&&(n.rem=r),r=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],A={},s=t.length,c=0;c<s;++c)for(A[e]=o=t[c],i=0;i<s;++i)A[n]=t[i],r(A)&&(a.push(kt(A)),(A={})[e]=o);return a}(r,o,a,t.filter||x.gb)):n.mod=r,n.source=this.value,n.modifies(i)};var zA={kde:AA,mixture:fA,normal:aA,lognormal:gA,uniform:CA};function KA(t){ha.call(this,null,t)}var qA=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],$A={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:qA},{name:"weights",type:"number",array:!0}]};function ts(t,e){return t?t.map((function(t,n){return e[n]||Object(x.h)(t)})):null}function es(t,e,n){var r,i,o,a,A,s,c=[],u=function(t){return t(a)};if(null==e)c.push(t.map(n));else for(r={},i=0,o=t.length;i<o;++i)a=t[i],(s=r[A=e.map(u)])||(r[A]=s=[],s.dims=A,c.push(s)),s.push(n(a));return c}KA.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:qA.concat($A)},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(x.y)(KA,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=function t(e,n){var r=e.function;Object(x.v)(zA,r)||Object(x.n)("Unknown distribution function: "+r);var i=zA[r]();for(var o in e)"field"===o?i.data((e.from||n()).map(e[o])):"distributions"===o?i[o](e[o].map((function(e){return t(e,n)}))):"function"===typeof i[o]&&i[o](e[o]);return i}(t.distribution,function(t){return function(){return t.materialize(t.SOURCE).source}}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200,a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&Object(x.n)("Invalid density method: "+a),t.extent||r.data||Object(x.n)("Missing density extent parameter."),a=r[a];var A=t.as||["value","density"],s=t.extent||Object(x.p)(r.data()),c=DA(a,s,i,o).map((function(t){var e={};return e[A[0]]=t[0],e[A[1]]=t[1],kt(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n};function ns(t){ha.call(this,null,t)}function rs(t){Pt.call(this,null,is,t),this.modified(!0)}function is(t){var e=t.expr;return this.value&&!t.modified("expr")?this.value:Object(x.f)((function(n){return e(n,t)}),Object(x.g)(e),Object(x.h)(e))}function os(t){ha.call(this,[void 0,void 0],t)}function as(t,e){Pt.call(this,t),this.parent=e,this.count=0}ns.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},Object(x.y)(ns,ha).transform=function(t,e){if(this.value&&!t.modified()&&!e.changed())return e;for(var n,r=e.materialize(e.SOURCE).source,i=es(e.source,t.groupby,x.x),o=t.smooth||!1,a=t.field,A=t.step||function(t,e){return Object(x.X)(Object(x.p)(t,e))/30}(r,a),s=Gt((function(t,e){return a(t)-a(e)})),c=t.as||"bin",u=i.length,l=1/0,g=-1/0,f=0;f<u;++f){var h=i[f].sort(s);n=-1;var d,I=Object(U.a)(za(h,A,o,a));try{for(I.s();!(d=I.n()).done;){var p=d.value;p<l&&(l=p),p>g&&(g=p),h[++n][c]=p}}catch(C){I.e(C)}finally{I.f()}}return this.value={start:l,stop:g,step:A},e.reflow(!0).modifies(c)},Object(x.y)(rs,Pt),os.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(x.y)(os,ha).transform=function(t,e){var n,r=this.value,i=t.field,o=r[0],a=r[1];if(((n=e.changed()||e.modified(i.fields)||t.modified("field"))||null==o)&&(o=1/0,a=-1/0),e.visit(n?e.SOURCE:e.ADD,(function(t){var e=Object(x.cb)(i(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){var A=Object(x.h)(i);A&&(A=' for field "'.concat(A,'"')),e.dataflow.warn("Infinite extent".concat(A,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]};var As=Object(x.y)(as,Pt);function ss(t){ha.call(this,{},t),this._keys=Object(x.s)();var e=this._targets=[];e.active=0,e.forEach=function(t){for(var n=0,r=e.active;n<r;++n)t(e[n],n,e)}}As.connect=function(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},As.add=function(t){this.count+=1,this.value.add.push(t)},As.rem=function(t){this.count-=1,this.value.rem.push(t)},As.mod=function(t){this.value.mod.push(t)},As.init=function(t){this.value.init(t,t.NO_SOURCE)},As.evaluate=function(){return this.value};var cs=Object(x.y)(ss,ha);function us(t){Pt.call(this,null,ls,t)}function ls(t){return this.value&&!t.modified()?this.value:Object(x.A)(t.name)?Object(x.i)(t.name).map((function(t){return Object(x.t)(t)})):Object(x.t)(t.name,t.as)}function gs(t){ha.call(this,Object(x.s)(),t)}function fs(t){ha.call(this,[],t)}function hs(t){ha.call(this,[],t)}function ds(t){ha.call(this,null,t)}function Is(t){ha.call(this,[],t)}function ps(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n<o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n<c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function Cs(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n>o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n>c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}cs.activate=function(t){this._targets[this._targets.active++]=t},cs.subflow=function(t,e,n,r){var i,o,a=this.value,A=Object(x.v)(a,t)&&a[t];return A?A.value.stamp<n.stamp&&(A.init(n),this.activate(A)):(o=r||(o=this._group[t])&&o.tuple,i=n.dataflow,A=new as(n.fork(n.NO_SOURCE),this),i.add(A).connect(e(i,t,o)),a[t]=A,this.activate(A)),A},cs.clean=function(){var t=this.value;for(var e in t)if(0===t[e].count){var n=t[e].detachSubflow;n&&n(),delete t[e]}},cs.initTargets=function(){for(var t=this._targets,e=t.length,n=0;n<e&&null!=t[n];++n)t[n]=null;t.active=0},cs.transform=function(t,e){var n=this,r=e.dataflow,i=t.key,o=t.subflow,a=this._keys,A=t.modified("key"),s=function(t){return n.subflow(t,o,e)};return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(function(t){var e=Ut(t),n=a.get(e);void 0!==n&&(a.delete(e),s(n).rem(t))})),e.visit(e.ADD,(function(t){var e=i(t);a.set(Ut(t),e),s(e).add(t)})),A||e.modified(i.fields)?e.visit(e.MOD,(function(t){var e=Ut(t),n=a.get(e),r=i(t);n===r?s(r).mod(t):(a.set(e,r),s(n).rem(t),s(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(function(t){s(a.get(Ut(t))).mod(t)})),A&&e.visit(e.REFLOW,(function(t){var e=Ut(t),n=a.get(e),r=i(t);n!==r&&(a.set(e,r),s(n).rem(t),s(r).add(t))})),e.clean()?r.runAfter((function(){n.clean(),a.clean()})):a.empty>r.cleanThreshold&&r.runAfter(a.clean),e},Object(x.y)(us,Pt),gs.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(x.y)(gs,ha).transform=function(t,e){var n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,A=i.mod,s=t.expr,c=!0;function u(e){var n=Ut(e),i=s(e,t),u=r.get(n);i&&u?(r.delete(n),o.push(e)):i||u?c&&i&&!u&&A.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(function(t){var e=Ut(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(function(e){s(e,t)?o.push(e):r.set(Ut(e),1)})),e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i},fs.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Object(x.y)(fs,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=ts(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,A,s,c=r.map((function(e){return e(t)})),u=c.reduce((function(t,e){return Math.max(t,e.length)}),0),l=0;l<u;++l){for(A=Ot(t),e=0;e<a;++e)A[i[e]]=null==(s=c[e][l])?null:s;o&&(A[o]=l),n.add.push(A)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)},hs.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},Object(x.y)(hs,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=r.map(x.h),o=t.as||["key","value"],a=o[0],A=o[1],s=r.length;return n.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,o=0;o<s;++o)(e=Ot(t))[a]=i[o],e[A]=r[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)},ds.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},Object(x.y)(ds,ha).transform=function(t,e){var n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,(function(e){return e[r]=n(e,t)}))},Object(x.y)(Is,ha).transform=function(t,e){var n,r,i,o=this.value,a=e.fork(e.ALL),A=t.size-o.length,s=t.generator;if(A>0){for(n=[];--A>=0;)n.push(i=kt(s(t))),o.push(i);a.add=a.add.length?a.materialize(a.ADD).add.concat(n):n}else r=o.slice(0,-A),a.rem=a.rem.length?a.materialize(a.REM).rem.concat(r):r,o=o.slice(-A);return a.source=this.value=o,a};var ys=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};function vs(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}var Bs=Z.a.mark(ms);function ms(t,e){var n,r,i,o,a,A,s;return Z.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==e){c.next=21;break}n=Object(U.a)(t),c.prev=2,n.s();case 4:if((r=n.n()).done){c.next=11;break}if(!(null!=(i=r.value)&&(i=+i)>=i)){c.next=9;break}return c.next=9,i;case 9:c.next=4;break;case 11:c.next=16;break;case 13:c.prev=13,c.t0=c.catch(2),n.e(c.t0);case 16:return c.prev=16,n.f(),c.finish(16);case 19:c.next=40;break;case 21:o=-1,a=Object(U.a)(t),c.prev=23,a.s();case 25:if((A=a.n()).done){c.next=32;break}if(s=A.value,!(null!=(s=e(s,++o,t))&&(s=+s)>=s)){c.next=30;break}return c.next=30,s;case 30:c.next=25;break;case 32:c.next=37;break;case 34:c.prev=34,c.t1=c.catch(23),a.e(c.t1);case 37:return c.prev=37,a.f(),c.finish(37);case 40:case"end":return c.stop()}}),Bs,null,[[2,13,16,19],[23,34,37,40]])}function bs(t,e,n){if(r=(t=Float64Array.from(ms(t,n))).length){if((e=+e)<=0||r<2)return Cs(t);if(e>=1)return ps(t);var r,i=(r-1)*e,o=Math.floor(i),a=ps(function t(e,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ys;i>r;){if(i-r>600){var a=i-r+1,A=n-r+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(A-a/2<0?-1:1),l=Math.max(r,Math.floor(n-A*c/a+u)),g=Math.min(i,Math.floor(n+(a-A)*c/a+u));t(e,n,l,g,o)}var f=e[n],h=r,d=i;for(vs(e,r,n),o(e[i],f)>0&&vs(e,r,i);h<d;){for(vs(e,h,d),++h,--d;o(e[h],f)<0;)++h;for(;o(e[d],f)>0;)--d}0===o(e[r],f)?vs(e,r,d):vs(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}return e}(t,o).subarray(0,o+1));return a+(Cs(t.subarray(o+1))-a)*(i-o)}}var Es={value:"value",median:function(t,e){return bs(t,.5,e)},mean:function(t,e){var n=0,r=0;if(void 0===e){var i,o=Object(U.a)(t);try{for(o.s();!(i=o.n()).done;){var a=i.value;null!=a&&(a=+a)>=a&&(++n,r+=a)}}catch(l){o.e(l)}finally{o.f()}}else{var A,s=-1,c=Object(U.a)(t);try{for(c.s();!(A=c.n()).done;){var u=A.value;null!=(u=e(u,++s,t))&&(u=+u)>=u&&(++n,r+=u)}}catch(l){c.e(l)}finally{c.f()}}if(n)return r/n},min:Cs,max:ps},Qs=[];function Fs(t){ha.call(this,[],t)}function ws(t){TA.call(this,t)}Fs.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(x.y)(Fs,ha).transform=function(t,e){var n,r,i,o,a,A,s,c,u,l,g=e.fork(e.ALL),f=function(t){var e,n=t.method||Es.value;if(null!=Es[n])return n===Es.value?(e=void 0!==t.value?t.value:0,function(){return e}):Es[n];Object(x.n)("Unrecognized imputation method: "+n)}(t),h=function(t){var e=t.field;return function(t){return t?e(t):NaN}}(t),d=Object(x.h)(t.field),I=Object(x.h)(t.key),p=(t.groupby||[]).map(x.h),C=function(t,e,n,r){var i,o,a,A,s,c,u,l,g=function(t){return t(l)},f=[],h=r?r.slice():[],d={},I={};for(h.forEach((function(t,e){d[t]=e+1})),A=0,u=t.length;A<u;++A)l=t[A],c=n(l),s=d[c]||(d[c]=h.push(c)),o=(i=e?e.map(g):Qs)+"",(a=I[o])||(a=I[o]=[],f.push(a),a.values=i),a[s-1]=l;return f.domain=h,f}(e.source,t.groupby,t.key,t.keyvals),y=[],v=this.value,B=C.domain.length;for(a=0,c=C.length;a<c;++a)for(i=(n=C[a]).values,r=NaN,s=0;s<B;++s)if(null==n[s]){for(o=C.domain[s],l={_impute:!0},A=0,u=i.length;A<u;++A)l[p[A]]=i[A];l[I]=o,l[d]=Number.isNaN(r)?r=f(n,h):r,y.push(kt(l))}return y.length&&(g.add=g.materialize(g.ADD).add.concat(y)),v.length&&(g.rem=g.materialize(g.REM).rem.concat(v)),this.value=y,g},ws.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Ea},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var Ss=Object(x.y)(ws,TA);function Rs(t){ha.call(this,null,t)}function Us(t){Pt.call(this,null,xs,t)}function xs(t){return this.value&&!t.modified()?this.value:Object(x.I)(t.fields,t.flat)}function ks(t){ha.call(this,[],t),this._pending=null}function Os(t,e,n){n.forEach(kt);var r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function Ns(t){ha.call(this,{},t)}function Ds(t){Pt.call(this,null,Gs,t)}function Gs(t){if(this.value&&!t.modified())return this.value;var e,n,r,i=1/0,o=-1/0,a=t.extents;for(e=0,n=a.length;e<n;++e)(r=a[e])[0]<i&&(i=r[0]),r[1]>o&&(o=r[1]);return[i,o]}function _s(t){Pt.call(this,null,Ms,t)}function Ms(t){return this.value&&!t.modified()?this.value:t.values.reduce((function(t,e){return t.concat(e)}),[])}function Ts(t){ha.call(this,null,t)}function js(t){TA.call(this,t)}Ss.transform=function(t,e){var n,r=this,i=t.modified();return r.value&&(i||e.modified(r._inputs,!0))?(n=r.value=i?r.init(t):{},e.visit(e.SOURCE,(function(t){r.add(t)}))):(n=r.value=r.value||this.init(t),e.visit(e.REM,(function(t){r.rem(t)})),e.visit(e.ADD,(function(t){r.add(t)}))),r.changes(),e.visit(e.SOURCE,(function(t){Object(x.o)(t,n[r.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},Ss.changes=function(){var t,e,n=this._adds,r=this._mods;for(t=0,e=this._alen;t<e;++t)this.celltuple(n[t]),n[t]=null;for(t=0,e=this._mlen;t<e;++t)this.celltuple(r[t]),r[t]=null;this._alen=this._mlen=0},Rs.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(x.y)(Rs,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=e.materialize(e.SOURCE).source,i=es(r,t.groupby,t.field),o=(t.groupby||[]).map(x.h),a=t.bandwidth,A=t.cumulative?"cdf":"pdf",s=t.as||["value","density"],c=[],u=t.extent,l=t.steps||t.minsteps||25,g=t.steps||t.maxsteps||200;"pdf"!==A&&"cdf"!==A&&Object(x.n)("Invalid density method: "+A),"shared"===t.resolve&&(u||(u=Object(x.p)(r,t.field)),l=g=t.steps||g),i.forEach((function(e){var n=AA(e,a)[A],r=t.counts?e.length:1,i=u||Object(x.p)(e);DA(n,i,l,g).forEach((function(t){for(var n={},i=0;i<o.length;++i)n[o[i]]=e.dims[i];n[s[0]]=t[0],n[s[1]]=t[1]*r,c.push(kt(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n},Object(x.y)(Us,Pt),Object(x.y)(ks,ha).transform=function(t,e){var n=this,r=e.dataflow;return this._pending?Os(this,e,this._pending):function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t)?e.StopPropagation:t.values?Os(this,e,r.parse(t.values,t.format)):t.async?{async:r.request(t.url,t.format).then((function(t){return n._pending=Object(x.i)(t.data),function(t){return t.touch(n)}}))}:r.request(t.url,t.format).then((function(t){return Os(n,e,Object(x.i)(t.data))}))},Ns.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(x.y)(Ns,ha).transform=function(t,e){var n,r,i=e,o=t.as,a=t.fields,A=t.index,s=t.values,c=null==t.default?null:t.default,u=t.modified(),l=u?e.SOURCE:e.ADD,g=a.length;return s?(r=s.length,g>1&&!o&&Object(x.n)('Multi-field lookup requires explicit "as" parameter.'),o&&o.length!==g*r&&Object(x.n)('The "as" parameter has too few output field names.'),o=o||s.map(x.h),n=function(t){for(var e,n,i=0,u=0;i<g;++i)if(null==(n=A.get(a[i](t))))for(e=0;e<r;++e,++u)t[o[u]]=c;else for(e=0;e<r;++e,++u)t[o[u]]=s[e](n)}):(o||Object(x.n)("Missing output field names."),n=function(t){for(var e,n=0;n<g;++n)e=A.get(a[n](t)),t[o[n]]=null==e?c:e}),u?i=e.reflow(!0):l|=a.some((function(t){return e.modified(t.fields)}))?e.MOD:0,e.visit(l,n),i.modifies(o)},Object(x.y)(Ds,Pt),Object(x.y)(_s,Pt),Object(x.y)(Ts,ha),Ts.prototype.transform=function(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)},js.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ea,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};var Ls=Object(x.y)(js,TA);function Vs(t){ss.call(this,t)}function Zs(t){ha.call(this,null,t)}function Ps(t){ha.call(this,null,t)}Ls._transform=Ls.transform,Ls.transform=function(t,e){return this._transform(function(t,e){var n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=Object(x.g)(n).concat(Object(x.g)(r)),a=function(t,e,n){var r={},i=[];return n.visit(n.SOURCE,(function(e){var n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort((function(t,e){return(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0)})),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((function(){return i})),fields:a.map((function(t){return function(t,e,n,r){return Object(x.f)((function(r){return e(r)===t?n(r):NaN}),r,t+"")}(t,n,r,o)})),as:a.map((function(t){return t+""})),modified:t.modified.bind(t)}}(t,e),e)},Object(x.y)(Vs,ss).transform=function(t,e){var n=this,r=t.subflow,i=t.field,o=function(t){return n.subflow(Ut(t),r,e,t)};return(t.modified("field")||i&&e.modified(Object(x.g)(i)))&&Object(x.n)("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(function(t){var e=o(t);i(t).forEach((function(t){return e.mod(t)}))})),e.visit(e.ADD,(function(t){var e=o(t);i(t).forEach((function(t){return e.add(kt(t))}))})),e.visit(e.REM,(function(t){var e=o(t);i(t).forEach((function(t){return e.rem(t)}))}))):(e.visit(e.MOD,(function(t){return o(t).mod(t)})),e.visit(e.ADD,(function(t){return o(t).add(t)})),e.visit(e.REM,(function(t){return o(t).rem(t)}))),e.clean()&&e.runAfter((function(){return n.clean()})),e},Zs.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(x.y)(Zs,ha).transform=function(t,e){var n,r,i=t.fields,o=ts(t.fields,t.as||[]),a=i?function(t,e){return function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,i,o)}:Nt;return this.value?r=this.value:(e=e.addAll(),r=this.value={}),n=e.fork(e.NO_SOURCE),e.visit(e.REM,(function(t){var e=Ut(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(function(t){var e=a(t,kt({}));r[Ut(t)]=e,n.add.push(e)})),e.visit(e.MOD,(function(t){n.mod.push(a(t,r[Ut(t)]))})),n},Object(x.y)(Ps,ha).transform=function(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};var Ws=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o};function Js(t){ha.call(this,null,t)}Js.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};var Hs=Object(x.y)(Js,ha);function Ys(t){ha.call(this,null,t)}function Xs(t){ha.call(this,[],t),this.count=0}function zs(t){ha.call(this,null,t)}function Ks(t){ha.call(this,null,t),this.modified(!0)}function qs(t){ha.call(this,null,t)}Hs.transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;var i=es(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(x.h),a=[],A=t.step||.01,s=t.probs||Ws(A/2,1-1e-14,A),c=s.length;return i.forEach((function(t){for(var e=Va(t,s),n=0;n<c;++n){for(var i={},A=0;A<o.length;++A)i[o[A]]=t.dims[A];i[r[0]]=s[n],i[r[1]]=e[n],a.push(kt(i))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n},Object(x.y)(Ys,ha).transform=function(t,e){var n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(function(t){var e=Ut(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(function(t){var e=Ot(t);r[Ut(t)]=e,n.add.push(e)})),e.visit(e.MOD,(function(t){var e,i=r[Ut(t)];for(e in t)i[e]=t[e],n.modifies(e);n.mod.push(i)}))),n},Xs.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(x.y)(Xs,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value,a=this.count,A=0,s=o.reduce((function(t,e){return t[Ut(e)]=1,t}),{});function c(t){var e,r;o.length<i?o.push(t):(r=~~((a+1)*Ha()))<o.length&&r>=A&&(e=o[r],s[Ut(e)]&&n.rem.push(e),o[r]=t),++a}if(e.rem.length&&(e.visit(e.REM,(function(t){var e=Ut(t);s[e]&&(s[e]=-1,n.rem.push(t)),--a})),o=o.filter((function(t){return-1!==s[Ut(t)]}))),(e.rem.length||r)&&o.length<i&&e.source&&(A=a=o.length,e.visit(e.SOURCE,(function(t){s[Ut(t)]||c(t)})),A=-1),r&&o.length>i){for(var u=0,l=o.length-i;u<l;++u)s[Ut(o[u])]=-1,n.rem.push(o[u]);o=o.slice(l)}return e.mod.length&&e.visit(e.MOD,(function(t){s[Ut(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,c),(e.add.length||A<0)&&(n.add=o.filter((function(t){return!s[Ut(t)]}))),this.count=a,this.value=n.source=o,n},zs.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(x.y)(zs,ha).transform=function(t,e){if(!this.value||t.modified()){var n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Ws(t.start,t.stop,t.step||1).map((function(t){var e={};return e[r]=t,kt(e)})),n.add=e.add.concat(this.value),n}},Object(x.y)(Ks,ha).transform=function(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};var $s=["unit0","unit1"];qs.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:vn,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:$s}]};var tc=Object(x.y)(qs,ha);function ec(t){ha.call(this,Object(x.s)(),t)}function nc(t){ha.call(this,null,t)}tc.transform=function(t,e){var n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?Wr:Pr)(o.unit).offset,A=t.as||$s,s=A[0],c=A[1],u=o.start||1/0,l=o.stop||-1/0,g=o.step,f=e.ADD;return(t.modified()||e.modified(Object(x.g)(n)))&&(f=(e=e.reflow(!0)).SOURCE,u=1/0,l=-1/0),e.visit(f,(function(t){var e,i,A=n(t);null==A?(t[s]=null,r&&(t[c]=null)):(t[s]=e=i=o(A),r&&(t[c]=i=a(e,g)),e<u&&(u=e),i>l&&(l=i))})),o.start=u,o.stop=l,e.modifies(r?A:s)},tc._floor=function(t,e){var n="utc"===t.timezone,r=t.units?{units:t.units,step:t.step||1}:li({extent:t.extent||Object(x.p)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),i=r.units,o=r.step;i=mn(i);var a=this.value||{},A=(n?yr:Ir)(i,o);return A.unit=Object(x.U)(i),A.units=i,A.step=o,A.start=a.start,A.stop=a.stop,this.value=A},Object(x.y)(ec,ha).transform=function(t,e){var n=e.dataflow,r=t.field,i=this.value,o=!0;function a(t){i.set(r(t),t)}return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,a)):e.changed()?(e.visit(e.REM,(function(t){i.delete(r(t))})),e.visit(e.ADD,a)):o=!1,this.modified(o),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()},Object(x.y)(nc,ha).transform=function(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(Gt(t.sort)):e.source).map(t.field))};var rc={row_number:function(){return{next:function(t){return t.index+1}}},rank:function(){var t;return{init:function(){return t=1},next:function(e){var n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){var t;return{init:function(){return t=1},next:function(e){var n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){var t=rc.rank(),e=t.next;return{init:t.init,next:function(t){return(e(t)-1)/(t.data.length-1)}}},cume_dist:function(){var t;return{init:function(){return t=0},next:function(e){var n=e.index,r=e.data,i=e.compare;if(t<n){for(;n+1<r.length&&!i(r[n],r[n+1]);)++n;t=n}return(1+t)/r.length}}},ntile:function(t,e){(e=+e)>0||Object(x.n)("ntile num must be greater than zero.");var n=rc.cume_dist(),r=n.next;return{init:n.init,next:function(t){return Math.ceil(e*r(t))}}},lag:function(t,e){return e=+e||1,{next:function(n){var r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:function(n){var r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:function(e){return t(e.data[e.i0])}}},last_value:function(t){return{next:function(e){return t(e.data[e.i1-1])}}},nth_value:function(t,e){return(e=+e)>0||Object(x.n)("nth_value nth must be greater than zero."),{next:function(n){var r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){var e;return{init:function(){return e=null},next:function(n){var r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){var e,n;return{init:function(){return e=null,n=-1},next:function(r){var i=r.data;return r.index<=n?e:(n=function(t,e,n){for(var r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};var ic=Object.keys(rc);function oc(t){var e=Object(x.i)(t.ops),n=Object(x.i)(t.fields),r=Object(x.i)(t.params),i=Object(x.i)(t.as),o=this.outputs=[],a=this.windows=[],A={},s={},c=!0,u=[],l=[];function g(t){Object(x.i)(Object(x.g)(t)).forEach((function(t){return A[t]=1}))}g(t.sort),e.forEach((function(t,e){var A=n[e],f=Object(x.h)(A),h=va(t,f,i[e]);if(g(A),o.push(h),Object(x.v)(rc,t))a.push(function(t,e,n,r){var i=rc[t](e,n);return{init:i.init||x.kb,update:function(t,e){e[r]=i.next(t)}}}(t,n[e],r[e],h));else{if(null==A&&"count"!==t&&Object(x.n)("Null aggregate field specified."),"count"===t)return void u.push(h);c=!1;var d=s[f];d||((d=s[f]=[]).field=A,l.push(d)),d.push(Qa(t,h))}})),(u.length||l.length)&&(this.cell=function(t,e,n){t=t.map((function(t){return xa(t,t.field)}));var r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var A=r.data=new _A;return r.add=function(t){if(r.num+=1,!n){A&&A.add(t);for(var e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){A&&A.rem(t);for(var e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){var i,a;for(A&&A.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,A&&A.reset();for(var t=0;t<i;++t)o[t].init()},r}(l,u,c)),this.inputs=Object.keys(A)}var ac=oc.prototype;ac.init=function(){this.windows.forEach((function(t){return t.init()})),this.cell&&this.cell.init()},ac.update=function(t,e){var n,r=this.cell,i=this.windows,o=t.data,a=i&&i.length;if(r){for(n=t.p0;n<t.i0;++n)r.rem(o[n]);for(n=t.p1;n<t.i1;++n)r.add(o[n]);r.set(e)}for(n=0;n<a;++n)i[n].update(t,e)};var Ac=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return ys(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};function sc(t){ha.call(this,{},t),this._mlen=0,this._mods=[]}sc.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ic.concat(Ea)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};var cc=Object(x.y)(sc,ha);function uc(t,e,n,r){var i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],A=t.data(n),s=A.length,c=0,u=o?Ac(i):null,l={i0:0,i1:0,p0:0,p1:0,index:0,data:A,compare:i||Object(x.l)(-1)};for(e.init();c<s;++c)lc(l,a,c,s),o&&gc(l,u),e.update(l,A[c])}function lc(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function gc(t,e){var n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}cc.transform=function(t,e){var n,r,i=this,o=i.state,a=t.modified(),A=Gt(t.sort);this.stamp=e.stamp,o&&!a||(o=i.state=new oc(t));var s=ya(t.groupby);function c(t){return i.group(s(t))}for(a||e.modified(o.inputs)?(i.value={},e.visit(e.SOURCE,(function(t){c(t).add(t)}))):(e.visit(e.REM,(function(t){c(t).remove(t)})),e.visit(e.ADD,(function(t){c(t).add(t)}))),n=0,r=i._mlen;n<r;++n)uc(i._mods[n],o,A,t);return i._mlen=0,i._mods=[],e.reflow(a).modifies(o.outputs)},cc.group=function(t){var e=this.value[t];return e||((e=this.value[t]=ZA(Ut)).stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e};var fc="top",hc="left",dc="right",Ic="end",pc="row",Cc=0;function yc(t){return t&&t.gradient}function vc(t,e,n){var r=t.id,i=t.gradient,o="radial"===i?"p_":"";return r||(r=t.id="gradient_"+Cc++,"radial"===i?(t.x1=Bc(t.x1,.5),t.y1=Bc(t.y1,.5),t.r1=Bc(t.r1,0),t.x2=Bc(t.x2,.5),t.y2=Bc(t.y2,.5),t.r2=Bc(t.r2,.5),o="p_"):(t.x1=Bc(t.x1,0),t.y1=Bc(t.y1,0),t.x2=Bc(t.x2,1),t.y2=Bc(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function Bc(t,e){return null!=t?t:e}var mc=function(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}};function bc(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Ec(t){this._context=t}Ec.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bc(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Qc=function(){};function Fc(t){this._context=t}Fc.prototype={areaStart:Qc,areaEnd:Qc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:bc(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wc(t){this._context=t}wc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:bc(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Sc(t,e){this._basis=new Ec(t),this._beta=e}Sc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,A=e[n]-o,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*e[s]+(1-this._beta)*(o+r*A));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Rc=function t(e){function n(t){return 1===e?new Ec(t):new Sc(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Uc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function xc(t,e){this._context=t,this._k=(1-e)/6}xc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Uc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Uc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kc=function t(e){function n(t){return new xc(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Oc(t,e){this._context=t,this._k=(1-e)/6}Oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Nc=function t(e){function n(t){return new Oc(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Dc(t,e){this._context=t,this._k=(1-e)/6}Dc.prototype={areaStart:Qc,areaEnd:Qc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Uc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Gc=function t(e){function n(t){return new Dc(t,e)}return n.tension=function(e){return t(+e)},n}(0),_c=Math.abs,Mc=Math.atan2,Tc=Math.cos,jc=Math.max,Lc=Math.min,Vc=Math.sin,Zc=Math.sqrt,Pc=Math.PI,Wc=Pc/2,Jc=2*Pc;function Hc(t){return t>1?0:t<-1?Pc:Math.acos(t)}function Yc(t){return t>=1?Wc:t<=-1?-Wc:Math.asin(t)}function Xc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>1e-12){var A=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*A-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*A-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function zc(t,e){this._context=t,this._alpha=e}zc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Xc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Kc=function t(e){function n(t){return e?new zc(t,e):new xc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function qc(t,e){this._context=t,this._alpha=e}qc.prototype={areaStart:Qc,areaEnd:Qc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Xc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $c=function t(e){function n(t){return e?new qc(t,e):new Dc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function tu(t,e){this._context=t,this._alpha=e}tu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var eu=function t(e){function n(t){return e?new tu(t,e):new Oc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function nu(t){this._context=t}nu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var ru=function(t){return new nu(t)};function iu(t){this._context=t}iu.prototype={areaStart:Qc,areaEnd:Qc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function ou(t){return t<0?-1:1}function au(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),A=(o*i+a*r)/(r+i);return(ou(o)+ou(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(A))||0}function Au(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function su(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,A=(o-r)/3;t._context.bezierCurveTo(r+A,i+A*e,o-A,a-A*n,o,a)}function cu(t){this._context=t}function uu(t){this._context=new lu(t)}function lu(t){this._context=t}function gu(t){this._context=t}function fu(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}cu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:su(this,this._t0,Au(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,su(this,Au(this,n=au(this,t,e)),n);break;default:su(this,this._t0,n=au(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(uu.prototype=Object.create(cu.prototype)).point=function(t,e){cu.prototype.point.call(this,e,t)},lu.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},gu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=fu(t),i=fu(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function hu(t,e){this._context=t,this._t=e}hu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var du={basis:{curve:function(t){return new Ec(t)}},"basis-closed":{curve:function(t){return new Fc(t)}},"basis-open":{curve:function(t){return new wc(t)}},bundle:{curve:Rc,tension:"beta",value:.85},cardinal:{curve:kc,tension:"tension",value:0},"cardinal-open":{curve:Nc,tension:"tension",value:0},"cardinal-closed":{curve:Gc,tension:"tension",value:0},"catmull-rom":{curve:Kc,tension:"alpha",value:.5},"catmull-rom-closed":{curve:$c,tension:"alpha",value:.5},"catmull-rom-open":{curve:eu,tension:"alpha",value:.5},linear:{curve:ru},"linear-closed":{curve:function(t){return new iu(t)}},monotone:{horizontal:function(t){return new uu(t)},vertical:function(t){return new cu(t)}},natural:{curve:function(t){return new gu(t)}},step:{curve:function(t){return new hu(t,.5)}},"step-after":{curve:function(t){return new hu(t,1)}},"step-before":{curve:function(t){return new hu(t,0)}}};function Iu(t,e,n){var r=Object(x.v)(du,t)&&du[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}var pu={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Cu=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],yu=function(t){var e,n,r,i,o,a,A,s,c,u,l,g=[];for(s=0,u=(e=t.slice().replace(Cu[0],"###$1").split(Cu[1]).slice(1)).length;s<u;++s){for(r=(n=e[s]).slice(1).trim().replace(Cu[2],"$1###$2").split(Cu[3]),i=[a=n.charAt(0)],c=0,l=r.length;c<l;++c)(o=+r[c])===o&&i.push(o);if(A=pu[a.toLowerCase()],i.length-1>A)for(c=1,l=i.length;c<l;c+=A)g.push([a].concat(i.slice(c,c+A)));else g.push(i)}return g},vu=Math.PI/180,Bu=Math.PI/2,mu=2*Math.PI,bu=Math.sqrt(3)/2,Eu={},Qu={},Fu=[].join;function wu(t){var e=Fu.call(t);if(Qu[e])return Qu[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],A=t[5],s=t[6],c=t[7],u=c*a,l=-s*A,g=s*a,f=c*A,h=Math.cos(i),d=Math.sin(i),I=Math.cos(o),p=Math.sin(o),C=.5*(o-i),y=Math.sin(.5*C),v=8/3*y*y/Math.sin(C),B=n+h-v*d,m=r+d+v*h,b=n+I,E=r+p,Q=b+v*p,F=E-v*I;return Qu[e]=[u*B+l*m,g*B+f*m,u*Q+l*F,g*Q+f*F,u*b+l*E,g*b+f*E]}var Su=["l",0,0,0,0,0,0,0];function Ru(t,e,n){var r=Su[0]=t[0];if("a"===r||"A"===r)Su[1]=e*t[1],Su[2]=n*t[2],Su[3]=t[3],Su[4]=t[4],Su[5]=t[5],Su[6]=e*t[6],Su[7]=n*t[7];else if("h"===r||"H"===r)Su[1]=e*t[1];else if("v"===r||"V"===r)Su[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)Su[i]=(i%2==1?e:n)*t[i];return Su}var Uu=function(t,e,n,r,i,o){var a,A,s,c,u,l=null,g=0,f=0,h=0,d=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var I=0,p=e.length;I<p;++I){switch(a=e[I],1===i&&1===o||(a=Ru(a,i,o)),a[0]){case"l":g+=a[1],f+=a[2],t.lineTo(g+n,f+r);break;case"L":g=a[1],f=a[2],t.lineTo(g+n,f+r);break;case"h":g+=a[1],t.lineTo(g+n,f+r);break;case"H":g=a[1],t.lineTo(g+n,f+r);break;case"v":f+=a[1],t.lineTo(g+n,f+r);break;case"V":f=a[1],t.lineTo(g+n,f+r);break;case"m":g+=a[1],f+=a[2],t.moveTo(g+n,f+r);break;case"M":g=a[1],f=a[2],t.moveTo(g+n,f+r);break;case"c":A=g+a[5],s=f+a[6],h=g+a[3],d=f+a[4],t.bezierCurveTo(g+a[1]+n,f+a[2]+r,h+n,d+r,A+n,s+r),g=A,f=s;break;case"C":g=a[5],f=a[6],h=a[3],d=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,h+n,d+r,g+n,f+r);break;case"s":A=g+a[3],s=f+a[4],h=2*g-h,d=2*f-d,t.bezierCurveTo(h+n,d+r,g+a[1]+n,f+a[2]+r,A+n,s+r),h=g+a[1],d=f+a[2],g=A,f=s;break;case"S":A=a[3],s=a[4],h=2*g-h,d=2*f-d,t.bezierCurveTo(h+n,d+r,a[1]+n,a[2]+r,A+n,s+r),g=A,f=s,h=a[1],d=a[2];break;case"q":A=g+a[3],s=f+a[4],h=g+a[1],d=f+a[2],t.quadraticCurveTo(h+n,d+r,A+n,s+r),g=A,f=s;break;case"Q":A=a[3],s=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,A+n,s+r),g=A,f=s,h=a[1],d=a[2];break;case"t":A=g+a[1],s=f+a[2],null===l[0].match(/[QqTt]/)?(h=g,d=f):"t"===l[0]?(h=2*g-c,d=2*f-u):"q"===l[0]&&(h=2*g-h,d=2*f-d),c=h,u=d,t.quadraticCurveTo(h+n,d+r,A+n,s+r),f=s,h=(g=A)+a[1],d=f+a[2];break;case"T":A=a[1],s=a[2],h=2*g-h,d=2*f-d,t.quadraticCurveTo(h+n,d+r,A+n,s+r),g=A,f=s;break;case"a":xu(t,g+n,f+r,[a[1],a[2],a[3],a[4],a[5],a[6]+g+n,a[7]+f+r]),g+=a[6],f+=a[7];break;case"A":xu(t,g+n,f+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),g=a[6],f=a[7];break;case"z":case"Z":t.closePath()}l=a}};function xu(t,e,n,r){for(var i=function(t,e,n,r,i,o,a,A,s){var c=Fu.call(arguments);if(Eu[c])return Eu[c];var u=a*vu,l=Math.sin(u),g=Math.cos(u),f=g*(A-t)*.5+l*(s-e)*.5,h=g*(s-e)*.5-l*(A-t)*.5,d=f*f/((n=Math.abs(n))*n)+h*h/((r=Math.abs(r))*r);d>1&&(n*=d=Math.sqrt(d),r*=d);var I=g/n,p=l/n,C=-l/r,y=g/r,v=I*A+p*s,B=C*A+y*s,m=I*t+p*e,b=C*t+y*e,E=(m-v)*(m-v)+(b-B)*(b-B),Q=1/E-.25;Q<0&&(Q=0);var F=Math.sqrt(Q);o==i&&(F=-F);var w=.5*(v+m)-F*(b-B),S=.5*(B+b)+F*(m-v),R=Math.atan2(B-S,v-w),U=Math.atan2(b-S,m-w),x=U-R;x<0&&1===o?x+=mu:x>0&&0===o&&(x-=mu);for(var k=Math.ceil(Math.abs(x/(Bu+.001))),O=[],N=0;N<k;++N){var D=R+N*x/k,G=R+(N+1)*x/k;O[N]=[w,S,D,G,n,r,l,g]}return Eu[c]=O}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n),o=0;o<i.length;++o){var a=wu(i[o]);t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}var ku=.5773502691896257,Ou={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,mu)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n,i=r-n*ku,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n,i=r-n*ku;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=bu*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function Nu(t){return Object(x.v)(Ou,t)?Ou[t]:function(t){if(!Object(x.v)(Du,t)){var e=yu(t);Du[t]={draw:function(t,n){Uu(t,e,0,0,Math.sqrt(n)/2)}}}return Du[t]}(t)}var Du={};var Gu=Math.PI,_u=2*Gu,Mu=_u-1e-6;function Tu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ju(){return new Tu}Tu.prototype=ju.prototype={constructor:Tu,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,A=n-t,s=r-e,c=o-t,u=a-e,l=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(l>1e-6)if(Math.abs(u*A-s*c)>1e-6&&i){var g=n-o,f=r-a,h=A*A+s*s,d=g*g+f*f,I=Math.sqrt(h),p=Math.sqrt(l),C=i*Math.tan((Gu-Math.acos((h+l-d)/(2*I*p)))/2),y=C/p,v=C/I;Math.abs(y-1)>1e-6&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+i+","+i+",0,0,"+ +(u*g>c*f)+","+(this._x1=t+v*A)+","+(this._y1=e+v*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),A=n*Math.sin(r),s=t+a,c=e+A,u=1^o,l=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+s+","+c),n&&(l<0&&(l=l%_u+_u),l>Mu?this._+="A"+n+","+n+",0,1,"+u+","+(t-a)+","+(e-A)+"A"+n+","+n+",0,1,"+u+","+(this._x1=s)+","+(this._y1=c):l>1e-6&&(this._+="A"+n+","+n+",0,"+ +(l>=Gu)+","+u+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Lu=ju,Vu=.448084975506;function Zu(t){return t.x}function Pu(t){return t.y}function Wu(t){return t.width}function Ju(t){return t.height}function Hu(t){return"function"===typeof t?t:function(){return+t}}function Yu(t,e,n){return Math.max(e,Math.min(t,n))}var Xu=function(){var t=Zu,e=Pu,n=Wu,r=Ju,i=Hu(0),o=i,a=i,A=i,s=null;function c(c,u,l){var g,f=null!=u?u:+t.call(this,c),h=null!=l?l:+e.call(this,c),d=+n.call(this,c),I=+r.call(this,c),p=Math.min(d,I)/2,C=Yu(+i.call(this,c),0,p),y=Yu(+o.call(this,c),0,p),v=Yu(+a.call(this,c),0,p),B=Yu(+A.call(this,c),0,p);if(s||(s=g=Lu()),C<=0&&y<=0&&v<=0&&B<=0)s.rect(f,h,d,I);else{var m=f+d,b=h+I;s.moveTo(f+C,h),s.lineTo(m-y,h),s.bezierCurveTo(m-Vu*y,h,m,h+Vu*y,m,h+y),s.lineTo(m,b-B),s.bezierCurveTo(m,b-Vu*B,m-Vu*B,b,m-B,b),s.lineTo(f+v,b),s.bezierCurveTo(f+Vu*v,b,f,b-Vu*v,f,b-v),s.lineTo(f,h+C),s.bezierCurveTo(f,h+Vu*C,f+Vu*C,h,f+C,h),s.closePath()}if(g)return s=null,g+""||null}return c.x=function(e){return arguments.length?(t=Hu(e),c):t},c.y=function(t){return arguments.length?(e=Hu(t),c):e},c.width=function(t){return arguments.length?(n=Hu(t),c):n},c.height=function(t){return arguments.length?(r=Hu(t),c):r},c.cornerRadius=function(t,e,n,r){return arguments.length?(i=Hu(t),o=null!=e?Hu(e):i,A=null!=n?Hu(n):i,a=null!=r?Hu(r):o,c):i},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c},zu=function(){var t,e,n,r,i,o,a,A,s=null;function c(t,e,n){var r=n/2;if(i){var c=a-e,u=t-o;if(c||u){var l=Math.sqrt(c*c+u*u),g=(c/=l)*A,f=(u/=l)*A,h=Math.atan2(u,c);s.moveTo(o-g,a-f),s.lineTo(t-c*r,e-u*r),s.arc(t,e,r,h-Math.PI,h),s.lineTo(o+g,a+f),s.arc(o,a,A,h,h+Math.PI)}else s.arc(t,e,r,0,mu);s.closePath()}else i=1;o=t,a=e,A=r}function u(o){var a,A,u,l=o.length,g=!1;for(null==s&&(s=u=Lu()),a=0;a<=l;++a)!(a<l&&r(A=o[a],a,o))===g&&(g=!g)&&(i=0),g&&c(+t(A,a,o),+e(A,a,o),+n(A,a,o));if(u)return s=null,u+""||null}return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(t){return arguments.length?(e=t,u):e},u.size=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(r=t,u):r},u.context=function(t){return arguments.length?(s=null==t?null:t,u):s},u},Ku=function(t){return function(){return t}};function qu(t){return t.innerRadius}function $u(t){return t.outerRadius}function tl(t){return t.startAngle}function el(t){return t.endAngle}function nl(t){return t&&t.padAngle}function rl(t,e,n,r,i,o,a,A){var s=n-t,c=r-e,u=a-i,l=A-o,g=l*s-u*c;if(!(g*g<1e-12))return[t+(g=(u*(e-o)-l*(t-i))/g)*s,e+g*c]}function il(t,e,n,r,i,o,a){var A=t-n,s=e-r,c=(a?o:-o)/Zc(A*A+s*s),u=c*s,l=-c*A,g=t+u,f=e+l,h=n+u,d=r+l,I=(g+h)/2,p=(f+d)/2,C=h-g,y=d-f,v=C*C+y*y,B=i-o,m=g*d-h*f,b=(y<0?-1:1)*Zc(jc(0,B*B*v-m*m)),E=(m*y-C*b)/v,Q=(-m*C-y*b)/v,F=(m*y+C*b)/v,w=(-m*C+y*b)/v,S=E-I,R=Q-p,U=F-I,x=w-p;return S*S+R*R>U*U+x*x&&(E=F,Q=w),{cx:E,cy:Q,x01:-u,y01:-l,x11:E*(i/B-1),y11:Q*(i/B-1)}}function ol(t){return t[0]}function al(t){return t[1]}var Al=function(){var t=ol,e=al,n=Ku(!0),r=null,i=ru,o=null;function a(a){var A,s,c,u=a.length,l=!1;for(null==r&&(o=i(c=Lu())),A=0;A<=u;++A)!(A<u&&n(s=a[A],A,a))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+t(s,A,a),+e(s,A,a));if(c)return o=null,c+""||null}return a.x=function(e){return arguments.length?(t="function"===typeof e?e:Ku(+e),a):t},a.y=function(t){return arguments.length?(e="function"===typeof t?t:Ku(+t),a):e},a.defined=function(t){return arguments.length?(n="function"===typeof t?t:Ku(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a},sl=function(){var t=ol,e=null,n=Ku(0),r=al,i=Ku(!0),o=null,a=ru,A=null;function s(s){var c,u,l,g,f,h=s.length,d=!1,I=new Array(h),p=new Array(h);for(null==o&&(A=a(f=Lu())),c=0;c<=h;++c){if(!(c<h&&i(g=s[c],c,s))===d)if(d=!d)u=c,A.areaStart(),A.lineStart();else{for(A.lineEnd(),A.lineStart(),l=c-1;l>=u;--l)A.point(I[l],p[l]);A.lineEnd(),A.areaEnd()}d&&(I[c]=+t(g,c,s),p[c]=+n(g,c,s),A.point(e?+e(g,c,s):I[c],r?+r(g,c,s):p[c]))}if(f)return A=null,f+""||null}function c(){return Al().defined(i).curve(a).context(o)}return s.x=function(n){return arguments.length?(t="function"===typeof n?n:Ku(+n),e=null,s):t},s.x0=function(e){return arguments.length?(t="function"===typeof e?e:Ku(+e),s):t},s.x1=function(t){return arguments.length?(e=null==t?null:"function"===typeof t?t:Ku(+t),s):e},s.y=function(t){return arguments.length?(n="function"===typeof t?t:Ku(+t),r=null,s):n},s.y0=function(t){return arguments.length?(n="function"===typeof t?t:Ku(+t),s):n},s.y1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:Ku(+t),s):r},s.lineX0=s.lineY0=function(){return c().x(t).y(n)},s.lineY1=function(){return c().x(t).y(r)},s.lineX1=function(){return c().x(e).y(n)},s.defined=function(t){return arguments.length?(i="function"===typeof t?t:Ku(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(A=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=A=null:A=a(o=t),s):o},s},cl={draw:function(t,e){var n=Math.sqrt(e/Pc);t.moveTo(n,0),t.arc(0,0,n,0,Jc)}},ul=(Math.sqrt(1/3),Math.sin(Pc/10)/Math.sin(7*Pc/10));Math.sin(Jc/10),Math.cos(Jc/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function ll(t,e){return null!=t?t:e}var gl=function(t){return t.x||0},fl=function(t){return t.y||0},hl=function(t){return!(!1===t.defined)},dl=function(){var t=qu,e=$u,n=Ku(0),r=null,i=tl,o=el,a=nl,A=null;function s(){var s,c,u=+t.apply(this,arguments),l=+e.apply(this,arguments),g=i.apply(this,arguments)-Wc,f=o.apply(this,arguments)-Wc,h=_c(f-g),d=f>g;if(A||(A=s=Lu()),l<u&&(c=l,l=u,u=c),l>1e-12)if(h>Jc-1e-12)A.moveTo(l*Tc(g),l*Vc(g)),A.arc(0,0,l,g,f,!d),u>1e-12&&(A.moveTo(u*Tc(f),u*Vc(f)),A.arc(0,0,u,f,g,d));else{var I,p,C=g,y=f,v=g,B=f,m=h,b=h,E=a.apply(this,arguments)/2,Q=E>1e-12&&(r?+r.apply(this,arguments):Zc(u*u+l*l)),F=Lc(_c(l-u)/2,+n.apply(this,arguments)),w=F,S=F;if(Q>1e-12){var R=Yc(Q/u*Vc(E)),U=Yc(Q/l*Vc(E));(m-=2*R)>1e-12?(v+=R*=d?1:-1,B-=R):(m=0,v=B=(g+f)/2),(b-=2*U)>1e-12?(C+=U*=d?1:-1,y-=U):(b=0,C=y=(g+f)/2)}var x=l*Tc(C),k=l*Vc(C),O=u*Tc(B),N=u*Vc(B);if(F>1e-12){var D,G=l*Tc(y),_=l*Vc(y),M=u*Tc(v),T=u*Vc(v);if(h<Pc&&(D=rl(x,k,M,T,G,_,O,N))){var j=x-D[0],L=k-D[1],V=G-D[0],Z=_-D[1],P=1/Vc(Hc((j*V+L*Z)/(Zc(j*j+L*L)*Zc(V*V+Z*Z)))/2),W=Zc(D[0]*D[0]+D[1]*D[1]);w=Lc(F,(u-W)/(P-1)),S=Lc(F,(l-W)/(P+1))}}b>1e-12?S>1e-12?(I=il(M,T,x,k,l,S,d),p=il(G,_,O,N,l,S,d),A.moveTo(I.cx+I.x01,I.cy+I.y01),S<F?A.arc(I.cx,I.cy,S,Mc(I.y01,I.x01),Mc(p.y01,p.x01),!d):(A.arc(I.cx,I.cy,S,Mc(I.y01,I.x01),Mc(I.y11,I.x11),!d),A.arc(0,0,l,Mc(I.cy+I.y11,I.cx+I.x11),Mc(p.cy+p.y11,p.cx+p.x11),!d),A.arc(p.cx,p.cy,S,Mc(p.y11,p.x11),Mc(p.y01,p.x01),!d))):(A.moveTo(x,k),A.arc(0,0,l,C,y,!d)):A.moveTo(x,k),u>1e-12&&m>1e-12?w>1e-12?(I=il(O,N,G,_,u,-w,d),p=il(x,k,M,T,u,-w,d),A.lineTo(I.cx+I.x01,I.cy+I.y01),w<F?A.arc(I.cx,I.cy,w,Mc(I.y01,I.x01),Mc(p.y01,p.x01),!d):(A.arc(I.cx,I.cy,w,Mc(I.y01,I.x01),Mc(I.y11,I.x11),!d),A.arc(0,0,u,Mc(I.cy+I.y11,I.cx+I.x11),Mc(p.cy+p.y11,p.cx+p.x11),d),A.arc(p.cx,p.cy,w,Mc(p.y11,p.x11),Mc(p.y01,p.x01),!d))):A.arc(0,0,u,B,v,d):A.lineTo(O,N)}else A.moveTo(0,0);if(A.closePath(),s)return A=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Pc/2;return[Tc(r)*n,Vc(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:Ku(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:Ku(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:Ku(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:Ku(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:Ku(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:Ku(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:Ku(+t),s):a},s.context=function(t){return arguments.length?(A=null==t?null:t,s):A},s}().startAngle((function(t){return t.startAngle||0})).endAngle((function(t){return t.endAngle||0})).padAngle((function(t){return t.padAngle||0})).innerRadius((function(t){return t.innerRadius||0})).outerRadius((function(t){return t.outerRadius||0})).cornerRadius((function(t){return t.cornerRadius||0})),Il=sl().x(gl).y1(fl).y0((function(t){return(t.y||0)+(t.height||0)})).defined(hl),pl=sl().y(fl).x1(gl).x0((function(t){return(t.x||0)+(t.width||0)})).defined(hl),Cl=Al().x(gl).y(fl).defined(hl),yl=Xu().x(gl).y(fl).width((function(t){return t.width||0})).height((function(t){return t.height||0})).cornerRadius((function(t){return ll(t.cornerRadiusTopLeft,t.cornerRadius)||0}),(function(t){return ll(t.cornerRadiusTopRight,t.cornerRadius)||0}),(function(t){return ll(t.cornerRadiusBottomRight,t.cornerRadius)||0}),(function(t){return ll(t.cornerRadiusBottomLeft,t.cornerRadius)||0})),vl=function(){var t=Ku(cl),e=Ku(64),n=null;function r(){var r;if(n||(n=r=Lu()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"===typeof e?e:Ku(e),r):t},r.size=function(t){return arguments.length?(e="function"===typeof t?t:Ku(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((function(t){return Nu(t.shape||"circle")})).size((function(t){return ll(t.size,64)})),Bl=zu().x(gl).y(fl).defined(hl).size((function(t){return t.size||1}));function ml(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function bl(t,e,n,r){return yl.context(t)(e,n,r)}var El=1;function Ql(){El=1}var Fl=function(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+El++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(x.D)(r)?a.path=r(null):ml(n)?a.path=bl(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"};function wl(t){this.clear(),t&&this.union(t)}var Sl=wl.prototype;function Rl(t){this.mark=t,this.bounds=this.bounds||new wl}function Ul(t){Rl.call(this,t),this.items=this.items||[]}function xl(t,e){if("undefined"!==typeof document&&document.createElement){var n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}function kl(){return"undefined"!==typeof Image?Image:null}function Ol(t){this._pending=0,this._loader=t||Po()}Sl.clone=function(){return new wl(this)},Sl.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},Sl.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},Sl.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},Sl.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},Sl.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},Sl.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},Sl.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},Sl.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},Sl.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},Sl.rotate=function(t,e,n){var r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},Sl.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,o=this.x2,a=this.y2,A=Math.cos(t),s=Math.sin(t),c=e-e*A+n*s,u=n-e*s-n*A;return[A*r-s*i+c,s*r+A*i+u,A*r-s*a+c,s*r+A*a+u,A*o-s*i+c,s*o+A*i+u,A*o-s*a+c,s*o+A*a+u]},Sl.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},Sl.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},Sl.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},Sl.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},Sl.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},Sl.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},Sl.width=function(){return this.x2-this.x1},Sl.height=function(){return this.y2-this.y1},Object(x.y)(Ul,Rl);var Nl=Ol.prototype;function Dl(t){t._pending+=1}function Gl(t){t._pending-=1}Nl.pending=function(){return this._pending},Nl.sanitizeURL=function(t){var e=this;return Dl(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return Gl(e),t})).catch((function(){return Gl(e),null}))},Nl.loadImage=function(t){var e=this,n=kl();return Dl(e),e._loader.sanitize(t,{context:"image"}).then((function(t){var r=t.href;if(!r||!n)throw{url:r};var i=new n,o=Object(x.v)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=function(){return Gl(e)},i.onerror=function(){return Gl(e)},i.src=r,i})).catch((function(t){return Gl(e),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},Nl.ready=function(){var t=this;return new Promise((function(e){!function n(r){t.pending()?setTimeout((function(){n(!0)}),10):e(r)}(!1)}))};var _l=function(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){var r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t};var Ml,Tl,jl,Ll=mu-1e-8;function Vl(t){return Ml=t,Vl}function Zl(){}function Pl(t,e){Ml.add(t,e)}function Wl(t,e){Pl(Tl=t,jl=e)}function Jl(t){Pl(t,Ml.y1)}function Hl(t){Pl(Ml.x1,t)}function Yl(t,e,n,r){var i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function Xl(t,e,n,r,i){var o,a=r-t+3*e-3*n,A=t+n-2*e,s=t-e,c=0,u=0;Math.abs(a)>1e-14?(o=A*A+s*a)>=0&&(c=(-A+(o=Math.sqrt(o)))/a,u=(-A-o)/a):c=.5*s/A,0<c&&c<1&&i(zl(c,t,e,n,r)),0<u&&u<1&&i(zl(u,t,e,n,r))}function zl(t,e,n,r,i){var o=1-t,a=o*o,A=t*t;return a*o*e+3*a*t*n+3*o*A*r+A*t*i}Vl.beginPath=Zl,Vl.closePath=Zl,Vl.moveTo=Wl,Vl.lineTo=Wl,Vl.rect=function(t,e,n,r){Pl(t+n,e+r),Wl(t,e)},Vl.quadraticCurveTo=function(t,e,n,r){Yl(Tl,t,n,Jl),Yl(jl,e,r,Hl),Wl(n,r)},Vl.bezierCurveTo=function(t,e,n,r,i,o){Xl(Tl,t,n,i,Jl),Xl(jl,e,r,o,Hl),Wl(i,o)},Vl.arc=function(t,e,n,r,i,o){if(Tl=n*Math.cos(i)+t,jl=n*Math.sin(i)+e,Math.abs(i-r)>Ll)Pl(t-n,e-n),Pl(t+n,e+n);else{var a,A,s=function(r){return Pl(n*Math.cos(r)+t,n*Math.sin(r)+e)};if(s(r),s(i),i!==r)if((r%=mu)<0&&(r+=mu),(i%=mu)<0&&(i+=mu),i<r&&(o=!o,a=r,r=i,i=a),o)for(i-=mu,a=r-r%Bu,A=0;A<4&&a>i;++A,a-=Bu)s(a);else for(a=r-r%Bu+Bu,A=0;A<4&&a<i;++A,a+=Bu)s(a)}};var Kl=(Kl=xl(1,1))?Kl.getContext("2d"):null,ql=new wl;function $l(t){return function(e,n){if(!Kl)return!0;t(Kl,e),ql.clear().union(e.bounds).intersect(n).round();for(var r=ql.x1,i=ql.y1,o=ql.x2,a=ql.y2,A=i;A<=a;++A)for(var s=r;s<=o;++s)if(Kl.isPointInPath(s,A))return!0;return!1}}function tg(t,e){return e.contains(t.x||0,t.y||0)}function eg(t,e){var n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(ql.set(n,r,n+i,r+o))}function ng(t,e){var n=t.x||0,r=t.y||0;return rg(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function rg(t,e,n,r,i){var o,a,A,s,c=t.x1,u=t.y1,l=t.x2,g=t.y2,f=r-e,h=i-n,d=0,I=1;for(s=0;s<4;++s){if(0===s&&(o=-f,a=-(c-e)),1===s&&(o=f,a=l-e),2===s&&(o=-h,a=-(u-n)),3===s&&(o=h,a=g-n),Math.abs(o)<1e-10&&a<0)return!1;if(A=a/o,o<0){if(A>I)return!1;A>d&&(d=A)}else if(o>0){if(A<d)return!1;A<I&&(I=A)}}return!0}var ig=function(t,e){t.globalCompositeOperation=e.blend||"source-over"},og=function(t,e){return null==t?e:t};function ag(t,e){for(var n=e.length,r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}var Ag=function(t,e,n){return yc(n)?function(t,e,n){var r,i=n.width(),o=n.height();if("radial"===e.gradient)r=t.createRadialGradient(n.x1+og(e.x1,.5)*i,n.y1+og(e.y1,.5)*o,Math.max(i,o)*og(e.r1,0),n.x1+og(e.x2,.5)*i,n.y1+og(e.y2,.5)*o,Math.max(i,o)*og(e.r2,.5));else{var a=og(e.x1,0),A=og(e.y1,0),s=og(e.x2,1),c=og(e.y2,0);if(a!==s&&A!==c&&i!==o){var u=xl(Math.ceil(i),Math.ceil(o)),l=u.getContext("2d");return l.scale(i,o),l.fillStyle=ag(l.createLinearGradient(a,A,s,c),e.stops),l.fillRect(0,0,i,o),t.createPattern(u,"no-repeat")}r=t.createLinearGradient(n.x1+a*i,n.y1+A*o,n.x1+s*i,n.y1+c*o)}return ag(r,e.stops)}(t,n,e.bounds):n},sg=function(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Ag(t,e,e.fill),!0)},cg=[],ug=function(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Ag(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||cg),t.lineDashOffset=e.strokeDashOffset||0),!0))};function lg(t,e){return t.zindex-e.zindex||t.index-e.index}function gg(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(lg)}function fg(t,e){var n,r,i=t.items;if(i&&i.length){var o=gg(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}}function hg(t,e){var n,r,i=t.items;if(!i||!i.length)return null;var o=gg(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function dg(t){return function(e,n,r){fg(n,(function(n){r&&!r.intersects(n.bounds)||Ig(t,e,n,n)}))}}function Ig(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(ig(e,n),n.fill&&sg(e,n,i)&&e.fill(),n.stroke&&ug(e,n,i)&&e.stroke()))}function pg(t){return t=t||x.gb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,hg(n,(function(n){var A=n.bounds;if((!A||A.contains(o,a))&&A)return t(e,n,r,i,o,a)?n:void 0}))}}function Cg(t,e){return function(n,r,i,o){var a,A,s=Array.isArray(r)?r[0]:r,c=null==e?s.fill:e,u=s.stroke&&n.isPointInStroke;return u&&(a=s.strokeWidth,A=s.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=A?A:"butt"),!t(n,r)&&(c&&n.isPointInPath(i,o)||u&&n.isPointInStroke(i,o))}}function yg(t){return pg(Cg(t))}function vg(t,e){return"translate("+t+","+e+")"}function Bg(t){return"rotate("+t+")"}function mg(t){return vg(t.x||0,t.y||0)}function bg(t){return vg(t.x||0,t.y||0)+(t.angle?" "+Bg(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}var Eg=function(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=vu),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",bg(n)),t("d",e(null,n))},bound:function(t,n){var r=n.x||0,i=n.y||0;return e(Vl(t),n),_l(t,n).translate(r,i),n.angle&&t.rotate(n.angle*vu,r,i),t},draw:dg(r),pick:yg(r),isect:n||$l(r)}},Qg=Eg("arc",(function(t,e){return dl.context(t)(e)}));var Fg=function(t,e,n){function r(t,n){t.beginPath(),e(t,n)}var i,o=Cg(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Vl(t),r),_l(t,r[0]))},draw:(i=r,function(t,e,n){!e.items.length||n&&!n.intersects(e.bounds)||Ig(i,t,e.items[0],e.items)}),pick:function(t,e,n,r,i,a){var A=e.items,s=e.bounds;return!A||!A.length||s&&!s.contains(i,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,o(t,A,n,r)?A[0]:null)},isect:tg,tip:n}},wg=Fg("area",(function(t,e){var n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?pl:Il).curve(Iu(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,A=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<A&&(A=r,n=t[a]);return n}));function Sg(t,e){t.beginPath(),ml(e)?bl(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function Rg(t){var e=og(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function Ug(t,e){var n=Rg(e);t("d",bl(null,e,n,n))}function xg(t,e,n,r){var i=Rg(e);t.beginPath(),bl(t,e,(n||0)+i,(r||0)+i)}var kg=Cg(xg),Og=Cg(xg,!1);var Ng={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",mg(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,r=n.length,i=0;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),_l(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var r=this;fg(e,(function(e){var i=e.x||0,o=e.y||0,a=e.strokeForeground,A=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&A&&(xg(t,e,i,o),ig(t,e),e.fill&&sg(t,e,A)&&t.fill(),e.stroke&&!a&&ug(t,e,A)&&t.stroke()),t.save(),t.translate(i,o),e.clip&&Sg(t,e),n&&n.translate(-i,-o),fg(e,(function(e){r.draw(t,e,n)})),n&&n.translate(i,o),t.restore(),a&&e.stroke&&A&&(xg(t,e,i,o),ig(t,e),ug(t,e,A)&&t.stroke())}))},pick:function(t,e,n,r,i,o){var a=this;if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;var A=n*t.pixelRatio,s=r*t.pixelRatio;return hg(e,(function(c){var u,l,g,f,h,d,I,p,C;if((!(p=c.bounds)||p.contains(i,o))&&(f=c.x||0,h=c.y||0,d=f+(c.width||0),I=h+(c.height||0),!(C=c.clip)||!(i<f||i>d||o<h||o>I)))return t.save(),t.translate(f,h),f=i-f,h=o-h,C&&ml(c)&&!kg(t,c,A,s)?(t.restore(),null):(l=c.strokeForeground,(g=!1!==e.interactive)&&l&&c.stroke&&Og(t,c,A,s)?(t.restore(),c):(!(u=hg(c,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,f,h)?a.pick(t,n,r,f,h):null})))&&g&&(c.fill||!l&&c.stroke)&&kg(t,c,A,s)&&(u=c),t.restore(),u||null))}))},isect:eg,content:function(t,e,n){t("clip-path",e.clip?Fl(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),Ug(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?Ug(t,e):t("d","")}},Dg={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Gg(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((function(e){t.image=e,t.image.url=t.url}))),n}function _g(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function Mg(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function Tg(t,e){return"center"===t?e/2:"right"===t?e:0}function jg(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Lg={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var r=Gg(e,n),i=_g(e,r),o=Mg(e,r),a=(e.x||0)-Tg(e.align,i),A=(e.y||0)-jg(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Dg["xmlns:xlink"],"xlink:href"),t("transform",vg(a,A)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){var n=e.image,r=_g(e,n),i=Mg(e,n),o=(e.x||0)-Tg(e.align,r),a=(e.y||0)-jg(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){var r=this;fg(e,(function(e){if(!n||n.intersects(e.bounds)){var i,o,a,A,s=Gg(e,r),c=_g(e,s),u=Mg(e,s),l=(e.x||0)-Tg(e.align,c),g=(e.y||0)-jg(e.baseline,u);!1!==e.aspect&&(o=s.width/s.height,a=e.width/e.height,o===o&&a===a&&o!==a&&(a<o?(g+=(u-(A=c/o))/2,u=A):(l+=(c-(A=u*o))/2,c=A))),(s.complete||s.toDataURL)&&(ig(t,e),t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(s,l,g,c,u))}}))},pick:pg(),isect:x.gb,get:Gg,xOffset:Tg,yOffset:jg},Vg=Fg("line",(function(t,e){var n=e[0],r=n.interpolate||"linear";return Cl.curve(Iu(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function Zg(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,A=(e.angle||0)*vu,s=e.pathCache;s&&s.path===n||((e.pathCache=s=yu(n)).path=n),A&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(A),Uu(t,s,0,0,o,a),t.rotate(-A),t.translate(-r,-i)):Uu(t,s,r,i,o,a)}var Pg={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",bg(e)),t("d",e.path)},bound:function(t,e){return Zg(Vl(t),e)?t.set(0,0,0,0):_l(t,e,!0),e.angle&&t.rotate(e.angle*vu,e.x||0,e.y||0),t},draw:dg(Zg),pick:yg(Zg),isect:$l(Zg)};function Wg(t,e){t.beginPath(),bl(t,e)}var Jg={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",bl(null,e))},bound:function(t,e){var n,r;return _l(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:dg(Wg),pick:yg(Wg),isect:eg};function Hg(t,e,n){var r,i,o,a;return!(!e.stroke||!ug(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Yg={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",mg(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return _l(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){fg(e,(function(e){if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Hg(t,e,r)&&(ig(t,e),t.stroke())}}))},pick:pg((function(t,e,n,r){return!!t.isPointInStroke&&(Hg(t,e,1)&&t.isPointInStroke(n,r))})),isect:ng},Xg=Eg("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),zg=Eg("symbol",(function(t,e){return vl.context(t)(e)}),tg),Kg=Object(x.L)(),qg={height:of,measureWidth:nf,estimateWidth:tf,width:tf,canvas:$g};function $g(t){qg.width=t&&Kl?nf:tf}function tf(t,e){return ef(cf(t,e),of(t))}function ef(t,e){return~~(.8*t.length*e)}function nf(t,e){return of(t)<=0||!(e=cf(t,e))?0:rf(e,lf(t))}function rf(t,e){var n="(".concat(e,") ").concat(t),r=Kg.get(n);return void 0===r&&(Kl.font=e,r=Kl.measureText(t).width,Kg.set(n,r)),r}function of(t){return null!=t.fontSize?+t.fontSize||0:11}function af(t){return null!=t.lineHeight?t.lineHeight:of(t)+2}function Af(t){return e=t.lineBreak&&t.text&&!Object(x.A)(t.text)?t.text.split(t.lineBreak):t.text,Object(x.A)(e)?e.length>1?e:e[0]:e;var e}function sf(t){var e=Af(t);return(Object(x.A)(e)?e.length-1:0)*af(t)}function cf(t,e){var n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(qg.width===nf){var e=lf(t);return function(t){return rf(t,e)}}var n=of(t);return function(t){return ef(t,n)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"\u2026",a="rtl"===t.dir,A=0,s=e.length;if(n-=r(o),a){for(;A<s;)i=A+s>>>1,r(e.slice(i))>n?A=i+1:s=i;return o+e.slice(A)}for(;A<s;)i=1+(A+s>>>1),r(e.slice(0,i))<n?A=i:s=i-1;return e.slice(0,A)+o}(t,n):n}function uf(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function lf(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+of(t)+"px "+uf(t,e)}function gf(t){var e=t.baseline,n=of(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*af(t):"line-bottom"===e?.29*n-.5*af(t):0)}$g(!0);var ff={left:"start",center:"middle",right:"end"},hf=new wl;function df(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-Bu,n+=i*Math.cos(e),r+=i*Math.sin(e)),hf.x1=n,hf.y1=r,hf}function If(t,e,n){var r,i=qg.height(e),o=e.align,a=df(e),A=a.x1,s=a.y1,c=e.dx||0,u=(e.dy||0)+gf(e)-Math.round(.8*i),l=Af(e);if(Object(x.A)(l)?(i+=af(e)*(l.length-1),r=l.reduce((function(t,n){return Math.max(t,qg.width(e,n))}),0)):r=qg.width(e,l),"center"===o?c-=r/2:"right"===o&&(c-=r),t.set(c+=A,u+=s,c+r,u+i),e.angle&&!n)t.rotate(e.angle*vu,A,s);else if(2===n)return t.rotatedPoints(e.angle*vu,A,s);return t}var pf={arc:Qg,area:wg,group:Ng,image:Lg,line:Vg,path:Pg,rect:Jg,rule:Yg,shape:Xg,symbol:zg,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+gf(e),o=df(e),a=o.x1,A=o.y1,s=e.angle||0;t("text-anchor",ff[e.align]||"start"),s?(n=vg(a,A)+" "+Bg(s),(r||i)&&(n+=" "+vg(r,i))):n=vg(a+r,A+i),t("transform",n)},bound:If,draw:function(t,e,n){fg(e,(function(e){var r,i,o,a,A,s,c,u=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===u||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=lf(e),t.textAlign=e.align||"left",i=(r=df(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*vu),i=o=0),i+=e.dx||0,o+=(e.dy||0)+gf(e),s=Af(e),ig(t,e),Object(x.A)(s))for(A=af(e),a=0;a<s.length;++a)c=cf(e,s[a]),e.fill&&sg(t,e,u)&&t.fillText(c,i,o),e.stroke&&ug(t,e,u)&&t.strokeText(c,i,o),o+=A;else c=cf(e,s),e.fill&&sg(t,e,u)&&t.fillText(c,i,o),e.stroke&&ug(t,e,u)&&t.strokeText(c,i,o);e.angle&&t.restore()}}))},pick:pg((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=df(e),A=a.x1,s=a.y1,c=If(hf,e,1),u=-e.angle*vu,l=Math.cos(u),g=Math.sin(u),f=l*i-g*o+(A-l*A+g*s),h=g*i+l*o+(s-g*A-l*s);return c.contains(f,h)})),isect:function(t,e){var n=If(hf,t,2);return rg(e,n[0],n[1],n[2],n[3])||rg(e,n[0],n[1],n[4],n[5])||rg(e,n[4],n[5],n[6],n[7])||rg(e,n[2],n[3],n[6],n[7])}},trail:Fg("trail",(function(t,e){return Bl.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))},Cf=function(t,e,n){var r=pf[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new wl),t,n)},yf={mark:null},vf=function(t,e,n){var r,i,o,a,A=pf[t.marktype],s=A.bound,c=t.items,u=c&&c.length;if(A.nested)return u?o=c[0]:(yf.mark=t,o=yf),a=Cf(o,s,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new wl,u)for(r=0,i=c.length;r<i;++r)e.union(Cf(c[r],s,n));return t.bounds=e},Bf=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function mf(t,e){return JSON.stringify(t,Bf,e)}function bf(t){return function t(e){var n,r,i,o=e.marktype,a=e.items;if(a)for(r=0,i=a.length;r<i;++r)n=o?"mark":"group",a[r][n]=e,a[r].zindex&&(a[r][n].zdirty=!0),"group"===(o||n)&&t(a[r]);o&&vf(e);return e}("string"===typeof t?JSON.parse(t):t)}function Ef(t){arguments.length?this.root=bf(t):(this.root=Ff({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Ul(this.root)])}var Qf=Ef.prototype;function Ff(t,e){var n={bounds:new wl,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function wf(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Sf(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Rf(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=wf(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function Uf(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function xf(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}Qf.toJSON=function(t){return mf(this.root,t||0)},Qf.mark=function(t,e,n){var r=Ff(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r};var kf=function(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]};function Of(t,e){this._active=null,this._handlers={},this._loader=t||Po(),this._tooltip=e||Nf}function Nf(t,e,n,r){t.element().setAttribute("title",r||"")}var Df=Of.prototype;function Gf(t){this._el=null,this._bgcolor=null,this._loader=new Ol(t)}Df.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Df.element=function(){return this._el},Df.canvas=function(){return this._el&&this._el.firstChild},Df.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},Df.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Df.on=function(){},Df.off=function(){},Df._handlerIndex=function(t,e,n){for(var r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},Df.handlers=function(t){var e=this._handlers,n=[];if(t)n.push.apply(n,e[this.eventName(t)]);else for(var r in e)n.push.apply(n,e[r]);return n},Df.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Df.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),r=wf(null,"a");for(var i in e)r.setAttribute(i,e[i]);r.dispatchEvent(n)})).catch((function(){}))},Df.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=pf[a.marktype]).tip){for((o=kf(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);var r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},Df.getItemBoundingClientRect=function(t){var e=this.canvas();if(e){for(var n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height(),A=i.x1+r[0]+n.left,s=i.y1+r[1]+n.top;t.mark&&(t=t.mark.group);)A+=t.x||0,s+=t.y||0;return{x:A,y:s,width:o,height:a,left:A,top:s,right:A+o,bottom:s+a}}};var _f=Gf.prototype;_f.initialize=function(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},_f.element=function(){return this._el},_f.canvas=function(){return this._el&&this._el.firstChild},_f.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},_f.resize=function(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},_f.dirty=function(){},_f.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_f._render=function(){},_f.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},_f._load=function(t,e){var n=this,r=n._loader[t](e);if(!n._ready){var i=n._call;n._ready=n._loader.ready().then((function(t){t&&i(),n._ready=null}))}return r},_f.sanitizeURL=function(t){return this._load("sanitizeURL",t)},_f.loadImage=function(t){return this._load("loadImage",t)};var Mf="dragleave",Tf="mousedown",jf="mousemove",Lf="mouseout",Vf="click",Zf=["keydown","keypress","keyup","dragenter",Mf,"dragover",Tf,"mouseup",jf,Lf,"mouseover",Vf,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Pf=jf,Wf=Lf,Jf=Vf;function Hf(t,e){Of.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}var Yf=Object(x.y)(Hf,Of);Yf.initialize=function(t,e,n){var r=this;return this._canvas=t&&Sf(t,"canvas"),[Vf,Tf,jf,Lf,Mf].forEach((function(t){return Xf(r,t)})),Of.prototype.initialize.call(this,t,e,n)};function Xf(t,e){(function(t){return"touchstart"===t||"touchmove"===t||"touchend"===t?["touchstart","touchmove","touchend"]:[t]})(e).forEach((function(e){return function(t,e){var n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?function(n){return t[e](n)}:function(n){return t.fire(e,n)}))}(t,e)}))}function zf(t,e,n){return function(r){var i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Kf(t){return function(e){this.fire(t,e),this._active=null}}Yf.canvas=function(){return this._canvas},Yf.context=function(){return this._canvas.getContext("2d")},Yf.events=Zf,Yf.DOMMouseScroll=function(t){this.fire("mousewheel",t)},Yf.mousemove=zf(jf,"mouseover",Lf),Yf.dragover=zf("dragover","dragenter",Mf),Yf.mouseout=Kf(Lf),Yf.dragleave=Kf(Mf),Yf.mousedown=function(t){this._down=this._active,this.fire(Tf,t)},Yf.click=function(t){this._down===this._active&&(this.fire(Vf,t),this._down=null)},Yf.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},Yf.touchmove=function(t){this.fire("touchmove",t,!0)},Yf.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},Yf.fire=function(t,e,n){var r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===Jf&&r&&r.href?this.handleHref(e,r,r.href):t!==Pf&&t!==Wf||this.handleTooltip(e,r,t!==Wf),i)for(var o=0,a=i.length;o<a;++o)i[o].handler.call(this._obj,e,r)},Yf.on=function(t,e){var n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(Xf(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},Yf.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},Yf.pickEvent=function(t){var e=kf(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},Yf.pick=function(t,e,n,r,i){var o=this.context();return pf[t.marktype].pick.call(this,o,t,e,n,r,i)};var qf="undefined"!==typeof window&&window.devicePixelRatio||1;function $f(t){Gf.call(this,t),this._options={},this._redraw=!1,this._dirty=new wl,this._tempb=new wl}var th=Object(x.y)($f,Gf),eh=Gf.prototype;th.initialize=function(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:xl(1,1,this._options.type),t&&this._canvas&&(Uf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),eh.initialize.call(this,t,e,n,r,i)},th.resize=function(t,e,n,r){if(eh.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){var a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,A=t.getContext("2d"),s=a?qf:i;for(var c in t.width=e*s,t.height=n*s,o)A[c]=o[c];a&&1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),A.pixelRatio=s,A.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{var i=this._options.externalContext;i||Object(x.n)("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},th.canvas=function(){return this._canvas},th.context=function(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},th.dirty=function(t){for(var e=this._tempb.clear().union(t.bounds),n=t.mark.group;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)};function nh(t,e){Of.call(this,t,e);var n=this;n._hrefHandler=ih(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=ih(n,(function(t,e){n.handleTooltip(t,e,t.type!==Wf)}))}th._render=function(t){var e,n,r,i=this.context(),o=this._origin,a=this._width,A=this._height,s=this._dirty,c=(e=o,n=a,r=A,(new wl).set(0,0,n,r).translate(-e[0],-e[1]));i.save();var u=this._redraw||s.empty()?(this._redraw=!1,c.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(i,c.intersect(s),o);return this.clear(-o[0],-o[1],a,A),this.draw(i,t,u),i.restore(),s.clear(),this},th.draw=function(t,e,n){var r=pf[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),Object(x.D)(n)?(t.beginPath(),n(t),t.clip()):Sg(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},th.clear=function(t,e,n,r){var i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))};var rh=Object(x.y)(nh,Of);rh.initialize=function(t,e,n){var r=this._svg;return r&&(r.removeEventListener(Jf,this._hrefHandler),r.removeEventListener(Pf,this._tooltipHandler),r.removeEventListener(Wf,this._tooltipHandler)),this._svg=r=t&&Sf(t,"svg"),r&&(r.addEventListener(Jf,this._hrefHandler),r.addEventListener(Pf,this._tooltipHandler),r.addEventListener(Wf,this._tooltipHandler)),Of.prototype.initialize.call(this,t,e,n)},rh.canvas=function(){return this._svg};var ih=function(t,e){return function(n){var r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)}};rh.on=function(t,e){var n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){var i={type:t,handler:e,listener:ih(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},rh.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this};var oh=function(t,e,n){var r=t-e+2*n;return t?r>0?r:1:0},ah="log",Ah="time",sh="utc",ch="continuous",uh=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},lh=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return uh(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var gh=lh(uh),fh=gh.right,hh=(gh.left,fh);function dh(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ih(t,e){switch(arguments.length){case 0:break;case 1:"function"===typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"===typeof e?this.interpolator(e):this.range(e)}return this}var ph=Symbol("implicit");function Ch(){var t=new Map,e=[],n=[],r=ph;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==ph)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;var r,o=Object(U.a)(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,A=a+"";t.has(A)||t.set(A,e.push(a))}}catch(s){o.e(s)}finally{o.f()}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Ch(e,n).unknown(r)},dh.apply(i,arguments),i}function yh(){var t,e,n=Ch().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,A=0,s=0,c=.5;function u(){var n=r().length,u=o[1]<o[0],l=o[u-0],g=o[1-u],f=oh(n,A,s);t=(g-l)/(f||1),a&&(t=Math.floor(t)),l+=(g-l-t*(n-A))*c,e=t*(1-A),a&&(l=Math.round(l),e=Math.round(e));var h=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}(n).map((function(e){return l+t*e}));return i(u?h.reverse():h)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),u()):r()},n.range=function(t){return arguments.length?(o=[+t[0],+t[1]],u()):o.slice()},n.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,u()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,u()):a},n.padding=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),A=s,u()):A},n.paddingInner=function(t){return arguments.length?(A=Math.max(0,Math.min(1,t)),u()):A},n.paddingOuter=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u()):s},n.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),u()):c},n.invertRange=function(t){if(null!=t[0]&&null!=t[1]){var n,a,A,s=+t[0],c=+t[1],u=o[1]<o[0],l=u?i().reverse():i(),g=l.length-1;if(s===s&&c===c&&(c<s&&(A=s,s=c,c=A),!(c<l[0]||s>o[1-u])))return n=Math.max(0,fh(l,s)-1),a=s===c?n:fh(l,c)-1,s-l[n]>e+1e-10&&++n,u&&(A=n,n=g-a,a=g-A),n>a?void 0:r().slice(n,a+1)}},n.invert=function(t){var e=n.invertRange([t,t]);return e?e[0]:e},n.copy=function(){return yh().domain(r()).range(o).round(a).paddingInner(A).paddingOuter(s).align(c)},u()}var vh=Math.sqrt(50),Bh=Math.sqrt(10),mh=Math.sqrt(2),bh=function(t,e,n){var r,i,o,a,A=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=Eh(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++A<i;)o[A]=(t+A)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++A<i;)o[A]=(t-A)/a;return r&&o.reverse(),o};function Eh(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=vh?10:o>=Bh?5:o>=mh?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=vh?10:o>=Bh?5:o>=mh?2:1)}function Qh(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=vh?i*=10:o>=Bh?i*=5:o>=mh&&(i*=2),e<t?-i:i}var Fh=function(t,e,n,r){var i,o=Qh(t,e,n);switch((r=Te(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Xe(o,a))||(r.precision=i),Pe(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=ze(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ke(o))||(r.precision=i-2*("%"===r.type))}return Ze(r)},wh=Array.prototype.map;function Sh(t){return wh.call(t,(function(t){return+t}))}var Rh=Array.prototype.slice;var Uh=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function xh(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function kh(){}var Oh="\\s*([+-]?\\d+)\\s*",Nh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gh=/^#([0-9a-f]{3,8})$/,_h=new RegExp("^rgb\\("+[Oh,Oh,Oh]+"\\)$"),Mh=new RegExp("^rgb\\("+[Dh,Dh,Dh]+"\\)$"),Th=new RegExp("^rgba\\("+[Oh,Oh,Oh,Nh]+"\\)$"),jh=new RegExp("^rgba\\("+[Dh,Dh,Dh,Nh]+"\\)$"),Lh=new RegExp("^hsl\\("+[Nh,Dh,Dh]+"\\)$"),Vh=new RegExp("^hsla\\("+[Nh,Dh,Dh,Nh]+"\\)$"),Zh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ph(){return this.rgb().formatHex()}function Wh(){return this.rgb().formatRgb()}function Jh(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gh.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Hh(e):3===n?new Kh(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new Kh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new Kh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_h.exec(t))?new Kh(e[1],e[2],e[3],1):(e=Mh.exec(t))?new Kh(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Th.exec(t))?Yh(e[1],e[2],e[3],e[4]):(e=jh.exec(t))?Yh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Lh.exec(t))?ed(e[1],e[2]/100,e[3]/100,1):(e=Vh.exec(t))?ed(e[1],e[2]/100,e[3]/100,e[4]):Zh.hasOwnProperty(t)?Hh(Zh[t]):"transparent"===t?new Kh(NaN,NaN,NaN,0):null}function Hh(t){return new Kh(t>>16&255,t>>8&255,255&t,1)}function Yh(t,e,n,r){return r<=0&&(t=e=n=NaN),new Kh(t,e,n,r)}function Xh(t){return t instanceof kh||(t=Jh(t)),t?new Kh((t=t.rgb()).r,t.g,t.b,t.opacity):new Kh}function zh(t,e,n,r){return 1===arguments.length?Xh(t):new Kh(t,e,n,null==r?1:r)}function Kh(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function qh(){return"#"+td(this.r)+td(this.g)+td(this.b)}function $h(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function td(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ed(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new id(t,e,n,r)}function nd(t){if(t instanceof id)return new id(t.h,t.s,t.l,t.opacity);if(t instanceof kh||(t=Jh(t)),!t)return new id;if(t instanceof id)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,A=o-i,s=(o+i)/2;return A?(a=e===o?(n-r)/A+6*(n<r):n===o?(r-e)/A+2:(e-n)/A+4,A/=s<.5?o+i:2-o-i,a*=60):A=s>0&&s<1?0:a,new id(a,A,s,t.opacity)}function rd(t,e,n,r){return 1===arguments.length?nd(t):new id(t,e,n,null==r?1:r)}function id(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function od(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ad(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Uh(kh,Jh,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ph,formatHex:Ph,formatHsl:function(){return nd(this).formatHsl()},formatRgb:Wh,toString:Wh}),Uh(Kh,zh,xh(kh,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kh(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kh(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qh,formatHex:qh,formatRgb:$h,toString:$h})),Uh(id,rd,xh(kh,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new id(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new id(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Kh(od(t>=240?t-240:t+120,i,r),od(t,i,r),od(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Ad=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,A=r<e-1?t[r+2]:2*o-i;return ad((n-r/e)*e,a,i,o,A)}},sd=function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],A=t[(r+2)%e];return ad((n-r/e)*e,i,o,a,A)}},cd=function(t){return function(){return t}};function ud(t,e){return function(n){return t+n*e}}function ld(t,e){var n=e-t;return n?ud(t,n>180||n<-180?n-360*Math.round(n/360):n):cd(isNaN(t)?e:t)}function gd(t){return 1===(t=+t)?fd:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):cd(isNaN(e)?n:e)}}function fd(t,e){var n=e-t;return n?ud(t,n):cd(isNaN(t)?e:t)}var hd=function t(e){var n=gd(e);function r(t,e){var r=n((t=zh(t)).r,(e=zh(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=fd(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function dd(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),A=new Array(i);for(n=0;n<i;++n)r=zh(e[n]),o[n]=r.r||0,a[n]=r.g||0,A[n]=r.b||0;return o=t(o),a=t(a),A=t(A),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=A(t),r+""}}}var Id=dd(Ad),pd=dd(sd),Cd=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function yd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var vd=function(t,e){return(yd(e)?Cd:Bd)(t,e)};function Bd(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Sd(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var md=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},bd=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Ed=function(t,e){var n,r={},i={};for(n in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)n in t?r[n]=Sd(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Qd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fd=new RegExp(Qd.source,"g");var wd=function(t,e){var n,r,i,o=Qd.lastIndex=Fd.lastIndex=0,a=-1,A=[],s=[];for(t+="",e+="";(n=Qd.exec(t))&&(r=Fd.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),A[a]?A[a]+=i:A[++a]=i),(n=n[0])===(r=r[0])?A[a]?A[a]+=r:A[++a]=r:(A[++a]=null,s.push({i:a,x:bd(n,r)})),o=Fd.lastIndex;return o<e.length&&(i=e.slice(o),A[a]?A[a]+=i:A[++a]=i),A.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)A[(n=s[r]).i]=n.x(t);return A.join("")})},Sd=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?cd(e):("number"===r?bd:"string"===r?(n=Jh(e))?(e=n,hd):wd:e instanceof Jh?hd:e instanceof Date?md:yd(e)?Cd:Array.isArray(e)?Bd:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?Ed:bd)(t,e)},Rd=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},Ud=function(t){return+t},xd=[0,1];function kd(t){return t}function Od(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Nd(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Od(i,r),o=n(a,o)):(r=Od(r,i),o=n(o,a)),function(t){return o(r(t))}}function Dd(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Od(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=hh(t,e,1,r)-1;return o[n](i[n](e))}}function Gd(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function _d(){var t,e,n,r,i,o,a=xd,A=xd,s=Sd,c=kd;function u(){var t=Math.min(a.length,A.length);return c!==kd&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?Dd:Nd,i=o=null,l}function l(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),A,s)))(t(c(e)))}return l.invert=function(n){return c(e((o||(o=r(A,a.map(t),bd)))(n)))},l.domain=function(t){return arguments.length?(a=Array.from(t,Ud),u()):a.slice()},l.range=function(t){return arguments.length?(A=Array.from(t),u()):A.slice()},l.rangeRound=function(t){return A=Array.from(t),s=Rd,u()},l.clamp=function(t){return arguments.length?(c=!!t||kd,u()):c!==kd},l.interpolate=function(t){return arguments.length?(s=t,u()):s},l.unknown=function(t){return arguments.length?(n=t,l):n},function(n,r){return t=n,e=r,u()}}function Md(){return _d()(kd,kd)}function Td(t){var e=t.domain;return t.ticks=function(t){var n=e();return bh(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Fh(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),o=0,a=i.length-1,A=i[o],s=i[a];return s<A&&(r=A,A=s,s=r,r=o,o=a,a=r),(r=Eh(A,s,n))>0?r=Eh(A=Math.floor(A/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=Eh(A=Math.ceil(A*r)/r,s=Math.floor(s*r)/r,n)),r>0?(i[o]=Math.floor(A/r)*r,i[a]=Math.ceil(s/r)*r,e(i)):r<0&&(i[o]=Math.ceil(A*r)/r,i[a]=Math.floor(s*r)/r,e(i)),t},t}var jd=function(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t};function Ld(t){return Math.log(t)}function Vd(t){return Math.exp(t)}function Zd(t){return-Math.log(-t)}function Pd(t){return-Math.exp(-t)}function Wd(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Jd(t){return function(e){return-t(-e)}}function Hd(t){var e,n,r=t(Ld,Vd),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Wd:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=Jd(e),n=Jd(n),t(Zd,Pd)):t(Ld,Vd),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),A=a[0],s=a[a.length-1];(r=s<A)&&(g=A,A=s,s=g);var c,u,l,g=e(A),f=e(s),h=null==t?10:+t,d=[];if(!(o%1)&&f-g<h){if(g=Math.floor(g),f=Math.ceil(f),A>0){for(;g<=f;++g)for(u=1,c=n(g);u<o;++u)if(!((l=c*u)<A)){if(l>s)break;d.push(l)}}else for(;g<=f;++g)for(u=o-1,c=n(g);u>=1;--u)if(!((l=c*u)<A)){if(l>s)break;d.push(l)}2*d.length<h&&(d=bh(A,s,h))}else d=bh(g,f,Math.min(f-g,h)).map(n);return r?d.reverse():d},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!==typeof i&&(i=Ze(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(jd(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function Yd(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Xd(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function zd(t){return t<0?-t*t:t*t}function Kd(t){var e=t(kd,kd),n=1;function r(){return 1===n?t(kd,kd):.5===n?t(Xd,zd):t(Yd(n),Yd(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},Td(e)}function qd(){var t=Kd(_d());return t.copy=function(){return Gd(t,qd()).exponent(t.exponent())},dh.apply(t,arguments),t}function $d(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tI(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function eI(t){var e=1,n=t($d(e),tI(e));return n.constant=function(n){return arguments.length?t($d(e=+n),tI(e)):e},Td(n)}function nI(t){return new Date(t)}function rI(t){return t instanceof Date?+t:+new Date(+t)}function iI(t,e,n,r,i,o,a,A,s){var c=Md(),u=c.invert,l=c.domain,g=s(".%L"),f=s(":%S"),h=s("%I:%M"),d=s("%I %p"),I=s("%a %d"),p=s("%b %d"),C=s("%B"),y=s("%Y"),v=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function B(A){return(a(A)<A?g:o(A)<A?f:i(A)<A?h:r(A)<A?d:e(A)<A?n(A)<A?I:p:t(A)<A?C:y)(A)}function m(e,n,r){if(null==e&&(e=10),"number"===typeof e){var i,o=Math.abs(r-n)/e,a=lh((function(t){return t[2]})).right(v,o);return a===v.length?(i=Qh(n/31536e6,r/31536e6,e),e=t):a?(i=(a=v[o/v[a-1][2]<v[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max(Qh(n,r,e),1),e=A),e.every(i)}return e}return c.invert=function(t){return new Date(u(t))},c.domain=function(t){return arguments.length?l(Array.from(t,rI)):l().map(nI)},c.ticks=function(t){var e,n=l(),r=n[0],i=n[n.length-1],o=i<r;return o&&(e=r,r=i,i=e),e=(e=m(t,r,i))?e.range(r,i+1):[],o?e.reverse():e},c.tickFormat=function(t,e){return null==e?B:s(e)},c.nice=function(t){var e=l();return(t=m(t,e[0],e[e.length-1]))?l(jd(e,t)):c},c.copy=function(){return Gd(c,iI(t,e,n,r,i,o,a,A,s))},c}function oI(){var t,e,n,r,i,o=0,a=1,A=kd,s=!1;function c(e){return isNaN(e=+e)?i:A(0===n?.5:(e=(r(e)-t)*n,s?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,r,i,o;return arguments.length?(n=e,i=(r=Object(QA.a)(n,2))[0],o=r[1],A=t(i,o),c):[A(0),A(1)]}}return c.domain=function(i){var A,s;return arguments.length?(A=i,s=Object(QA.a)(A,2),o=s[0],a=s[1],t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),c):[o,a]},c.clamp=function(t){return arguments.length?(s=!!t,c):s},c.interpolator=function(t){return arguments.length?(A=t,c):A},c.range=u(Sd),c.rangeRound=u(Rd),c.unknown=function(t){return arguments.length?(i=t,c):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),c}}function aI(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function AI(){var t=Td(oI()(kd));return t.copy=function(){return aI(t,AI())},Ih.apply(t,arguments)}function sI(){var t=Kd(oI());return t.copy=function(){return aI(t,sI()).exponent(t.exponent())},Ih.apply(t,arguments)}function cI(t,e){for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function uI(){var t,e,n,r,i,o,a,A=0,s=.5,c=1,u=1,l=kd,g=!1;function f(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(u*t<u*e?r:i),l(g?Math.max(0,Math.min(1,t)):t))}function h(t){return function(e){var n,r,i,o,a;return arguments.length?(n=e,i=(r=Object(QA.a)(n,3))[0],o=r[1],a=r[2],l=cI(t,[i,o,a]),f):[l(0),l(.5),l(1)]}}return f.domain=function(a){var l,g;return arguments.length?(l=a,g=Object(QA.a)(l,3),A=g[0],s=g[1],c=g[2],t=o(A=+A),e=o(s=+s),n=o(c=+c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),u=e<t?-1:1,f):[A,s,c]},f.clamp=function(t){return arguments.length?(g=!!t,f):g},f.interpolator=function(t){return arguments.length?(l=t,f):l},f.range=h(Sd),f.rangeRound=h(Rd),f.unknown=function(t){return arguments.length?(a=t,f):a},function(a){return o=a,t=a(A),e=a(s),n=a(c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),u=e<t?-1:1,f}}function lI(){var t=Kd(uI());return t.copy=function(){return aI(t,lI()).exponent(t.exponent())},Ih.apply(t,arguments)}function gI(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n<o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n<c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function fI(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n>o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n>c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function hI(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}var dI=Z.a.mark(II);function II(t,e){var n,r,i,o,a,A,s;return Z.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==e){c.next=21;break}n=Object(U.a)(t),c.prev=2,n.s();case 4:if((r=n.n()).done){c.next=11;break}if(!(null!=(i=r.value)&&(i=+i)>=i)){c.next=9;break}return c.next=9,i;case 9:c.next=4;break;case 11:c.next=16;break;case 13:c.prev=13,c.t0=c.catch(2),n.e(c.t0);case 16:return c.prev=16,n.f(),c.finish(16);case 19:c.next=40;break;case 21:o=-1,a=Object(U.a)(t),c.prev=23,a.s();case 25:if((A=a.n()).done){c.next=32;break}if(s=A.value,!(null!=(s=e(s,++o,t))&&(s=+s)>=s)){c.next=30;break}return c.next=30,s;case 30:c.next=25;break;case 32:c.next=37;break;case 34:c.prev=34,c.t1=c.catch(23),a.e(c.t1);case 37:return c.prev=37,a.f(),c.finish(37);case 40:case"end":return c.stop()}}),dI,null,[[2,13,16,19],[23,34,37,40]])}function pI(t,e,n){if(r=(t=Float64Array.from(II(t,n))).length){if((e=+e)<=0||r<2)return fI(t);if(e>=1)return gI(t);var r,i=(r-1)*e,o=Math.floor(i),a=gI(function t(e,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:uh;i>r;){if(i-r>600){var a=i-r+1,A=n-r+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(A-a/2<0?-1:1),l=Math.max(r,Math.floor(n-A*c/a+u)),g=Math.min(i,Math.floor(n+(a-A)*c/a+u));t(e,n,l,g,o)}var f=e[n],h=r,d=i;for(hI(e,r,n),o(e[i],f)>0&&hI(e,r,i);h<d;){for(hI(e,h,d),++h,--d;o(e[h],f)<0;)++h;for(;o(e[d],f)>0;)--d}0===o(e[r],f)?hI(e,r,d):hI(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}return e}(t,o).subarray(0,o+1));return a+(fI(t.subarray(o+1))-a)*(i-o)}}var CI={};function yI(t,e,n){var r=function(){var n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){var n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){var n,r,i,o,a=t.range(),A=e[0],s=e[1],c=-1;for(s<A&&(r=A,A=s,s=r),i=0,o=a.length;i<o;++i)a[i]>=A&&a[i]<=s&&(c<0&&(c=i),n=i);if(!(c<0))return A=t.invertExtent(a[c]),s=t.invertExtent(a[n]),[void 0===A[0]?A[1]:A[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=t,n};return r.metadata=Object(x.db)(Object(x.i)(n)),r}function vI(t,e,n){return arguments.length>1?(CI[t]=yI(t,e,n),this):BI(t)?CI[t]:void 0}function BI(t){return Object(x.v)(CI,t)}function mI(t,e){var n=CI[t];return n&&n.metadata[e]}function bI(t){return mI(t,ch)}function EI(t){return mI(t,"discrete")}function QI(t){return mI(t,"discretizing")}function FI(t){return mI(t,ah)}function wI(t){return mI(t,"interpolating")}function SI(t){return mI(t,"quantile")}vI("identity",(function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Ud),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Ud):[0,1],Td(r)})),vI("linear",(function t(){var e=Md();return e.copy=function(){return Gd(e,t())},dh.apply(e,arguments),Td(e)}),ch),vI(ah,(function t(){var e=Hd(_d()).domain([1,10]);return e.copy=function(){return Gd(e,t()).base(e.base())},dh.apply(e,arguments),e}),[ch,ah]),vI("pow",qd,ch),vI("sqrt",(function(){return qd.apply(null,arguments).exponent(.5)}),ch),vI("symlog",(function t(){var e=eI(_d());return e.copy=function(){return Gd(e,t()).constant(e.constant())},dh.apply(e,arguments)}),ch),vI(Ah,(function(){return dh.apply(iI(Br,br,xn,Rn,Qr,wr,Rr,xr,pi).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[ch,"temporal"]),vI(sh,(function(){return dh.apply(iI(Dr,_r,Wn,Tn,Tr,Lr,Rr,xr,yi).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[ch,"temporal"]),vI("sequential",AI,[ch,"interpolating"]),vI("".concat("sequential","-").concat("linear"),AI,[ch,"interpolating"]),vI("".concat("sequential","-").concat(ah),(function t(){var e=Hd(oI()).domain([1,10]);return e.copy=function(){return aI(e,t()).base(e.base())},Ih.apply(e,arguments)}),[ch,"interpolating",ah]),vI("".concat("sequential","-").concat("pow"),sI,[ch,"interpolating"]),vI("".concat("sequential","-").concat("sqrt"),(function(){return sI.apply(null,arguments).exponent(.5)}),[ch,"interpolating"]),vI("".concat("sequential","-").concat("symlog"),(function t(){var e=eI(oI());return e.copy=function(){return aI(e,t()).constant(e.constant())},Ih.apply(e,arguments)}),[ch,"interpolating"]),vI("".concat("diverging","-").concat("linear"),(function t(){var e=Td(uI()(kd));return e.copy=function(){return aI(e,t())},Ih.apply(e,arguments)}),[ch,"interpolating"]),vI("".concat("diverging","-").concat(ah),(function t(){var e=Hd(uI()).domain([.1,1,10]);return e.copy=function(){return aI(e,t()).base(e.base())},Ih.apply(e,arguments)}),[ch,"interpolating",ah]),vI("".concat("diverging","-").concat("pow"),lI,[ch,"interpolating"]),vI("".concat("diverging","-").concat("sqrt"),(function(){return lI.apply(null,arguments).exponent(.5)}),[ch,"interpolating"]),vI("".concat("diverging","-").concat("symlog"),(function t(){var e=eI(uI());return e.copy=function(){return aI(e,t()).constant(e.constant())},Ih.apply(e,arguments)}),[ch,"interpolating"]),vI("quantile",(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=pI(n,t/e);return a}function a(t){return isNaN(t=+t)?e:r[hh(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];var e,r=Object(U.a)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;null==i||isNaN(i=+i)||n.push(i)}}catch(a){r.e(a)}finally{r.f()}return n.sort(uh),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},dh.apply(a,arguments)}),["discretizing","quantile"]),vI("quantize",(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function A(t){return t<=t?a[hh(o,t,0,i)]:e}function s(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return A}return A.domain=function(t){var e,i;return arguments.length?(e=t,i=Object(QA.a)(e,2),n=i[0],r=i[1],n=+n,r=+r,s()):[n,r]},A.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,s()):a.slice()},A.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},A.unknown=function(t){return arguments.length?(e=t,A):A},A.thresholds=function(){return o.slice()},A.copy=function(){return t().domain([n,r]).range(a).unknown(e)},dh.apply(Td(A),arguments)}),"discretizing"),vI("threshold",(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[hh(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},dh.apply(o,arguments)}),"discretizing"),vI("bin-ordinal",(function t(){var e=[],n=[];function r(t){return null==t||t!==t?void 0:n[(hh(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=Sh(t),r):e.slice()},r.range=function(t){return arguments.length?(n=Rh.call(t),r):n.slice()},r.tickFormat=function(t,n){return Fh(e[0],Object(x.U)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),vI("ordinal",Ch,"discrete"),vI("band",yh,"discrete"),vI("point",(function(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(yh().paddingInner(1))}),"discrete");var RI,UI,xI,kI,OI=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},NI=function(t,e){var n=ld(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},DI=180/Math.PI,GI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},_I=function(t,e,n,r,i,o){var a,A,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(A=Math.sqrt(n*n+r*r))&&(n/=A,r/=A,s/=A),t*r<e*n&&(t=-t,e=-e,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*DI,skewX:Math.atan(s)*DI,scaleX:a,scaleY:A}};function MI(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var A=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,A){if(t!==i||r!==o){var s=a.push("translate(",null,e,null,n);A.push({i:s-4,x:bd(t,i)},{i:s-2,x:bd(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,A,s),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:bd(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,A,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:bd(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,A,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var A=o.push(i(o)+"scale(",null,",",null,")");a.push({i:A-4,x:bd(t,n)},{i:A-2,x:bd(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,A,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n<r;)A[(e=s[n]).i]=e.x(t);return A.join("")}}}var TI=MI((function(t){return"none"===t?GI:(RI||(RI=document.createElement("DIV"),UI=document.documentElement,xI=document.defaultView),RI.style.transform=t,t=xI.getComputedStyle(UI.appendChild(RI),null).getPropertyValue("transform"),UI.removeChild(RI),t=t.slice(7,-1).split(","),_I(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),jI=MI((function(t){return null==t?GI:(kI||(kI=document.createElementNS("http://www.w3.org/2000/svg","g")),kI.setAttribute("transform",t),(t=kI.transform.baseVal.consolidate())?(t=t.matrix,_I(t.a,t.b,t.c,t.d,t.e,t.f)):GI)}),", ",")",")"),LI=Math.SQRT2;function VI(t){return((t=Math.exp(t))+1/t)/2}var ZI=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],A=e[0],s=e[1],c=e[2],u=A-i,l=s-o,g=u*u+l*l;if(g<1e-12)r=Math.log(c/a)/LI,n=function(t){return[i+t*u,o+t*l,a*Math.exp(LI*t*r)]};else{var f=Math.sqrt(g),h=(c*c-a*a+4*g)/(2*a*2*f),d=(c*c-a*a-4*g)/(2*c*2*f),I=Math.log(Math.sqrt(h*h+1)-h),p=Math.log(Math.sqrt(d*d+1)-d);r=(p-I)/LI,n=function(t){var e,n=t*r,A=VI(I),s=a/(2*f)*(A*(e=LI*n+I,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(I));return[i+s*u,o+s*l,a*A/VI(LI*n+I)]}}return n.duration=1e3*r,n};function PI(t){return function(e,n){var r=t((e=rd(e)).h,(n=rd(n)).h),i=fd(e.s,n.s),o=fd(e.l,n.l),a=fd(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var WI=PI(ld),JI=PI(fd),HI=Math.PI/180,YI=180/Math.PI;function XI(t){if(t instanceof KI)return new KI(t.l,t.a,t.b,t.opacity);if(t instanceof ip)return op(t);t instanceof Kh||(t=Xh(t));var e,n,r=ep(t.r),i=ep(t.g),o=ep(t.b),a=qI((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=qI((.4360747*r+.3850649*i+.1430804*o)/.96422),n=qI((.0139322*r+.0971045*i+.7141733*o)/.82521)),new KI(116*a-16,500*(e-a),200*(a-n),t.opacity)}function zI(t,e,n,r){return 1===arguments.length?XI(t):new KI(t,e,n,null==r?1:r)}function KI(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function qI(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function $I(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function tp(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ep(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function np(t){if(t instanceof ip)return new ip(t.h,t.c,t.l,t.opacity);if(t instanceof KI||(t=XI(t)),0===t.a&&0===t.b)return new ip(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*YI;return new ip(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function rp(t,e,n,r){return 1===arguments.length?np(t):new ip(t,e,n,null==r?1:r)}function ip(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function op(t){if(isNaN(t.h))return new KI(t.l,0,0,t.opacity);var e=t.h*HI;return new KI(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function ap(t,e){var n=fd((t=zI(t)).l,(e=zI(e)).l),r=fd(t.a,e.a),i=fd(t.b,e.b),o=fd(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function Ap(t){return function(e,n){var r=t((e=rp(e)).h,(n=rp(n)).h),i=fd(e.c,n.c),o=fd(e.l,n.l),a=fd(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}Uh(KI,zI,xh(kh,{brighter:function(t){return new KI(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new KI(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Kh(tp(3.1338561*(e=.96422*$I(e))-1.6168667*(t=1*$I(t))-.4906146*(n=.82521*$I(n))),tp(-.9787684*e+1.9161415*t+.033454*n),tp(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Uh(ip,rp,xh(kh,{brighter:function(t){return new ip(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ip(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return op(this).rgb()}}));var sp=Ap(ld),cp=Ap(fd),up=1.97294,lp=-.90649*up,gp=1.78277*up,fp=-.6557636667999999;function hp(t){if(t instanceof Ip)return new Ip(t.h,t.s,t.l,t.opacity);t instanceof Kh||(t=Xh(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(fp*r+lp*e-gp*n)/(fp+lp-gp),o=r-i,a=(up*(n-i)- -.29227*o)/-.90649,A=Math.sqrt(a*a+o*o)/(up*i*(1-i)),s=A?Math.atan2(a,o)*YI-120:NaN;return new Ip(s<0?s+360:s,A,i,t.opacity)}function dp(t,e,n,r){return 1===arguments.length?hp(t):new Ip(t,e,n,null==r?1:r)}function Ip(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function pp(t){return function e(n){function r(e,r){var i=t((e=dp(e)).h,(r=dp(r)).h),o=fd(e.s,r.s),a=fd(e.l,r.l),A=fd(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=A(t),e+""}}return n=+n,r.gamma=e,r}(1)}Uh(Ip,dp,xh(kh,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ip(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ip(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*HI,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Kh(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(-.29227*r+-.90649*i)),255*(e+n*(up*r)),this.opacity)}}));var Cp=pp(ld),yp=pp(fd),vp=function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n},Bp=["clamp","base","constant","exponent"];function mp(t,e){var n=e[0],r=Object(x.U)(e)-n;return function(e){return t(n+e*r)}}function bp(t,e,n){return cI(Fp(e||"rgb",n),t)}function Ep(t,e){for(var n=new Array(e),r=e+1,i=0;i<e;)n[i]=t(++i/r);return n}function Qp(t,e,n){var r,i,o,a=n-e;return a&&Number.isFinite(a)?(r=(i=t.type).indexOf("-"),i=r<0?i:i.slice(r+1),o=vI(i)().domain([e,n]).range([0,1]),Bp.forEach((function(e){return t[e]?o[e](t[e]()):0})),o):Object(x.l)(.5)}function Fp(t,e){var n=a[function(t){return"interpolate"+t.toLowerCase().split("-").map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function wp(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function Sp(t,e){for(var n in t)Up(n,e(t[n]))}var Rp={};function Up(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Rp[t]=e,this):Rp[t]}Sp({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},wp),Sp({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(function(t){return bp(wp(t))}));var xp,kp,Op=function(t){return Object(x.A)(t)?t.map((function(t){return String(t)})):String(t)},Np=function(t,e){return t[1]-e[1]},Dp=function(t,e){return e[1]-t[1]};function Gp(t,e,n){var r;return Object(x.E)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(Object(x.X)(t.domain())/n||1)))),Object(x.F)(e)&&(r=e.step,e=e.interval),Object(x.H)(e)&&(e=t.type===Ah?Pr(e):t.type==sh?Wr(e):Object(x.n)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function _p(t,e,n){var r=t.range(),i=r[0],o=Object(x.U)(r),a=Np;if(i>o&&(r=o,o=i,i=r,a=Dp),i=Math.floor(i),o=Math.ceil(o),e=e.map((function(e){return[e,t(e)]})).filter((function(t){return i<=t[1]&&t[1]<=o})).sort(a).map((function(t){return t[0]})),n>0&&e.length>1){for(var A=[e[0],Object(x.U)(e)];e.length>n&&e.length>=3;)e=e.filter((function(t,e){return!(e%2)}));e.length<3&&(e=A)}return e}function Mp(t,e){return t.bins?_p(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Tp(t,e,n,r,i,o){var a=e.type,A=Op;if(a===Ah||i===Ah)A=t.timeFormat(r);else if(a===sh||i===sh)A=t.utcFormat(r);else if(FI(a)){var s=t.formatFloat(r);if(o||e.bins)A=s;else{var c=jp(e,n,!1);A=function(t){return c(t)?s(t):""}}}else if(e.tickFormat){var u=e.domain();A=t.formatSpan(u[0],u[u.length-1],n,r)}else r&&(A=t.format(r));return A}function jp(t,e,n){var r=Mp(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),A=function(t){var e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(A):A}var Lp=(xp={},Object(v.a)(xp,"quantile","quantiles"),Object(v.a)(xp,"quantize","thresholds"),Object(v.a)(xp,"threshold","domain"),xp),Vp=(kp={},Object(v.a)(kp,"quantile","quantiles"),Object(v.a)(kp,"quantize","domain"),kp);function Zp(t,e){return t.bins?function(t){var e=t.slice(0,-1);return e.max=Object(x.U)(t),e}(t.bins):t.type===ah?jp(t,e,!0):Lp[t.type]?function(t){var e=[-1/0].concat(t);return e.max=1/0,e}(t[Lp[t.type]]()):Mp(t,e)}function Pp(t,e,n,r,i,o,a){var A=Vp[e.type]&&o!==Ah&&o!==sh?function(t,e,n){var r,i=e[Vp[e.type]](),o=i.length,a=o>1?i[1]-i[0]:i[0];for(r=1;r<o;++r)a=Math.min(a,i[r]-i[r-1]);return t.formatSpan(0,a,30,n)}(t,e,i):Tp(t,e,n,i,o,a);return"symbol"===r&&function(t){return Lp[t.type]||t.bins}(e)?function(t){return function(e,n,r){var i=Wp(r[n+1],Wp(r.max,1/0)),o=Jp(e,t),a=Jp(i,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o}}(A):"discrete"===r?function(t){return function(e,n){return n?t(e):null}}(A):function(t){return function(e){return t(e)}}(A)}function Wp(t,e){return null!=t?t:e}function Jp(t,e){return Number.isFinite(t)?e(t):null}function Hp(t,e,n,r){var i=r||e.type;return Object(x.H)(n)&&mI(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Ah?n||i!==sh?Pp(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Yp(t,e,n){n=n||{};var r=Math.max(3,n.maxlen||7),i=Hp(t,e,n.format,n.formatType);if(QI(e.type)){var o=Zp(e).slice(1).map(i),a=o.length;return"".concat(a," boundar").concat(1===a?"y":"ies",": ").concat(o.join(", "))}if(EI(e.type)){var A=e.domain(),s=A.length,c=s>r?A.slice(0,r-2).map(i).join(", ")+", ending with "+A.slice(-1).map(i):A.map(i).join(", ");return"".concat(s," value").concat(1===s?"":"s",": ").concat(c)}var u=e.domain();return"values from ".concat(i(u[0])," to ").concat(i(Object(x.U)(u)))}var Xp=function(t,e,n){var r;return r={},Object(v.a)(r,"role",t),Object(v.a)(r,"aria-roledescription",e),Object(v.a)(r,"aria-label",n||void 0),r},zp=Object(x.db)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Kp={axis:{desc:"axis",caption:function(t){var e=t.datum,n=t.orient,r=e.title?nC(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),A=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(EI(A)?"discrete":A," scale")+" with ".concat(Yp(a,o,t))}},legend:{desc:"legend",caption:function(t){var e=t.datum,n=e.title?nC(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,A=a.scales[i[o[0]]].value,s=a.dataflow.locale();return c=r,(c.length?c[0].toUpperCase()+c.slice(1):c)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return(t=t.map((function(t){return t+("fill"===t||"stroke"===t?" color":"")}))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+Object(x.U)(t)}(o))+" with ".concat(Yp(s,A,t));var c}},"title-text":{desc:"title",caption:function(t){return"Title text '".concat(eC(t),"'")}},"title-subtitle":{desc:"subtitle",caption:function(t){return"Subtitle text '".concat(eC(t),"'")}}},qp={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function $p(t,e){var n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(var r in qp)t(qp[r],void 0);else{var i=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===i?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||"".concat(i," mark"))}}function tC(t){return!1===t.aria?Object(v.a)({},"aria-hidden",!0):zp[t.role]?null:Kp[t.role]?function(t,e){try{var n=t.items[0],r=e.caption||function(){return""};return Xp(e.role||"graphics-symbol",e.desc,n.description||r(n))}catch(i){return null}}(t,Kp[t.role]):function(t){var e=t.marktype,n="group"===e||"text"===e||t.items.some((function(t){return null!=t.description&&!1!==t.aria}));return Xp(n?"graphics-object":"graphics-symbol","".concat(e," mark container"),t.description)}(t)}function eC(t){return Object(x.i)(t.text).join(" ")}function nC(t){try{return Object(x.i)(Object(x.U)(t.items).items[0].text).join(" ")}catch(e){return null}}var rC=function(t){return(t+"").replace(/&/g,"&amp;").replace(/"/g,"&quot;")};function iC(t,e,n){var r,i,o="<"+t;if(e)for(r in e)null!=(i=e[r])&&(o+=" "+r+'="'+rC(i)+'"');return n&&(o+=" "+n),o+">"}function oC(t){return"</"+t+">"}var aC={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},AC={fill:"none","stroke-miterlimit":10},sC=Dg.xmlns;function cC(t){Gf.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var uC=Object(x.y)(cC,Gf),lC=Gf.prototype;function gC(t,e,n){var r,i,o;if("radial"===e.gradient){var a=Rf(t,n++,"pattern",sC);a.setAttribute("id","p_"+e.id),a.setAttribute("viewBox","0,0,1,1"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("preserveAspectRatio","xMidYMid slice"),(a=Rf(a,0,"rect",sC)).setAttribute("width","1"),a.setAttribute("height","1"),a.setAttribute("fill","url("+mC()+"#"+e.id+")"),(t=Rf(t,n++,"radialGradient",sC)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=Rf(t,n++,"linearGradient",sC)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(r=0,i=e.stops.length;r<i;++r)(o=Rf(t,r,"stop",sC)).setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return Uf(t,r),n}function fC(t,e,n){var r;return(t=Rf(t,n,"clipPath",sC)).setAttribute("id",e.id),e.path?(r=Rf(t,0,"path",sC)).setAttribute("d",e.path):((r=Rf(t,0,"rect",sC)).setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",e.width),r.setAttribute("height",e.height)),Uf(t,1),n+1}function hC(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function dC(t,e,n,r,i){var o,a=t._svg;if(!a&&(a=wf(o=e.ownerDocument,r,sC),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){var A=wf(o,"path",sC);a.appendChild(A),A.__data__=t;var s=wf(o,"g",sC);a.appendChild(s),s.__data__=t;var c=wf(o,"path",sC);a.appendChild(c),c.__data__=t,c.__values__={fill:"default"}}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}uC.initialize=function(t,e,n,r){if(this._defs={gradient:{},clipping:{}},t){for(var i in this._svg=Rf(t,0,"svg",sC),this._svg.setAttribute("class","marks"),Uf(t,1),this._root=Rf(this._svg,0,"g",sC),AC)this._root.setAttribute(i,AC[i]);Uf(this._svg,1)}return this.background(this._bgcolor),lC.initialize.call(this,t,e,n,r)},uC.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),lC.background.apply(this,arguments)},uC.resize=function(t,e,n,r){return lC.resize.call(this,t,e,n,r),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},uC.canvas=function(){return this._svg},uC.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in Dg)t[e]=Dg[e];var n=this._bgcolor?iC("rect",{width:this._width,height:this._height,fill:this._bgcolor})+oC("rect"):"";return iC("svg",t)+(this._defs.el?this._defs.el.outerHTML:"")+n+this._root.outerHTML+oC("svg")},uC._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Uf(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},uC.updateDefs=function(){var t=this._svg,e=this._defs,n=e.el,r=0;for(var i in e.gradient)n||(e.el=n=Rf(t,0,"defs",sC)),r=gC(n,e.gradient[i],r);for(var o in e.clipping)n||(e.el=n=Rf(t,0,"defs",sC)),r=fC(n,e.clipping[o],r);n&&(0===r?(t.removeChild(n),e.el=null):Uf(n,r))},uC._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},uC.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},uC.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},uC._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,r,i,o,a,A,s=++this._dirtyID;for(o=0,a=t.length;o<a;++o)(n=(e=t[o]).mark).marktype!==r&&(r=n.marktype,i=pf[r]),n.zdirty&&n.dirty!==s&&(this._dirtyAll=!1,hC(e,s),n.items.forEach((function(t){t.dirty=s}))),n.zdirty||(e.exit?(i.nested&&n.items.length?(A=n.items[0])._svg&&this._update(i,A._svg,A):e._svg&&(A=e._svg.parentNode)&&A.removeChild(e._svg),e._svg=null):(e=i.nested?n.items[0]:e)._update!==s&&(e._svg&&e._svg.ownerSVGElement?this._update(i,e._svg,e):(this._dirtyAll=!1,hC(e,s)),e._update=s));return!this._dirtyAll},uC.draw=function(t,e,n){var r=this;if(!this.isDirty(e))return e._svg;var i,o=this._svg,a=pf[e.marktype],A=!1===e.interactive?"none":null,s="g"===a.tag,c=null,u=0;(i=dC(e,t,n,"g",o)).setAttribute("class",xf(e));var l=tC(e);for(var g in l)BC(i,g,l[g]);s||BC(i,"pointer-events",A),BC(i,"clip-path",e.clip?Fl(this,e,e.group):null);var f=function(t){var e=r.isDirty(t),n=dC(t,i,c,a.tag,o);e&&(r._update(a,n,t),s&&function(t,e,n){e=e.lastChild.previousSibling;var r,i=0;fg(n,(function(n){r=t.draw(e,n,r),++i})),Uf(e,1+i)}(r,n,t)),c=n,++u};return a.nested?e.items.length&&f(e.items[0]):fg(e,f),Uf(i,u),i};var IC=null,pC=null,CC={group:function(t,e,n){var r=IC=e.childNodes[2];pC=r.__values__,t.foreground(vC,n,this),pC=e.__values__,IC=e.childNodes[1],t.content(vC,n,this);var i=IC=e.childNodes[0];t.background(vC,n,this);var o=!1===n.mark.interactive?"none":null;if(o!==pC.events&&(BC(r,"pointer-events",o),BC(i,"pointer-events",o),pC.events=o),n.strokeForeground&&n.stroke){var a=n.fill;BC(r,"display",null),this.style(i,n),BC(i,"stroke",null),a&&(n.fill=null),pC=r.__values__,this.style(r,n),a&&(n.fill=a),IC=null}else BC(r,"display","none")},image:function(t,e,n){!1===n.smooth?(yC(e,"image-rendering","optimizeSpeed"),yC(e,"image-rendering","pixelated")):yC(e,"image-rendering",null)},text:function(t,e,n){var r,i,o,a,A=Af(n);Object(x.A)(A)?(r=(i=A.map((function(t){return cf(n,t)}))).join("\n"))!==pC.text&&(Uf(e,0),o=e.ownerDocument,a=af(n),i.forEach((function(t,r){var i=wf(o,"tspan",sC);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",a)),e.appendChild(i)})),pC.text=r):(i=cf(n,A))!==pC.text&&(e.textContent=i,pC.text=i),BC(e,"font-family",uf(n)),BC(e,"font-size",of(n)+"px"),BC(e,"font-style",n.fontStyle),BC(e,"font-variant",n.fontVariant),BC(e,"font-weight",n.fontWeight)}};function yC(t,e,n){n!==pC[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),pC[e]=n)}function vC(t,e,n){e!==pC[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(IC,t,e,n):BC(IC,t,e),pC[t]=e)}function BC(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function mC(){var t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function bC(t){Gf.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}uC._update=function(t,e,n){IC=e,pC=e.__values__,$p(vC,n),t.attr(vC,n,this);var r=CC[t.type];r&&r.call(this,t,e,n),IC&&this.style(IC,n)},uC.style=function(t,e){if(null!=e)for(var n in aC){var r="font"===n?uf(e):e[n];if(r!==pC[n]){var i=aC[n];null==r?t.removeAttribute(i):(yc(r)&&(r=vc(r,this._defs.gradient,mC())),t.setAttribute(i,r+"")),pC[n]=r}}};var EC=Object(x.y)(bC,Gf),QC=Gf.prototype;function FC(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}EC.resize=function(t,e,n,r){QC.resize.call(this,t,e,n,r);var i=this._origin,o=this._text,a={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var A in Dg)a[A]=Dg[A];o.head=iC("svg",a);var s=this._bgcolor;return"transparent"!==s&&"none"!==s||(s=null),o.bg=s?iC("rect",{width:this._width,height:this._height,fill:s})+oC("rect"):"",o.root=iC("g",Object(x.o)({},AC,{transform:"translate("+i+")"})),o.foot=oC("g")+oC("svg"),this},EC.background=function(){var t=QC.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},EC.svg=function(){var t=this._text;return t.head+t.defs+t.bg+t.root+t.body+t.foot},EC._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},EC.buildDefs=function(){var t,e="";for(var n in this._defs.gradient){var r=this._defs.gradient[n],i=r.stops;"radial"===r.gradient?(e+=iC(t="pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e+=iC("rect",{width:"1",height:"1",fill:"url(#"+n+")"})+oC("rect"),e+=oC(t),e+=iC(t="radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e+=iC(t="linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(var o=0;o<i.length;++o)e+=iC("stop",{offset:i[o].offset,"stop-color":i[o].color})+oC("stop");e+=oC(t)}for(var a in this._defs.clipping){var A=this._defs.clipping[a];e+=iC("clipPath",{id:a}),A.path?e+=iC("path",{d:A.path})+oC("path"):e+=iC("rect",{x:0,y:0,width:A.width,height:A.height})+oC("rect"),e+=oC("clipPath")}return e?iC("defs")+e+oC("defs"):""},EC.attr=function(t,e,n,r){var i=this,o={},a=function(t,e,n,r){o[r||t]=e};return Array.isArray(n)?n.forEach((function(t){return t(a,e,i)})):n(a,e,this),r&&function(t,e,n,r,i){if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=uf(e),t["font-size"]=of(e)+"px",e.fontStyle&&(t["font-style"]=e.fontStyle),e.fontVariant&&(t["font-variant"]=e.fontVariant),e.fontWeight&&(t["font-weight"]=e.fontWeight));for(var o in aC){var a=e[o],A=aC[o];("transparent"!==a||"fill"!==A&&"stroke"!==A)&&null!=a&&(yc(a)&&(a=vc(a,i.gradient,"")),t[A]=a)}}(o,e,t,r,this._defs),o},EC.href=function(t){var e,n=this,r=t.href;if(r){if(e=n._hrefs&&n._hrefs[r])return e;n.sanitizeURL(r).then((function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[r]=t}))}return null},EC.mark=function(t){var e=this,n=pf[t.marktype],r=n.tag,i=[$p,n.attr],o="";o+=iC("g",Object(x.o)({class:xf(t),"clip-path":t.clip?Fl(this,t,t.group):null},tC(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null}));var a=function(a){var A=e.href(a);if(A&&(o+=iC("a",A)),o+=iC(r,e.attr(t,a,i,"g"!==r?r:null)),"text"===r){var s=Af(a);if(Object(x.A)(s))for(var c={x:0,dy:af(a)},u=0;u<s.length;++u)o+=iC("tspan",u?c:null)+FC(cf(a,s[u]))+oC("tspan");else o+=FC(cf(a,s))}else if("g"===r){var l=a.strokeForeground,g=a.fill,f=a.stroke;l&&f&&(a.stroke=null),o+=iC("path",e.attr(t,a,n.background,"bgrect"))+oC("path"),o+=iC("g",e.attr(t,a,n.content))+e.markGroup(a)+oC("g"),l&&f?(g&&(a.fill=null),a.stroke=f,o+=iC("path",e.attr(t,a,n.foreground,"bgrect"))+oC("path"),g&&(a.fill=g)):o+=iC("path",e.attr(t,a,n.foreground,"bgfore"))+oC("path")}o+=oC(r),A&&(o+=oC("a"))};return n.nested?t.items&&t.items.length&&a(t.items[0]):fg(t,a),o+oC("g")},EC.markGroup=function(t){var e=this,n="";return fg(t,(function(t){n+=e.mark(t)})),n};var wC={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},SC={};function RC(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(SC[t]=e,this):SC[t]}function UC(t,e,n){var r=[],i=(new wl).union(e),o=t.marktype;return o?xC(t,i,n,r):"group"===o?kC(t,i,n,r):Object(x.n)("Intersect scene must be mark node or group item.")}function xC(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){var i=t.items,o=t.marktype,a=i.length,A=0;if("group"===o)for(;A<a;++A)kC(i[A],e,n,r);else for(var s=pf[o].isect;A<a;++A){var c=i[A];OC(c,e,s)&&r.push(c)}}return r}function kC(t,e,n,r){n&&n(t.mark)&&OC(t,e,pf.group.isect)&&r.push(t);var i=t.items,o=i&&i.length;if(o){var a=t.x||0,A=t.y||0;e.translate(-a,-A);for(var s=0;s<o;++s)xC(i[s],e,n,r);e.translate(a,A)}return r}function OC(t,e,n){var r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}SC.canvas=SC.png={renderer:$f,headless:$f,handler:Hf},SC.svg={renderer:cC,headless:bC,handler:nh},SC.none={};var NC=new wl,DC=function(t){var e=t.clip;if(Object(x.D)(e))e(Vl(NC.clear()));else{if(!e)return;NC.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(NC)};function GC(t,e,n){return t===e||("path"===n?_C(t,e):t instanceof Date&&e instanceof Date?+t===+e:Object(x.E)(t)&&Object(x.E)(e)?Math.abs(t-e)<=1e-9:t&&e&&(Object(x.F)(t)||Object(x.F)(e))?null!=t&&null!=e&&function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!GC(t[n],e[n],n))return!1;return typeof t===typeof e}(t,e):t==e)}function _C(t,e){return GC(yu(t),yu(e))}function MC(){Ql(),Cc=0}function TC(t){ha.call(this,null,t)}function jC(t,e,n){return e(t.bounds.clear(),t,n)}Object(x.y)(TC,ha).transform=function(t,e){var n,r=e.dataflow,i=t.mark,o=i.marktype,a=pf[o],A=a.bound,s=i.bounds;if(a.nested)i.items.length&&r.dirty(i.items[0]),s=jC(i,A),i.items.forEach((function(t){t.bounds.clear().union(s)}));else if("group"===o||t.modified())switch(e.visit(e.MOD,(function(t){return r.dirty(t)})),s.clear(),i.items.forEach((function(t){return s.union(jC(t,A))})),i.role){case"axis":case"legend":case"title":e.reflow()}else n=e.changed(e.REM),e.visit(e.ADD,(function(t){s.union(jC(t,A))})),e.visit(e.MOD,(function(t){n=n||s.alignsWith(t.bounds),r.dirty(t),s.union(jC(t,A))})),n&&(s.clear(),i.items.forEach((function(t){return s.union(t.bounds)})));return DC(i),e.modifies("bounds")};function LC(t){ha.call(this,0,t)}function VC(t){ha.call(this,null,t)}function ZC(t){ha.call(this,null,t)}LC.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(x.y)(LC,ha).transform=function(t,e){var n=function(t){var e=t._signals[":vega_identifier:"];e||(t._signals[":vega_identifier:"]=e=t.add(0));return e}(e.dataflow),r=n.value,i=t.as;return e.visit(e.ADD,(function(t){t[i]||(t[i]=++r)})),n.set(this.value=r),e},Object(x.y)(VC,ha).transform=function(t,e){var n=this.value;n||((n=e.dataflow.scenegraph().mark(t.markdef,function(t){var e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index)).group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);var r="group"===n.marktype?Ul:Rl;return e.visit(e.ADD,(function(t){return r.call(t,n)})),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e};var PC=Object(x.y)(ZC,ha),WC={parity:function(t){return t.filter((function(t,e){return e%2?t.opacity=0:1}))},greedy:function(t,e){var n;return t.filter((function(t,r){return r&&JC(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)}))}};function JC(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function HC(t,e){for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(JC(o,n=t[r].bounds,e))return!0}function YC(t){var e=t.bounds;return e.width()>1&&e.height()>1}function XC(t){return t.forEach((function(t){return t.opacity=1})),t}function zC(t,e){return t.reflow(e.modified()).modifies("opacity")}function KC(t){ha.call(this,null,t)}PC.transform=function(t,e){var n,r,i,o=WC[t.method]||WC.parity,a=e.materialize(e.SOURCE).source,A=t.separation||0;if(a&&a.length){if(!t.method)return t.modified("method")&&(XC(a),e=zC(e,t)),e;if((a=a.filter(YC)).length){if(t.sort&&(a=a.slice().sort(t.sort)),n=XC(a),e=zC(e,t),n.length>=3&&HC(n,A)){do{n=o(n,A)}while(n.length>=3&&HC(n,A));n.length<3&&!Object(x.U)(a).opacity&&(n.length>1&&(Object(x.U)(n).opacity=0),Object(x.U)(a).opacity=1)}return t.boundScale&&t.boundTolerance>=0&&(r=function(t,e,n){var r=t.range(),i=new wl;return e===fc||"bottom"===e?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),function(t){return i.encloses(t.bounds)}}(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((function(t){r(t)||(t.opacity=0)}))),i=n[0].mark.bounds.clear(),a.forEach((function(t){t.opacity&&i.union(t.bounds)})),e}}},Object(x.y)(KC,ha).transform=function(t,e){var n=e.dataflow;if(e.visit(e.ALL,(function(t){return n.dirty(t)})),e.fields&&e.fields.zindex){var r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}};var qC=new wl;function $C(t,e,n){return t[e]===n?0:(t[e]=n,1)}function ty(t){var e=t.items[0].orient;return e===hc||e===dc}function ey(t,e,n,r){var i,o,a=e.items[0],A=a.datum,s=null!=a.translate?a.translate:.5,c=a.orient,u=function(t){var e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(A),l=a.range,g=a.offset,f=a.position,h=a.minExtent,d=a.maxExtent,I=A.title&&a.items[u[2]].items[0],p=a.titlePadding,C=a.bounds,y=I&&sf(I),v=0,B=0;switch(qC.clear().union(C),C.clear(),(i=u[0])>-1&&C.union(a.items[i].bounds),(i=u[1])>-1&&C.union(a.items[i].bounds),c){case fc:v=f||0,B=-g,o=Math.max(h,Math.min(d,-C.y1)),C.add(0,-o).add(l,0),I&&ny(t,I,o,p,y,0,-1,C);break;case hc:v=-g,B=f||0,o=Math.max(h,Math.min(d,-C.x1)),C.add(-o,0).add(0,l),I&&ny(t,I,o,p,y,1,-1,C);break;case dc:v=n+g,B=f||0,o=Math.max(h,Math.min(d,C.x2)),C.add(0,0).add(o,l),I&&ny(t,I,o,p,y,1,1,C);break;case"bottom":v=f||0,B=r+g,o=Math.max(h,Math.min(d,C.y2)),C.add(0,0).add(l,o),I&&ny(t,I,o,p,0,0,1,C);break;default:v=a.x,B=a.y}return _l(C.translate(v,B),a),$C(a,"x",v+s)|$C(a,"y",B+s)&&(a.bounds=qC,t.dirty(a),a.bounds=C,t.dirty(a)),a.mark.bounds.clear().union(C)}function ny(t,e,n,r,i,o,a,A){var s=e.bounds;if(e.auto){var c=a*(n+i+r),u=0,l=0;t.dirty(e),o?u=(e.x||0)-(e.x=c):l=(e.y||0)-(e.y=c),e.mark.bounds.clear().union(s.translate(-u,-l)),t.dirty(e)}A.union(s)}var ry=function(t,e){return Math.floor(Math.min(t,e))},iy=function(t,e){return Math.ceil(Math.max(t,e))};function oy(t){return(new wl).set(0,0,t.width||0,t.height||0)}function ay(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function Ay(t,e,n){var r=Object(x.F)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function sy(t){return t<0?Math.ceil(-t):0}function cy(t,e,n){var r,i,o,a,A,s,c,u,l,g,f,h=!n.nodirty,d="flush"===n.bounds?oy:ay,I=qC.set(0,0,0,0),p=Ay(n.align,"column"),C=Ay(n.align,pc),y=Ay(n.padding,"column"),v=Ay(n.padding,pc),B=n.columns||e.length,m=B<=0?1:Math.ceil(e.length/B),b=e.length,E=Array(b),Q=Array(B),F=0,w=Array(b),S=Array(m),R=0,U=Array(b),x=Array(b),k=Array(b);for(i=0;i<B;++i)Q[i]=0;for(i=0;i<m;++i)S[i]=0;for(i=0;i<b;++i)s=e[i],A=k[i]=d(s),s.x=s.x||0,U[i]=0,s.y=s.y||0,x[i]=0,o=i%B,a=~~(i/B),F=Math.max(F,c=Math.ceil(A.x2)),R=Math.max(R,u=Math.ceil(A.y2)),Q[o]=Math.max(Q[o],c),S[a]=Math.max(S[a],u),E[i]=y+sy(A.x1),w[i]=v+sy(A.y1),h&&t.dirty(e[i]);for(i=0;i<b;++i)i%B===0&&(E[i]=0),i<B&&(w[i]=0);if("each"===p)for(o=1;o<B;++o){for(f=0,i=o;i<b;i+=B)f<E[i]&&(f=E[i]);for(i=o;i<b;i+=B)E[i]=f+Q[o-1]}else if("all"===p){for(f=0,i=0;i<b;++i)i%B&&f<E[i]&&(f=E[i]);for(i=0;i<b;++i)i%B&&(E[i]=f+F)}else for(p=!1,o=1;o<B;++o)for(i=o;i<b;i+=B)E[i]+=Q[o-1];if("each"===C)for(a=1;a<m;++a){for(f=0,r=(i=a*B)+B;i<r;++i)f<w[i]&&(f=w[i]);for(i=a*B;i<r;++i)w[i]=f+S[a-1]}else if("all"===C){for(f=0,i=B;i<b;++i)f<w[i]&&(f=w[i]);for(i=B;i<b;++i)w[i]=f+R}else for(C=!1,a=1;a<m;++a)for(r=(i=a*B)+B;i<r;++i)w[i]+=S[a-1];for(l=0,i=0;i<b;++i)l=E[i]+(i%B?l:0),U[i]+=l-e[i].x;for(o=0;o<B;++o)for(g=0,i=o;i<b;i+=B)g+=w[i],x[i]+=g-e[i].y;if(p&&Ay(n.center,"column")&&m>1)for(i=0;i<b;++i)(l=(A="all"===p?F:Q[i%B])-k[i].x2-e[i].x-U[i])>0&&(U[i]+=l/2);if(C&&Ay(n.center,pc)&&1!==B)for(i=0;i<b;++i)(g=(A="all"===C?R:S[~~(i/B)])-k[i].y2-e[i].y-x[i])>0&&(x[i]+=g/2);for(i=0;i<b;++i)I.union(k[i].translate(U[i],x[i]));switch(l=Ay(n.anchor,"x"),g=Ay(n.anchor,"y"),Ay(n.anchor,"column")){case Ic:l-=I.width();break;case"middle":l-=I.width()/2}switch(Ay(n.anchor,pc)){case Ic:g-=I.height();break;case"middle":g-=I.height()/2}for(l=Math.round(l),g=Math.round(g),I.clear(),i=0;i<b;++i)e[i].mark.bounds.clear();for(i=0;i<b;++i)(s=e[i]).x+=U[i]+=l,s.y+=x[i]+=g,I.union(s.mark.bounds.union(s.bounds.translate(U[i],x[i]))),h&&t.dirty(s);return I}function uy(t,e,n){var r,i,o,a,A,s,c,u=function(t){for(var e,n,r,i,o,a,A,s=t.items,c=s.length,u=0,l={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};u<c;++u)if(A=(a=s[u]).items,"group"===a.marktype)switch(a.role){case"axis":case"legend":case"title":break;case"row-header":(e=l.rowheaders).push.apply(e,Object(B.a)(A));break;case"row-footer":(n=l.rowfooters).push.apply(n,Object(B.a)(A));break;case"column-header":(r=l.colheaders).push.apply(r,Object(B.a)(A));break;case"column-footer":(i=l.colfooters).push.apply(i,Object(B.a)(A));break;case"row-title":l.rowtitle=A[0];break;case"column-title":l.coltitle=A[0];break;default:(o=l.marks).push.apply(o,Object(B.a)(A))}return l}(e),l=u.marks,g="flush"===n.bounds?ly:gy,f=n.offset,h=n.columns||l.length,d=h<=0?1:Math.ceil(l.length/h),I=d*h,p=cy(t,l,n);p.empty()&&p.set(0,0,0,0),u.rowheaders&&(s=Ay(n.headerBand,pc,null),r=fy(t,u.rowheaders,l,h,d,-Ay(f,"rowHeader"),ry,0,g,"x1",0,h,1,s)),u.colheaders&&(s=Ay(n.headerBand,"column",null),i=fy(t,u.colheaders,l,h,h,-Ay(f,"columnHeader"),ry,1,g,"y1",0,1,h,s)),u.rowfooters&&(s=Ay(n.footerBand,pc,null),o=fy(t,u.rowfooters,l,h,d,Ay(f,"rowFooter"),iy,0,g,"x2",h-1,h,1,s)),u.colfooters&&(s=Ay(n.footerBand,"column",null),a=fy(t,u.colfooters,l,h,h,Ay(f,"columnFooter"),iy,1,g,"y2",I-h,1,h,s)),u.rowtitle&&(A=Ay(n.titleAnchor,pc),c=Ay(f,"rowTitle"),c=A===Ic?o+c:r-c,s=Ay(n.titleBand,pc,.5),hy(t,u.rowtitle,c,0,p,s)),u.coltitle&&(A=Ay(n.titleAnchor,"column"),c=Ay(f,"columnTitle"),c=A===Ic?a+c:i-c,s=Ay(n.titleBand,"column",.5),hy(t,u.coltitle,c,1,p,s))}function ly(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function gy(t,e){return t.bounds[e]}function fy(t,e,n,r,i,o,a,A,s,c,u,l,g,f){var h,d,I,p,C,y,v,B,m,b=n.length,E=0,Q=0;if(!b)return E;for(h=u;h<b;h+=l)n[h]&&(E=a(E,s(n[h],c)));if(!e.length)return E;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),E+=o,d=0,p=e.length;d<p;++d)t.dirty(e[d]),e[d].mark.bounds.clear();for(h=u,d=0,p=e.length;d<p;++d,h+=l){for(C=(y=e[d]).mark.bounds,I=h;I>=0&&null==(v=n[I]);I-=g);A?(B=null==f?v.x:Math.round(v.bounds.x1+f*v.bounds.width()),m=E):(B=E,m=null==f?v.y:Math.round(v.bounds.y1+f*v.bounds.height())),C.union(y.bounds.translate(B-(y.x||0),m-(y.y||0))),y.x=B,y.y=m,t.dirty(y),Q=a(Q,C[c])}return Q}function hy(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,A=n;r?a=Math.round(i.x1+o*i.width()):A=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),A-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=A,t.dirty(e)}}function dy(t,e,n,r,i,o,a){var A=function(t,e){var n=t[e]||{};return function(e,r){return null!=n[e]?n[e]:null!=t[e]?t[e]:r}}(n,e),s=function(t,e){var n=-1/0;return t.forEach((function(t){null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,A("offset",0)),c=A("anchor","start"),u=c===Ic?1:"middle"===c?.5:0,l={align:"each",bounds:A("bounds","flush"),columns:"vertical"===A("direction")?1:t.length,padding:A("margin",8),center:A("center"),nodirty:!0};switch(e){case hc:l.anchor={x:Math.floor(r.x1)-s,column:Ic,y:u*(a||r.height()+2*r.y1),row:c};break;case dc:l.anchor={x:Math.ceil(r.x2)+s,y:u*(a||r.height()+2*r.y1),row:c};break;case fc:l.anchor={y:Math.floor(i.y1)-s,row:Ic,x:u*(o||i.width()+2*i.x1),column:c};break;case"bottom":l.anchor={y:Math.ceil(i.y2)+s,x:u*(o||i.width()+2*i.x1),column:c};break;case"top-left":l.anchor={x:s,y:s};break;case"top-right":l.anchor={x:o-s,y:s,column:Ic};break;case"bottom-left":l.anchor={x:s,y:a-s,row:Ic};break;case"bottom-right":l.anchor={x:o-s,y:a-s,column:Ic,row:Ic}}return l}function Iy(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,A=i.bounds,s=i.x,c=i.y;return i._bounds?i._bounds.clear().union(A):i._bounds=A.clone(),A.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],A=a.anchor,s=e.titlePadding||0,c=r-a.x,u=r-a.y;switch(a.orient){case hc:i+=Math.ceil(a.bounds.width())+s;break;case dc:case"bottom":break;default:o+=a.bounds.height()+s}switch((i||o)&&Cy(t,n,i,o),a.orient){case hc:u+=py(e,n,a,A,1,1);break;case dc:c+=py(e,n,a,Ic,0,0)+s,u+=py(e,n,a,A,1,1);break;case"bottom":c+=py(e,n,a,A,0,0),u+=py(e,n,a,Ic,-1,0,1)+s;break;default:c+=py(e,n,a,A,0,0)}(c||u)&&Cy(t,a,c,u),(c=Math.round(a.bounds.x1-r))<0&&(Cy(t,n,-c,0),Cy(t,a,-c,0))}else(i||o)&&Cy(t,n,i,o)}(t,i,i.items[0].items[0]),A=function(t,e){return t.items.forEach((function(t){return e.union(t.bounds)})),e.x1=t.padding,e.y1=t.padding,e}(i,A),n=2*i.padding,r=2*i.padding,A.empty()||(n=Math.ceil(A.width()+n),r=Math.ceil(A.height()+r)),"symbol"===o.type&&function(t){var e=t.reduce((function(t,e){return t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t}),{});t.forEach((function(t){t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(i.items[0].items[0].items[0].items),"none"!==a&&(i.x=s=0,i.y=c=0),i.width=n,i.height=r,_l(A.set(s,c,s+n,c+r),i),i.mark.bounds.clear().union(A),i}function py(t,e,n,r,i,o,a){var A="symbol"!==t.datum.type,s=n.datum.vgrad,c=(!A||!o&&s||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,u=s&&o?c:0,l=s&&o?0:c,g=i<=0?0:sf(n);return Math.round("start"===r?u:r===Ic?l-g:.5*(c-g))}function Cy(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function yy(t){ha.call(this,null,t)}function vy(t){ha.call(this,null,t)}function By(t){ha.call(this,null,t)}function my(){return kt({})}function by(t){ha.call(this,null,t)}function Ey(t){ha.call(this,[],t)}Object(x.y)(yy,ha).transform=function(t,e){var n,r=e.dataflow;return t.mark.items.forEach((function(e){t.layout&&uy(r,e,t.layout),function(t,e,n){var r,i,o,a,A,s=e.items,c=Math.max(0,e.width||0),u=Math.max(0,e.height||0),l=(new wl).set(0,0,c,u),g=l.clone(),f=l.clone(),h=[];for(a=0,A=s.length;a<A;++a)switch((i=s[a]).role){case"axis":(ty(i)?g:f).union(ey(t,i,c,u));break;case"title":r=i;break;case"legend":h.push(Iy(t,i));break;case"frame":case"scope":case"row-header":case"row-footer":case"row-title":case"column-header":case"column-footer":case"column-title":g.union(i.bounds),f.union(i.bounds);break;default:l.union(i.bounds)}if(h.length){var d={};for(var I in h.forEach((function(t){"none"!==(o=t.orient||dc)&&(d[o]||(d[o]=[])).push(t)})),d){var p=d[I];cy(t,p,dy(p,I,n.legends,g,f,c,u))}h.forEach((function(e){var r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&"fit"===n.autosize.type)switch(e.orient){case hc:case dc:l.add(r.x1,0).add(r.x2,0);break;case fc:case"bottom":l.add(0,r.y1).add(0,r.y2)}else l.union(r)}))}l.union(g).union(f),r&&l.union(function(t,e,n,r,i){var o,a=e.items[0],A=a.frame,s=a.orient,c=a.anchor,u=a.offset,l=a.padding,g=a.items[0].items[0],f=a.items[1]&&a.items[1].items[0],h=s===hc||s===dc?r:n,d=0,I=0,p=0,C=0,y=0;if("group"!==A?s===hc?(d=i.y2,h=i.y1):s===dc?(d=i.y1,h=i.y2):(d=i.x1,h=i.x2):s===hc&&(d=r,h=0),o="start"===c?d:c===Ic?h:(d+h)/2,f&&f.text){switch(s){case fc:case"bottom":y=g.bounds.height()+l;break;case hc:C=g.bounds.width()+l;break;case dc:C=-g.bounds.width()-l}qC.clear().union(f.bounds),qC.translate(C-(f.x||0),y-(f.y||0)),$C(f,"x",C)|$C(f,"y",y)&&(t.dirty(f),f.bounds.clear().union(qC),f.mark.bounds.clear().union(qC),t.dirty(f)),qC.clear().union(f.bounds)}else qC.clear();switch(qC.union(g.bounds),s){case fc:I=o,p=i.y1-qC.height()-u;break;case hc:I=i.x1-qC.width()-u,p=o;break;case dc:I=i.x2+qC.width()+u,p=o;break;case"bottom":I=o,p=i.y2+u;break;default:I=a.x,p=a.y}return $C(a,"x",I)|$C(a,"y",p)&&(qC.translate(I,p),t.dirty(a),a.bounds.clear().union(qC),e.bounds.clear().union(qC),t.dirty(a)),a.bounds}(t,r,c,u,l));e.clip&&l.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){var i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;var a=t._width,A=t._height,s=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,Math.ceil(n.x2-s)),l=Math.max(0,e.height||0),g=Math.max(0,Math.ceil(-n.y1)),f=Math.max(0,Math.ceil(n.y2-l));if("padding"===i.contains){var h=t.padding();a-=h.left+h.right,A-=h.top+h.bottom}"none"===o?(c=0,g=0,s=a,l=A):"fit"===o?(s=Math.max(0,a-c-u),l=Math.max(0,A-g-f)):"fit-x"===o?(s=Math.max(0,a-c-u),A=l+g+f):"fit-y"===o?(a=s+c+u,l=Math.max(0,A-g-f)):"pad"===o&&(a=s+c+u,A=l+g+f);t._resizeView(a,A,s,l,[c,g],i.resize)}(t,e,l,n)}(r,e,t)})),(n=t.mark.group)&&"legend-entry"!==n.mark.role?e.reflow():e},Object(x.y)(vy,ha).transform=function(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=Gp(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),A=t.format||Tp(n,o,a,t.formatSpecifier,t.formatType,!!t.values),s=t.values?_p(o,t.values,a):Mp(o,a);return i&&(r.rem=i),i=s.map((function(t,e){return kt({index:e/(s.length-1||1),value:t,label:A(t)})})),t.extra&&i.length&&i.push(kt({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r},Object(x.y)(By,ha).transform=function(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||my,o=t.key||Ut,a=this.value;return Object(x.A)(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&Object(x.n)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){var e=Object(x.s)().test((function(t){return t.exit}));return e.lookup=function(n){return e.get(t(n))},e}(o)),e.visit(e.ADD,(function(t){var e=o(t),n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(function(t){var e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(function(t){var e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r},Object(x.y)(by,ha).transform=function(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(Object(x.A)(o)){if(!n.changed()&&!o.every((function(t){return i[t]})))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,A=i.update||x.r,s=i.enter||x.r,c=i.exit||x.r,u=(o&&!a?i[o]:A)||x.r;if(e.changed(e.ADD)&&(e.visit(e.ADD,(function(e){s(e,t),A(e,t)})),n.modifies(s.output),n.modifies(A.output),u!==x.r&&u!==A&&(e.visit(e.ADD,(function(e){u(e,t)})),n.modifies(u.output))),e.changed(e.REM)&&c!==x.r&&(e.visit(e.REM,(function(e){c(e,t)})),n.modifies(c.output)),a||u!==x.r){var l=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(l,(function(e){var i=s(e,t)||r;(u(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(s.output)):e.visit(l,(function(e){(u(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation},Object(x.y)(Ey,ha).transform=function(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,A=e.dataflow.locale(),s=e.fork(e.NO_SOURCE|e.NO_FIELDS),c=this.value,u=t.type||"symbol",l=t.scale,g=+t.limit,f=Gp(l,null==t.count?5:t.count,t.minstep),h=!!t.values||"symbol"===u,d=t.format||Pp(A,l,f,u,t.formatSpecifier,t.formatType,h),I=t.values||Zp(l,f);return c&&(s.rem=c),"symbol"===u?(g&&I.length>g?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),c=I.slice(0,g-1),a=!0):c=I,Object(x.D)(i=t.size)?(t.values||0!==l(c[0])||(c=c.slice(1)),o=c.reduce((function(e,n){return Math.max(e,i(n,t))}),0)):i=Object(x.l)(o=i||8),c=c.map((function(e,n){return kt({index:n,label:d(e,n,c),value:e,offset:o,size:i(e,t)})})),a&&(a=I[c.length],c.push(kt({index:c.length,label:"\u2026".concat(I.length-c.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===u?(n=l.domain(),r=Qp(l,n[0],Object(x.U)(n)),I.length<3&&!t.values&&n[0]!==Object(x.U)(n)&&(I=[n[0],Object(x.U)(n)]),c=I.map((function(t,e){return kt({index:e,label:d(t,e,I),value:t,perc:r(t)})}))):(i=I.length-1,r=function(t){var e=t.domain(),n=e.length-1,r=+e[0],i=+Object(x.U)(e),o=i-r;if("threshold"===t.type){var a=n?o/n:.1;o=(i+=a)-(r-=a)}return function(t){return(t-r)/o}}(l),c=I.map((function(t,e){return kt({index:e,label:d(t,e,I),value:t,perc:e?r(t):0,perc2:e===i?1:r(I[e+1])})}))),s.source=c,s.add=c,this.value=c,s};var Qy=Object(x.s)({line:xy,"line-radial":function(t,e,n,r){return xy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},arc:ky,"arc-radial":function(t,e,n,r){return ky(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},curve:Oy,"curve-radial":function(t,e,n,r){return Oy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},"orthogonal-horizontal":function(t,e,n,r){return"M"+t+","+e+"V"+r+"H"+n},"orthogonal-vertical":function(t,e,n,r){return"M"+t+","+e+"H"+n+"V"+r},"orthogonal-radial":function(t,e,n,r){var i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),A=Math.sin(n),s=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(s?1:0)+" "+e*a+","+e*A+"L"+r*a+","+r*A},"diagonal-horizontal":function(t,e,n,r){var i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":function(t,e,n,r){var i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":function(t,e,n,r){var i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),A=Math.sin(n),s=(e+r)/2;return"M"+e*i+","+e*o+"C"+s*i+","+s*o+" "+s*a+","+s*A+" "+r*a+","+r*A}});function Fy(t){return t.source.x}function wy(t){return t.source.y}function Sy(t){return t.target.x}function Ry(t){return t.target.y}function Uy(t){ha.call(this,{},t)}function xy(t,e,n,r){return"M"+t+","+e+"L"+n+","+r}function ky(t,e,n,r){var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r}function Oy(t,e,n,r){var i=n-t,o=r-e,a=.2*(i+o),A=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+A)+" "+(n+A)+","+(r-a)+" "+n+","+r}Uy.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Object(x.y)(Uy,ha).transform=function(t,e){var n=t.sourceX||Fy,r=t.sourceY||wy,i=t.targetX||Sy,o=t.targetY||Ry,a=t.as||"path",A=t.orient||"vertical",s=t.shape||"line",c=Qy.get(s+"-"+A)||Qy.get(s);return c||Object(x.n)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(function(t){t[a]=c(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)};var Ny=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o};function Dy(t){ha.call(this,null,t)}Dy.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(x.y)(Dy,ha).transform=function(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],A=o[1],s=t.field||x.O,c=t.startAngle||0,u=null!=t.endAngle?t.endAngle:2*Math.PI,l=e.source,g=l.map(s),f=g.length,h=c,d=(u-c)/function(t,e){var n=0;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;(o=+o)&&(n+=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;(c=+e(c,++A,t))&&(n+=c)}}catch(u){s.e(u)}finally{s.f()}}return n}(g),I=Ny(f);for(t.sort&&I.sort((function(t,e){return g[t]-g[e]})),n=0;n<f;++n)i=g[I[n]],(r=l[I[n]])[a]=h,r[A]=h+=i*d;return this.value=g,e.reflow(t.modified()).modifies(o)};function Gy(t){return bI(t)&&"sequential"!==t}var _y=Object(x.db)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function My(t){ha.call(this,null,t),this.modified(!0)}function Ty(t,e,n){FI(t)&&(Math.abs(e.reduce((function(t,e){return t+(e<0?-1:e>0?1:0)}),0))!==e.length&&n.warn("Log scale domain includes zero: "+Object(x.Z)(e)));return e}function jy(t,e,n){return Object(x.D)(t)&&(e||n)?mp(t,Ly(e||[0,1],n)):t}function Ly(t,e){return e?t.slice().reverse():t}function Vy(t){ha.call(this,null,t)}Object(x.y)(My,ha).transform=function(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if("sequential"===n)return"sequential-linear";(function(t){var e=t.type;return bI(e)&&e!==Ah&&e!==sh&&(t.scheme||t.range&&t.range.length&&t.range.every(x.H))})(t)&&(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0,r=2===e?"sequential-":3===e?"diverging-":"");return(r+n||"linear").toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=vI(i)()),t)if(!_y[i]){if("padding"===i&&Gy(r.type))continue;Object(x.D)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){"band"!==t&&"point"!==t&&Object(x.n)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i="point"===t?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*oh(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i,o=e.schemeExtent;Object(x.A)(e.scheme)?i=bp(e.scheme,e.interpolate,e.interpolateGamma):(r=e.scheme.toLowerCase(),(i=Up(r))||Object(x.n)("Unrecognized scheme name: ".concat(e.scheme)));return n="threshold"===t?n+1:"bin-ordinal"===t?n-1:"quantile"===t||"quantize"===t?+e.schemeCount||5:n,wI(t)?jy(i,o,e.reverse):Object(x.D)(i)?Ep(jy(i,o),n):"ordinal"===t?i:i.slice(0,n)}(r,e,n),Object(x.D)(o))){if(t.interpolator)return t.interpolator(o);Object(x.n)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&wI(r))return t.interpolator(bp(Ly(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Fp(e.interpolate,e.interpolateGamma)):Object(x.D)(t.round)?t.round(i):Object(x.D)(t.rangeRound)&&t.interpolate(i?Rd:Sd);o&&t.range(Ly(o,e.reverse))}(r,t,function(t,e,n){var r=e.bins;if(r&&!Object(x.A)(r)){var i=t.domain(),o=i[0],a=Object(x.U)(i),A=null==r.start?o:r.start,s=null==r.stop?a:r.stop,c=r.step;c||Object(x.n)("Scale bins parameter missing step property."),A<o&&(A=c*Math.ceil(o/c)),s>a&&(s=c*Math.floor(a/c)),r=Ny(A,s+c/2,c)}r?t.bins=r:t.bins&&delete t.bins;"bin-ordinal"===t.type&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){var r=function(t,e,n){return e?(t.domain(Ty(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,A=t.type,s=e.zero||void 0===e.zero&&function(t){var e=t.type;return!t.bins&&("linear"===e||"pow"===e||"sqrt"===e)}(t);if(!a)return 0;Gy(A)&&e.padding&&a[0]!==Object(x.U)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(Object(x.U)(n)-n[0]),A=a/(a-2*r),s=t===ah?Object(x.mb)(e,null,A):"sqrt"===t?Object(x.nb)(e,null,A,.5):"pow"===t?Object(x.nb)(e,null,A,i||1):"symlog"===t?Object(x.ob)(e,null,A,o||1):Object(x.lb)(e,null,A);return(e=e.slice())[0]=s[0],e[e.length-1]=s[1],e}(A,a,e.range,e.padding,e.exponent,e.constant));if((s||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,s&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){var c=(o=e.domainMid)>a[i]?i+1:o<a[0]?0:i;c!==i&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(c,0,o)}t.domain(Ty(A,a,n)),"ordinal"===A&&t.unknown(e.domainImplicit?ph:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Gp(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)},Object(x.y)(Vy,ha).transform=function(t,e){var n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(Gt(t.sort)),this.modified(n),e};var Zy=["y0","y1"];function Py(t){ha.call(this,null,t)}function Wy(t,e,n,r,i){for(var o,a=(e-t.sum)/2,A=t.length,s=0;s<A;++s)(o=t[s])[r]=a,o[i]=a+=Math.abs(n(o))}function Jy(t,e,n,r,i){for(var o,a=1/t.sum,A=0,s=t.length,c=0,u=0;c<s;++c)(o=t[c])[r]=A,o[i]=A=a*(u+=Math.abs(n(o)))}function Hy(t,e,n,r,i){for(var o,a,A=0,s=0,c=t.length,u=0;u<c;++u)(o=+n(a=t[u]))<0?(a[r]=s,a[i]=s+=o):(a[r]=A,a[i]=A+=o)}function Yy(t,e){var n;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n<o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n<c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}function Xy(){}Py.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:Zy}]},Object(x.y)(Py,ha).transform=function(t,e){var n,r,i,o,a=t.as||Zy,A=a[0],s=a[1],c=Gt(t.sort),u=t.field||x.O,l="center"===t.offset?Wy:"normalize"===t.offset?Jy:Hy;for(n=function(t,e,n,r){var i,o,a,A,s,c,u,l,g,f=[],h=function(t){return t(s)};if(null==e)f.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)s=t[o],c=e.map(h),(u=i[c])||(i[c]=u=[],f.push(u)),u.push(s);for(c=0,g=0,A=f.length;c<A;++c){for(u=f[c],o=0,l=0,a=u.length;o<a;++o)l+=Math.abs(r(u[o]));u.sum=l,l>g&&(g=l),n&&u.sort(n)}return f.max=g,f}(e.source,t.groupby,c,u),r=0,i=n.length,o=n.max;r<i;++r)l(n[r],o,u,A,s);return e.reflow(t.modified()).modifies(a)};var zy=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Ky=function(){var t=1,e=1,n=a;function r(t,e){return e.map((function(e){return i(t,e)}))}function i(r,i){var a=[],A=[];return function(n,r,i){var a,A,s,c,u,l,g=new Array,f=new Array;a=A=-1,c=n[0]>=r,zy[c<<1].forEach(h);for(;++a<t-1;)s=c,c=n[a+1]>=r,zy[s|c<<1].forEach(h);zy[c<<0].forEach(h);for(;++A<e-1;){for(a=-1,c=n[A*t+t]>=r,u=n[A*t]>=r,zy[c<<1|u<<2].forEach(h);++a<t-1;)s=c,c=n[A*t+t+a+1]>=r,l=u,u=n[A*t+a+1]>=r,zy[s|c<<1|u<<2|l<<3].forEach(h);zy[c|u<<3].forEach(h)}a=-1,u=n[A*t]>=r,zy[u<<2].forEach(h);for(;++a<t-1;)l=u,u=n[A*t+a+1]>=r,zy[u<<2|l<<3].forEach(h);function h(t){var e,n,r=[t[0][0]+a,t[0][1]+A],s=[t[1][0]+a,t[1][1]+A],c=o(r),u=o(s);(e=f[c])?(n=g[u])?(delete f[e.end],delete g[n.start],e===n?(e.ring.push(s),i(e.ring)):g[e.start]=f[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete f[e.end],e.ring.push(s),f[e.end=u]=e):(e=g[u])?(n=f[c])?(delete g[e.start],delete f[n.end],e===n?(e.ring.push(s),i(e.ring)):g[n.start]=f[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete g[e.start],e.ring.unshift(r),g[e.start=c]=e):g[c]=f[u]={start:c,end:u,ring:[r,s]}}zy[u<<3].forEach(h)}(r,i,(function(t){n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):A.push(t)})),A.forEach((function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==qy((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((function(n){var o,a=n[0],A=n[1],s=0|a,c=0|A,u=r[c*t+s];a>0&&a<t&&s===a&&(o=r[c*t+s-1],n[0]=a+(i-o)/(u-o)-.5),A>0&&A<e&&c===A&&(o=r[(c-1)*t+s],n[1]=A+(i-o)/(u-o)-.5)}))}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);return i>=0&&o>=0||Object(x.n)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:Xy,r):n===a},r};function qy(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=$y(t,e[r]))return n;return 0}function $y(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,A=a-1;o<a;A=o++){var s=t[o],c=s[0],u=s[1],l=t[A],g=l[0],f=l[1];if(tv(s,l,e))return 0;u>r!==f>r&&n<(g-c)*(r-u)/(f-u)+c&&(i=-i)}return i}function tv(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}var ev=Math.sqrt(50),nv=Math.sqrt(10),rv=Math.sqrt(2);var iv=function(t,e,n){return function(r){var i=Object(x.p)(r),o=n?Math.min(i[0],0):i[0],a=i[1],A=a-o,s=e?function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=ev?i*=10:o>=nv?i*=5:o>=rv&&(i*=2),e<t?-i:i}(o,a,t):A/(t+1);return function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}(s,a,s)}};function ov(t){ha.call(this,null,t)}function av(t,e,n,r,i){var o=t.x1||0,a=t.y1||0,A=e*n<0;function s(t){t.forEach(c)}function c(t){A&&t.reverse(),t.forEach(u)}function u(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(s),t}}function Av(t,e,n){var r=t>=0?t:Wa(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function sv(t){return Object(x.D)(t)?t:Object(x.l)(+t)}ov.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Object(x.y)(ov,ha).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||x.x,o=Ky().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){var r=iv(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map((function(t){return Yy(e(t).values)})))}(r,i,t),A=null===t.as?null:t.as||"contour",s=[];return r.forEach((function(e){var n=i(e),r=o.size([n.width,n.height])(n.values,Object(x.A)(a)?a:a(n.values));!function(t,e,n,r){var i=r.scale||e.scale,o=r.translate||e.translate;Object(x.D)(i)&&(i=i(n,r));Object(x.D)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;var a=(Object(x.E)(i)?i:i[0])||1,A=(Object(x.E)(i)?i:i[1])||1,s=o&&o[0]||0,c=o&&o[1]||0;t.forEach(av(e,a,A,s,c))}(r,n,e,t),r.forEach((function(t){s.push(Nt(e,kt(null!=A?Object(v.a)({},A,t):t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=s,n};var cv=function(){var t=function(t){return t[0]},e=function(t){return t[1]},n=x.O,r=[-1,-1],i=960,o=500,a=2;function A(A,s){var c=Av(r[0],A,t)>>a,u=Av(r[1],A,e)>>a,l=c?c+2:0,g=u?u+2:0,f=2*l+(i>>a),h=2*g+(o>>a),d=new Float32Array(f*h),I=new Float32Array(f*h),p=d;A.forEach((function(r){var i=l+(+t(r)>>a),o=g+(+e(r)>>a);i>=0&&i<f&&o>=0&&o<h&&(d[i+o*f]+=+n(r))})),c>0&&u>0?(uv(f,h,d,I,c),lv(f,h,I,d,u),uv(f,h,d,I,c),lv(f,h,I,d,u),uv(f,h,d,I,c),lv(f,h,I,d,u)):c>0?(uv(f,h,d,I,c),uv(f,h,I,d,c),uv(f,h,d,I,c),p=I):u>0&&(lv(f,h,d,I,u),lv(f,h,I,d,u),lv(f,h,d,I,u),p=I);for(var C=s?Math.pow(2,-2*a):1/function(t,e){var n=0;if(void 0===e){var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;(o=+o)&&(n+=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(U.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;(c=+e(c,++A,t))&&(n+=c)}}catch(u){s.e(u)}finally{s.f()}}return n}(p),y=0,v=f*h;y<v;++y)p[y]*=C;return{values:p,scale:1<<a,width:f,height:h,x1:l,y1:g,x2:l+(i>>a),y2:g+(o>>a)}}return A.x=function(e){return arguments.length?(t=sv(e),A):t},A.y=function(t){return arguments.length?(e=sv(t),A):e},A.weight=function(t){return arguments.length?(n=sv(t),A):n},A.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||Object(x.n)("invalid size"),i=e,o=n,A},A.cellSize=function(t){return arguments.length?((t=+t)>=1||Object(x.n)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),A):1<<a},A.bandwidth=function(t){return arguments.length?(1===(t=Object(x.i)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&Object(x.n)("invalid bandwidth"),r=t,A):r},A};function uv(t,e,n,r,i){for(var o=1+(i<<1),a=0;a<e;++a)for(var A=0,s=0;A<t+i;++A)A<t&&(s+=n[A+a*t]),A>=i&&(A>=o&&(s-=n[A-o+a*t]),r[A-i+a*t]=s/Math.min(A+1,t-1+o-A,o))}function lv(t,e,n,r,i){for(var o=1+(i<<1),a=0;a<t;++a)for(var A=0,s=0;A<e+i;++A)A<e&&(s+=n[a+A*t]),A>=i&&(A>=o&&(s-=n[a+(A-o)*t]),r[a+(A-i)*t]=s/Math.min(A+1,e-1+o-A,o))}function gv(t){ha.call(this,null,t)}gv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};var fv=Object(x.y)(gv,ha),hv=["x","y","weight","size","cellSize","bandwidth"];function dv(t,e){return hv.forEach((function(n){return null!=e[n]?t[n](e[n]):0})),t}function Iv(t){ha.call(this,null,t)}fv.transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,A,s=[],c=function(t){return t(o)};if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],a=e.map(c),(A=n[a])||(n[a]=A=[],A.dims=a,s.push(A)),A.push(o);return s}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(x.h),a=dv(cv(),t),A=t.as||"grid";return n=i.map((function(e){return kt(function(t,e){for(var n=0;n<o.length;++n)t[o[n]]=e[n];return t}(Object(v.a)({},A,a(e,t.counts)),e.dims))})),this.value&&(r.rem=this.value),this.value=r.source=r.add=n,r},Iv.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},Object(x.y)(Iv,ha).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=Ky().smooth(!1!==t.smooth),a=t.values,A=t.thresholds||iv(t.count||10,t.nice,!!a),s=t.size;return a||(a=e.materialize(e.SOURCE).source,r=av(n=dv(cv(),t)(a,!0),n.scale||1,n.scale||1,0,0),s=[n.width,n.height],a=n.values),A=Object(x.A)(A)?A:A(a),a=o.size(s)(a,A),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(kt),i};function pv(t){ha.call(this,null,t)}pv.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},Object(x.y)(pv,ha).transform=function(t,e){var n,r=this._features,i=this._points,o=t.fields,a=o&&o[0],A=o&&o[1],s=t.geojson||!o&&x.x,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(Object(x.g)(s))||a&&e.modified(Object(x.g)(a))||A&&e.modified(Object(x.g)(A)),this.value&&!n||(c=e.SOURCE,this._features=r=[],this._points=i=[]),s&&e.visit(c,(function(t){r.push(s(t))})),a&&A&&(e.visit(c,(function(t){var e=a(t),n=A(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])})),r=r.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:"FeatureCollection",features:r}};var Cv=function(t){return t};function yv(t,e){t&&Bv.hasOwnProperty(t.type)&&Bv[t.type](t,e)}var vv={Feature:function(t,e){yv(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)yv(n[r].geometry,e)}},Bv={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){mv(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)mv(n[r],e,0)},Polygon:function(t,e){bv(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)bv(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)yv(n[r],e)}};function mv(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function bv(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)mv(t[n],e,1);e.polygonEnd()}var Ev=function(t,e){t&&vv.hasOwnProperty(t.type)?vv[t.type](t,e):yv(t,e)},Qv=function(){return new Fv};function Fv(){this.reset()}Fv.prototype={constructor:Fv,reset:function(){this.s=this.t=0},add:function(t){Sv(wv,t,this.t),Sv(this,wv.s,this.s),this.s?this.t+=wv.t:this.s=wv.t},valueOf:function(){return this.s}};var wv=new Fv;function Sv(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var Rv=Math.PI,Uv=Rv/2,xv=Rv/4,kv=2*Rv,Ov=180/Rv,Nv=Rv/180,Dv=Math.abs,Gv=Math.atan,_v=Math.atan2,Mv=Math.cos,Tv=(Math.ceil,Math.exp),jv=(Math.floor,Math.log),Lv=Math.pow,Vv=Math.sin,Zv=Math.sign||function(t){return t>0?1:t<0?-1:0},Pv=Math.sqrt,Wv=Math.tan;function Jv(t){return t>1?0:t<-1?Rv:Math.acos(t)}function Hv(t){return t>1?Uv:t<-1?-Uv:Math.asin(t)}function Yv(){}var Xv,zv,Kv,qv,$v=Qv(),tB=Qv(),eB={point:Yv,lineStart:Yv,lineEnd:Yv,polygonStart:function(){eB.lineStart=nB,eB.lineEnd=oB},polygonEnd:function(){eB.lineStart=eB.lineEnd=eB.point=Yv,$v.add(Dv(tB)),tB.reset()},result:function(){var t=$v/2;return $v.reset(),t}};function nB(){eB.point=rB}function rB(t,e){eB.point=iB,Xv=Kv=t,zv=qv=e}function iB(t,e){tB.add(qv*t-Kv*e),Kv=t,qv=e}function oB(){iB(Xv,zv)}var aB=eB,AB=1/0,sB=AB,cB=-AB,uB=cB;var lB,gB,fB,hB,dB={point:function(t,e){t<AB&&(AB=t);t>cB&&(cB=t);e<sB&&(sB=e);e>uB&&(uB=e)},lineStart:Yv,lineEnd:Yv,polygonStart:Yv,polygonEnd:Yv,result:function(){var t=[[AB,sB],[cB,uB]];return cB=uB=-(sB=AB=1/0),t}},IB=0,pB=0,CB=0,yB=0,vB=0,BB=0,mB=0,bB=0,EB=0,QB={point:FB,lineStart:wB,lineEnd:UB,polygonStart:function(){QB.lineStart=xB,QB.lineEnd=kB},polygonEnd:function(){QB.point=FB,QB.lineStart=wB,QB.lineEnd=UB},result:function(){var t=EB?[mB/EB,bB/EB]:BB?[yB/BB,vB/BB]:CB?[IB/CB,pB/CB]:[NaN,NaN];return IB=pB=CB=yB=vB=BB=mB=bB=EB=0,t}};function FB(t,e){IB+=t,pB+=e,++CB}function wB(){QB.point=SB}function SB(t,e){QB.point=RB,FB(fB=t,hB=e)}function RB(t,e){var n=t-fB,r=e-hB,i=Pv(n*n+r*r);yB+=i*(fB+t)/2,vB+=i*(hB+e)/2,BB+=i,FB(fB=t,hB=e)}function UB(){QB.point=FB}function xB(){QB.point=OB}function kB(){NB(lB,gB)}function OB(t,e){QB.point=NB,FB(lB=fB=t,gB=hB=e)}function NB(t,e){var n=t-fB,r=e-hB,i=Pv(n*n+r*r);yB+=i*(fB+t)/2,vB+=i*(hB+e)/2,BB+=i,mB+=(i=hB*t-fB*e)*(fB+t),bB+=i*(hB+e),EB+=3*i,FB(fB=t,hB=e)}var DB=QB;function GB(t){this._context=t}GB.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,kv)}},result:Yv};var _B,MB,TB,jB,LB,VB=Qv(),ZB={point:Yv,lineStart:function(){ZB.point=PB},lineEnd:function(){_B&&WB(MB,TB),ZB.point=Yv},polygonStart:function(){_B=!0},polygonEnd:function(){_B=null},result:function(){var t=+VB;return VB.reset(),t}};function PB(t,e){ZB.point=WB,MB=jB=t,TB=LB=e}function WB(t,e){jB-=t,LB-=e,VB.add(Pv(jB*jB+LB*LB)),jB=t,LB=e}var JB=ZB;function HB(){this._string=[]}function YB(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}HB.prototype={_radius:4.5,_circle:YB(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=YB(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var XB=function(t,e){var n,r,i=4.5;function o(t){return t&&("function"===typeof i&&r.pointRadius(+i.apply(this,arguments)),Ev(t,n(r))),r.result()}return o.area=function(t){return Ev(t,n(aB)),aB.result()},o.measure=function(t){return Ev(t,n(JB)),JB.result()},o.bounds=function(t){return Ev(t,n(dB)),dB.result()},o.centroid=function(t){return Ev(t,n(DB)),DB.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,Cv):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new HB):new GB(e=t),"function"!==typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"===typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)},zB=function(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Yv,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},KB=function(t,e){return Dv(t[0]-e[0])<1e-6&&Dv(t[1]-e[1])<1e-6};function qB(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var $B=function(t,e,n,r,i){var o,a,A=[],s=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(KB(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}A.push(n=new qB(r,t,null,!0)),s.push(n.o=new qB(r,null,n,!1)),A.push(n=new qB(a,t,null,!1)),s.push(n.o=new qB(a,null,n,!0))}})),A.length){for(s.sort(e),tm(A),tm(s),o=0,a=s.length;o<a;++o)s[o].e=n=!n;for(var c,u,l=A[0];;){for(var g=l,f=!0;g.v;)if((g=g.n)===l)return;c=g.z,i.lineStart();do{if(g.v=g.o.v=!0,g.e){if(f)for(o=0,a=c.length;o<a;++o)i.point((u=c[o])[0],u[1]);else r(g.x,g.n.x,1,i);g=g.n}else{if(f)for(c=g.p.z,o=c.length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(g.x,g.p.x,-1,i);g=g.p}c=(g=g.o).z,f=!f}while(!g.v);i.lineEnd()}}};function tm(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function em(t){return[_v(t[1],t[0]),Hv(t[2])]}function nm(t){var e=t[0],n=t[1],r=Mv(n);return[r*Mv(e),r*Vv(e),Vv(n)]}function rm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function im(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function om(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function am(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Am(t){var e=Pv(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var sm=Qv();function cm(t){return Dv(t[0])<=Rv?t[0]:Zv(t[0])*((Dv(t[0])+Rv)%kv-Rv)}var um=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var lm=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return um(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}(um);lm.right,lm.left;var gm=Array.prototype;gm.slice,gm.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var fm=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var hm=function(t,e,n,r){return function(i){var o,a,A,s=e(i),c=zB(),u=e(c),l=!1,g={point:f,lineStart:d,lineEnd:I,polygonStart:function(){g.point=p,g.lineStart=C,g.lineEnd=y,a=[],o=[]},polygonEnd:function(){g.point=f,g.lineStart=d,g.lineEnd=I,a=fm(a);var t=function(t,e){var n=cm(e),r=e[1],i=Vv(r),o=[Vv(n),-Mv(n),0],a=0,A=0;sm.reset(),1===i?r=Uv+1e-6:-1===i&&(r=-Uv-1e-6);for(var s=0,c=t.length;s<c;++s)if(l=(u=t[s]).length)for(var u,l,g=u[l-1],f=cm(g),h=g[1]/2+xv,d=Vv(h),I=Mv(h),p=0;p<l;++p,f=y,d=B,I=m,g=C){var C=u[p],y=cm(C),v=C[1]/2+xv,B=Vv(v),m=Mv(v),b=y-f,E=b>=0?1:-1,Q=E*b,F=Q>Rv,w=d*B;if(sm.add(_v(w*E*Vv(Q),I*m+w*Mv(Q))),a+=F?b+E*kv:b,F^f>=n^y>=n){var S=im(nm(g),nm(C));Am(S);var R=im(o,S);Am(R);var U=(F^b>=0?-1:1)*Hv(R[2]);(r>U||r===U&&(S[0]||S[1]))&&(A+=F^b>=0?1:-1)}}return(a<-1e-6||a<1e-6&&sm<-1e-6)^1&A}(o,r);a.length?(l||(i.polygonStart(),l=!0),$B(a,Im,t,n,i)):t&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(e,n){t(e,n)&&i.point(e,n)}function h(t,e){s.point(t,e)}function d(){g.point=h,s.lineStart()}function I(){g.point=f,s.lineEnd()}function p(t,e){A.push([t,e]),u.point(t,e)}function C(){u.lineStart(),A=[]}function y(){p(A[0][0],A[0][1]),u.lineEnd();var t,e,n,r,s=u.clean(),g=c.result(),f=g.length;if(A.pop(),o.push(A),A=null,f)if(1&s){if((e=(n=g[0]).length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else f>1&&2&s&&g.push(g.pop().concat(g.shift())),a.push(g.filter(dm))}return g}};function dm(t){return t.length>1}function Im(t,e){return((t=t.x)[0]<0?t[1]-Uv-1e-6:Uv-t[1])-((e=e.x)[0]<0?e[1]-Uv-1e-6:Uv-e[1])}var pm=hm((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var A=o>0?Rv:-Rv,s=Dv(o-n);Dv(s-Rv)<1e-6?(t.point(n,r=(r+a)/2>0?Uv:-Uv),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),t.point(o,r),e=0):i!==A&&s>=Rv&&(Dv(n-i)<1e-6&&(n-=1e-6*i),Dv(o-A)<1e-6&&(o-=1e-6*A),r=function(t,e,n,r){var i,o,a=Vv(t-n);return Dv(a)>1e-6?Gv((Vv(e)*(o=Mv(r))*Vv(n)-Vv(r)*(i=Mv(e))*Vv(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),e=0),t.point(n=o,r=a),i=A},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Uv,r.point(-Rv,i),r.point(0,i),r.point(Rv,i),r.point(Rv,0),r.point(Rv,-i),r.point(0,-i),r.point(-Rv,-i),r.point(-Rv,0),r.point(-Rv,i);else if(Dv(t[0]-e[0])>1e-6){var o=t[0]<e[0]?Rv:-Rv;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-Rv,-Uv]);var Cm=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function ym(t,e){return[Dv(t)>Rv?t+Math.round(-t/kv)*kv:t,e]}function vm(t,e,n){return(t%=kv)?e||n?Cm(mm(t),bm(e,n)):mm(t):e||n?bm(e,n):ym}function Bm(t){return function(e,n){return[(e+=t)>Rv?e-kv:e<-Rv?e+kv:e,n]}}function mm(t){var e=Bm(t);return e.invert=Bm(-t),e}function bm(t,e){var n=Mv(t),r=Vv(t),i=Mv(e),o=Vv(e);function a(t,e){var a=Mv(e),A=Mv(t)*a,s=Vv(t)*a,c=Vv(e),u=c*n+A*r;return[_v(s*i-u*o,A*n-c*r),Hv(u*i+s*o)]}return a.invert=function(t,e){var a=Mv(e),A=Mv(t)*a,s=Vv(t)*a,c=Vv(e),u=c*i-s*o;return[_v(s*i+c*o,A*n+u*r),Hv(u*n-A*r)]},a}ym.invert=ym;function Em(t,e,n,r,i,o){if(n){var a=Mv(e),A=Vv(e),s=r*n;null==i?(i=e+r*kv,o=e-s/2):(i=Qm(a,i),o=Qm(a,o),(r>0?i<o:i>o)&&(i+=r*kv));for(var c,u=i;r>0?u>o:u<o;u-=s)c=em([a,-A*Mv(u),-A*Vv(u)]),t.point(c[0],c[1])}}function Qm(t,e){(e=nm(e))[0]-=t,Am(e);var n=Jv(-e[1]);return((-e[2]<0?-n:n)+kv-1e-6)%kv}var Fm=function(t){var e=Mv(t),n=6*Nv,r=e>0,i=Dv(e)>1e-6;function o(t,n){return Mv(t)*Mv(n)>e}function a(t,n,r){var i=[1,0,0],o=im(nm(t),nm(n)),a=rm(o,o),A=o[0],s=a-A*A;if(!s)return!r&&t;var c=e*a/s,u=-e*A/s,l=im(i,o),g=am(i,c);om(g,am(o,u));var f=l,h=rm(g,f),d=rm(f,f),I=h*h-d*(rm(g,g)-1);if(!(I<0)){var p=Pv(I),C=am(f,(-h-p)/d);if(om(C,g),C=em(C),!r)return C;var y,v=t[0],B=n[0],m=t[1],b=n[1];B<v&&(y=v,v=B,B=y);var E=B-v,Q=Dv(E-Rv)<1e-6;if(!Q&&b<m&&(y=m,m=b,b=y),Q||E<1e-6?Q?m+b>0^C[1]<(Dv(C[0]-v)<1e-6?m:b):m<=C[1]&&C[1]<=b:E>Rv^(v<=C[0]&&C[0]<=B)){var F=am(f,(-h+p)/d);return om(F,g),[C,em(F)]}}}function A(e,n){var i=r?t:Rv-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return hm(o,(function(t){var e,n,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(l,g){var f,h=[l,g],d=o(l,g),I=r?d?0:A(l,g):d?A(l+(l<0?Rv:-Rv),g):0;if(!e&&(c=s=d)&&t.lineStart(),d!==s&&(!(f=a(e,h))||KB(e,f)||KB(h,f))&&(h[2]=1),d!==s)u=0,d?(t.lineStart(),f=a(h,e),t.point(f[0],f[1])):(f=a(e,h),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^d){var p;I&n||!(p=a(h,e,!0))||(u=0,r?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1],3)))}!d||e&&KB(e,h)||t.point(h[0],h[1]),e=h,s=d,n=I},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}}),(function(e,r,i,o){Em(o,t,n,i,e,r)}),r?[0,-t]:[-Rv,t-Rv])};function wm(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,A,c){var u=0,l=0;if(null==i||(u=a(i,A))!==(l=a(o,A))||s(i,o)<0^A>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+A+4)%4)!==l);else c.point(o[0],o[1])}function a(r,i){return Dv(r[0]-t)<1e-6?i>0?0:3:Dv(r[0]-n)<1e-6?i>0?2:1:Dv(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function A(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,c,u,l,g,f,h,d,I,p,C,y=a,v=zB(),B={point:m,lineStart:function(){B.point=b,c&&c.push(u=[]);p=!0,I=!1,h=d=NaN},lineEnd:function(){s&&(b(l,g),f&&I&&v.rejoin(),s.push(v.result()));B.point=m,I&&y.lineEnd()},polygonStart:function(){y=v,s=[],c=[],C=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,a,A=c[n],s=1,u=A.length,l=A[0],g=l[0],f=l[1];s<u;++s)o=g,a=f,l=A[s],g=l[0],f=l[1],a<=r?f>r&&(g-o)*(r-a)>(f-a)*(t-o)&&++e:f<=r&&(g-o)*(r-a)<(f-a)*(t-o)&&--e;return e}(),n=C&&e,i=(s=fm(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&$B(s,A,e,o,a),a.polygonEnd());y=a,s=c=u=null}};function m(t,e){i(t,e)&&y.point(t,e)}function b(o,a){var A=i(o,a);if(c&&u.push([o,a]),p)l=o,g=a,f=A,p=!1,A&&(y.lineStart(),y.point(o,a));else if(A&&I)y.point(o,a);else{var s=[h=Math.max(-1e9,Math.min(1e9,h)),d=Math.max(-1e9,Math.min(1e9,d))],v=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,i,o){var a,A=t[0],s=t[1],c=0,u=1,l=e[0]-A,g=e[1]-s;if(a=n-A,l||!(a>0)){if(a/=l,l<0){if(a<c)return;a<u&&(u=a)}else if(l>0){if(a>u)return;a>c&&(c=a)}if(a=i-A,l||!(a<0)){if(a/=l,l<0){if(a>u)return;a>c&&(c=a)}else if(l>0){if(a<c)return;a<u&&(u=a)}if(a=r-s,g||!(a>0)){if(a/=g,g<0){if(a<c)return;a<u&&(u=a)}else if(g>0){if(a>u)return;a>c&&(c=a)}if(a=o-s,g||!(a<0)){if(a/=g,g<0){if(a>u)return;a>c&&(c=a)}else if(g>0){if(a<c)return;a<u&&(u=a)}return c>0&&(t[0]=A+c*l,t[1]=s+c*g),u<1&&(e[0]=A+u*l,e[1]=s+u*g),!0}}}}}(s,v,t,e,n,r)?A&&(y.lineStart(),y.point(o,a),C=!1):(I||(y.lineStart(),y.point(s[0],s[1])),y.point(v[0],v[1]),A||y.lineEnd(),C=!1)}h=o,d=a,I=A}return B}}function Sm(t){return function(e){var n=new Rm;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Rm(){}function Um(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Ev(n,t.stream(dB)),e(dB.result()),null!=r&&t.clipExtent(r),t}function xm(t,e,n){return Um(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,A=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,A])}),n)}function km(t,e,n){return xm(t,[[0,0],e],n)}function Om(t,e,n){return Um(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Nm(t,e,n){return Um(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}Rm.prototype={constructor:Rm,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Dm=Mv(30*Nv),Gm=function(t,e){return+e?function(t,e){function n(r,i,o,a,A,s,c,u,l,g,f,h,d,I){var p=c-r,C=u-i,y=p*p+C*C;if(y>4*e&&d--){var v=a+g,B=A+f,m=s+h,b=Pv(v*v+B*B+m*m),E=Hv(m/=b),Q=Dv(Dv(m)-1)<1e-6||Dv(o-l)<1e-6?(o+l)/2:_v(B,v),F=t(Q,E),w=F[0],S=F[1],R=w-r,U=S-i,x=C*R-p*U;(x*x/y>e||Dv((p*R+C*U)/y-.5)>.3||a*g+A*f+s*h<Dm)&&(n(r,i,o,a,A,s,w,S,Q,v/=b,B/=b,m,d,I),I.point(w,S),n(w,S,Q,v,B,m,c,u,l,g,f,h,d,I))}}return function(e){var r,i,o,a,A,s,c,u,l,g,f,h,d={point:I,lineStart:p,lineEnd:y,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=p}};function I(n,r){n=t(n,r),e.point(n[0],n[1])}function p(){u=NaN,d.point=C,e.lineStart()}function C(r,i){var o=nm([r,i]),a=t(r,i);n(u,l,c,g,f,h,u=a[0],l=a[1],c=r,g=o[0],f=o[1],h=o[2],16,e),e.point(u,l)}function y(){d.point=I,e.lineEnd()}function v(){p(),d.point=B,d.lineEnd=m}function B(t,e){C(r=t,e),i=u,o=l,a=g,A=f,s=h,d.point=C}function m(){n(u,l,c,g,f,h,i,o,r,a,A,s,16,e),d.lineEnd=y,y()}return d}}(t,e):function(t){return Sm({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var _m=Sm({point:function(t,e){this.stream.point(t*Nv,e*Nv)}});function Mm(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}function Tm(t,e,n,r,i,o){var a=Mv(o),A=Vv(o),s=a*t,c=A*t,u=a/t,l=A/t,g=(A*n-a*e)/t,f=(A*e+a*n)/t;function h(t,o){return[s*(t*=r)-c*(o*=i)+e,n-c*t-s*o]}return h.invert=function(t,e){return[r*(u*t-l*e+g),i*(f-l*t-u*e)]},h}function jm(t){return Lm((function(){return t}))()}function Lm(t){var e,n,r,i,o,a,A,s,c,u,l=150,g=480,f=250,h=0,d=0,I=0,p=0,C=0,y=0,v=1,B=1,m=null,b=pm,E=null,Q=Cv,F=.5;function w(t){return s(t[0]*Nv,t[1]*Nv)}function S(t){return(t=s.invert(t[0],t[1]))&&[t[0]*Ov,t[1]*Ov]}function R(){var t=Tm(l,0,0,v,B,y).apply(null,e(h,d)),r=(y?Tm:Mm)(l,g-t[0],f-t[1],v,B,y);return n=vm(I,p,C),A=Cm(e,r),s=Cm(n,A),a=Gm(A,F),U()}function U(){return c=u=null,w}return w.stream=function(t){return c&&u===t?c:c=_m(function(t){return Sm({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(b(a(Q(u=t)))))},w.preclip=function(t){return arguments.length?(b=t,m=void 0,U()):b},w.postclip=function(t){return arguments.length?(Q=t,E=r=i=o=null,U()):Q},w.clipAngle=function(t){return arguments.length?(b=+t?Fm(m=t*Nv):(m=null,pm),U()):m*Ov},w.clipExtent=function(t){return arguments.length?(Q=null==t?(E=r=i=o=null,Cv):wm(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),U()):null==E?null:[[E,r],[i,o]]},w.scale=function(t){return arguments.length?(l=+t,R()):l},w.translate=function(t){return arguments.length?(g=+t[0],f=+t[1],R()):[g,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Nv,d=t[1]%360*Nv,R()):[h*Ov,d*Ov]},w.rotate=function(t){return arguments.length?(I=t[0]%360*Nv,p=t[1]%360*Nv,C=t.length>2?t[2]%360*Nv:0,R()):[I*Ov,p*Ov,C*Ov]},w.angle=function(t){return arguments.length?(y=t%360*Nv,R()):y*Ov},w.reflectX=function(t){return arguments.length?(v=t?-1:1,R()):v<0},w.reflectY=function(t){return arguments.length?(B=t?-1:1,R()):B<0},w.precision=function(t){return arguments.length?(a=Gm(A,F=t*t),U()):Pv(F)},w.fitExtent=function(t,e){return xm(w,t,e)},w.fitSize=function(t,e){return km(w,t,e)},w.fitWidth=function(t,e){return Om(w,t,e)},w.fitHeight=function(t,e){return Nm(w,t,e)},function(){return e=t.apply(this,arguments),w.invert=e.invert&&S,R()}}function Vm(t){var e=0,n=Rv/3,r=Lm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Nv,n=t[1]*Nv):[e*Ov,n*Ov]},i}function Zm(t,e){var n=Vv(t),r=(n+Vv(e))/2;if(Dv(r)<1e-6)return function(t){var e=Mv(t);function n(t,n){return[t*e,Vv(n)/e]}return n.invert=function(t,n){return[t/e,Hv(n*e)]},n}(t);var i=1+n*(2*r-n),o=Pv(i)/r;function a(t,e){var n=Pv(i-2*r*Vv(e))/r;return[n*Vv(t*=r),o-n*Mv(t)]}return a.invert=function(t,e){var n=o-e,a=_v(t,Dv(n))*Zv(n);return n*r<0&&(a-=Rv*Zv(t)*Zv(n)),[a/r,Hv((i-(t*t+n*n)*r*r)/(2*r))]},a}var Pm=function(){return Vm(Zm).scale(155.424).center([0,33.6442])},Wm=function(){return Pm().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function Jm(t){return function(e,n){var r=Mv(e),i=Mv(n),o=t(r*i);return[o*i*Vv(e),o*Vv(n)]}}function Hm(t){return function(e,n){var r=Pv(e*e+n*n),i=t(r),o=Vv(i),a=Mv(i);return[_v(e*o,r*a),Hv(r&&n*o/r)]}}var Ym=Jm((function(t){return Pv(2/(1+t))}));Ym.invert=Hm((function(t){return 2*Hv(t/2)}));var Xm=Jm((function(t){return(t=Jv(t))&&t/Vv(t)}));Xm.invert=Hm((function(t){return t}));function zm(t,e){return[t,jv(Wv((Uv+e)/2))]}zm.invert=function(t,e){return[t,2*Gv(Tv(e))-Uv]};function Km(t){var e,n,r,i=jm(t),o=i.center,a=i.scale,A=i.translate,s=i.clipExtent,c=null;function u(){var o=Rv*a(),A=i(function(t){function e(e){return(e=t(e[0]*Nv,e[1]*Nv))[0]*=Ov,e[1]*=Ov,e}return t=vm(t[0]*Nv,t[1]*Nv,t.length>2?t[2]*Nv:0),e.invert=function(e){return(e=t.invert(e[0]*Nv,e[1]*Nv))[0]*=Ov,e[1]*=Ov,e},e}(i.rotate()).invert([0,0]));return s(null==c?[[A[0]-o,A[1]-o],[A[0]+o,A[1]+o]]:t===zm?[[Math.max(A[0]-o,c),e],[Math.min(A[0]+o,n),r]]:[[c,Math.max(A[1]-o,e)],[n,Math.min(A[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(A(t),u()):A()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=n=r=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==c?null:[[c,e],[n,r]]},u()}function qm(t){return Wv((Uv+t)/2)}function $m(t,e){var n=Mv(t),r=t===e?Vv(t):jv(n/Mv(e))/jv(qm(e)/qm(t)),i=n*Lv(qm(t),r)/r;if(!r)return zm;function o(t,e){i>0?e<1e-6-Uv&&(e=1e-6-Uv):e>Uv-1e-6&&(e=Uv-1e-6);var n=i/Lv(qm(e),r);return[n*Vv(r*t),i-n*Mv(r*t)]}return o.invert=function(t,e){var n=i-e,o=Zv(r)*Pv(t*t+n*n),a=_v(t,Dv(n))*Zv(n);return n*r<0&&(a-=Rv*Zv(t)*Zv(n)),[a/r,2*Gv(Lv(i/o,1/r))-Uv]},o}function tb(t,e){return[t,e]}tb.invert=tb;function eb(t,e){var n=Mv(t),r=t===e?Vv(t):(n-Mv(e))/(e-t),i=n/r+t;if(Dv(r)<1e-6)return tb;function o(t,e){var n=i-e,o=r*t;return[n*Vv(o),i-n*Mv(o)]}return o.invert=function(t,e){var n=i-e,o=_v(t,Dv(n))*Zv(n);return n*r<0&&(o-=Rv*Zv(t)*Zv(n)),[o/r,i-Zv(r)*Pv(t*t+n*n)]},o}var nb=1.340264,rb=-.081106,ib=893e-6,ob=.003796,ab=Pv(3)/2;function Ab(t,e){var n=Hv(ab*Vv(e)),r=n*n,i=r*r*r;return[t*Mv(n)/(ab*(nb+3*rb*r+i*(7*ib+9*ob*r))),n*(nb+rb*r+i*(ib+ob*r))]}Ab.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(nb+rb*i+o*(ib+ob*i))-e)/(nb+3*rb*i+o*(7*ib+9*ob*i)))*r)*i*i,!(Dv(n)<1e-12));++a);return[ab*t*(nb+3*rb*i+o*(7*ib+9*ob*i))/Mv(r),Hv(Vv(r)/ab)]};function sb(t,e){var n=Mv(e),r=Mv(t)*n;return[n*Vv(t)/r,Vv(e)/r]}sb.invert=Hm(Gv);function cb(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}cb.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Dv(n)>1e-6&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function ub(t,e){return[Mv(e)*Vv(t),Vv(e)]}ub.invert=Hm(Hv);function lb(t,e){var n=Mv(e),r=1+Mv(t)*n;return[n*Vv(t)/r,Vv(e)/r]}lb.invert=Hm((function(t){return 2*Gv(t)}));function gb(t,e){return[jv(Wv((Uv+e)/2)),-t]}gb.invert=function(t,e){return[-e,2*Gv(Tv(t))-Uv]};function fb(){}var hb=function(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:fb,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},db=Math.PI,Ib=db/2,pb=db/4,Cb=2*db,yb=180/db,vb=db/180,Bb=Math.abs,mb=Math.atan,bb=Math.atan2,Eb=Math.cos,Qb=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),Fb=Math.sign||function(t){return t>0?1:t<0?-1:0},wb=Math.sqrt;Math.tan;function Sb(t){return t>1?Ib:t<-1?-Ib:Math.asin(t)}var Rb=function(t,e){return Bb(t[0]-e[0])<1e-6&&Bb(t[1]-e[1])<1e-6};function Ub(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var xb=function(t,e,n,r,i){var o,a,A=[],s=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Rb(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}A.push(n=new Ub(r,t,null,!0)),s.push(n.o=new Ub(r,null,n,!1)),A.push(n=new Ub(a,t,null,!1)),s.push(n.o=new Ub(a,null,n,!0))}})),A.length){for(s.sort(e),kb(A),kb(s),o=0,a=s.length;o<a;++o)s[o].e=n=!n;for(var c,u,l=A[0];;){for(var g=l,f=!0;g.v;)if((g=g.n)===l)return;c=g.z,i.lineStart();do{if(g.v=g.o.v=!0,g.e){if(f)for(o=0,a=c.length;o<a;++o)i.point((u=c[o])[0],u[1]);else r(g.x,g.n.x,1,i);g=g.n}else{if(f)for(c=g.p.z,o=c.length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(g.x,g.p.x,-1,i);g=g.p}c=(g=g.o).z,f=!f}while(!g.v);i.lineEnd()}}};function kb(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Ob(){this.reset()}Ob.prototype={constructor:Ob,reset:function(){this.s=this.t=0},add:function(t){Db(Nb,t,this.t),Db(this,Nb.s,this.s),this.s?this.t+=Nb.t:this.s=Nb.t},valueOf:function(){return this.s}};var Nb=new Ob;function Db(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Gb(t){return[bb(t[1],t[0]),Sb(t[2])]}function _b(t){var e=t[0],n=t[1],r=Eb(n);return[r*Eb(e),r*Qb(e),Qb(n)]}function Mb(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Tb(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function jb(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Lb(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vb(t){var e=wb(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Zb=new Ob;function Pb(t){return Bb(t[0])<=db?t[0]:Fb(t[0])*((Bb(t[0])+db)%Cb-db)}var Wb=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var Jb=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Wb(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}(Wb);Jb.right,Jb.left;var Hb=Array.prototype;Hb.slice,Hb.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var Yb=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var Xb=function(t,e,n,r){return function(i){var o,a,A,s=e(i),c=hb(),u=e(c),l=!1,g={point:f,lineStart:d,lineEnd:I,polygonStart:function(){g.point=p,g.lineStart=C,g.lineEnd=y,a=[],o=[]},polygonEnd:function(){g.point=f,g.lineStart=d,g.lineEnd=I,a=Yb(a);var t=function(t,e){var n=Pb(e),r=e[1],i=Qb(r),o=[Qb(n),-Eb(n),0],a=0,A=0;Zb.reset(),1===i?r=Ib+1e-6:-1===i&&(r=-Ib-1e-6);for(var s=0,c=t.length;s<c;++s)if(l=(u=t[s]).length)for(var u,l,g=u[l-1],f=Pb(g),h=g[1]/2+pb,d=Qb(h),I=Eb(h),p=0;p<l;++p,f=y,d=B,I=m,g=C){var C=u[p],y=Pb(C),v=C[1]/2+pb,B=Qb(v),m=Eb(v),b=y-f,E=b>=0?1:-1,Q=E*b,F=Q>db,w=d*B;if(Zb.add(bb(w*E*Qb(Q),I*m+w*Eb(Q))),a+=F?b+E*Cb:b,F^f>=n^y>=n){var S=Tb(_b(g),_b(C));Vb(S);var R=Tb(o,S);Vb(R);var U=(F^b>=0?-1:1)*Sb(R[2]);(r>U||r===U&&(S[0]||S[1]))&&(A+=F^b>=0?1:-1)}}return(a<-1e-6||a<1e-6&&Zb<-1e-6)^1&A}(o,r);a.length?(l||(i.polygonStart(),l=!0),xb(a,Kb,t,n,i)):t&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(e,n){t(e,n)&&i.point(e,n)}function h(t,e){s.point(t,e)}function d(){g.point=h,s.lineStart()}function I(){g.point=f,s.lineEnd()}function p(t,e){A.push([t,e]),u.point(t,e)}function C(){u.lineStart(),A=[]}function y(){p(A[0][0],A[0][1]),u.lineEnd();var t,e,n,r,s=u.clean(),g=c.result(),f=g.length;if(A.pop(),o.push(A),A=null,f)if(1&s){if((e=(n=g[0]).length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else f>1&&2&s&&g.push(g.pop().concat(g.shift())),a.push(g.filter(zb))}return g}};function zb(t){return t.length>1}function Kb(t,e){return((t=t.x)[0]<0?t[1]-Ib-1e-6:Ib-t[1])-((e=e.x)[0]<0?e[1]-Ib-1e-6:Ib-e[1])}var qb=Xb((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var A=o>0?db:-db,s=Bb(o-n);Bb(s-db)<1e-6?(t.point(n,r=(r+a)/2>0?Ib:-Ib),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),t.point(o,r),e=0):i!==A&&s>=db&&(Bb(n-i)<1e-6&&(n-=1e-6*i),Bb(o-A)<1e-6&&(o-=1e-6*A),r=function(t,e,n,r){var i,o,a=Qb(t-n);return Bb(a)>1e-6?mb((Qb(e)*(o=Eb(r))*Qb(n)-Qb(r)*(i=Eb(e))*Qb(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),e=0),t.point(n=o,r=a),i=A},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Ib,r.point(-db,i),r.point(0,i),r.point(db,i),r.point(db,0),r.point(db,-i),r.point(0,-i),r.point(-db,-i),r.point(-db,0),r.point(-db,i);else if(Bb(t[0]-e[0])>1e-6){var o=t[0]<e[0]?db:-db;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-db,-Ib]);var $b=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function tE(t,e){return[Bb(t)>db?t+Math.round(-t/Cb)*Cb:t,e]}function eE(t,e,n){return(t%=Cb)?e||n?$b(rE(t),iE(e,n)):rE(t):e||n?iE(e,n):tE}function nE(t){return function(e,n){return[(e+=t)>db?e-Cb:e<-db?e+Cb:e,n]}}function rE(t){var e=nE(t);return e.invert=nE(-t),e}function iE(t,e){var n=Eb(t),r=Qb(t),i=Eb(e),o=Qb(e);function a(t,e){var a=Eb(e),A=Eb(t)*a,s=Qb(t)*a,c=Qb(e),u=c*n+A*r;return[bb(s*i-u*o,A*n-c*r),Sb(u*i+s*o)]}return a.invert=function(t,e){var a=Eb(e),A=Eb(t)*a,s=Qb(t)*a,c=Qb(e),u=c*i-s*o;return[bb(s*i+c*o,A*n+u*r),Sb(u*n-A*r)]},a}tE.invert=tE;function oE(t,e,n,r,i,o){if(n){var a=Eb(e),A=Qb(e),s=r*n;null==i?(i=e+r*Cb,o=e-s/2):(i=aE(a,i),o=aE(a,o),(r>0?i<o:i>o)&&(i+=r*Cb));for(var c,u=i;r>0?u>o:u<o;u-=s)c=Gb([a,-A*Eb(u),-A*Qb(u)]),t.point(c[0],c[1])}}function aE(t,e){(e=_b(e))[0]-=t,Vb(e);var n,r=(n=-e[1])>1?0:n<-1?db:Math.acos(n);return((-e[2]<0?-r:r)+Cb-1e-6)%Cb}var AE=function(t){var e=Eb(t),n=6*vb,r=e>0,i=Bb(e)>1e-6;function o(t,n){return Eb(t)*Eb(n)>e}function a(t,n,r){var i=[1,0,0],o=Tb(_b(t),_b(n)),a=Mb(o,o),A=o[0],s=a-A*A;if(!s)return!r&&t;var c=e*a/s,u=-e*A/s,l=Tb(i,o),g=Lb(i,c);jb(g,Lb(o,u));var f=l,h=Mb(g,f),d=Mb(f,f),I=h*h-d*(Mb(g,g)-1);if(!(I<0)){var p=wb(I),C=Lb(f,(-h-p)/d);if(jb(C,g),C=Gb(C),!r)return C;var y,v=t[0],B=n[0],m=t[1],b=n[1];B<v&&(y=v,v=B,B=y);var E=B-v,Q=Bb(E-db)<1e-6;if(!Q&&b<m&&(y=m,m=b,b=y),Q||E<1e-6?Q?m+b>0^C[1]<(Bb(C[0]-v)<1e-6?m:b):m<=C[1]&&C[1]<=b:E>db^(v<=C[0]&&C[0]<=B)){var F=Lb(f,(-h+p)/d);return jb(F,g),[C,Gb(F)]}}}function A(e,n){var i=r?t:db-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Xb(o,(function(t){var e,n,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(l,g){var f,h=[l,g],d=o(l,g),I=r?d?0:A(l,g):d?A(l+(l<0?db:-db),g):0;if(!e&&(c=s=d)&&t.lineStart(),d!==s&&(!(f=a(e,h))||Rb(e,f)||Rb(h,f))&&(h[2]=1),d!==s)u=0,d?(t.lineStart(),f=a(h,e),t.point(f[0],f[1])):(f=a(e,h),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^d){var p;I&n||!(p=a(h,e,!0))||(u=0,r?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1],3)))}!d||e&&Rb(e,h)||t.point(h[0],h[1]),e=h,s=d,n=I},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}}),(function(e,r,i,o){oE(o,t,n,i,e,r)}),r?[0,-t]:[-db,t-db])};function sE(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,A,c){var u=0,l=0;if(null==i||(u=a(i,A))!==(l=a(o,A))||s(i,o)<0^A>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+A+4)%4)!==l);else c.point(o[0],o[1])}function a(r,i){return Bb(r[0]-t)<1e-6?i>0?0:3:Bb(r[0]-n)<1e-6?i>0?2:1:Bb(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function A(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,c,u,l,g,f,h,d,I,p,C,y=a,v=hb(),B={point:m,lineStart:function(){B.point=b,c&&c.push(u=[]);p=!0,I=!1,h=d=NaN},lineEnd:function(){s&&(b(l,g),f&&I&&v.rejoin(),s.push(v.result()));B.point=m,I&&y.lineEnd()},polygonStart:function(){y=v,s=[],c=[],C=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,a,A=c[n],s=1,u=A.length,l=A[0],g=l[0],f=l[1];s<u;++s)o=g,a=f,l=A[s],g=l[0],f=l[1],a<=r?f>r&&(g-o)*(r-a)>(f-a)*(t-o)&&++e:f<=r&&(g-o)*(r-a)<(f-a)*(t-o)&&--e;return e}(),n=C&&e,i=(s=Yb(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&xb(s,A,e,o,a),a.polygonEnd());y=a,s=c=u=null}};function m(t,e){i(t,e)&&y.point(t,e)}function b(o,a){var A=i(o,a);if(c&&u.push([o,a]),p)l=o,g=a,f=A,p=!1,A&&(y.lineStart(),y.point(o,a));else if(A&&I)y.point(o,a);else{var s=[h=Math.max(-1e9,Math.min(1e9,h)),d=Math.max(-1e9,Math.min(1e9,d))],v=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,i,o){var a,A=t[0],s=t[1],c=0,u=1,l=e[0]-A,g=e[1]-s;if(a=n-A,l||!(a>0)){if(a/=l,l<0){if(a<c)return;a<u&&(u=a)}else if(l>0){if(a>u)return;a>c&&(c=a)}if(a=i-A,l||!(a<0)){if(a/=l,l<0){if(a>u)return;a>c&&(c=a)}else if(l>0){if(a<c)return;a<u&&(u=a)}if(a=r-s,g||!(a>0)){if(a/=g,g<0){if(a<c)return;a<u&&(u=a)}else if(g>0){if(a>u)return;a>c&&(c=a)}if(a=o-s,g||!(a<0)){if(a/=g,g<0){if(a>u)return;a>c&&(c=a)}else if(g>0){if(a<c)return;a<u&&(u=a)}return c>0&&(t[0]=A+c*l,t[1]=s+c*g),u<1&&(e[0]=A+u*l,e[1]=s+u*g),!0}}}}}(s,v,t,e,n,r)?A&&(y.lineStart(),y.point(o,a),C=!1):(I||(y.lineStart(),y.point(s[0],s[1])),y.point(v[0],v[1]),A||y.lineEnd(),C=!1)}h=o,d=a,I=A}return B}}var cE=function(t){return t};function uE(t){return function(e){var n=new lE;for(var r in t)n[r]=t[r];return n.stream=e,n}}function lE(){}function gE(t,e){t&&hE.hasOwnProperty(t.type)&&hE[t.type](t,e)}lE.prototype={constructor:lE,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var fE={Feature:function(t,e){gE(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)gE(n[r].geometry,e)}},hE={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){dE(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dE(n[r],e,0)},Polygon:function(t,e){IE(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)IE(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)gE(n[r],e)}};function dE(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function IE(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)dE(t[n],e,1);e.polygonEnd()}var pE=1/0,CE=pE,yE=-pE,vE=yE;var BE={point:function(t,e){t<pE&&(pE=t);t>yE&&(yE=t);e<CE&&(CE=e);e>vE&&(vE=e)},lineStart:fb,lineEnd:fb,polygonStart:fb,polygonEnd:fb,result:function(){var t=[[pE,CE],[yE,vE]];return yE=vE=-(CE=pE=1/0),t}};function mE(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&fE.hasOwnProperty(t.type)?fE[t.type](t,e):gE(t,e)}(n,t.stream(BE)),e(BE.result()),null!=r&&t.clipExtent(r),t}function bE(t,e,n){return mE(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,A=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,A])}),n)}var EE=Eb(30*vb),QE=function(t,e){return+e?function(t,e){function n(r,i,o,a,A,s,c,u,l,g,f,h,d,I){var p=c-r,C=u-i,y=p*p+C*C;if(y>4*e&&d--){var v=a+g,B=A+f,m=s+h,b=wb(v*v+B*B+m*m),E=Sb(m/=b),Q=Bb(Bb(m)-1)<1e-6||Bb(o-l)<1e-6?(o+l)/2:bb(B,v),F=t(Q,E),w=F[0],S=F[1],R=w-r,U=S-i,x=C*R-p*U;(x*x/y>e||Bb((p*R+C*U)/y-.5)>.3||a*g+A*f+s*h<EE)&&(n(r,i,o,a,A,s,w,S,Q,v/=b,B/=b,m,d,I),I.point(w,S),n(w,S,Q,v,B,m,c,u,l,g,f,h,d,I))}}return function(e){var r,i,o,a,A,s,c,u,l,g,f,h,d={point:I,lineStart:p,lineEnd:y,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=p}};function I(n,r){n=t(n,r),e.point(n[0],n[1])}function p(){u=NaN,d.point=C,e.lineStart()}function C(r,i){var o=_b([r,i]),a=t(r,i);n(u,l,c,g,f,h,u=a[0],l=a[1],c=r,g=o[0],f=o[1],h=o[2],16,e),e.point(u,l)}function y(){d.point=I,e.lineEnd()}function v(){p(),d.point=B,d.lineEnd=m}function B(t,e){C(r=t,e),i=u,o=l,a=g,A=f,s=h,d.point=C}function m(){n(u,l,c,g,f,h,i,o,r,a,A,s,16,e),d.lineEnd=y,y()}return d}}(t,e):function(t){return uE({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var FE=uE({point:function(t,e){this.stream.point(t*vb,e*vb)}});function wE(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}function SE(t,e,n,r,i,o){var a=Eb(o),A=Qb(o),s=a*t,c=A*t,u=a/t,l=A/t,g=(A*n-a*e)/t,f=(A*e+a*n)/t;function h(t,o){return[s*(t*=r)-c*(o*=i)+e,n-c*t-s*o]}return h.invert=function(t,e){return[r*(u*t-l*e+g),i*(f-l*t-u*e)]},h}function RE(t){return function(t){var e,n,r,i,o,a,A,s,c,u,l=150,g=480,f=250,h=0,d=0,I=0,p=0,C=0,y=0,v=1,B=1,m=null,b=qb,E=null,Q=cE,F=.5;function w(t){return s(t[0]*vb,t[1]*vb)}function S(t){return(t=s.invert(t[0],t[1]))&&[t[0]*yb,t[1]*yb]}function R(){var t=SE(l,0,0,v,B,y).apply(null,e(h,d)),r=(y?SE:wE)(l,g-t[0],f-t[1],v,B,y);return n=eE(I,p,C),A=$b(e,r),s=$b(n,A),a=QE(A,F),U()}function U(){return c=u=null,w}return w.stream=function(t){return c&&u===t?c:c=FE(function(t){return uE({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(b(a(Q(u=t)))))},w.preclip=function(t){return arguments.length?(b=t,m=void 0,U()):b},w.postclip=function(t){return arguments.length?(Q=t,E=r=i=o=null,U()):Q},w.clipAngle=function(t){return arguments.length?(b=+t?AE(m=t*vb):(m=null,qb),U()):m*yb},w.clipExtent=function(t){return arguments.length?(Q=null==t?(E=r=i=o=null,cE):sE(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),U()):null==E?null:[[E,r],[i,o]]},w.scale=function(t){return arguments.length?(l=+t,R()):l},w.translate=function(t){return arguments.length?(g=+t[0],f=+t[1],R()):[g,f]},w.center=function(t){return arguments.length?(h=t[0]%360*vb,d=t[1]%360*vb,R()):[h*yb,d*yb]},w.rotate=function(t){return arguments.length?(I=t[0]%360*vb,p=t[1]%360*vb,C=t.length>2?t[2]%360*vb:0,R()):[I*yb,p*yb,C*yb]},w.angle=function(t){return arguments.length?(y=t%360*vb,R()):y*yb},w.reflectX=function(t){return arguments.length?(v=t?-1:1,R()):v<0},w.reflectY=function(t){return arguments.length?(B=t?-1:1,R()):B<0},w.precision=function(t){return arguments.length?(a=QE(A,F=t*t),U()):wb(F)},w.fitExtent=function(t,e){return bE(w,t,e)},w.fitSize=function(t,e){return function(t,e,n){return bE(t,[[0,0],e],n)}(w,t,e)},w.fitWidth=function(t,e){return function(t,e,n){return mE(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}(w,t,e)},w.fitHeight=function(t,e){return function(t,e,n){return mE(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}(w,t,e)},function(){return e=t.apply(this,arguments),w.invert=e.invert&&S,R()}}((function(){return t}))()}var UE=Math.abs,xE=(Math.atan,Math.atan2,Math.ceil,Math.cos),kE=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),OE=(Math.tan,Math.PI),NE=OE/2,DE=(Math.SQRT1_2,_E(2));_E(OE);function GE(t){return t>1?NE:t<-1?-NE:Math.asin(t)}function _E(t){return t>0?Math.sqrt(t):0}function ME(t,e){var n,r=t*kE(e),i=30;do{e-=n=(e+kE(e)-r)/(1+xE(e))}while(UE(n)>1e-6&&--i>0);return e/2}var TE=function(t,e,n){function r(r,i){return[t*r*xE(i=ME(n,i)),e*kE(i)]}return r.invert=function(r,i){return i=GE(i/e),[r/(t*xE(i)),GE((2*i+kE(2*i))/n)]},r}(DE/NE,DE,OE),jE=XB(),LE=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function VE(t,e){return function n(){var r=e();return r.type=t,r.path=XB().projection(r),r.copy=r.copy||function(){var t=n();return LE.forEach((function(e){r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},r}}function ZE(t,e){if(!t||"string"!==typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(WE[t]=VE(t,e),this):WE[t]||null}function PE(t){return t&&t.path||jE}var WE={albers:Wm,albersusa:function(){var t,e,n,r,i,o,a=Wm(),A=Pm().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Pm().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function l(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?A:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},u.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),A.stream(n),s.stream(n)])},u.precision=function(t){return arguments.length?(a.precision(t),A.precision(t),s.precision(t),l()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),A.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(c),r=A.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+1e-6,u+.12*e+1e-6],[o-.214*e-1e-6,u+.234*e-1e-6]]).stream(c),i=s.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+1e-6,u+.166*e+1e-6],[o-.115*e-1e-6,u+.234*e-1e-6]]).stream(c),l()},u.fitExtent=function(t,e){return xm(u,t,e)},u.fitSize=function(t,e){return km(u,t,e)},u.fitWidth=function(t,e){return Om(u,t,e)},u.fitHeight=function(t,e){return Nm(u,t,e)},u.scale(1070)},azimuthalequalarea:function(){return jm(Ym).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return jm(Xm).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Vm($m).scale(109.5).parallels([30,30])},conicequalarea:Pm,conicequidistant:function(){return Vm(eb).scale(131.154).center([0,13.9389])},equalEarth:function(){return jm(Ab).scale(177.158)},equirectangular:function(){return jm(tb).scale(152.63)},gnomonic:function(){return jm(sb).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a,A=1,s=0,c=0,u=1,l=1,g=0,f=null,h=1,d=1,I=Sm({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),p=Cv;function C(){return h=A*u,d=A*l,o=a=null,y}function y(n){var r=n[0]*h,i=n[1]*d;if(g){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+s,i+c]}return y.invert=function(n){var r=n[0]-s,i=n[1]-c;if(g){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/h,i/d]},y.stream=function(t){return o&&a===t?o:o=I(p(a=t))},y.postclip=function(t){return arguments.length?(p=t,f=n=r=i=null,C()):p},y.clipExtent=function(t){return arguments.length?(p=null==t?(f=n=r=i=null,Cv):wm(f=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),C()):null==f?null:[[f,n],[r,i]]},y.scale=function(t){return arguments.length?(A=+t,C()):A},y.translate=function(t){return arguments.length?(s=+t[0],c=+t[1],C()):[s,c]},y.angle=function(n){return arguments.length?(e=Vv(g=n%360*Nv),t=Mv(g),C()):g*Ov},y.reflectX=function(t){return arguments.length?(u=t?-1:1,C()):u<0},y.reflectY=function(t){return arguments.length?(l=t?-1:1,C()):l<0},y.fitExtent=function(t,e){return xm(y,t,e)},y.fitSize=function(t,e){return km(y,t,e)},y.fitWidth=function(t,e){return Om(y,t,e)},y.fitHeight=function(t,e){return Nm(y,t,e)},y},mercator:function(){return Km(zm).scale(961/kv)},mollweide:function(){return RE(TE).scale(169.529)},naturalEarth1:function(){return jm(cb).scale(175.295)},orthographic:function(){return jm(ub).scale(249.5).clipAngle(90.000001)},stereographic:function(){return jm(lb).scale(250).clipAngle(142)},transversemercator:function(){var t=Km(gb),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(var JE in WE)ZE(JE,WE[JE]);function HE(t){ha.call(this,null,t)}function YE(t){ha.call(this,null,t)}function XE(t){ha.call(this,null,t)}HE.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(x.y)(HE,ha).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||x.x,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=PE(t.projection),n.materialize().reflow()):a=i===x.x||e.modified(i.fields)?n.ADD_MOD:n.ADD;var A=function(t,e){var n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,(function(t){t[o]=r(i(t))})),r.pointRadius(A),n.modifies(o)},YE.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(x.y)(YE,ha).transform=function(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],A=a[0],s=a[1];function c(t){var e=r([i(t),o(t)]);e?(t[A]=e[0],t[s]=e[1]):(t[A]=void 0,t[s]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,c)),e.modifies(a)},XE.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(x.y)(XE,ha).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){var r=null==n?function(n){return t(e(n))}:function(r){var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=function(e){return t.context(e),r},r}(PE(t.projection),t.field||Object(x.t)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(function(t){t[i]=r})),n.modifies(i)};var zE=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var KE=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return zE(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}(zE);KE.right,KE.left;var qE=Array.prototype,$E=(qE.slice,qE.map,function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o});Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);Math.PI;var tQ=Math.abs,eQ=(Math.atan,Math.atan2,Math.cos,Math.ceil);Math.exp,Math.floor,Math.log,Math.pow,Math.sin,Math.sign,Math.sqrt,Math.tan;function nQ(t,e,n){var r=$E(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function rQ(t,e,n){var r=$E(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function iQ(){var t,e,n,r,i,o,a,A,s,c,u,l,g=10,f=g,h=90,d=360,I=2.5;function p(){return{type:"MultiLineString",coordinates:C()}}function C(){return $E(eQ(r/h)*h,n,h).map(u).concat($E(eQ(A/d)*d,a,d).map(l)).concat($E(eQ(e/g)*g,t,g).filter((function(t){return tQ(t%h)>1e-6})).map(s)).concat($E(eQ(o/f)*f,i,f).filter((function(t){return tQ(t%d)>1e-6})).map(c))}return p.lines=function(){return C().map((function(t){return{type:"LineString",coordinates:t}}))},p.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(l(a).slice(1),u(n).reverse().slice(1),l(A).reverse().slice(1))]}},p.extent=function(t){return arguments.length?p.extentMajor(t).extentMinor(t):p.extentMinor()},p.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],A=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),A>a&&(t=A,A=a,a=t),p.precision(I)):[[r,A],[n,a]]},p.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),p.precision(I)):[[e,o],[t,i]]},p.step=function(t){return arguments.length?p.stepMajor(t).stepMinor(t):p.stepMinor()},p.stepMajor=function(t){return arguments.length?(h=+t[0],d=+t[1],p):[h,d]},p.stepMinor=function(t){return arguments.length?(g=+t[0],f=+t[1],p):[g,f]},p.precision=function(g){return arguments.length?(I=+g,s=nQ(o,i,90),c=rQ(e,t,I),u=nQ(A,a,90),l=rQ(r,n,I),p):I},p.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function oQ(t){ha.call(this,[],t),this.generator=iQ()}oQ.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(x.y)(oQ,ha).transform=function(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(var o in t)Object(x.D)(i[o])&&i[o](t[o]);return n=i(),r.length?e.mod.push(Dt(r[0],n)):e.add.push(kt(n)),r[0]=n,e};var aQ=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function AQ(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function sQ(){}var cQ="\\s*([+-]?\\d+)\\s*",uQ="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lQ="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gQ=/^#([0-9a-f]{3,8})$/,fQ=new RegExp("^rgb\\("+[cQ,cQ,cQ]+"\\)$"),hQ=new RegExp("^rgb\\("+[lQ,lQ,lQ]+"\\)$"),dQ=new RegExp("^rgba\\("+[cQ,cQ,cQ,uQ]+"\\)$"),IQ=new RegExp("^rgba\\("+[lQ,lQ,lQ,uQ]+"\\)$"),pQ=new RegExp("^hsl\\("+[uQ,lQ,lQ]+"\\)$"),CQ=new RegExp("^hsla\\("+[uQ,lQ,lQ,uQ]+"\\)$"),yQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function vQ(){return this.rgb().formatHex()}function BQ(){return this.rgb().formatRgb()}function mQ(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gQ.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?bQ(e):3===n?new wQ(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?EQ(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?EQ(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=fQ.exec(t))?new wQ(e[1],e[2],e[3],1):(e=hQ.exec(t))?new wQ(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=dQ.exec(t))?EQ(e[1],e[2],e[3],e[4]):(e=IQ.exec(t))?EQ(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=pQ.exec(t))?xQ(e[1],e[2]/100,e[3]/100,1):(e=CQ.exec(t))?xQ(e[1],e[2]/100,e[3]/100,e[4]):yQ.hasOwnProperty(t)?bQ(yQ[t]):"transparent"===t?new wQ(NaN,NaN,NaN,0):null}function bQ(t){return new wQ(t>>16&255,t>>8&255,255&t,1)}function EQ(t,e,n,r){return r<=0&&(t=e=n=NaN),new wQ(t,e,n,r)}function QQ(t){return t instanceof sQ||(t=mQ(t)),t?new wQ((t=t.rgb()).r,t.g,t.b,t.opacity):new wQ}function FQ(t,e,n,r){return 1===arguments.length?QQ(t):new wQ(t,e,n,null==r?1:r)}function wQ(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function SQ(){return"#"+UQ(this.r)+UQ(this.g)+UQ(this.b)}function RQ(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function UQ(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new OQ(t,e,n,r)}function kQ(t){if(t instanceof OQ)return new OQ(t.h,t.s,t.l,t.opacity);if(t instanceof sQ||(t=mQ(t)),!t)return new OQ;if(t instanceof OQ)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,A=o-i,s=(o+i)/2;return A?(a=e===o?(n-r)/A+6*(n<r):n===o?(r-e)/A+2:(e-n)/A+4,A/=s<.5?o+i:2-o-i,a*=60):A=s>0&&s<1?0:a,new OQ(a,A,s,t.opacity)}function OQ(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function NQ(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function DQ(t){ha.call(this,null,t)}function GQ(t){if(!Object(x.D)(t))return!1;var e=Object(x.db)(Object(x.g)(t));return e.$x||e.$y||e.$value||e.$max}function _Q(t){ha.call(this,null,t),this.modified(!0)}function MQ(t,e,n){Object(x.D)(t[e])&&t[e](n)}aQ(sQ,mQ,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:vQ,formatHex:vQ,formatHsl:function(){return kQ(this).formatHsl()},formatRgb:BQ,toString:BQ}),aQ(wQ,FQ,AQ(sQ,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new wQ(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new wQ(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:SQ,formatHex:SQ,formatRgb:RQ,toString:RQ})),aQ(OQ,(function(t,e,n,r){return 1===arguments.length?kQ(t):new OQ(t,e,n,null==r?1:r)}),AQ(sQ,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new OQ(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new OQ(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new wQ(NQ(t>=240?t-240:t+120,i,r),NQ(t,i,r),NQ(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}})),DQ.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(x.y)(DQ,ha).transform=function(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||x.x,o=function(t,e){var n;Object(x.D)(t)?(n=function(n){return t(n,e)}).dep=GQ(t):t?n=Object(x.l)(t):(n=function(t){return t.$value/t.$max||0}).dep=!0;return n}(t.opacity,t),a=function(t,e){var n;Object(x.D)(t)?(n=function(n){return FQ(t(n,e))}).dep=GQ(t):n=Object(x.l)(FQ(t||"#888"));return n}(t.color,t),A=t.as||"image",s={$x:0,$y:0,$value:0,$max:r?Yy(n.map((function(t){return Yy(i(t).values)}))):0};return n.forEach((function(t){var e=i(t),n=Object(x.o)({},t,s);r||(n.$max=Yy(e.values||[])),t[A]=function(t,e,n,r){for(var i=t.width,o=t.height,a=t.x1||0,A=t.y1||0,s=t.x2||i,c=t.y2||o,u=t.values,l=u?function(t){return u[t]}:x.kb,g=xl(s-a,c-A),f=g.getContext("2d"),h=f.getImageData(0,0,s-a,c-A),d=h.data,I=A,p=0;I<c;++I){e.$y=I-A;for(var C=a,y=I*i;C<s;++C,p+=4){e.$x=C-a,e.$value=l(C+y);var v=n(e);d[p+0]=v.r,d[p+1]=v.g,d[p+2]=v.b,d[p+3]=~~(255*r(e))}}return f.putImageData(h,0,0),g}(e,n,a.dep?a:Object(x.l)(a(n)),o.dep?o:Object(x.l)(o(n)))})),e.reflow(!0).modifies(A)},Object(x.y)(_Q,ha).transform=function(t,e){var n=this.value;return!n||t.modified("type")?(this.value=n=function(t){var e=ZE((t||"mercator").toLowerCase());e||Object(x.n)("Unrecognized projection type: "+t);return e()}(t.type),LE.forEach((function(e){null!=t[e]&&MQ(n,e,t[e])}))):LE.forEach((function(e){t.modified(e)&&MQ(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){var n=function(t){return 1===(t=Object(x.i)(t)).length?t[0]:{type:"FeatureCollection",features:t.reduce((function(t,e){return t.concat(function(t){return"FeatureCollection"===t.type?t.features:Object(x.i)(t).filter((function(t){return null!=t})).map((function(t){return"Feature"===t.type?t:{type:"Feature",geometry:t}}))}(e))}),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)};var TQ=n(936),jQ=function(t){return function(){return t}},LQ=function(t){return 1e-6*(t()-.5)};function VQ(t){return t.x+t.vx}function ZQ(t){return t.y+t.vy}var PQ=n(841);function WQ(t){return t.index}function JQ(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}var HQ={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,A=0,s=0;for(i=0;i<a;++i)A+=(o=n[i]).x,s+=o.y;for(A=(A/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=A,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i},collide:function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,u,l,g,f=e.length,h=0;h<o;++h)for(a=Object(TQ.a)(e,VQ,ZQ).visitAfter(A),t=0;t<f;++t)s=e[t],l=n[s.index],g=l*l,c=s.x+s.vx,u=s.y+s.vy,a.visit(d);function d(t,e,n,o,a){var A=t.data,f=t.r,h=l+f;if(!A)return e>c+h||o<c-h||n>u+h||a<u-h;if(A.index>s.index){var d=c-A.x-A.vx,I=u-A.y-A.vy,p=d*d+I*I;p<h*h&&(0===d&&(p+=(d=LQ(r))*d),0===I&&(p+=(I=LQ(r))*I),p=(h-(p=Math.sqrt(p)))/p*i,s.vx+=(d*=p)*(h=(f*=f)/(g+f)),s.vy+=(I*=p)*h,A.vx-=d*(h=1-h),A.vy-=I*h)}}}function A(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!==typeof t&&(t=jQ(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"===typeof e?e:jQ(+e),s(),a):t},a},nbody:function(){var t,e,n,r,i,o=jQ(-30),a=1,A=1/0,s=.81;function c(n){var i,o=t.length,a=Object(TQ.a)(t,PQ.b,PQ.c).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(g)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,A=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(A+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{A+=i[e.data.index]}while(e=e.next)}t.value=A}function g(t,o,c,u){if(!t.value)return!0;var l=t.x-e.x,g=t.y-e.y,f=u-o,h=l*l+g*g;if(f*f/s<h)return h<A&&(0===l&&(h+=(l=LQ(n))*l),0===g&&(h+=(g=LQ(n))*g),h<a&&(h=Math.sqrt(a*h)),e.vx+=l*t.value*r/h,e.vy+=g*t.value*r/h),!0;if(!(t.length||h>=A)){(t.data!==e||t.next)&&(0===l&&(h+=(l=LQ(n))*l),0===g&&(h+=(g=LQ(n))*g),h<a&&(h=Math.sqrt(a*h)));do{t.data!==e&&(f=i[t.data.index]*r/h,e.vx+=l*f,e.vy+=g*f)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,u()},c.strength=function(t){return arguments.length?(o="function"===typeof t?t:jQ(+t),u(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(A=t*t,c):Math.sqrt(A)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c},link:function(t){var e,n,r,i,o,a,A=WQ,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=jQ(30),u=1;function l(r){for(var i=0,A=t.length;i<u;++i)for(var s,c,l,g,f,h,d,I=0;I<A;++I)c=(s=t[I]).source,g=(l=s.target).x+l.vx-c.x-c.vx||LQ(a),f=l.y+l.vy-c.y-c.vy||LQ(a),g*=h=((h=Math.sqrt(g*g+f*f))-n[I])/h*r*e[I],f*=h,l.vx-=g*(d=o[I]),l.vy-=f*d,c.vx+=g*(d=1-d),c.vy+=f*d}function g(){if(r){var a,s,c=r.length,u=t.length,l=new Map(r.map((function(t,e){return[A(t,e,r),t]})));for(a=0,i=new Array(c);a<u;++a)(s=t[a]).index=a,"object"!==typeof s.source&&(s.source=JQ(l,s.source)),"object"!==typeof s.target&&(s.target=JQ(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(u),f(),n=new Array(u),h()}}function f(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function h(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,g()},l.links=function(e){return arguments.length?(t=e,g(),l):t},l.id=function(t){return arguments.length?(A=t,l):A},l.iterations=function(t){return arguments.length?(u=+t,l):u},l.strength=function(t){return arguments.length?(s="function"===typeof t?t:jQ(+t),f(),l):s},l.distance=function(t){return arguments.length?(c="function"===typeof t?t:jQ(+t),h(),l):c},l},x:function(t){var e,n,r,i=jQ(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=jQ(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:jQ(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"===typeof e?e:jQ(+e),a(),o):t},o},y:function(t){var e,n,r,i=jQ(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=jQ(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:jQ(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"===typeof e?e:jQ(+e),a(),o):t},o}},YQ=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],XQ=["static","iterations"],zQ=["x","y","vx","vy"];function KQ(t){ha.call(this,null,t)}KQ.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:zQ}]};var qQ=Object(x.y)(KQ,ha);function $Q(t,e,n,r){var i,o,a,A,s=Object(x.i)(e.forces);for(i=0,o=YQ.length;i<o;++i)"forces"!==(a=YQ[i])&&e.modified(a)&&t[a](e[a]);for(i=0,o=s.length;i<o;++i)A="forces"+i,(a=n||e.modified("forces",i)?eF(s[i]):r&&tF(s[i],r)?t.force(A):null)&&t.force(A,a);for(o=t.numForces||0;i<o;++i)t.force("forces"+i,null);return t.numForces=s.length,t}function tF(t,e){var n,r;for(n in t)if(Object(x.D)(r=t[n])&&e.modified(Object(x.g)(r)))return 1;return 0}function eF(t){var e,n;for(n in Object(x.v)(HQ,t.force)||Object(x.n)("Unrecognized force: "+t.force),e=HQ[t.force](),t)Object(x.D)(e[n])&&nF(e[n],t[n],t);return e}function nF(t,e,n){t(Object(x.D)(e)?function(t){return e(t,n)}:e)}qQ.transform=function(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(YQ),A=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&$Q(i,t,0,e)):(this.value=i=function(t,e){var n=Object(PQ.a)(t),r=!1,i=n.stop,o=n.restart;return n.stopped=function(){return r},n.restart=function(){return r=!1,o()},n.stop=function(){return r=!0,i()},$Q(n,e,!0).on("end",(function(){r=!0}))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,function(){n.touch(r).run()})),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(XQ)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/A)),t.static)for(i.stop();--A>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},qQ.finish=function(t,e){for(var n,r=e.dataflow,i=this._argops,o=0,a=i.length;o<a;++o)if("forces"===(n=i[o]).name&&"link"===n.op._argval.force)for(var A,s=n.op._argops,c=0,u=s.length;c<u;++c)if("links"===s[c].name&&(A=s[c].op.source)){r.pulse(A,r.changeset().reflow());break}return e.reflow(t.modified()).modifies(zQ)};var rF=function(t,e,n){var r={};return t.each((function(t){var i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t};function iF(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function oF(t,e){var n,r,i,o,a,A=new cF(t),s=+t.value&&(A.value=t.value),c=[A];for(null==e&&(e=aF);n=c.pop();)if(s&&(n.value=+n.data.value),(i=e(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)c.push(r=n.children[o]=new cF(i[o])),r.parent=n,r.depth=n.depth+1;return A.eachBefore(sF)}function aF(t){return t.children}function AF(t){t.data=t.data.data}function sF(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function cF(t){this.data=t,this.depth=this.height=0,this.parent=null}function uF(t){ha.call(this,null,t)}function lF(t){return t.values}function gF(){var t,e=[];return t={entries:function(t){return function t(n,r){if(++r>e.length)return n;var i,o=[];for(i in n)o.push({key:i,values:t(n[i],r)});return o}(function t(n,r){if(r>=e.length)return n;for(var i,o,a,A=-1,s=n.length,c=e[r++],u={},l={};++A<s;)(a=u[i=c(o=n[A])+""])?a.push(o):u[i]=[o];for(i in u)l[i]=t(u[i],r);return l}(t,0),0)},key:function(n){return e.push(n),t}}}function fF(t){ha.call(this,null,t)}function hF(t,e){return t.parent===e.parent?1:2}cF.prototype=oF.prototype={constructor:cF,count:function(){return this.eachAfter(iF)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(t){for(var e,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return oF(this).eachBefore(AF)}},uF.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},Object(x.y)(uF,ha).transform=function(t,e){e.source||Object(x.n)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each((function(t){t.children&&Rt(t.data)&&i.rem.push(t.data)})),this.value=o=oF({values:Object(x.i)(t.keys).reduce((function(t,e){return t.key(e),t}),gF()).entries(i.source)},lF),n&&o.each((function(t){t.children&&(t=kt(t.data),i.add.push(t),i.source.push(t))})),rF(o,Ut,Ut)),i.source.root=o,i},Object(x.y)(fF,ha).transform=function(t,e){e.source&&e.source.root||Object(x.n)(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(Gt(t.sort,(function(t){return t.data}))),function(t,e,n){for(var r,i=0,o=e.length;i<o;++i)(r=e[i])in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?hF:x.O);try{this.value=n(i)}catch(a){Object(x.n)(a)}return i.each((function(t){!function(t,e,n){for(var r=t.data,i=0,o=e.length-1;i<o;++i)r[n[i]]=t[e[i]];r[n[o]]=t.children?t.children.length:0}(t,r,o)})),e.reflow(t.modified()).modifies(o).modifies("leaf")};var dF=Array.prototype.slice;var IF=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(dF.call(t))).length,o=[];r<i;)e=t[r],n&&yF(n,e)?++r:(n=BF(o=pF(o,e)),r=0);return n};function pF(t,e){var n,r;if(vF(e,t))return[e];for(n=0;n<t.length;++n)if(CF(e,t[n])&&vF(mF(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(CF(mF(t[n],t[r]),e)&&CF(mF(t[n],e),t[r])&&CF(mF(t[r],e),t[n])&&vF(bF(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function CF(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function yF(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function vF(t,e){for(var n=0;n<e.length;++n)if(!yF(t,e[n]))return!1;return!0}function BF(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return mF(t[0],t[1]);case 3:return bF(t[0],t[1],t[2])}var e}function mF(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,A=e.r,s=o-n,c=a-r,u=A-i,l=Math.sqrt(s*s+c*c);return{x:(n+o+s/l*u)/2,y:(r+a+c/l*u)/2,r:(l+i+A)/2}}function bF(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,A=e.y,s=e.r,c=n.x,u=n.y,l=n.r,g=r-a,f=r-c,h=i-A,d=i-u,I=s-o,p=l-o,C=r*r+i*i-o*o,y=C-a*a-A*A+s*s,v=C-c*c-u*u+l*l,B=f*h-g*d,m=(h*v-d*y)/(2*B)-r,b=(d*I-h*p)/B,E=(f*y-g*v)/(2*B)-i,Q=(g*p-f*I)/B,F=b*b+Q*Q-1,w=2*(o+m*b+E*Q),S=m*m+E*E-o*o,R=-(F?(w+Math.sqrt(w*w-4*F*S))/(2*F):S/w);return{x:r+m+b*R,y:i+E+Q*R,r:R}}function EF(t,e,n){var r,i,o,a,A=t.x-e.x,s=t.y-e.y,c=A*A+s*s;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*A-o*s,n.y=t.y-r*s+o*A):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*A-o*s,n.y=e.y+r*s+o*A)):(n.x=e.x+n.r,n.y=e.y)}function QF(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function FF(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function wF(t){this._=t,this.next=null,this.previous=null}function SF(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,A,s,c,u,l;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;EF(n,e,r=t[2]),e=new wF(e),n=new wF(n),r=new wF(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(A=3;A<i;++A){EF(e._,n._,r=t[A]),r=new wF(r),s=n.next,c=e.previous,u=n._.r,l=e._.r;do{if(u<=l){if(QF(s._,r._)){n=s,e.next=n,n.previous=e,--A;continue t}u+=s._.r,s=s.next}else{if(QF(c._,r._)){(e=c).next=n,n.previous=e,--A;continue t}l+=c._.r,c=c.previous}}while(s!==c.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,o=FF(e);(r=r.next)!==n;)(a=FF(r))<o&&(e=r,o=a);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=IF(e),A=0;A<i;++A)(e=t[A]).x-=r.x,e.y-=r.y;return r.r}function RF(t){return null==t?null:UF(t)}function UF(t){if("function"!==typeof t)throw new Error;return t}function xF(){return 0}var kF=function(t){return function(){return t}};function OF(t){return Math.sqrt(t.value)}function NF(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function DF(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,A=t(n)*e||0;if(A)for(i=0;i<a;++i)r[i].r+=A;if(o=SF(r),A)for(i=0;i<a;++i)r[i].r-=A;n.r=o+A}}}function GF(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}var _F=["x","y","r","depth","children"];function MF(t){fF.call(this,t)}MF.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:_F.length,default:_F}]};var TF=Object(x.y)(MF,fF);TF.layout=function(){var t=null,e=1,n=1,r=xF;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(NF(t)).eachAfter(DF(r,.5)).eachBefore(GF(1)):i.eachBefore(NF(OF)).eachAfter(DF(xF,1)).eachAfter(DF(r,i.r/Math.min(e,n))).eachBefore(GF(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=RF(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"===typeof t?t:kF(+t),i):r},i},TF.params=["radius","size","padding"],TF.fields=_F;var jF=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},LF=function(t,e,n,r,i){for(var o,a=t.children,A=-1,s=a.length,c=t.value&&(r-e)/t.value;++A<s;)(o=a[A]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*c},VF=["x0","y0","x1","y1","depth","children"];function ZF(t){fF.call(this,t)}ZF.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:VF.length,default:VF}]};var PF=Object(x.y)(ZF,fF);PF.layout=function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&LF(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,A=r.y1-n;a<i&&(i=a=(i+a)/2),A<o&&(o=A=(o+A)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=A}}(e,o)),r&&i.eachBefore(jF),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},PF.params=["size","round","padding"],PF.fields=VF;var WF={depth:-1},JF={};function HF(t){return t.id}function YF(t){return t.parentId}var XF=function(){var t=HF,e=YF;function n(n){var r,i,o,a,A,s,c,u=n.length,l=new Array(u),g={};for(i=0;i<u;++i)r=n[i],A=l[i]=new cF(r),null!=(s=t(r,i,n))&&(s+="")&&(g[c="$"+(A.id=s)]=c in g?JF:A);for(i=0;i<u;++i)if(A=l[i],null!=(s=e(n[i],i,n))&&(s+="")){if(!(a=g["$"+s]))throw new Error("missing: "+s);if(a===JF)throw new Error("ambiguous: "+s);a.children?a.children.push(A):a.children=[A],A.parent=a}else{if(o)throw new Error("multiple roots");o=A}if(!o)throw new Error("no root");if(o.parent=WF,o.eachBefore((function(t){t.depth=t.parent.depth+1,--u})).eachBefore(sF),o.parent=null,u>0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=UF(e),n):t},n.parentId=function(t){return arguments.length?(e=UF(t),n):e},n};function zF(t){ha.call(this,null,t)}function KF(t,e){return t.parent===e.parent?1:2}function qF(t){var e=t.children;return e?e[0]:t.t}function $F(t){var e=t.children;return e?e[e.length-1]:t.t}function tw(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function ew(t,e,n){return t.a.parent===e.parent?t.a:n}function nw(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}zF.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},Object(x.y)(zF,ha).transform=function(t,e){e.source||Object(x.n)("Stratify transform requires an upstream data source.");var n=this.value,r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!this.value||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?rF(XF().id(t.key).parentId(t.parentKey)(i.source),t.key,x.gb):rF(XF()([{}]),t.key,t.key)),i.source.root=this.value=n,i},nw.prototype=Object.create(cF.prototype);function rw(t,e){return t.parent===e.parent?1:2}function iw(t,e){return t+e.x}function ow(t,e){return Math.max(t,e.y)}var aw={tidy:function(){var t=KF,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new nw(t,0),A=[a];e=A.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)A.push(n=e.children[i]=new nw(r[i],i)),n.parent=e;return(a.parent=new nw(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(A);else{var c=i,u=i,l=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>l.depth&&(l=t)}));var g=c===u?1:t(c,u)/2,f=g-c.x,h=e/(u.x+g+f),d=n/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+f)*h,t.y=t.depth*d}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,A=n,s=o.parent.children[0],c=o.m,u=a.m,l=A.m,g=s.m;A=$F(A),o=qF(o),A&&o;)s=qF(s),(a=$F(a)).a=e,(i=A.z+l-o.z-c+t(A._,o._))>0&&(tw(ew(A,e,r),e,i),c+=i,u+=i),l+=A.m,c+=o.m,g+=s.m,u+=a.m;A&&!$F(a)&&(a.t=A,a.m+=l-u),o&&!qF(s)&&(s.t=o,s.m+=c-g,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function A(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=rw,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(iw,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ow,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var A=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=A.x-t(A,s)/2,u=s.x+t(s,A)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(u-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},Aw=["x","y","depth","children"];function sw(t){fF.call(this,t)}sw.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:Aw.length,default:Aw}]};var cw=Object(x.y)(sw,fF);function uw(t){ha.call(this,[],t)}cw.layout=function(t){var e=t||"tidy";if(Object(x.v)(aw,e))return aw[e]();Object(x.n)("Unrecognized Tree layout method: "+e)},cw.params=["size","nodeSize"],cw.fields=Aw,uw.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(x.y)(uw,ha).transform=function(t,e){var n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||Object(x.n)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(function(t){o[Ut(t)]=1})),r.each((function(t){var e=t.data,n=t.parent&&t.parent.data;n&&o[Ut(e)]&&o[Ut(n)]&&i.add.push(kt({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(function(t){o[Ut(t)]=1})),n.forEach((function(t){(o[Ut(t.source)]||o[Ut(t.target)])&&i.mod.push(t)}))),i};var lw=function(t,e,n,r,i){for(var o,a=t.children,A=-1,s=a.length,c=t.value&&(i-n)/t.value;++A<s;)(o=a[A]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*c},gw=(1+Math.sqrt(5))/2;function fw(t,e,n,r,i,o){for(var a,A,s,c,u,l,g,f,h,d,I,p=[],C=e.children,y=0,v=0,B=C.length,m=e.value;y<B;){s=i-n,c=o-r;do{u=C[v++].value}while(!u&&v<B);for(l=g=u,I=u*u*(d=Math.max(c/s,s/c)/(m*t)),h=Math.max(g/I,I/l);v<B;++v){if(u+=A=C[v].value,A<l&&(l=A),A>g&&(g=A),I=u*u*d,(f=Math.max(g/I,I/l))>h){u-=A;break}h=f}p.push(a={value:u,dice:s<c,children:C.slice(y,v)}),a.dice?LF(a,n,r,i,m?r+=c*u/m:o):lw(a,n,r,m?n+=s*u/m:i,o),m-=u,y=v}return p}var hw=function t(e){function n(t,n,r,i,o){fw(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(gw),dw=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,A,s,c,u,l=-1,g=a.length,f=t.value;++l<g;){for(s=(A=a[l]).children,c=A.value=0,u=s.length;c<u;++c)A.value+=s[c].value;A.dice?LF(A,n,r,i,r+=(o-r)*A.value/f):lw(A,n,r,n+=(i-n)*A.value/f,o),f-=A.value}else t._squarify=a=fw(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(gw),Iw={binary:function(t,e,n,r,i){var o,a,A=t.children,s=A.length,c=new Array(s+1);for(c[0]=a=o=0;o<s;++o)c[o+1]=a+=A[o].value;!function t(e,n,r,i,o,a,s){if(e>=n-1){var u=A[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=s)}var l=c[e],g=r/2+l,f=e+1,h=n-1;for(;f<h;){var d=f+h>>>1;c[d]<g?f=d+1:h=d}g-c[f-1]<c[f]-g&&e+1<f&&--f;var I=c[f]-l,p=r-I;if(a-i>s-o){var C=(i*p+a*I)/r;t(e,f,I,i,o,C,s),t(f,n,p,C,o,a,s)}else{var y=(o*p+s*I)/r;t(e,f,I,i,o,a,y),t(f,n,p,i,y,a,s)}}(0,s,t.value,e,n,r,i)},dice:LF,slice:lw,slicedice:function(t,e,n,r,i){(1&t.depth?lw:LF)(t,e,n,r,i)},squarify:hw,resquarify:dw},pw=["x0","y0","x1","y1","depth","children"];function Cw(t){fF.call(this,t)}Cw.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:pw.length,default:pw}]};var yw=Object(x.y)(Cw,fF);yw.layout=function(){var t=function(){var t=hw,e=!1,n=1,r=1,i=[0],o=xF,a=xF,A=xF,s=xF,c=xF;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(l),i=[0],e&&t.eachBefore(jF),t}function l(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,l=e.x1-n,g=e.y1-n;l<r&&(r=l=(r+l)/2),g<u&&(u=g=(u+g)/2),e.x0=r,e.y0=u,e.x1=l,e.y1=g,e.children&&(n=i[e.depth+1]=o(e)/2,r+=c(e)-n,u+=a(e)-n,(l-=A(e)-n)<r&&(r=l=(r+l)/2),(g-=s(e)-n)<u&&(u=g=(u+g)/2),t(e,r,u,l,g))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=UF(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"===typeof t?t:kF(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"===typeof t?t:kF(+t),u):a},u.paddingRight=function(t){return arguments.length?(A="function"===typeof t?t:kF(+t),u):A},u.paddingBottom=function(t){return arguments.length?(s="function"===typeof t?t:kF(+t),u):s},u.paddingLeft=function(t){return arguments.length?(c="function"===typeof t?t:kF(+t),u):c},u}();return t.ratio=function(e){var n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=function(e){Object(x.v)(Iw,e)?t.tile(Iw[e]):Object(x.n)("Unrecognized Treemap layout method: "+e)},t},yw.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],yw.fields=pw;var vw=function(t,e){var n,r,i,o,a,A,s=[],c=function(t){return t(o)};if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(A=n[a=e.map(c)])||(n[a]=A=[],A.dims=a,s.push(A)),A.push(o);return s};function Bw(t){ha.call(this,null,t)}Bw.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(x.y)(Bw,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=e.materialize(e.SOURCE).source,i=vw(r,t.groupby),o=(t.groupby||[]).map(x.h),a=o.length,A=t.as||[Object(x.h)(t.x),Object(x.h)(t.y)],s=[];i.forEach((function(e){xA(e,t.x,t.y,t.bandwidth||.3).forEach((function(t){for(var n={},r=0;r<a;++r)n[o[r]]=e.dims[r];n[A[0]]=t[0],n[A[1]]=t[1],s.push(kt(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n};var mw={linear:bA,log:EA,exp:FA,pow:wA,quad:SA,poly:RA};function bw(t){ha.call(this,null,t)}bw.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(mw)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},Object(x.y)(bw,ha).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=e.materialize(e.SOURCE).source,i=vw(r,t.groupby),o=(t.groupby||[]).map(x.h),a=t.method||"linear",A=t.order||3,s=function(t,e){return"poly"===t?e:"quad"===t?2:1}(a,A),c=t.as||[Object(x.h)(t.x),Object(x.h)(t.y)],u=mw[a],l=[],g=t.extent;Object(x.v)(mw,a)||Object(x.n)("Invalid regression method: "+a),null!=g&&"log"===a&&g[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),g=null),i.forEach((function(n){if(n.length<=s)e.dataflow.warn("Skipping regression with more parameters than data points.");else{var r=u(n,t.x,t.y,A);if(t.params)l.push(kt({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));else{var i=g||Object(x.p)(n,t.x),f=function(t){for(var e={},r=0;r<o.length;++r)e[o[r]]=n.dims[r];e[c[0]]=t[0],e[c[1]]=t[1],l.push(kt(e))};"linear"===a?i.forEach((function(t){return f([t,r.predict(t)])})):DA(r.predict,i,25,200).forEach(f)}}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n};var Ew=Math.pow(2,-52),Qw=new Uint32Array(512),Fw=function(){function t(e){Object(F.a)(this,t);var n=e.length>>1;if(n>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;var r=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}return Object(w.a)(t,null,[{key:"from",value:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nw,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Dw,i=e.length,o=new Float64Array(2*i),a=0;a<i;a++){var A=e[a];o[2*a]=n(A),o[2*a+1]=r(A)}return new t(o)}}]),Object(w.a)(t,[{key:"update",value:function(){for(var t=this.coords,e=this._hullPrev,n=this._hullNext,r=this._hullTri,i=this._hullHash,o=t.length>>1,a=1/0,A=1/0,s=-1/0,c=-1/0,u=0;u<o;u++){var l=t[2*u],g=t[2*u+1];l<a&&(a=l),g<A&&(A=g),l>s&&(s=l),g>c&&(c=g),this._ids[u]=u}for(var f,h,d,I=(a+s)/2,p=(A+c)/2,C=1/0,y=0;y<o;y++){var v=ww(I,p,t[2*y],t[2*y+1]);v<C&&(f=y,C=v)}var B=t[2*f],m=t[2*f+1];C=1/0;for(var b=0;b<o;b++)if(b!==f){var E=ww(B,m,t[2*b],t[2*b+1]);E<C&&E>0&&(h=b,C=E)}for(var Q=t[2*h],F=t[2*h+1],w=1/0,S=0;S<o;S++)if(S!==f&&S!==h){var R=xw(B,m,Q,F,t[2*S],t[2*S+1]);R<w&&(d=S,w=R)}var U=t[2*d],x=t[2*d+1];if(w===1/0){for(var k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];kw(this._ids,this._dists,0,o-1);for(var O=new Uint32Array(o),N=0,D=0,G=-1/0;D<o;D++){var _=this._ids[D];this._dists[_]>G&&(O[N++]=_,G=this._dists[_])}return this.hull=O.subarray(0,N),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Rw(B,m,Q,F,U,x)){var M=h,T=Q,j=F;h=d,Q=U,F=x,d=M,U=T,x=j}var L=function(t,e,n,r,i,o){var a=n-t,A=r-e,s=i-t,c=o-e,u=a*a+A*A,l=s*s+c*c,g=.5/(a*c-A*s);return{x:t+(c*u-A*l)*g,y:e+(a*l-s*u)*g}}(B,m,Q,F,U,x);this._cx=L.x,this._cy=L.y;for(var V=0;V<o;V++)this._dists[V]=ww(t[2*V],t[2*V+1],L.x,L.y);kw(this._ids,this._dists,0,o-1),this._hullStart=f;var Z=3;n[f]=e[d]=h,n[h]=e[f]=d,n[d]=e[h]=f,r[f]=0,r[h]=1,r[d]=2,i.fill(-1),i[this._hashKey(B,m)]=f,i[this._hashKey(Q,F)]=h,i[this._hashKey(U,x)]=d,this.trianglesLen=0,this._addTriangle(f,h,d,-1,-1,-1);for(var P,W,J=0;J<this._ids.length;J++){var H=this._ids[J],Y=t[2*H],X=t[2*H+1];if(!(J>0&&Math.abs(Y-P)<=Ew&&Math.abs(X-W)<=Ew)&&(P=Y,W=X,H!==f&&H!==h&&H!==d)){for(var z=0,K=0,q=this._hashKey(Y,X);K<this._hashSize&&(-1===(z=i[(q+K)%this._hashSize])||z===n[z]);K++);for(var $=z=e[z],tt=void 0;tt=n[$],!Rw(Y,X,t[2*$],t[2*$+1],t[2*tt],t[2*tt+1]);)if(($=tt)===z){$=-1;break}if(-1!==$){var et=this._addTriangle($,H,n[$],-1,-1,r[$]);r[H]=this._legalize(et+2),r[$]=et,Z++;for(var nt=n[$];tt=n[nt],Rw(Y,X,t[2*nt],t[2*nt+1],t[2*tt],t[2*tt+1]);)et=this._addTriangle(nt,H,tt,r[H],-1,r[nt]),r[H]=this._legalize(et+2),n[nt]=nt,Z--,nt=tt;if($===z)for(;Rw(Y,X,t[2*(tt=e[$])],t[2*tt+1],t[2*$],t[2*$+1]);)et=this._addTriangle(tt,H,$,-1,r[$],r[tt]),this._legalize(et+2),r[tt]=et,n[$]=$,Z--,$=tt;this._hullStart=e[H]=$,n[$]=e[nt]=H,n[H]=nt,i[this._hashKey(Y,X)]=H,i[this._hashKey(t[2*$],t[2*$+1])]=$}}}this.hull=new Uint32Array(Z);for(var rt=0,it=this._hullStart;rt<Z;rt++)this.hull[rt]=it,it=n[it];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}},{key:"_hashKey",value:function(t,e){return Math.floor(function(t,e){var n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}},{key:"_legalize",value:function(t){for(var e=this._triangles,n=this._halfedges,r=this.coords,i=0,o=0;;){var a=n[t],A=t-t%3;if(o=A+(t+2)%3,-1!==a){var s=a-a%3,c=A+(t+1)%3,u=s+(a+2)%3,l=e[o],g=e[t],f=e[c],h=e[u];if(Uw(r[2*l],r[2*l+1],r[2*g],r[2*g+1],r[2*f],r[2*f+1],r[2*h],r[2*h+1])){e[t]=h,e[a]=l;var d=n[u];if(-1===d){var I=this._hullStart;do{if(this._hullTri[I]===u){this._hullTri[I]=t;break}I=this._hullPrev[I]}while(I!==this._hullStart)}this._link(t,d),this._link(a,n[o]),this._link(o,u);var p=s+(a+1)%3;i<Qw.length&&(Qw[i++]=p)}else{if(0===i)break;t=Qw[--i]}}else{if(0===i)break;t=Qw[--i]}}return o}},{key:"_link",value:function(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}},{key:"_addTriangle",value:function(t,e,n,r,i,o){var a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}]),t}();function ww(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}function Sw(t,e,n,r,i,o){var a=(r-e)*(i-t),A=(n-t)*(o-e);return Math.abs(a-A)>=33306690738754716e-32*Math.abs(a+A)?a-A:0}function Rw(t,e,n,r,i,o){return(Sw(i,o,t,e,n,r)||Sw(t,e,n,r,i,o)||Sw(n,r,i,o,t,e))<0}function Uw(t,e,n,r,i,o,a,A){var s=t-a,c=e-A,u=n-a,l=r-A,g=i-a,f=o-A,h=u*u+l*l,d=g*g+f*f;return s*(l*d-h*f)-c*(u*d-h*g)+(s*s+c*c)*(u*f-l*g)<0}function xw(t,e,n,r,i,o){var a=n-t,A=r-e,s=i-t,c=o-e,u=a*a+A*A,l=s*s+c*c,g=.5/(a*c-A*s),f=(c*u-A*l)*g,h=(a*l-s*u)*g;return f*f+h*h}function kw(t,e,n,r){if(r-n<=20)for(var i=n+1;i<=r;i++){for(var o=t[i],a=e[o],A=i-1;A>=n&&e[t[A]]>a;)t[A+1]=t[A--];t[A+1]=o}else{var s=n+1,c=r;Ow(t,n+r>>1,s),e[t[n]]>e[t[r]]&&Ow(t,n,r),e[t[s]]>e[t[r]]&&Ow(t,s,r),e[t[n]]>e[t[s]]&&Ow(t,n,s);for(var u=t[s],l=e[u];;){do{s++}while(e[t[s]]<l);do{c--}while(e[t[c]]>l);if(c<s)break;Ow(t,s,c)}t[n+1]=t[c],t[c]=u,r-s+1>=c-n?(kw(t,e,s,r),kw(t,e,n,c-1)):(kw(t,e,n,c-1),kw(t,e,s,r))}}function Ow(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Nw(t){return t[0]}function Dw(t){return t[1]}var Gw=function(){function t(){Object(F.a)(this,t),this._x0=this._y0=this._x1=this._y1=null,this._=""}return Object(w.a)(t,[{key:"moveTo",value:function(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}},{key:"closePath",value:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}},{key:"lineTo",value:function(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}},{key:"arc",value:function(t,e,n){var r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(r,",").concat(i):(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+r+","+i),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=r,",").concat(this._y1=i))}},{key:"rect",value:function(t,e,n,r){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+r,"h").concat(-n,"Z")}},{key:"value",value:function(){return this._||null}}]),t}(),_w=function(){function t(){Object(F.a)(this,t),this._=[]}return Object(w.a)(t,[{key:"moveTo",value:function(t,e){this._.push([t,e])}},{key:"closePath",value:function(){this._.push(this._[0].slice())}},{key:"lineTo",value:function(t,e){this._.push([t,e])}},{key:"value",value:function(){return this._.length?this._:null}}]),t}(),Mw=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500],r=Object(QA.a)(n,4),i=r[0],o=r[1],a=r[2],A=r[3];if(Object(F.a)(this,t),!((a=+a)>=(i=+i))||!((A=+A)>=(o=+o)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=a,this.xmin=i,this.ymax=A,this.ymin=o,this._init()}return Object(w.a)(t,[{key:"update",value:function(){return this.delaunay.update(),this._init(),this}},{key:"_init",value:function(){for(var t,e,n=this.delaunay,r=n.points,i=n.hull,o=n.triangles,a=this.vectors,A=this.circumcenters=this._circumcenters.subarray(0,o.length/3*2),s=0,c=0,u=o.length;s<u;s+=3,c+=2){var l=2*o[s],g=2*o[s+1],f=2*o[s+2],h=r[l],d=r[l+1],I=r[g],p=r[g+1],C=r[f],y=r[f+1],v=I-h,B=p-d,m=C-h,b=y-d,E=v*v+B*B,Q=m*m+b*b,F=2*(v*b-B*m);if(F)if(Math.abs(F)<1e-8)t=(h+C)/2,e=(d+y)/2;else{var w=1/F;t=h+(b*E-B*Q)*w,e=d+(v*Q-m*E)*w}else t=(h+C)/2-1e8*b,e=(d+y)/2+1e8*m;A[c]=t,A[c+1]=e}var S,R,U,x=i[i.length-1],k=4*x,O=r[2*x],N=r[2*x+1];a.fill(0);for(var D=0;D<i.length;++D)S=k,R=O,U=N,k=4*(x=i[D]),O=r[2*x],N=r[2*x+1],a[S+2]=a[k]=U-N,a[S+3]=a[k+1]=O-R}},{key:"render",value:function(t){var e=null==t?t=new Gw:void 0,n=this.delaunay,r=n.halfedges,i=n.inedges,o=n.hull,a=this.circumcenters,A=this.vectors;if(o.length<=1)return null;for(var s=0,c=r.length;s<c;++s){var u=r[s];if(!(u<s)){var l=2*Math.floor(s/3),g=2*Math.floor(u/3),f=a[l],h=a[l+1],d=a[g],I=a[g+1];this._renderSegment(f,h,d,I,t)}}for(var p,C=o[o.length-1],y=0;y<o.length;++y){p=C,C=o[y];var v=2*Math.floor(i[C]/3),B=a[v],m=a[v+1],b=4*p,E=this._project(B,m,A[b+2],A[b+3]);E&&this._renderSegment(B,m,E[0],E[1],t)}return e&&e.value()}},{key:"renderBounds",value:function(t){var e=null==t?t=new Gw:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}},{key:"renderCell",value:function(t,e){var n=null==e?e=new Gw:void 0,r=this._clip(t);if(null!==r&&r.length){e.moveTo(r[0],r[1]);for(var i=r.length;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(var o=2;o<i;o+=2)r[o]===r[o-2]&&r[o+1]===r[o-1]||e.lineTo(r[o],r[o+1]);return e.closePath(),n&&n.value()}}},{key:"cellPolygons",value:Z.a.mark((function t(){var e,n,r,i;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.delaunay.points,n=0,r=e.length/2;case 2:if(!(n<r)){t.next=11;break}if(!(i=this.cellPolygon(n))){t.next=8;break}return i.index=n,t.next=8,i;case 8:++n,t.next=2;break;case 11:case"end":return t.stop()}}),t,this)}))},{key:"cellPolygon",value:function(t){var e=new _w;return this.renderCell(t,e),e.value()}},{key:"_renderSegment",value:function(t,e,n,r,i){var o,a=this._regioncode(t,e),A=this._regioncode(n,r);0===a&&0===A?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,A))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}},{key:"contains",value:function(t,e,n){return(e=+e)===e&&(n=+n)===n&&this.delaunay._step(t,e,n)===t}},{key:"neighbors",value:Z.a.mark((function t(e){var n,r,i,o,a,A,s,c,u;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=this._clip(e))){t.next=33;break}r=Object(U.a)(this.delaunay.neighbors(e)),t.prev=3,r.s();case 5:if((i=r.n()).done){t.next=25;break}if(o=i.value,!(a=this._clip(o))){t.next=23;break}A=0,s=n.length;case 10:if(!(A<s)){t.next=23;break}c=0,u=a.length;case 12:if(!(c<u)){t.next=20;break}if(n[A]!=a[c]||n[A+1]!=a[c+1]||n[(A+2)%s]!=a[(c+u-2)%u]||n[(A+3)%s]!=a[(c+u-1)%u]){t.next=17;break}return t.next=16,o;case 16:return t.abrupt("break",23);case 17:c+=2,t.next=12;break;case 20:A+=2,t.next=10;break;case 23:t.next=5;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(3),r.e(t.t0);case 30:return t.prev=30,r.f(),t.finish(30);case 33:case"end":return t.stop()}}),t,this,[[3,27,30,33]])}))},{key:"_cell",value:function(t){var e=this.circumcenters,n=this.delaunay,r=n.inedges,i=n.halfedges,o=n.triangles,a=r[t];if(-1===a)return null;var A=[],s=a;do{var c=Math.floor(s/3);if(A.push(e[2*c],e[2*c+1]),o[s=s%3===2?s-2:s+1]!==t)break;s=i[s]}while(s!==a&&-1!==s);return A}},{key:"_clip",value:function(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];var e=this._cell(t);if(null===e)return null;var n=this.vectors,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}},{key:"_clipFinite",value:function(t,e){for(var n,r,i,o,a,A=e.length,s=null,c=e[A-2],u=e[A-1],l=this._regioncode(c,u),g=0;g<A;g+=2)if(n=c,r=u,c=e[g],u=e[g+1],i=l,l=this._regioncode(c,u),0===i&&0===l)o=a,a=0,s?s.push(c,u):s=[c,u];else{var f=void 0,h=void 0,d=void 0,I=void 0,p=void 0;if(0===i){if(null===(f=this._clipSegment(n,r,c,u,i,l)))continue;var C=f,y=Object(QA.a)(C,4);h=y[0],d=y[1],I=y[2],p=y[3]}else{if(null===(f=this._clipSegment(c,u,n,r,l,i)))continue;var v=f,B=Object(QA.a)(v,4);I=B[0],p=B[1],h=B[2],d=B[3],o=a,a=this._edgecode(h,d),o&&a&&this._edge(t,o,a,s,s.length),s?s.push(h,d):s=[h,d]}o=a,a=this._edgecode(I,p),o&&a&&this._edge(t,o,a,s,s.length),s?s.push(I,p):s=[I,p]}if(s)o=a,a=this._edgecode(s[0],s[1]),o&&a&&this._edge(t,o,a,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}},{key:"_clipSegment",value:function(t,e,n,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;var a=void 0,A=void 0,s=i||o;8&s?(a=t+(n-t)*(this.ymax-e)/(r-e),A=this.ymax):4&s?(a=t+(n-t)*(this.ymin-e)/(r-e),A=this.ymin):2&s?(A=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(A=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=A,i=this._regioncode(t,e)):(n=a,r=A,o=this._regioncode(n,r))}}},{key:"_clipInfinite",value:function(t,e,n,r,i,o){var a,A=Array.from(e);if((a=this._project(A[0],A[1],n,r))&&A.unshift(a[0],a[1]),(a=this._project(A[A.length-2],A[A.length-1],i,o))&&A.push(a[0],a[1]),A=this._clipFinite(t,A))for(var s,c=0,u=A.length,l=this._edgecode(A[u-2],A[u-1]);c<u;c+=2)s=l,l=this._edgecode(A[c],A[c+1]),s&&l&&(c=this._edge(t,s,l,A,c),u=A.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(A=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return A}},{key:"_edge",value:function(t,e,n,r,i){for(;e!==n;){var o=void 0,a=void 0;switch(e){case 5:e=4;continue;case 4:e=6,o=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,o=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,o=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,o=this.xmin,a=this.ymin}r[i]===o&&r[i+1]===a||!this.contains(t,o,a)||(r.splice(i,0,o,a),i+=2)}if(r.length>4)for(var A=0;A<r.length;A+=2){var s=(A+2)%r.length,c=(A+4)%r.length;(r[A]===r[s]&&r[s]===r[c]||r[A+1]===r[s+1]&&r[s+1]===r[c+1])&&(r.splice(s,2),A-=2)}return i}},{key:"_project",value:function(t,e,n,r){var i,o,a,A=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<A&&(a=this.ymin,o=t+(A=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<A&&(a=this.ymax,o=t+(A=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<A&&(o=this.xmax,a=e+(A=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<A&&(o=this.xmin,a=e+(A=i)*r)}return[o,a]}},{key:"_edgecode",value:function(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}},{key:"_regioncode",value:function(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}]),t}(),Tw=Z.a.mark(Hw),jw=2*Math.PI,Lw=Math.pow;function Vw(t){return t[0]}function Zw(t){return t[1]}function Pw(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var Ww=function(){function t(e){Object(F.a)(this,t),this._delaunator=new Fw(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}return Object(w.a)(t,null,[{key:"from",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vw,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zw,i=arguments.length>3?arguments[3]:void 0;return new t("length"in e?Jw(e,n,r,i):Float64Array.from(Hw(e,n,r,i)))}}]),Object(w.a)(t,[{key:"update",value:function(){return this._delaunator.update(),this._init(),this}},{key:"_init",value:function(){var t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){for(var e=t.triangles,n=t.coords,r=0;r<e.length;r+=3){var i=2*e[r],o=2*e[r+1],a=2*e[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(function(t,e){return e})).sort((function(t,n){return e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]}));for(var n=this.collinear[0],r=this.collinear[this.collinear.length-1],i=[e[2*n],e[2*n+1],e[2*r],e[2*r+1]],o=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]),a=0,A=e.length/2;a<A;++a){var s=Pw(e[2*a],e[2*a+1],o);e[2*a]=s[0],e[2*a+1]=s[1]}this._delaunator=new Fw(e)}else delete this.collinear;for(var c=this.halfedges=this._delaunator.halfedges,u=this.hull=this._delaunator.hull,l=this.triangles=this._delaunator.triangles,g=this.inedges.fill(-1),f=this._hullIndex.fill(-1),h=0,d=c.length;h<d;++h){var I=l[h%3===2?h-2:h+1];-1!==c[h]&&-1!==g[I]||(g[I]=h)}for(var p=0,C=u.length;p<C;++p)f[u[p]]=p;u.length<=2&&u.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=u[0],this.triangles[1]=u[1],this.triangles[2]=u[1],g[u[0]]=1,2===u.length&&(g[u[1]]=0))}},{key:"voronoi",value:function(t){return new Mw(this,t)}},{key:"neighbors",value:Z.a.mark((function t(e){var n,r,i,o,a,A,s,c,u,l,g;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.inedges,r=this.hull,i=this._hullIndex,o=this.halfedges,a=this.triangles,!(A=this.collinear)){t.next=10;break}if(!((s=A.indexOf(e))>0)){t.next=6;break}return t.next=6,A[s-1];case 6:if(!(s<A.length-1)){t.next=9;break}return t.next=9,A[s+1];case 9:return t.abrupt("return");case 10:if(-1!==(c=n[e])){t.next=13;break}return t.abrupt("return");case 13:u=c,l=-1;case 14:return t.next=16,l=a[u];case 16:if(a[u=u%3===2?u-2:u+1]===e){t.next=19;break}return t.abrupt("return");case 19:if(-1!==(u=o[u])){t.next=26;break}if((g=r[(i[e]+1)%r.length])===l){t.next=25;break}return t.next=25,g;case 25:return t.abrupt("return");case 26:if(u!==c){t.next=14;break}case 27:case"end":return t.stop()}}),t,this)}))},{key:"find",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((t=+t)!==t||(e=+e)!==e)return-1;for(var r,i=n;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}},{key:"_step",value:function(t,e,n){var r=this.inedges,i=this.hull,o=this._hullIndex,a=this.halfedges,A=this.triangles,s=this.points;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);var c=t,u=Lw(e-s[2*t],2)+Lw(n-s[2*t+1],2),l=r[t],g=l;do{var f=A[g],h=Lw(e-s[2*f],2)+Lw(n-s[2*f+1],2);if(h<u&&(u=h,c=f),A[g=g%3===2?g-2:g+1]!==t)break;if(-1===(g=a[g])){if((g=i[(o[t]+1)%i.length])!==f&&Lw(e-s[2*g],2)+Lw(n-s[2*g+1],2)<u)return g;break}}while(g!==l);return c}},{key:"render",value:function(t){for(var e=null==t?t=new Gw:void 0,n=this.points,r=this.halfedges,i=this.triangles,o=0,a=r.length;o<a;++o){var A=r[o];if(!(A<o)){var s=2*i[o],c=2*i[A];t.moveTo(n[s],n[s+1]),t.lineTo(n[c],n[c+1])}}return this.renderHull(t),e&&e.value()}},{key:"renderPoints",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=null==t?t=new Gw:void 0,r=this.points,i=0,o=r.length;i<o;i+=2){var a=r[i],A=r[i+1];t.moveTo(a+e,A),t.arc(a,A,e,0,jw)}return n&&n.value()}},{key:"renderHull",value:function(t){var e=null==t?t=new Gw:void 0,n=this.hull,r=this.points,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(var a=1;a<o;++a){var A=2*n[a];t.lineTo(r[A],r[A+1])}return t.closePath(),e&&e.value()}},{key:"hullPolygon",value:function(){var t=new _w;return this.renderHull(t),t.value()}},{key:"renderTriangle",value:function(t,e){var n=null==e?e=new Gw:void 0,r=this.points,i=this.triangles,o=2*i[t*=3],a=2*i[t+1],A=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[A],r[A+1]),e.closePath(),n&&n.value()}},{key:"trianglePolygons",value:Z.a.mark((function t(){var e,n,r;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.triangles,n=0,r=e.length/3;case 2:if(!(n<r)){t.next=8;break}return t.next=5,this.trianglePolygon(n);case 5:++n,t.next=2;break;case 8:case"end":return t.stop()}}),t,this)}))},{key:"trianglePolygon",value:function(t){var e=new _w;return this.renderTriangle(t,e),e.value()}}]),t}();function Jw(t,e,n,r){for(var i=t.length,o=new Float64Array(2*i),a=0;a<i;++a){var A=t[a];o[2*a]=e.call(r,A,a,t),o[2*a+1]=n.call(r,A,a,t)}return o}function Hw(t,e,n,r){var i,o,a,A;return Z.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:i=0,o=Object(U.a)(t),s.prev=2,o.s();case 4:if((a=o.n()).done){s.next=13;break}return A=a.value,s.next=8,e.call(r,A,i,t);case 8:return s.next=10,n.call(r,A,i,t);case 10:++i;case 11:s.next=4;break;case 13:s.next=18;break;case 15:s.prev=15,s.t0=s.catch(2),o.e(s.t0);case 18:return s.prev=18,o.f(),s.finish(18);case 21:case"end":return s.stop()}}),Tw,null,[[2,15,18,21]])}function Yw(t){ha.call(this,null,t)}Yw.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};var Xw=Object(x.y)(Yw,ha),zw=[-1e5,-1e5,1e5,1e5];function Kw(t){for(var e=t[0][0],n=t[0][1],r=t.length-1;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}Xw.transform=function(t,e){var n=t.as||"path",r=e.source;if(!r||!r.length)return e;var i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:zw;for(var o=this.value=Ww.from(r,t.x,t.y).voronoi(i),a=0,A=r.length;a<A;++a){var s=o.cellPolygon(a);r[a][n]=s?Kw(s):null}return e.reflow(t.modified()).modifies(n)};var qw=Math.PI/180,$w=function(){var t,e,n,r,i,o,a,A=[256,256],s=rS,c=[],u=Math.random,l={};function g(t,e,n){for(var r,i,o,a,c,l=e.x,g=e.y,f=Math.sqrt(A[0]*A[0]+A[1]*A[1]),h=s(A),d=u()<.5?1:-1,I=-d;(r=h(I+=d))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=f));)if(e.x=l+i,e.y=g+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>A[0]||e.y+e.y1>A[1])&&(!n||!eS(e,t,A[0]))&&(!n||(c=n,(a=e).x+a.x1>c[0].x&&a.x+a.x0<c[1].x&&a.y+a.y1>c[0].y&&a.y+a.y0<c[1].y))){for(var p,C=e.sprite,y=e.width>>5,v=A[0]>>5,B=e.x-(y<<4),m=127&B,b=32-m,E=e.y1-e.y0,Q=(e.y+e.y0)*v+(B>>5),F=0;F<E;F++){p=0;for(var w=0;w<=y;w++)t[Q+w]|=p<<b|(w<y?(p=C[F*y+w])>>>m:0);Q+=v}return e.sprite=null,!0}return!1}return l.layout=function(){for(var s=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=2048/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(xl()),l=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((A[0]>>5)*A[1]),f=null,h=c.length,d=-1,I=[],p=c.map((function(A){return{text:t(A),font:e(A),style:r(A),weight:i(A),rotate:o(A),size:~~(n(A)+1e-14),padding:a(A),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:A}})).sort((function(t,e){return e.size-t.size}));++d<h;){var C=p[d];C.x=A[0]*(u()+.5)>>1,C.y=A[1]*(u()+.5)>>1,tS(s,C,p,d),C.hasText&&g(l,C,f)&&(I.push(C),f?nS(f,C):f=[{x:C.x+C.x0,y:C.y+C.y0},{x:C.x+C.x1,y:C.y+C.y1}],C.x-=A[0]>>1,C.y-=A[1]>>1)}return I},l.words=function(t){return arguments.length?(c=t,l):c},l.size=function(t){return arguments.length?(A=[+t[0],+t[1]],l):A},l.font=function(t){return arguments.length?(e=iS(t),l):e},l.fontStyle=function(t){return arguments.length?(r=iS(t),l):r},l.fontWeight=function(t){return arguments.length?(i=iS(t),l):i},l.rotate=function(t){return arguments.length?(o=iS(t),l):o},l.text=function(e){return arguments.length?(t=iS(e),l):t},l.spiral=function(t){return arguments.length?(s=oS[t]||t,l):s},l.fontSize=function(t){return arguments.length?(n=iS(t),l):n},l.padding=function(t){return arguments.length?(a=iS(t),l):a},l.random=function(t){return arguments.length?(u=t,l):u},l};function tS(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,2048/o);var a,A,s,c,u,l=0,g=0,f=0,h=n.length;for(--r;++r<h;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,s=e.size<<1,e.rotate){var d=Math.sin(e.rotate*qw),I=Math.cos(e.rotate*qw),p=a*I,C=a*d,y=s*I,v=s*d;a=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,s=~~Math.max(Math.abs(C+y),Math.abs(C-y))}else a=a+31>>5<<5;if(s>f&&(f=s),l+a>=2048&&(l=0,g+=f,f=0),g+s>=2048)break;i.translate((l+(a>>1))/o,(g+(s>>1))/o),e.rotate&&i.rotate(e.rotate*qw),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=s,e.xoff=l,e.yoff=g,e.x1=a>>1,e.y1=s>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=a}for(var B=i.getImageData(0,0,2048/o,2048/o).data,m=[];--r>=0;)if((e=n[r]).hasText){for(A=(a=e.width)>>5,s=e.y1-e.y0,c=0;c<s*A;c++)m[c]=0;if(null==(l=e.xoff))return;g=e.yoff;var b=0,E=-1;for(u=0;u<s;u++){for(c=0;c<a;c++){var Q=A*u+(c>>5),F=B[2048*(g+u)+(l+c)<<2]?1<<31-c%32:0;m[Q]|=F,b|=F}b?E=u:(e.y0++,s--,u--,g++)}e.y1=e.y0+E,e.sprite=m.slice(0,(e.y1-e.y0)*A)}}}function eS(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),A=127&a,s=32-A,c=t.y1-t.y0,u=(t.y+t.y0)*n+(a>>5),l=0;l<c;l++){r=0;for(var g=0;g<=o;g++)if((r<<s|(g<o?(r=i[l*o+g])>>>A:0))&e[u+g])return!0;u+=n}return!1}function nS(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function rS(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function iS(t){return"function"===typeof t?t:function(){return t}}var oS={archimedean:rS,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}},aS=["x","y","font","fontSize","fontStyle","fontWeight","angle"],AS=["text","font","rotate","fontSize","fontStyle","fontWeight"];function sS(t){ha.call(this,$w(),t)}function cS(t){return new Uint8Array(t)}function uS(t){return new Uint16Array(t)}function lS(t){return new Uint32Array(t)}function gS(t,e,n){var r=(e<257?cS:e<65537?uS:lS)(t);return n&&r.set(n),r}sS.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:aS}]},Object(x.y)(sS,ha).transform=function(t,e){!t.size||t.size[0]&&t.size[1]||Object(x.n)("Wordcloud size dimensions must be non-zero.");var n=t.modified();if(n||e.changed(e.ADD_REM)||AS.some((function(n){var r=t[n];return Object(x.D)(r)&&e.modified(r.fields)}))){var r,i=e.materialize(e.SOURCE).source,o=this.value,a=t.as||aS,A=t.fontSize||14;if(Object(x.D)(A)?r=t.fontSizeRange:A=Object(x.l)(A),r){var s=A,c=vI("sqrt")().domain(Object(x.p)(i,s)).range(r);A=function(t){return c(s(t))}}i.forEach((function(t){t[a[0]]=NaN,t[a[1]]=NaN,t[a[3]]=0}));for(var u,l,g=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(A).random(Ha).layout(),f=o.size(),h=f[0]>>1,d=f[1]>>1,I=0,p=g.length;I<p;++I)(l=(u=g[I]).datum)[a[0]]=u.x+h,l[a[1]]=u.y+d,l[a[2]]=u.font,l[a[3]]=u.size,l[a[4]]=u.style,l[a[5]]=u.weight,l[a[6]]=u.rotate;return e.reflow(n).modifies(a)}};var fS=function(t,e,n){var r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd:function(t,e){var n,i=this.bisect(this.range,t.value),o=t.index,a=i[0],A=i[1],s=o.length;for(n=0;n<a;++n)e[o[n]]|=r;for(n=A;n<s;++n)e[o[n]]|=r;return this}}},hS=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var dS=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return hS(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}(hS),IS=dS.right,pS=dS.left;function CS(){var t=lS(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];var a,A,s,c=n,u=i.length,l=Array(u),g=lS(u);for(s=0;s<u;++s)l[s]=r(i[s]),g[s]=s;if(l=function(t,e){return t.sort.call(e,(function(e,n){var r=t[e],i=t[n];return r<i?-1:r>i?1:0})),function(t,e){return Array.from(e,(function(e){return t[e]}))}(t,e)}(l,g),c)a=e,A=t,e=Array(c+u),t=lS(c+u),function(t,e,n,r,i,o,a,A,s){var c,u=0,l=0;for(c=0;u<r&&l<a;++c)e[u]<i[l]?(A[c]=e[u],s[c]=n[u++]):(A[c]=i[l],s[c]=o[l++]+t);for(;u<r;++u,++c)A[c]=e[u],s[c]=n[u];for(;l<a;++l,++c)A[c]=i[l],s[c]=o[l]+t}(o,a,A,c,l,g,u,e,t);else{if(o>0)for(s=0;s<u;++s)g[s]+=o;e=l,t=g}return n=c+u,{index:g,value:l}},remove:function(r,i){var o,a,A,s=n;for(a=0;!i[t[a]]&&a<s;++a);for(A=a;a<s;++a)i[o=t[a]]||(t[A]=o,e[A]=e[a],++A);n=s-r},bisect:function(t,r){var i;return r?i=r.length:(r=e,i=n),[pS(r,t[0],0,i),IS(r,t[1],0,i)]},reindex:function(e){for(var r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:function(){return t},size:function(){return n}}}function yS(t){ha.call(this,function(){var t=8,e=[],n=lS(0),r=gS(0,t),i=gS(0,t);return{data:function(){return e},seen:function(){return t=n,r=e.length,n=t.length>=r?t:((i=i||new t.constructor(r)).set(t),i);var t,r,i},add:function(t){for(var n,r=0,i=e.length,o=t.length;r<o;++r)(n=t[r])._index=i++,e.push(n)},remove:function(t,n){var o,a,A,s=e.length,c=Array(s-t),u=e;for(a=0;!n[a]&&a<s;++a)c[a]=e[a],u[a]=a;for(A=a;a<s;++a)o=e[a],n[a]?u[a]=-1:(u[a]=A,r[A]=r[a],i[A]=i[a],c[A]=o,o._index=A++),r[a]=0;return e=c,u},size:function(){return e.length},curr:function(){return r},prev:function(){return i},reset:function(t){i[t]=r[t]},all:function(){return t<257?255:t<65537?65535:4294967295},set:function(t,e){r[t]|=e},clear:function(t,e){r[t]&=~e},resize:function(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=gS(e,t,r),i=gS(e,t))}}}(),t),this._indices=null,this._dims=null}yS.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};var vS=Object(x.y)(yS,ha);function BS(t){ha.call(this,null,t)}vS.transform=function(t,e){return this._dims?t.modified("fields")||t.fields.some((function(t){return e.modified(t.fields)}))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},vS.init=function(t,e){for(var n,r,i=t.fields,o=t.query,a=this._indices={},A=this._dims=[],s=o.length,c=0;c<s;++c)r=a[n=i[c].fname]||(a[n]=CS()),A.push(fS(r,c,o[c]));return this.eval(t,e)},vS.reinit=function(t,e){var n,r,i,o,a,A,s,c,u,l=e.materialize().fork(),g=t.fields,f=t.query,h=this._indices,d=this._dims,I=this.value,p=I.curr(),C=I.prev(),y=I.all(),v=l.rem=l.add,B=l.mod,m=f.length,b={};if(C.set(p),e.rem.length&&(a=this.remove(t,e,l)),e.add.length&&I.add(e.add),e.mod.length)for(A={},s=0,c=(o=e.mod).length;s<c;++s)A[o[s]._index]=1;for(s=0;s<m;++s)u=g[s],(!d[s]||t.modified("fields",s)||e.modified(u.fields))&&((n=b[i=u.fname])||(h[i]=r=CS(),b[i]=n=r.insert(u,e.source,0)),d[s]=fS(r,s,f[s]).onAdd(n,p));for(s=0,c=I.data().length;s<c;++s)a[s]||(C[s]!==p[s]?v.push(s):A[s]&&p[s]!==y&&B.push(s));return I.mask=(1<<m)-1,l},vS.eval=function(t,e){var n=e.materialize().fork(),r=this._dims.length,i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},vS.insert=function(t,e,n){var r,i,o,a=e.add,A=this.value,s=this._dims,c=this._indices,u=t.fields,l={},g=n.add,f=A.size(),h=f+a.length,d=s.length;A.resize(h,d),A.add(a);var I=A.curr(),p=A.prev(),C=A.all();for(r=0;r<d;++r)o=l[i=u[r].fname]||(l[i]=c[i].insert(u[r],a,f)),s[r].onAdd(o,I);for(;f<h;++f)p[f]=C,I[f]!==C&&g.push(f)},vS.modify=function(t,e){var n,r,i,o=e.mod,a=this.value,A=a.curr(),s=a.all(),c=t.mod;for(n=0,r=c.length;n<r;++n)A[i=c[n]._index]!==s&&o.push(i)},vS.remove=function(t,e,n){var r,i,o,a,A=this._indices,s=this.value,c=s.curr(),u=s.prev(),l=s.all(),g={},f=n.rem,h=e.rem;for(r=0,i=h.length;r<i;++r)g[o=h[r]._index]=1,u[o]=a=c[o],c[o]=l,a!==l&&f.push(o);for(o in A)A[o].remove(i,g);return this.reindex(e,i,g),g},vS.reindex=function(t,e,n){var r=this._indices,i=this.value;t.runAfter((function(){var t=i.remove(e,n);for(var o in r)r[o].reindex(t)}))},vS.update=function(t,e,n){var r,i,o=this._dims,a=t.query,A=e.stamp,s=o.length,c=0;for(n.filters=0,i=0;i<s;++i)t.modified("query",i)&&(r=i,++c);if(1===c)c=o[r].one,this.incrementOne(o[r],a[r],n.add,n.rem);else for(i=0,c=0;i<s;++i)t.modified("query",i)&&(c|=o[i].one,this.incrementAll(o[i],a[i],A,n.add),n.rem=n.add);return c},vS.incrementAll=function(t,e,n,r){var i,o,a,A=this.value,s=A.seen(),c=A.curr(),u=A.prev(),l=t.index(),g=t.bisect(t.range),f=t.bisect(e),h=f[0],d=f[1],I=g[0],p=g[1],C=t.one;if(h<I)for(i=h,o=Math.min(I,d);i<o;++i)s[a=l[i]]!==n&&(u[a]=c[a],s[a]=n,r.push(a)),c[a]^=C;else if(h>I)for(i=I,o=Math.min(h,p);i<o;++i)s[a=l[i]]!==n&&(u[a]=c[a],s[a]=n,r.push(a)),c[a]^=C;if(d>p)for(i=Math.max(h,p),o=d;i<o;++i)s[a=l[i]]!==n&&(u[a]=c[a],s[a]=n,r.push(a)),c[a]^=C;else if(d<p)for(i=Math.max(I,d),o=p;i<o;++i)s[a=l[i]]!==n&&(u[a]=c[a],s[a]=n,r.push(a)),c[a]^=C;t.range=e.slice()},vS.incrementOne=function(t,e,n,r){var i,o,a,A=this.value.curr(),s=t.index(),c=t.bisect(t.range),u=t.bisect(e),l=u[0],g=u[1],f=c[0],h=c[1],d=t.one;if(l<f)for(i=l,o=Math.min(f,g);i<o;++i)A[a=s[i]]^=d,n.push(a);else if(l>f)for(i=f,o=Math.min(l,h);i<o;++i)A[a=s[i]]^=d,r.push(a);if(g>h)for(i=Math.max(l,h),o=g;i<o;++i)A[a=s[i]]^=d,n.push(a);else if(g<h)for(i=Math.max(f,g),o=h;i<o;++i)A[a=s[i]]^=d,r.push(a);t.range=e.slice()},BS.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},Object(x.y)(BS,ha).transform=function(t,e){var n=~(t.ignore||0),r=t.filter,i=r.mask;if(0===(i&n))return e.StopPropagation;var o=e.fork(e.ALL),a=r.data(),A=r.curr(),s=r.prev(),c=function(t){return A[t]&n?null:a[t]};return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,(function(t){var e=A[t]&n;return!e&&e^s[t]&n?a[t]:null})),o.filter(o.REM,(function(t){var e=A[t]&n;return e&&!(e^e^s[t]&n)?a[t]:null}))):(o.filter(o.ADD,c),o.filter(o.REM,(function(t){return(A[t]&n)===i?a[t]:null}))),o.filter(o.SOURCE,(function(t){return c(t._index)}))};var mS=n(1084);function bS(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function ES(t,e){var n=t.globalCursor()?"undefined"!==typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function QS(t,e){var n=t._runtime.data;return Object(x.v)(n,e)||Object(x.n)("Unrecognized data set: "+e),n[e]}function FS(t,e){_t(e)||Object(x.n)("Second argument to changes must be a changeset.");var n=QS(this,t);return n.modified=!0,this.pulse(n.input,e)}function wS(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function SS(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function RS(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function US(t){var e=RS(t),n=wS(t),r=SS(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((function(e){try{e(n,r)}catch(i){t.error(i)}}))}var xS=function(t,e,n){var r,i,o,a=t._renderer,A=a&&a.canvas();return A&&(o=RS(t),i=e.changedTouches?e.changedTouches[0]:e,(r=kf(i,A))[0]-=o[0],r[1]-=o[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){var r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;Object(x.H)(t)&&(t=i(t));for(var e=n.slice();t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Object(x.l)(t),item:Object(x.l)(e||{}),group:i,xy:o,x:function(t){return o(t)[0]},y:function(t){return o(t)[1]}}}(t,n,r),e};var kS={trap:!1};function OS(t,e,n){var r=t._eventConfig&&t._eventConfig[e];return!(!1===r||Object(x.F)(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function NS(t){return t.item}function DS(t){return t.item.mark.source}function GS(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}var _S=function(t,e,n){var r=document.createElement(t);for(var i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r},MS=Math.sqrt(50),TS=Math.sqrt(10),jS=Math.sqrt(2);var LS=function(t,e,n){if(e){var r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:function(e){e!==t.signal(r.signal)&&t.runAsync(null,(function(){i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=Object(x.m)(r.debounce,i.update))),function(t,e,n,r){var i=_S("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(_S("label"));o.appendChild(_S("span",{class:"vega-bind-name"},n.name||n.signal)),e.appendChild(i);var a=VS;switch(n.input){case"checkbox":a=ZS;break;case"select":a=PS;break;case"radio":a=WS;break;case"range":a=JS}a(t,o,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,(function(){i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0),i}};function VS(t,e,n,r){var i=_S("input");for(var o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(function(){return t.update(i.value)})),t.elements=[i],t.set=function(t){return i.value=t}}function ZS(t,e,n,r){var i={type:"checkbox",name:n.signal};r&&(i.checked=!0);var o=_S("input",i);e.appendChild(o),o.addEventListener("change",(function(){return t.update(o.checked)})),t.elements=[o],t.set=function(t){return o.checked=!!t||null}}function PS(t,e,n,r){var i=_S("select",{name:n.signal}),o=n.labels||[];n.options.forEach((function(t,e){var n={value:t};HS(t,r)&&(n.selected=!0),i.appendChild(_S("option",n,(o[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(function(){t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=function(t){for(var e=0,r=n.options.length;e<r;++e)if(HS(n.options[e],t))return void(i.selectedIndex=e)}}function WS(t,e,n,r){var i=_S("span",{class:"vega-bind-radio"}),o=n.labels||[];e.appendChild(i),t.elements=n.options.map((function(e,a){var A={type:"radio",name:n.signal,value:e};HS(e,r)&&(A.checked=!0);var s=_S("input",A);s.addEventListener("change",(function(){return t.update(e)}));var c=_S("label",{},(o[a]||e)+"");return c.prepend(s),i.appendChild(c),s})),t.set=function(e){for(var n=t.elements,r=n.length,i=0;i<r;++i)HS(n[i].value,e)&&(n[i].checked=!0)}}function JS(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;var i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=MS?i*=10:o>=TS?i*=5:o>=jS&&(i*=2),e<t?-i:i}(o,i,100),A=_S("input",{type:"range",name:n.signal,min:o,max:i,step:a});A.value=r;var s=_S("span",{},+r);e.appendChild(A),e.appendChild(s);var c=function(){s.textContent=A.value,t.update(+A.value)};A.addEventListener("input",c),A.addEventListener("change",c),t.elements=[A],t.set=function(t){A.value=t,s.textContent=t}}function HS(t,e){return t===e||t+""===e+""}var YS=function(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,wS(t),SS(t),RS(t),i,o).background(t.background())},XS=function(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null};function zS(t,e){if("string"===typeof e){if("undefined"===typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}var KS=function(t){return+t||0},qS=function(t){return Object(x.F)(t)?{top:KS(t.top),bottom:KS(t.bottom),left:KS(t.left),right:KS(t.right)}:function(t){return{top:t,bottom:t,left:t,right:t}}(KS(t))},$S=function(t,e,n,r){return tR.apply(this,arguments)};function tR(){return(tR=Object(Et.a)(Z.a.mark((function t(e,n,r,i){var o,a;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=RC(n),(a=o&&o.headless)||Object(x.n)("Unrecognized renderer type: "+n),t.next=4,e.runAsync();case 4:return t.abrupt("return",YS(e,null,null,a,r,i).renderAsync(e._scenegraph.root));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function eR(){return(eR=Object(Et.a)(Z.a.mark((function t(e,n){var r;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e!==wC.Canvas&&e!==wC.SVG&&e!==wC.PNG&&Object(x.n)("Unrecognized image type: "+e),t.next=3,$S(this,e,n);case 3:return r=t.sent,t.abrupt("return",e===wC.SVG?nR(r.svg(),"image/svg+xml"):r.canvas().toDataURL("image/png"));case 5:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function nR(t,e){var n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}function rR(){return(rR=Object(Et.a)(Z.a.mark((function t(e,n){var r;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$S(this,wC.Canvas,e,n);case 2:return r=t.sent,t.abrupt("return",r.canvas());case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function iR(){return(iR=Object(Et.a)(Z.a.mark((function t(e){var n;return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$S(this,wC.SVG,e);case 2:return n=t.sent,t.abrupt("return",n.svg());case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function oR(t){var e=this.context.data[t];return e?e.values.value:[]}var aR=function(t){return function(e,n){return this.context.dataflow.locale()[t](n)(e)}},AR=aR("format"),sR=aR("timeFormat"),cR=aR("utcFormat"),uR=aR("timeParse"),lR=aR("utcParse"),gR=new Date(2e3,0,1);function fR(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(gR.setYear(2e3),gR.setMonth(t),gR.setDate(e),sR.call(this,gR,n)):""}var hR,dR,IR,pR,CR;function yR(t){this.type=t}yR.prototype.visit=function(t){var e,n,r;if(t(this))return 1;for(n=0,r=(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":var e=t.arguments.slice();return e.unshift(t.callee),e;case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this)).length;n<r;++n)if(e[n].visit(t))return 1};(hR={})[1]="Boolean",hR[2]="<end>",hR[3]="Identifier",hR[4]="Keyword",hR[5]="Null",hR[6]="Numeric",hR[7]="Punctuator",hR[8]="String",hR[9]="RegularExpression";var vR="ILLEGAL",BR=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),mR=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function bR(t,e){if(!t)throw new Error("ASSERT: "+e)}function ER(t){return t>=48&&t<=57}function QR(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function FR(t){return"01234567".indexOf(t)>=0}function wR(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function SR(t){return 10===t||13===t||8232===t||8233===t}function RR(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&BR.test(String.fromCharCode(t))}function UR(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&mR.test(String.fromCharCode(t))}var xR={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function kR(){for(var t;IR<pR&&(wR(t=dR.charCodeAt(IR))||SR(t));)++IR}function OR(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)IR<pR&&QR(dR[IR])?(r=dR[IR++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):XR({},"Unexpected token %0",vR);return String.fromCharCode(i)}function NR(){var t,e,n,r;for(e=0,"}"===(t=dR[IR])&&XR({},"Unexpected token %0",vR);IR<pR&&QR(t=dR[IR++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&XR({},"Unexpected token %0",vR),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function DR(){var t,e;for(t=dR.charCodeAt(IR++),e=String.fromCharCode(t),92===t&&(117!==dR.charCodeAt(IR)&&XR({},"Unexpected token %0",vR),++IR,(t=OR("u"))&&"\\"!==t&&RR(t.charCodeAt(0))||XR({},"Unexpected token %0",vR),e=t);IR<pR&&UR(t=dR.charCodeAt(IR));)++IR,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==dR.charCodeAt(IR)&&XR({},"Unexpected token %0",vR),++IR,(t=OR("u"))&&"\\"!==t&&UR(t.charCodeAt(0))||XR({},"Unexpected token %0",vR),e+=t);return e}function GR(){var t,e;return t=IR,{type:1===(e=92===dR.charCodeAt(IR)?DR():function(){var t,e;for(t=IR++;IR<pR;){if(92===(e=dR.charCodeAt(IR)))return IR=t,DR();if(!UR(e))break;++IR}return dR.slice(t,IR)}()).length?3:xR.hasOwnProperty(e)?4:"null"===e?5:"true"===e||"false"===e?1:3,value:e,start:t,end:IR}}function _R(){var t,e,n,r,i=IR,o=dR.charCodeAt(IR),a=dR[IR];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++IR,{type:7,value:String.fromCharCode(o),start:i,end:IR};default:if(61===(t=dR.charCodeAt(IR+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return IR+=2,{type:7,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:IR};case 33:case 61:return IR+=2,61===dR.charCodeAt(IR)&&++IR,{type:7,value:dR.slice(i,IR),start:i,end:IR}}}return">>>="===(r=dR.substr(IR,4))?{type:7,value:r,start:i,end:IR+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:IR+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:7,value:e,start:i,end:IR+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++IR}:void XR({},"Unexpected token %0",vR)}function MR(){var t,e,n;if(bR(ER((n=dR[IR]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=IR,t="","."!==n){if(t=dR[IR++],n=dR[IR],"0"===t){if("x"===n||"X"===n)return++IR,function(t){for(var e="";IR<pR&&QR(dR[IR]);)e+=dR[IR++];return 0===e.length&&XR({},"Unexpected token %0",vR),RR(dR.charCodeAt(IR))&&XR({},"Unexpected token %0",vR),{type:6,value:parseInt("0x"+e,16),start:t,end:IR}}(e);if(FR(n))return function(t){for(var e="0"+dR[IR++];IR<pR&&FR(dR[IR]);)e+=dR[IR++];return(RR(dR.charCodeAt(IR))||ER(dR.charCodeAt(IR)))&&XR({},"Unexpected token %0",vR),{type:6,value:parseInt(e,8),octal:!0,start:t,end:IR}}(e);n&&ER(n.charCodeAt(0))&&XR({},"Unexpected token %0",vR)}for(;ER(dR.charCodeAt(IR));)t+=dR[IR++];n=dR[IR]}if("."===n){for(t+=dR[IR++];ER(dR.charCodeAt(IR));)t+=dR[IR++];n=dR[IR]}if("e"===n||"E"===n)if(t+=dR[IR++],"+"!==(n=dR[IR])&&"-"!==n||(t+=dR[IR++]),ER(dR.charCodeAt(IR)))for(;ER(dR.charCodeAt(IR));)t+=dR[IR++];else XR({},"Unexpected token %0",vR);return RR(dR.charCodeAt(IR))&&XR({},"Unexpected token %0",vR),{type:6,value:parseFloat(t),start:e,end:IR}}function TR(){var t,e,n,r;return CR=null,kR(),t=IR,e=function(){var t,e,n,r;for(bR("/"===(t=dR[IR]),"Regular expression literal must start with a slash"),e=dR[IR++],n=!1,r=!1;IR<pR;)if(e+=t=dR[IR++],"\\"===t)SR((t=dR[IR++]).charCodeAt(0))&&XR({},"Invalid regular expression: missing /"),e+=t;else if(SR(t.charCodeAt(0)))XR({},"Invalid regular expression: missing /");else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||XR({},"Invalid regular expression: missing /"),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";IR<pR&&UR((t=dR[IR]).charCodeAt(0));)++IR,"\\"===t&&IR<pR?XR({},"Unexpected token %0",vR):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&XR({},"Invalid regular expression",n),{value:n,literal:e}}(),r=function(t,e){var n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(t,e){if(parseInt(e,16)<=1114111)return"x";XR({},"Invalid regular expression")})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){XR({},"Invalid regular expression")}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:IR}}function jR(){var t;return kR(),IR>=pR?{type:2,start:IR,end:IR}:RR(t=dR.charCodeAt(IR))?GR():40===t||41===t||59===t?_R():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(bR("'"===(t=dR[IR])||'"'===t,"String literal must starts with a quote"),e=IR,++IR;IR<pR;){if((n=dR[IR++])===t){t="";break}if("\\"===n)if((n=dR[IR++])&&SR(n.charCodeAt(0)))"\r"===n&&"\n"===dR[IR]&&++IR;else switch(n){case"u":case"x":"{"===dR[IR]?(++IR,i+=NR()):i+=OR(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:FR(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),IR<pR&&FR(dR[IR])&&(o=!0,r=8*r+"01234567".indexOf(dR[IR++]),"0123".indexOf(n)>=0&&IR<pR&&FR(dR[IR])&&(r=8*r+"01234567".indexOf(dR[IR++]))),i+=String.fromCharCode(r)):i+=n}else{if(SR(n.charCodeAt(0)))break;i+=n}}return""!==t&&XR({},"Unexpected token %0",vR),{type:8,value:i,octal:o,start:e,end:IR}}():46===t?ER(dR.charCodeAt(IR+1))?MR():_R():ER(t)?MR():_R()}function LR(){var t;return IR=(t=CR).end,CR=jR(),IR=t.end,t}function VR(){var t;t=IR,CR=jR(),IR=t}function ZR(t,e,n){var r=new yR("||"===t||"&&"===t?"LogicalExpression":"BinaryExpression");return r.operator=t,r.left=e,r.right=n,r}function PR(t,e){var n=new yR("CallExpression");return n.callee=t,n.arguments=e,n}function WR(t){var e=new yR("Identifier");return e.name=t,e}function JR(t){var e=new yR("Literal");return e.value=t.value,e.raw=dR.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function HR(t,e,n){var r=new yR("MemberExpression");return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function YR(t,e,n){var r=new yR("Property");return r.key=e,r.value=n,r.kind=t,r}function XR(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(function(t,e){return bR(e<r.length,"Message reference must be in range"),r[e]}));throw(n=new Error(i)).index=IR,n.description=i,n}function zR(t){2===t.type&&XR(t,"Unexpected end of input"),6===t.type&&XR(t,"Unexpected number"),8===t.type&&XR(t,"Unexpected string"),3===t.type&&XR(t,"Unexpected identifier"),4===t.type&&XR(t,"Unexpected reserved word"),XR(t,"Unexpected token %0",t.value)}function KR(t){var e=LR();7===e.type&&e.value===t||zR(e)}function qR(t){return 7===CR.type&&CR.value===t}function $R(t){return 4===CR.type&&CR.value===t}function tU(){var t=[];for(IR=CR.start,KR("[");!qR("]");)qR(",")?(LR(),t.push(null)):(t.push(gU()),qR("]")||KR(","));return LR(),function(t){var e=new yR("ArrayExpression");return e.elements=t,e}(t)}function eU(){var t;return IR=CR.start,8===(t=LR()).type||6===t.type?(t.octal&&XR(t,"Octal literals are not allowed in strict mode."),JR(t)):WR(t.value)}function nU(){var t,e,n;return IR=CR.start,3===(t=CR).type?(n=eU(),KR(":"),YR("init",n,gU())):2!==t.type&&7!==t.type?(e=eU(),KR(":"),YR("init",e,gU())):void zR(t)}function rU(){var t,e,n=[],r={},i=String;for(IR=CR.start,KR("{");!qR("}");)e="$"+("Identifier"===(t=nU()).key.type?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?XR({},"Duplicate data property in object literal not allowed in strict mode"):r[e]=!0,n.push(t),qR("}")||KR(",");return KR("}"),function(t){var e=new yR("ObjectExpression");return e.properties=t,e}(n)}var iU={if:1};function oU(){var t,e,n;if(qR("("))return function(){var t;return KR("("),t=fU(),KR(")"),t}();if(qR("["))return tU();if(qR("{"))return rU();if(t=CR.type,IR=CR.start,3===t||iU[CR.value])n=WR(LR().value);else if(8===t||6===t)CR.octal&&XR(CR,"Octal literals are not allowed in strict mode."),n=JR(LR());else{if(4===t)throw new Error("Disabled.");1===t?((e=LR()).value="true"===e.value,n=JR(e)):5===t?((e=LR()).value=null,n=JR(e)):qR("/")||qR("/=")?(n=JR(TR()),VR()):zR(LR())}return n}function aU(){var t=[];if(KR("("),!qR(")"))for(;IR<pR&&(t.push(gU()),!qR(")"));)KR(",");return KR(")"),t}function AU(){return KR("."),function(){var t;return IR=CR.start,function(t){return 3===t.type||4===t.type||1===t.type||5===t.type}(t=LR())||zR(t),WR(t.value)}()}function sU(){var t;return KR("["),t=fU(),KR("]"),t}function cU(){var t=function(){var t;for(t=oU();;)if(qR("."))t=HR(".",t,AU());else if(qR("("))t=PR(t,aU());else{if(!qR("["))break;t=HR("[",t,sU())}return t}();if(7===CR.type&&(qR("++")||qR("--")))throw new Error("Disabled.");return t}function uU(){var t,e;if(7!==CR.type&&4!==CR.type)e=cU();else{if(qR("++")||qR("--"))throw new Error("Disabled.");if(qR("+")||qR("-")||qR("~")||qR("!"))t=LR(),e=uU(),e=function(t,e){var n=new yR("UnaryExpression");return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if($R("delete")||$R("void")||$R("typeof"))throw new Error("Disabled.");e=cU()}}return e}function lU(t){var e=0;if(7!==t.type&&4!==t.type)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function gU(){var t,e;return t=function(){var t,e,n,r,i,o,a,A,s,c;if(t=CR,s=uU(),0===(i=lU(r=CR)))return s;for(r.prec=i,LR(),e=[t,CR],o=[s,r,a=uU()];(i=lU(CR))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),A=o.pop().value,s=o.pop(),e.pop(),n=ZR(A,s,a),o.push(n);(r=LR()).prec=i,o.push(r),e.push(CR),n=uU(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=ZR(o[c-1].value,o[c-2],n),c-=2;return n}(),qR("?")&&(LR(),e=gU(),KR(":"),t=function(t,e,n){var r=new yR("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,gU())),t}function fU(){var t=gU();if(qR(","))throw new Error("Disabled.");return t}var hU=function(t){IR=0,pR=(dR=t).length,CR=null,VR();var e=fU();if(2!==CR.type)throw new Error("Unexpect token after expression.");return e},dU={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"},IU=function(t){function e(e,n,r){return function(i){return function(e,n,r,i){var o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}}var n="new Date";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&Object(x.n)("Missing arguments to clamp function."),e.length>3&&Object(x.n)("Too many arguments to clamp function.");var n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),split:e("split","String"),replace:e("replace","String"),trim:e("trim","String",0),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&Object(x.n)("Missing arguments to if function."),e.length>3&&Object(x.n)("Too many arguments to if function.");var n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}};function pU(t,e,n,r){"Literal"!==e[0].type&&Object(x.n)("First argument to data functions must be a string literal.");var i=e[0].value,o=":"+i;if(!Object(x.v)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function CU(t,e,n,r){if("Literal"===e[0].type)yU(n,r,e[0].value);else for(t in n.scales)yU(n,r,t)}function yU(t,e,n){var r="%"+n;if(!Object(x.v)(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function vU(t,e){var n;return Object(x.D)(t)?t:Object(x.H)(t)?(n=e.scales[t])&&n.value:void 0}var BU=function(){return new mU};function mU(){this.reset()}mU.prototype={constructor:mU,reset:function(){this.s=this.t=0},add:function(t){EU(bU,t,this.t),EU(this,bU.s,this.s),this.s?this.t+=bU.t:this.s=bU.t},valueOf:function(){return this.s}};var bU=new mU;function EU(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var QU=Math.PI,FU=QU/2,wU=QU/4,SU=2*QU,RU=180/QU,UU=QU/180,xU=Math.abs,kU=(Math.atan,Math.atan2),OU=Math.cos,NU=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),DU=(Math.sign,Math.sqrt);Math.tan;function GU(t){return t>1?FU:t<-1?-FU:Math.asin(t)}function _U(){}function MU(t,e){t&&jU.hasOwnProperty(t.type)&&jU[t.type](t,e)}var TU={Feature:function(t,e){MU(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)MU(n[r].geometry,e)}},jU={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){LU(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)LU(n[r],e,0)},Polygon:function(t,e){VU(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)VU(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)MU(n[r],e)}};function LU(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function VU(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)LU(t[n],e,1);e.polygonEnd()}var ZU,PU,WU,JU,HU,YU=function(t,e){t&&TU.hasOwnProperty(t.type)?TU[t.type](t,e):MU(t,e)},XU=BU(),zU=BU(),KU={point:_U,lineStart:_U,lineEnd:_U,polygonStart:function(){XU.reset(),KU.lineStart=qU,KU.lineEnd=$U},polygonEnd:function(){var t=+XU;zU.add(t<0?SU+t:t),this.lineStart=this.lineEnd=this.point=_U},sphere:function(){zU.add(SU)}};function qU(){KU.point=tx}function $U(){ex(ZU,PU)}function tx(t,e){KU.point=ex,ZU=t,PU=e,WU=t*=UU,JU=OU(e=(e*=UU)/2+wU),HU=NU(e)}function ex(t,e){var n=(t*=UU)-WU,r=n>=0?1:-1,i=r*n,o=OU(e=(e*=UU)/2+wU),a=NU(e),A=HU*a,s=JU*o+A*OU(i),c=A*r*NU(i);XU.add(kU(c,s)),WU=t,JU=o,HU=a}function nx(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}var rx,ix,ox,ax,Ax,sx,cx,ux,lx,gx,fx=BU(),hx={point:dx,lineStart:px,lineEnd:Cx,polygonStart:function(){hx.point=yx,hx.lineStart=vx,hx.lineEnd=Bx,fx.reset(),KU.polygonStart()},polygonEnd:function(){KU.polygonEnd(),hx.point=dx,hx.lineStart=px,hx.lineEnd=Cx,XU<0?(rx=-(ox=180),ix=-(ax=90)):fx>1e-6?ax=90:fx<-1e-6&&(ix=-90),gx[0]=rx,gx[1]=ox},sphere:function(){rx=-(ox=180),ix=-(ax=90)}};function dx(t,e){lx.push(gx=[rx=t,ox=t]),e<ix&&(ix=e),e>ax&&(ax=e)}function Ix(t,e){var n,r=function(t){var e=t[0],n=t[1],r=OU(n);return[r*OU(e),r*NU(e),NU(n)]}([t*UU,e*UU]);if(ux){var i=nx(ux,r),o=nx([i[1],-i[0],0],i);!function(t){var e=DU(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}(o),o=[kU((n=o)[1],n[0]),GU(n[2])];var a,A=t-Ax,s=A>0?1:-1,c=o[0]*RU*s,u=xU(A)>180;u^(s*Ax<c&&c<s*t)?(a=o[1]*RU)>ax&&(ax=a):u^(s*Ax<(c=(c+360)%360-180)&&c<s*t)?(a=-o[1]*RU)<ix&&(ix=a):(e<ix&&(ix=e),e>ax&&(ax=e)),u?t<Ax?mx(rx,t)>mx(rx,ox)&&(ox=t):mx(t,ox)>mx(rx,ox)&&(rx=t):ox>=rx?(t<rx&&(rx=t),t>ox&&(ox=t)):t>Ax?mx(rx,t)>mx(rx,ox)&&(ox=t):mx(t,ox)>mx(rx,ox)&&(rx=t)}else lx.push(gx=[rx=t,ox=t]);e<ix&&(ix=e),e>ax&&(ax=e),ux=r,Ax=t}function px(){hx.point=Ix}function Cx(){gx[0]=rx,gx[1]=ox,hx.point=dx,ux=null}function yx(t,e){if(ux){var n=t-Ax;fx.add(xU(n)>180?n+(n>0?360:-360):n)}else sx=t,cx=e;KU.point(t,e),Ix(t,e)}function vx(){KU.lineStart()}function Bx(){yx(sx,cx),KU.lineEnd(),xU(fx)>1e-6&&(rx=-(ox=180)),gx[0]=rx,gx[1]=ox,ux=null}function mx(t,e){return(e-=t)<0?e+360:e}function bx(t,e){return t[0]-e[0]}function Ex(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var Qx,Fx,wx,Sx,Rx,Ux,xx,kx,Ox,Nx,Dx,Gx,_x,Mx,Tx,jx,Lx={sphere:_U,point:Vx,lineStart:Px,lineEnd:Hx,polygonStart:function(){Lx.lineStart=Yx,Lx.lineEnd=Xx},polygonEnd:function(){Lx.lineStart=Px,Lx.lineEnd=Hx}};function Vx(t,e){t*=UU;var n=OU(e*=UU);Zx(n*OU(t),n*NU(t),NU(e))}function Zx(t,e,n){++Qx,wx+=(t-wx)/Qx,Sx+=(e-Sx)/Qx,Rx+=(n-Rx)/Qx}function Px(){Lx.point=Wx}function Wx(t,e){t*=UU;var n=OU(e*=UU);Mx=n*OU(t),Tx=n*NU(t),jx=NU(e),Lx.point=Jx,Zx(Mx,Tx,jx)}function Jx(t,e){t*=UU;var n=OU(e*=UU),r=n*OU(t),i=n*NU(t),o=NU(e),a=kU(DU((a=Tx*o-jx*i)*a+(a=jx*r-Mx*o)*a+(a=Mx*i-Tx*r)*a),Mx*r+Tx*i+jx*o);Fx+=a,Ux+=a*(Mx+(Mx=r)),xx+=a*(Tx+(Tx=i)),kx+=a*(jx+(jx=o)),Zx(Mx,Tx,jx)}function Hx(){Lx.point=Vx}function Yx(){Lx.point=zx}function Xx(){Kx(Gx,_x),Lx.point=Vx}function zx(t,e){Gx=t,_x=e,t*=UU,e*=UU,Lx.point=Kx;var n=OU(e);Mx=n*OU(t),Tx=n*NU(t),jx=NU(e),Zx(Mx,Tx,jx)}function Kx(t,e){t*=UU;var n=OU(e*=UU),r=n*OU(t),i=n*NU(t),o=NU(e),a=Tx*o-jx*i,A=jx*r-Mx*o,s=Mx*i-Tx*r,c=DU(a*a+A*A+s*s),u=GU(c),l=c&&-u/c;Ox+=l*a,Nx+=l*A,Dx+=l*s,Fx+=u,Ux+=u*(Mx+(Mx=r)),xx+=u*(Tx+(Tx=i)),kx+=u*(jx+(jx=o)),Zx(Mx,Tx,jx)}function qx(t,e){return function(n,r,i){if(n){var o=vU(n,(i||this).context);return o&&o.path[t](r)}return e(r)}}var $x=qx("area",(function(t){return zU.reset(),YU(t,KU),2*zU})),tk=qx("bounds",(function(t){var e,n,r,i,o,a,A;if(ax=ox=-(rx=ix=1/0),lx=[],YU(t,hx),n=lx.length){for(lx.sort(bx),e=1,o=[r=lx[0]];e<n;++e)Ex(r,(i=lx[e])[0])||Ex(r,i[1])?(mx(r[0],i[1])>mx(r[0],r[1])&&(r[1]=i[1]),mx(i[0],r[1])>mx(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(A=mx(r[1],i[0]))>a&&(a=A,rx=i[0],ox=r[1])}return lx=gx=null,rx===1/0||ix===1/0?[[NaN,NaN],[NaN,NaN]]:[[rx,ix],[ox,ax]]})),ek=qx("centroid",(function(t){Qx=Fx=wx=Sx=Rx=Ux=xx=kx=Ox=Nx=Dx=0,YU(t,Lx);var e=Ox,n=Nx,r=Dx,i=e*e+n*n+r*r;return i<1e-12&&(e=Ux,n=xx,r=kx,Fx<1e-6&&(e=wx,n=Sx,r=Rx),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[kU(n,e)*RU,GU(r/DU(i))*RU]}));function nk(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}var rk=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function ik(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ok(){}var ak="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ak="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sk=/^#([0-9a-f]{3,8})$/,ck=new RegExp("^rgb\\("+["\\s*([+-]?\\d+)\\s*","\\s*([+-]?\\d+)\\s*","\\s*([+-]?\\d+)\\s*"]+"\\)$"),uk=new RegExp("^rgb\\("+[Ak,Ak,Ak]+"\\)$"),lk=new RegExp("^rgba\\("+["\\s*([+-]?\\d+)\\s*","\\s*([+-]?\\d+)\\s*","\\s*([+-]?\\d+)\\s*",ak]+"\\)$"),gk=new RegExp("^rgba\\("+[Ak,Ak,Ak,ak]+"\\)$"),fk=new RegExp("^hsl\\("+[ak,Ak,Ak]+"\\)$"),hk=new RegExp("^hsla\\("+[ak,Ak,Ak,ak]+"\\)$"),dk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ik(){return this.rgb().formatHex()}function pk(){return this.rgb().formatRgb()}function Ck(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=sk.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?yk(e):3===n?new bk(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?vk(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?vk(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ck.exec(t))?new bk(e[1],e[2],e[3],1):(e=uk.exec(t))?new bk(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=lk.exec(t))?vk(e[1],e[2],e[3],e[4]):(e=gk.exec(t))?vk(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=fk.exec(t))?wk(e[1],e[2]/100,e[3]/100,1):(e=hk.exec(t))?wk(e[1],e[2]/100,e[3]/100,e[4]):dk.hasOwnProperty(t)?yk(dk[t]):"transparent"===t?new bk(NaN,NaN,NaN,0):null}function yk(t){return new bk(t>>16&255,t>>8&255,255&t,1)}function vk(t,e,n,r){return r<=0&&(t=e=n=NaN),new bk(t,e,n,r)}function Bk(t){return t instanceof ok||(t=Ck(t)),t?new bk((t=t.rgb()).r,t.g,t.b,t.opacity):new bk}function mk(t,e,n,r){return 1===arguments.length?Bk(t):new bk(t,e,n,null==r?1:r)}function bk(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ek(){return"#"+Fk(this.r)+Fk(this.g)+Fk(this.b)}function Qk(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Fk(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function wk(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Uk(t,e,n,r)}function Sk(t){if(t instanceof Uk)return new Uk(t.h,t.s,t.l,t.opacity);if(t instanceof ok||(t=Ck(t)),!t)return new Uk;if(t instanceof Uk)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,A=o-i,s=(o+i)/2;return A?(a=e===o?(n-r)/A+6*(n<r):n===o?(r-e)/A+2:(e-n)/A+4,A/=s<.5?o+i:2-o-i,a*=60):A=s>0&&s<1?0:a,new Uk(a,A,s,t.opacity)}function Rk(t,e,n,r){return 1===arguments.length?Sk(t):new Uk(t,e,n,null==r?1:r)}function Uk(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function xk(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function kk(t){var e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ok(t){var e=mk(t);return.2126*kk(e.r)+.7152*kk(e.g)+.0722*kk(e.b)}rk(ok,Ck,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ik,formatHex:Ik,formatHsl:function(){return Sk(this).formatHsl()},formatRgb:pk,toString:pk}),rk(bk,mk,ik(ok,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new bk(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new bk(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ek,formatHex:Ek,formatRgb:Qk,toString:Qk})),rk(Uk,Rk,ik(ok,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Uk(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Uk(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new bk(xk(t>=240?t-240:t+120,i,r),xk(t,i,r),xk(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));function Nk(t,e){return t===e||t!==t&&e!==e||(Object(x.A)(t)?!(!Object(x.A)(e)||t.length!==e.length)&&function(t,e){for(var n=0,r=t.length;n<r;++n)if(!Nk(t[n],e[n]))return!1;return!0}(t,e):!(!Object(x.F)(t)||!Object(x.F)(e))&&Dk(t,e))}function Dk(t,e){for(var n in t)if(!Nk(t[n],e[n]))return!1;return!0}function Gk(t){return function(e){return Dk(t,e)}}var _k=function(t){return t.data};function Mk(t,e){var n=oR.call(e,t);return n.root&&n.root.lookup||{}}var Tk=function(){return"undefined"!==typeof window&&window||null};function jk(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,A=0;A<a;++A)if((r=i[A]).getter=x.t.getter||Object(x.t)(r.field),n=r.getter(t),Object(x.C)(n)&&(n=Object(x.cb)(n)),Object(x.C)(o[A])&&(o[A]=Object(x.cb)(o[A])),Object(x.C)(o[A][0])&&(o[A]=o[A].map(x.cb)),"E"===r.type){if(Object(x.A)(o[A])?o[A].indexOf(n)<0:n!==o[A])return!1}else if("R"===r.type){if(!Object(x.z)(n,o[A]))return!1}else if("R-RE"===r.type){if(!Object(x.z)(n,o[A],!0,!1))return!1}else if("R-E"===r.type){if(!Object(x.z)(n,o[A],!1,!1))return!1}else if("R-LE"===r.type&&!Object(x.z)(n,o[A],!1,!0))return!1;return!0}var Lk={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((function(t){return e.indexOf(t)>=0})):e},R_union:function(t,e){var n=Object(x.cb)(e[0]),r=Object(x.cb)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=Object(x.cb)(e[0]),r=Object(x.cb)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};function Vk(t,e,n,r){"Literal"!==e[0].type&&Object(x.n)("First argument to selection functions must be a string literal.");var i=e[0].value,o=":"+i;"intersect"!==(e.length>=2&&Object(x.U)(e).value)||Object(x.v)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(x.v)(r,o)||(r[o]=n.getData(i).tuplesRef())}var Zk=Math.PI/180,Pk=180/Math.PI;function Wk(t){if(t instanceof Hk)return new Hk(t.l,t.a,t.b,t.opacity);if(t instanceof tO)return eO(t);t instanceof bk||(t=Bk(t));var e,n,r=Kk(t.r),i=Kk(t.g),o=Kk(t.b),a=Yk((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=Yk((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Yk((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Hk(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Jk(t,e,n,r){return 1===arguments.length?Wk(t):new Hk(t,e,n,null==r?1:r)}function Hk(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Yk(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function Xk(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function zk(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Kk(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function qk(t){if(t instanceof tO)return new tO(t.h,t.c,t.l,t.opacity);if(t instanceof Hk||(t=Wk(t)),0===t.a&&0===t.b)return new tO(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Pk;return new tO(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function $k(t,e,n,r){return 1===arguments.length?qk(t):new tO(t,e,n,null==r?1:r)}function tO(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function eO(t){if(isNaN(t.h))return new Hk(t.l,0,0,t.opacity);var e=t.h*Zk;return new Hk(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}rk(Hk,Jk,ik(ok,{brighter:function(t){return new Hk(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Hk(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new bk(zk(3.1338561*(e=.96422*Xk(e))-1.6168667*(t=1*Xk(t))-.4906146*(n=.82521*Xk(n))),zk(-.9787684*e+1.9161415*t+.033454*n),zk(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),rk(tO,$k,ik(ok,{brighter:function(t){return new tO(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new tO(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return eO(this).rgb()}}));var nO={random:function(){return Ha()},cumulativeNormal:iA,cumulativeLogNormal:uA,cumulativeUniform:IA,densityNormal:rA,densityLogNormal:cA,densityUniform:dA,quantileNormal:oA,quantileLogNormal:lA,quantileUniform:pA,sampleNormal:nA,sampleLogNormal:sA,sampleUniform:hA,isArray:x.A,isBoolean:x.B,isDate:x.C,isDefined:function(t){return void 0!==t},isNumber:x.E,isObject:x.F,isRegExp:x.G,isString:x.H,isTuple:Rt,isValid:function(t){return null!=t&&t===t},toBoolean:x.ab,toDate:x.bb,toNumber:x.cb,toString:x.eb,flush:x.u,lerp:x.J,merge:function(){var t=[].slice.call(arguments);return t.unshift({}),x.o.apply(null,t)},pad:x.P,peek:x.U,span:x.X,inrange:x.z,truncate:x.fb,rgb:mk,lab:Jk,hcl:$k,hsl:Rk,luminance:Ok,contrast:function(t,e){var n=Ok(t),r=Ok(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o},format:AR,utcFormat:cR,utcParse:lR,utcOffset:Yr,utcSequence:Kr,timeFormat:sR,timeParse:uR,timeOffset:Hr,timeSequence:zr,timeUnitSpecifier:En,monthFormat:function(t){return fR.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return fR.call(this,t,1,"%b")},dayFormat:function(t){return fR.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return fR.call(this,0,2+t,"%a")},quarter:x.V,utcquarter:x.hb,week:er,utcweek:Ar,dayofyear:tr,utcdayofyear:ar,warn:function(){return nk(this.context.dataflow,"warn",arguments)},info:function(){return nk(this.context.dataflow,"info",arguments)},debug:function(){return nk(this.context.dataflow,"debug",arguments)},extent:x.p,inScope:function(t){var e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];var r=Object(QA.a)(t,2),i=r[0],o=r[1],a=(new wl).set(i[0],i[1],o[0],o[1]);return UC(n||this.context.dataflow.scenegraph().root,a,function(t){var e=null;if(t){var n=Object(x.i)(t.marktype),r=Object(x.i)(t.markname);e=function(t){return(!n.length||n.some((function(e){return t.marktype===e})))&&(!r.length||r.some((function(e){return t.name===e})))}}return e}(e))},clampRange:x.j,pinchDistance:function(t){var e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){var e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){var t=Tk();return t?t.screen:{}},containerSize:function(){var t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){var t=Tk();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return oh(t||0,e||0,n||0)},setdata:function(t,e){var n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(x.gb).insert(e)),1},pathShape:function(t){var e=null;return function(n){return n?Uu(n,e=e||yu(t)):t}},panLinear:x.Q,panLog:x.R,panPow:x.S,panSymlog:x.T,zoomLinear:x.lb,zoomLog:x.mb,zoomPow:x.nb,zoomSymlog:x.ob,encode:function(t,e,n){if(t){var r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){var a,A,s=this.context.dataflow,c=this.context.data[t],u=c.input,l=c.changes,g=s.stamp();if(!1===s._trigger||!(u.value.length||e||r))return 0;if((!l||l.stamp<g)&&(c.changes=l=s.changeset(),l.stamp=g,s.runAfter((function(){c.modified=!0,s.pulse(u,l).run()}),!0,1)),n&&(a=!0===n?x.gb:Object(x.A)(n)||Rt(n)?n:Gk(n),l.remove(a)),e&&l.insert(e),r&&(a=Gk(r),u.value.some(a)?l.remove(a):l.insert(r)),i)for(A in o)l.modify(i,A,o[A]);return 1}},rO=["view","item","group","xy","x","y"],iO={};function oO(t,e,n){return 1===arguments.length?nO[t]:(nO[t]=e,n&&(iO[t]=n),AO&&(AO.functions[t]="this."+t),this)}oO("bandwidth",(function(t,e){var n=vU(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),CU),oO("copy",(function(t,e){var n=vU(t,(e||this).context);return n?n.copy():void 0}),CU),oO("domain",(function(t,e){var n=vU(t,(e||this).context);return n?n.domain():[]}),CU),oO("range",(function(t,e){var n=vU(t,(e||this).context);return n&&n.range?n.range():[]}),CU),oO("invert",(function(t,e,n){var r=vU(t,(n||this).context);return r?Object(x.A)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),CU),oO("scale",(function(t,e,n){var r=vU(t,(n||this).context);return r?r(e):void 0}),CU),oO("gradient",(function(t,e,n,r,i){t=vU(t,(i||this).context);var o=mc(e,n),a=t.domain(),A=a[0],s=Object(x.U)(a),c=x.x;return s-A?c=Qp(t,A,s):t=(t.interpolator?vI("sequential")().interpolator(t.interpolator()):vI("linear")().interpolate(t.interpolate()).range(t.range())).domain([A=0,s=1]),t.ticks&&(A!==(a=t.ticks(+r||15))[0]&&a.unshift(A),s!==Object(x.U)(a)&&a.push(s)),a.forEach((function(e){return o.stop(c(e),t(e))})),o}),CU),oO("geoArea",$x,CU),oO("geoBounds",tk,CU),oO("geoCentroid",ek,CU),oO("geoShape",(function(t,e,n){var r=vU(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),CU),oO("indata",(function(t,e,n){var r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){"Literal"!==e[0].type&&Object(x.n)("First argument to indata must be a string literal."),"Literal"!==e[1].type&&Object(x.n)("Second argument to indata must be a string literal.");var i=e[0].value,o=e[1].value,a="@"+o;Object(x.v)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),oO("data",oR,pU),oO("treePath",(function(t,e,n){var r=Mk(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(_k):void 0}),pU),oO("treeAncestors",(function(t,e){var n=Mk(t,this)[e];return n?n.ancestors().map(_k):void 0}),pU),oO("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,A,s=this.context.data[t],c=s?s.values.value:[],u=s?s["index:unit"]&&s["index:unit"].value:void 0,l="intersect"===n,g=c.length,f=0;f<g;++f)if(r=c[f],u&&l){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(A=jk(e,r),i[a]=A?-1:++o,A&&1===u.size)return!0;if(!A&&o===u.get(a).count)return!1}else if(l^(A=jk(e,r)))return A;return g&&l}),Vk),oO("vlSelectionResolve",(function(t,e,n){for(var r,i,o,a,A,s,c,u,l,g,f,h=this.context.data[t],d=h?h.values.value:[],I={},p={},C={},y=d.length,B=0;B<y;++B){for(a=(r=d[B]).unit,i=r.fields,o=r.values,g=0,f=i.length;g<f;++g)A=i[g],c=(s=I[A.field]||(I[A.field]={}))[a]||(s[a]=[]),C[A.field]=u=A.type.charAt(0),l=Lk[u+"_union"],s[a]=l(c,Object(x.i)(o[g]));n&&(c=p[a]||(p[a]=[])).push(Object(x.i)(o).reduce((function(t,e,n){return t[i[n].field]=e,t}),{}))}return e=e||"union",Object.keys(I).forEach((function(t){I[t]=Object.keys(I[t]).map((function(e){return I[t][e]})).reduce((function(n,r){return void 0===n?r:Lk[C[t]+"_"+e](n,r)}))})),d=Object.keys(p),n&&d.length&&(I.vlMulti="union"===e?Object(v.a)({},"or",d.reduce((function(t,e){return t.push.apply(t,p[e]),t}),[])):Object(v.a)({},"and",d.map((function(t){return Object(v.a)({},"or",p[t])})))),I}),Vk);var aO={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(t){return"_["+Object(x.Z)("$"+t)+"]"},functions:function(t){var e=IU(t);for(var n in rO.forEach((function(t){return e[t]="event.vega."+t})),nO)e[n]="this."+n;return Object(x.o)(e,function(t,e,n){e.__bandwidth=function(t){return t&&t.bandwidth?t.bandwidth():0},n._bandwidth=CU,n._range=CU,n._scale=CU;var r=function(e){return"_["+("Literal"===e.type?Object(x.Z)("%"+e.value):Object(x.Z)("%")+"+"+t(e))+"]"};return{_bandwidth:function(t){return"this.__bandwidth(".concat(r(t[0]),")")},_range:function(t){return"".concat(r(t[0]),".range()")},_scale:function(e){return"".concat(r(e[0]),"(").concat(t(e[1]),")")}}}(t,nO,iO)),e},constants:dU,visitors:iO},AO=function(t){var e=(t=t||{}).whitelist?Object(x.db)(t.whitelist):{},n=t.blacklist?Object(x.db)(t.blacklist):{},r=t.constants||dU,i=(t.functions||IU)(l),o=t.globalvar,a=t.fieldvar,A={},s={},c=0,u=Object(x.D)(o)?o:function(t){return o+'["'+t+'"]'};function l(t){if(Object(x.H)(t))return t;var e=g[t.type];return null==e&&Object(x.n)("Unsupported type: "+t.type),e(t)}var g={Literal:function(t){return t.raw},Identifier:function(t){var i=t.name;return c>0?i:Object(x.v)(n,i)?Object(x.n)("Illegal identifier: "+i):Object(x.v)(r,i)?r[i]:Object(x.v)(e,i)?i:(A[i]=1,u(i))},MemberExpression:function(t){var e=!t.computed,n=l(t.object);e&&(c+=1);var r=l(t.property);return n===a&&(s[function(t){var e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&Object(x.n)("Illegal callee type: "+t.callee.type);var e=t.callee.name,n=t.arguments,r=Object(x.v)(i,e)&&i[e];return r||Object(x.n)("Unrecognized function: "+e),Object(x.D)(r)?r(n):r+"("+n.map(l).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(l).join(",")+"]"},BinaryExpression:function(t){return"("+l(t.left)+t.operator+l(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+l(t.argument)+")"},ConditionalExpression:function(t){return"("+l(t.test)+"?"+l(t.consequent)+":"+l(t.alternate)+")"},LogicalExpression:function(t){return"("+l(t.left)+t.operator+l(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(l).join(",")+"}"},Property:function(t){c+=1;var e=l(t.key);return c-=1,e+":"+l(t.value)}};function f(t){var e={code:l(t),globals:Object.keys(A),fields:Object.keys(s)};return A={},s={},e}return f.functions=i,f.constants=r,f}(aO),sO=function(t,e){var n,r,i={};try{t=Object(x.H)(t)?t:Object(x.Z)(t)+"",n=hU(t)}catch(o){Object(x.n)("Expression parse error: "+t)}return n.visit((function(t){if("CallExpression"===t.type){var n=t.callee.name,r=aO.visitors[n];r&&r(n,t.arguments,e,i)}})),(r=AO(n)).globals.forEach((function(t){var n="$"+t;!Object(x.v)(i,n)&&e.getSignal(t)&&(i[n]=e.signalRef(t))})),{$expr:Object(x.o)({code:r.code},e.options.ast?{ast:n}:null),$fields:r.fields,$params:i}},cO=Object(x.db)(["rule"]),uO=Object(x.db)(["group","image","rect"]);function lO(t){return(t+"").toLowerCase()}function gO(t,e,n){";"!==n[n.length-1]&&(n="return("+n+");");var r=Function.apply(null,e.concat(n));return t&&t.functions?r.bind(t.functions):r}var fO={operator:function(t,e){return gO(t,["_"],e.code)},parameter:function(t,e){return gO(t,["datum","_"],e.code)},event:function(t,e){return gO(t,["event"],e.code)},handler:function(t,e){return gO(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";"))},encode:function(t,e){var n=e.marktype,r=e.channels,i="var o=item,datum=o.datum,m=0,$;";for(var o in r){var a="o["+Object(x.Z)(o)+"]";i+="$=".concat(r[o].code,";if(").concat(a,"!==$)").concat(a,"=$,m=1;")}return i+=function(t,e){var n="";return cO[e]||(t.x2&&(t.x?(uO[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(uO[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),gO(t,["item","_"],i+="return m;")},codegen:{get:function(t){var e="[".concat(t.map(x.Z).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator:function(t,e){var n,r=Function("a","b","var u, v; return "+t.map((function(t,r){var i,o,a=e[r];return t.path?(i="a".concat(t.path),o="b".concat(t.path)):((n=n||{})["f"+r]=t,i="this.f".concat(r,"(a)"),o="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n  : (u > v || v == null) && u != null ? ").concat(r,"\n  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n  : v !== v && u === u ? ").concat(r," : ")}(i,o,-a,a)})).join("")+"0;");return n?r.bind(n):r}}};function hO(t,e,n){if(!t||!Object(x.F)(t))return t;for(var r,i=0,o=dO.length;i<o;++i)if(r=dO[i],Object(x.v)(t,r.key))return r.parse(t,e,n);return t}var dO=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||Object(x.n)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){var n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=Object(x.I)(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,e,n){t.$params&&e.parseParameters(t.$params,n);var r="e:"+t.$expr.code+"_"+t.$name;return e.fn[r]||(e.fn[r]=Object(x.f)(e.parameterExpression(t.$expr),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;var n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=Object(x.t)(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,e){var n=t.$encode,r={};for(var i in n){var o=n[i];r[i]=Object(x.f)(e.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}},{key:"$compare",parse:function(t,e){var n="c:"+t.$compare+"_"+t.$order,r=Object(x.i)(t.$compare).map((function(t){return t&&t.$tupleid?Ut:t}));return e.fn[n]||(e.fn[n]=Object(x.k)(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,i){var o=e.fork().parse(n),a=o.get(n.operators[0].id),A=o.signals.parent;return A&&A.set(i),a.detachSubflow=function(){return e.detach(o)},a}}},{key:"$tupleid",parse:function(){return Ut}}];var IO={skip:!0};var pO=function(t,e,n,r){return new CO(t,e,n,r)};function CO(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||fO,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function yO(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}CO.prototype=yO.prototype={fork:function(){var t=new yO(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach:function(t){this.subcontext=this.subcontext.filter((function(e){return e!==t}));for(var e=Object.keys(t.nodes),n=0,r=e;n<r.length;n++){var i=r[n];t.nodes[i]._targets=null}for(var o=0,a=e;o<a.length;o++){var A=a[o];t.nodes[A].detach()}t.nodes=null},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),"collect"===lO(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){var o=n.get(t.parent.$ref);o?(r.connect(o,[e]),e.targets().add(o)):(n.unresolved=n.unresolved||[]).push((function(){o=n.get(t.parent.$ref),r.connect(o,[e]),e.targets().add(o)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data){var a=function(r){var i=n.data[r]||(n.data[r]={});t.data[r].forEach((function(t){return i[t]=e}))};for(var A in t.data)a(A)}},resolve:function(){return(this.unresolved||[]).forEach((function(t){return t()})),delete this.unresolved,this},operator:function(t,e){this.add(t,this.dataflow.add(t.value,e))},transform:function(t,e){this.add(t,this.dataflow.add(this.transforms[lO(e)]))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression:function(t){return this.expr.operator(this,t)},parameterExpression:function(t){return this.expr.parameter(this,t)},eventExpression:function(t){return this.expr.event(this,t)},handlerExpression:function(t){return this.expr.handler(this,t)},encodeExpression:function(t){return this.expr.encode(this,t)},parse:function(t){var e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((function(t){return e.parseOperator(t)})),n.forEach((function(t){return e.parseOperatorParameters(t)})),(t.streams||[]).forEach((function(t){return e.parseStream(t)})),(t.updates||[]).forEach((function(t){return e.parseUpdate(t)})),e.resolve()},parseOperator:function(t){"operator"!==lO(t.type)&&t.type?this.transform(t,t.type):this.operator(t,t.update?this.operatorExpression(t.update):null)},parseOperatorParameters:function(t){if(t.params){var e=this.get(t.id);e||Object(x.n)("Invalid operator id: "+t.id),this.dataflow.connect(e,e.parameters(this.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};var n=this;for(var r in t){var i=t[r];e[r]=Object(x.A)(i)?i.map((function(t){return hO(t,n,e)})):hO(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map((function(t){return n.get(t)})))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((function(t){return n.get(t)})),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&Object(x.n)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=Object(x.F)(n=t.source)?n.$ref:n,r=this.get(n),i=t.update,o=void 0;r||Object(x.n)("Source not defined: "+t.source),e=t.target&&t.target.$expr?this.eventExpression(t.target.$expr):this.get(t.target),i&&i.$expr&&(i.$params&&(o=this.parseParameters(i.$params)),i=this.handlerExpression(i.$expr)),this.update(t,r,e,i,o)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((function(n){var i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((function(n){var r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((function(e){return e.getState(t)}))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((function(t){n.update(e.signals[t],i[t],IO)})),Object.keys(r||{}).forEach((function(t){n.pulse(e.data[t].input,n.changeset().remove(x.gb).insert(r[t]))})),(t.subcontext||[]).forEach((function(t,n){var r=e.subcontext[n];r&&r.setState(t)}))}};var vO={skip:!0};function BO(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.left+r.right:0)}function mO(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.top+r.bottom:0)}function bO(t,e){return e.modified&&Object(x.A)(e.input.value)&&t.indexOf("_:vega:_")}function EO(t,e){return!("parent"===t||e instanceof Ia.proxy)}var QO=n(839),FO=function(t,e,n,r){var i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":Object(x.A)(t)?wO(t):Object(x.F)(t)&&!Object(x.C)(t)?(e=t,Object.keys(e).map((function(t){var n=e[t];return t+": "+(Object(x.A)(n)?wO(n):SO(n))})).join("\n")):t+"";var e}(r))};function wO(t){return"["+t.map(SO).join(", ")+"]"}function SO(t){return Object(x.A)(t)?"[\u2026]":Object(x.F)(t)&&!Object(x.C)(t)?"{\u2026}":t}function RO(t,e){if(e=e||{},la.call(this),e.loader&&this.loader(e.loader),e.logger&&this.logger(e.logger),null!=e.logLevel&&this.logLevel(e.logLevel),e.locale||t.locale){var n=Object(x.o)({},t.locale,e.locale);this.locale(jo(n.number,n.time))}this._el=null,this._elBind=null,this._renderType=e.renderer||wC.Canvas,this._scenegraph=new Ef;var r=this._scenegraph.root;this._renderer=null,this._tooltip=e.tooltip||FO,this._redraw=!0,this._handler=(new Hf).scene(r),this._globalCursor=!1,this._preventDefault=!1,this._timers=[],this._eventListeners=[],this._resizeListeners=[],this._eventConfig=function(t){var e=Object(x.o)({defaults:{}},t),n=function(t,e){e.forEach((function(e){Object(x.A)(t[e])&&(t[e]=Object(x.db)(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),this.globalCursor(this._eventConfig.globalCursor);var i=function(t,e,n){return pO(t,Ia,nO,n).parse(e)}(this,t,e.expr);this._runtime=i,this._signals=i.signals,this._bind=(t.bindings||[]).map((function(t){return{state:null,param:Object(x.o)({},t)}})),i.root&&i.root.set(r),r.source=i.data.root.input,this.pulse(i.data.root.input,this.changeset().insert(r.items)),this._width=this.width(),this._height=this.height(),this._viewWidth=BO(this,this._width),this._viewHeight=mO(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(function(e){t._width=e.size,t._viewWidth=BO(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(function(e){t._height=e.size,t._viewHeight=mO(t,e.size),o()}),{size:r});var a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(this),function(t){t.add(null,(function(e){return t._background=e.bg,t._resize=1,e.bg}),{bg:t._signals.background})}(this),function(t){var e=t._signals.cursor||(t._signals.cursor=t.add({user:"default",item:null}));t.on(t.events("view","mousemove"),e,(function(t,n){var r=e.value,i=r?Object(x.H)(r)?r:r.user:"default",o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(e){var n=e.cursor,r=this.value;return Object(x.H)(n)||(r=n.item,n=n.user),ES(t,n&&"default"!==n?n:r||n),r}),{cursor:e})}(this),this.description(t.description),e.hover&&this.hover(),e.container&&this.initialize(e.container,e.bind)}var UO=Object(x.y)(RO,la);function xO(t,e){return Object(x.v)(t._signals,e)?t._signals[e]:Object(x.n)("Unrecognized signal name: "+Object(x.Z)(e))}function kO(t,e){var n=(t._targets||[]).filter((function(t){return t._update&&t._update.handler===e}));return n.length?n[0]:null}function OO(t,e,n,r){var i=kO(n,r);return i||((i=XS(t,(function(){return r(e,n.value)}))).handler=r,t.on(n,null,i)),t}function NO(t,e,n){var r=kO(e,n);return r&&e._targets.remove(r),t}UO.evaluate=function(){var t=Object(Et.a)(Z.a.mark((function t(e,n,r){return Z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,la.prototype.evaluate.call(this,e,n);case 2:if(!this._redraw&&!this._resize){t.next=14;break}if(t.prev=3,!this._renderer){t.next=8;break}return this._resize&&(this._resize=0,US(this)),t.next=8,this._renderer.renderAsync(this._scenegraph.root);case 8:this._redraw=!1,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),this.error(t.t0);case 14:return r&&Qt(this,r),t.abrupt("return",this);case 16:case"end":return t.stop()}}),t,this,[[3,11]])})));return function(e,n,r){return t.apply(this,arguments)}}(),UO.dirty=function(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},UO.description=function(t){if(arguments.length){var e=null!=t?t+"":null;return e!==this._desc&&bS(this._el,this._desc=e),this}return this._desc},UO.container=function(){return this._el},UO.scenegraph=function(){return this._scenegraph},UO.origin=function(){return this._origin.slice()},UO.signal=function(t,e,n){var r=xO(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},UO.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},UO.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},UO.padding=function(t){return arguments.length?this.signal("padding",qS(t)):qS(this.signal("padding"))},UO.autosize=function(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},UO.background=function(t){return arguments.length?this.signal("background",t):this.signal("background")},UO.renderer=function(t){return arguments.length?(RC(t)||Object(x.n)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},UO.tooltip=function(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},UO.loader=function(t){return arguments.length?(t!==this._loader&&(la.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},UO.resize=function(){return this._autosize=1,this.touch(xO(this,"autosize"))},UO._resetRenderer=function(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},UO._resizeView=function(t,e,n,r,i,o){this.runAfter((function(a){var A=0;a._autosize=0,a.width()!==n&&(A=1,a.signal("width",n,vO),a._resizeWidth.skip(!0)),a.height()!==r&&(A=1,a.signal("height",r,vO),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),A&&a.run("enter"),o&&a.runAfter((function(t){return t.resize()}))}),!1,1)},UO.addEventListener=function(t,e,n){var r=e;return n&&!1===n.trap||((r=XS(this,e)).raw=e),this._handler.on(t,r),this},UO.removeEventListener=function(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},UO.addResizeListener=function(t){var e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},UO.removeResizeListener=function(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},UO.addSignalListener=function(t,e){return OO(this,t,xO(this,t),e)},UO.removeSignalListener=function(t,e){return NO(this,xO(this,t),e)},UO.addDataListener=function(t,e){return OO(this,t,QS(this,t).values,e)},UO.removeDataListener=function(t,e){return NO(this,QS(this,t).values,e)},UO.globalCursor=function(t){if(arguments.length){if(this._globalCursor!==!!t){var e=ES(this,null);this._globalCursor=!!t,e&&ES(this,e)}return this}return this._globalCursor},UO.preventDefault=function(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},UO.timer=function(t,e){this._timers.push(function(t,e,n){var r=new QO.a,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?Object(QO.b)():+n,r.restart((function o(a){a+=i,r.restart(o,i+=e,n),t(a)}),e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},UO.events=function(t,e,n){var r,i=this,o=new Yt(n),a=function(n,r){i.runAsync(null,(function(){"view"===t&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(xS(i,n,r))}))};if("timer"===t)OS(i,"timer",e)&&i.timer(a,e);else if("view"===t)OS(i,"view",e)&&i.addEventListener(e,a,kS);else if("window"===t?OS(i,"window",e)&&"undefined"!==typeof window&&(r=[window]):"undefined"!==typeof document&&OS(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var A=0,s=r.length;A<s;++A)r[A].addEventListener(e,a);i._eventListeners.push({type:e,sources:r,handler:a})}else i.warn("Can not resolve event source: "+t);return o},UO.finalize=function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},UO.hover=function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",NS),DS,GS(t)),this.on(this.events("view","mouseout",NS),DS,GS(e)),this},UO.data=function(t,e){return arguments.length<2?QS(this,t).values.value:FS.call(this,t,Mt().remove(x.gb).insert(e))},UO.change=FS,UO.insert=function(t,e){return FS.call(this,t,Mt().insert(e))},UO.remove=function(t,e){return FS.call(this,t,Mt().remove(e))},UO.scale=function(t){var e=this._runtime.scales;return Object(x.v)(e,t)||Object(x.n)("Unrecognized scale or projection: "+t),e[t].value},UO.initialize=function(t,e){var n=this,r=n._renderType,i=n._eventConfig.bind,o=RC(r);t=n._el=t?zS(n,t):null,function(t){var e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),bS(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);var a=o.handler||Hf,A=t?o.renderer:o.headless;return n._renderer=A?YS(n,n._renderer,t,A):null,n._handler=function(t,e,n,r){var i=new r(t.loader(),XS(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,RS(t),t);return e&&e.handlers().forEach((function(t){i.on(t.type,t.handler)})),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=zS(n,e):t.appendChild(_S("form",{class:"vega-bindings"})),n._bind.forEach((function(t){t.param.element&&"container"!==i&&(t.element=zS(n,t.param.element))})),n._bind.forEach((function(t){LS(n,t.element||e,t)}))),n},UO.toImageURL=function(t,e){return eR.apply(this,arguments)},UO.toCanvas=function(t,e){return rR.apply(this,arguments)},UO.toSVG=function(t){return iR.apply(this,arguments)},UO.getState=function(t){return this._runtime.getState(t||{data:bO,signals:EO,recurse:!0})},UO.setState=function(t){return this.runAsync(null,(function(e){e._trigger=!1,e._runtime.setState(t)}),(function(t){t._trigger=!0})),this};var DO=function(t){return Object(x.F)(t)?t:{type:t||"pad"}},GO=function(t){return+t||0},_O=function(t){return Object(x.F)(t)?t.signal?t:{top:GO(t.top),bottom:GO(t.bottom),left:GO(t.left),right:GO(t.right)}:{top:e=GO(t),bottom:e,left:e,right:e};var e},MO=function(t){return Object(x.F)(t)&&!Object(x.A)(t)?Object(x.o)({},t):{value:t}};function TO(t,e,n,r){return null!=n?(Object(x.F)(n)&&!Object(x.A)(n)?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function jO(t,e,n){for(var r in e)TO(t,r,e[r]);for(var i in n)TO(t,i,n[i],"update")}function LO(t,e,n){for(var r in e)n&&Object(x.v)(n,r)||(t[r]=Object(x.o)(t[r]||{},e[r]));return t}function VO(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function ZO(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}var PO=function(t){return Object(x.H)(t)?Object(x.Z)(t):t.signal?"(".concat(t.signal,")"):YO(t)};function WO(t){if(null!=t.gradient)return function(t){var e=[t.start,t.stop,t.count].map((function(t){return null==t?null:Object(x.Z)(t)}));for(;e.length&&null==Object(x.U)(e);)e.pop();return e.unshift(PO(t.gradient)),"gradient(".concat(e.join(","),")")}(t);var e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?JO("hcl",t.h,t.c,t.l):t.h||t.s?JO("hsl",t.h,t.s,t.l):t.l||t.a?JO("lab",t.l,t.a,t.b):t.r||t.g||t.b?JO("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?YO(t.field):void 0!==t.value?Object(x.Z)(t.value):void 0;return null!=t.scale&&(e=function(t,e){var n=PO(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1===+t.band?"":"*"+HO(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(HO(t.exponent),")")),null!=t.mult&&(e+="*".concat(HO(t.mult))),null!=t.offset&&(e+="+".concat(HO(t.offset))),t.round&&(e="round(".concat(e,")")),e}var JO=function(t,e,n,r){return"(".concat(t,"(").concat([e,n,r].map(WO).join(","),")+'')")};function HO(t){return Object(x.F)(t)?"("+WO(t)+")":t}function YO(t){return function t(e){var n,r,i;if(e.signal)n="datum",i=e.signal;else if(e.group||e.parent){for(r=Math.max(1,e.level||1),n="item";r-- >0;)n+=".mark.group";e.parent?(i=e.parent,n+=".datum"):i=e.group}else e.datum?(n="datum",i=e.datum):Object(x.n)("Invalid field reference: "+Object(x.Z)(e));e.signal||(i=Object(x.H)(i)?Object(x.Y)(i).map(x.Z).join("]["):t(i));return n+"["+i+"]"}(Object(x.F)(t)?t:{datum:t})}var XO=function(t,e,n,r,i,o){var a={};for(var A in(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){var o,a,A,s={},c={};for(a in a="lineBreak","text"!==e||null==i[a]||VO(a,t)||ZO(s,a,i[a]),("legend"==n||String(n).startsWith("axis"))&&(n=null),A="frame"===n?i.group:"mark"===n?Object(x.o)({},i.mark,i[e]):null)VO(a,t)||("fill"===a||"stroke"===a)&&(VO("fill",t)||VO("stroke",t))||ZO(s,a,A[a]);for(a in Object(x.i)(r).forEach((function(e){var n=i.style&&i.style[e];for(var r in n)VO(r,t)||ZO(s,r,n[r])})),t=Object(x.o)({},t),s)(A=s[a]).signal?(o=o||{})[a]=A:c[a]=A;return t.enter=Object(x.o)(c,t.enter),o&&(t.update=Object(x.o)(o,t.update)),t}(t,e,n,r,i.config))a[A]=zO(t[A],e,o,i);return o};function zO(t,e,n,r){var i,o={},a={};for(var A in t)null!=t[A]&&(o[A]=KO((i=t[A],Object(x.A)(i)?function(t){var e="";return t.forEach((function(t){var n=WO(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===Object(x.U)(e)&&(e+="null"),e}(i):WO(i)),r,n,a));return{$expr:{marktype:e,channels:o},$fields:Object.keys(a),$output:Object.keys(t)}}function KO(t,e,n,r){var i=sO(t,e);return i.$fields.forEach((function(t){return r[t]=1})),Object(x.o)(n,i.$params),i.$expr}var qO=["value","update","init","react","bind"];function $O(t,e){Object(x.n)(t+' for "outer" push: '+Object(x.Z)(e))}var tN=function(t,e){var n=t.name;if("outer"===t.push)e.signals[n]||$O("No prior signal definition",n),qO.forEach((function(e){void 0!==t[e]&&$O("Invalid property ",e)}));else{var r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}};function eN(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function nN(t,e,n,r){return new eN(t,e,n,r)}function rN(t,e){return nN("operator",t,e)}function iN(t){var e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function oN(t,e){return e?{$field:t,$name:e}:{$field:t}}var aN=oN("key");function AN(t,e){return{$compare:t,$order:e}}function sN(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}function cN(t){return t&&t.signal}function uN(t){if(cN(t))return!0;if(Object(x.F)(t))for(var e in t)if(uN(t[e]))return!0;return!1}function lN(t,e){return null!=t?t:e}function gN(t){return t&&t.signal||t}function fN(t,e){return(t.merge?hN:t.stream?dN:t.type?IN:Object(x.n)("Invalid stream specification: "+Object(x.Z)(t)))(t,e)}function hN(t,e){var n=pN({merge:t.merge.map((function(t){return fN(t,e)}))},t,e);return e.addStream(n).id}function dN(t,e){var n=pN({stream:fN(t.stream,e)},t,e);return e.addStream(n).id}function IN(t,e){var n,r,i;return"timer"===t.type?(n=e.event("timer",t.throttle),t={between:t.between,filter:t.filter}):n=e.event("scope"===(i=t.source)?"view":i||"view",t.type),r=pN({stream:n},t,e),1===Object.keys(r).length?n:e.addStream(r).id}function pN(t,e,n){var r=e.between;return r&&(2!==r.length&&Object(x.n)('Stream "between" parameter must have 2 entries: '+Object(x.Z)(e)),t.between=[fN(r[0],n),fN(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){var r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),"scope"===e.source&&r.push("inScope(event.item)"),r.length&&(t.filter=sO("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}var CN,yN,vN=function(t,e,n){return CN=e||BN,yN=n||bN,QN(t.trim()).map(FN)},BN="view",mN=/[[\]{}]/,bN={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function EN(t,e,n,r,i){for(var o,a=0,A=t.length;e<A;++e){if(o=t[e],!a&&o===n)return e;i&&i.indexOf(o)>=0?--a:r&&r.indexOf(o)>=0&&++a}return e}function QN(t){for(var e=[],n=0,r=t.length,i=0;i<r;)i=EN(t,i,",","[{","]}"),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function FN(t){return"["===t[0]?function(t){var e,n,r=t.length,i=1;if((i=EN(t,i,"]","[","]"))===r)throw"Empty between selector: "+t;if(2!==(e=QN(t.substring(1,i))).length)throw"Between selector must have two elements: "+t;if(">"!==(t=t.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+t;if(e=e.map(FN),(n=FN(t.slice(1).trim())).between)return{between:e,stream:n};n.between=e;return n}(t):function(t){var e,n,r={source:CN},i=[],o=[0,0],a=0,A=0,s=t.length,c=0;if("}"===t[s-1]){if(!((c=t.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+t;try{o=function(t){var e=t.split(",");if(!t.length||e.length>2)throw t;return e.map((function(e){var n=+e;if(n!==n)throw t;return n}))}(t.substring(c+1,s-1))}catch(l){throw"Invalid throttle specification: "+t}t=t.slice(0,c).trim(),s=t.length,c=0}if(!s)throw t;"@"===t[0]&&(a=++c);(e=EN(t,c,":"))<s&&(i.push(t.substring(A,e).trim()),A=c=++e);if((c=EN(t,c,"["))===s)i.push(t.substring(A,s).trim());else if(i.push(t.substring(A,c).trim()),n=[],(A=++c)===s)throw"Unmatched left bracket: "+t;for(;c<s;){if((c=EN(t,c,"]"))===s)throw"Unmatched left bracket: "+t;if(n.push(t.substring(A,c).trim()),c<s-1&&"["!==t[++c])throw"Expected left bracket: "+t;A=++c}if(!(s=i.length)||mN.test(i[s-1]))throw"Invalid event selector: "+t;s>1?(r.type=i[1],a?r.markname=i[0].slice(1):(u=i[0],yN[u]?r.marktype=i[0]:r.source=i[0])):r.type=i[0];var u;"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);o[0]&&(r.throttle=o[0]);o[1]&&(r.debounce=o[1]);return r}(t)}var wN={code:"_.$value",ast:{type:"Identifier",value:"value"}},SN=function(t,e,n){var r=t.events,i=t.update,o=t.encode,a=[],A={target:n};r||Object(x.n)("Signal update missing events specification."),Object(x.H)(r)&&(r=vN(r,e.isSubscope()?"scope":"view")),r=Object(x.i)(r).filter((function(t){return t.signal||t.scale?(a.push(t),0):1})),a.length>1&&(a=[RN(a)]),r.length&&a.push(r.length>1?{merge:r}:r[0]),null!=o&&(i&&Object(x.n)("Signal encode and update are mutually exclusive."),i="encode(item(),"+Object(x.Z)(o)+")"),A.update=Object(x.H)(i)?sO(i,e):null!=i.expr?sO(i.expr,e):null!=i.value?i.value:null!=i.signal?{$expr:wN,$params:{$value:e.signalRef(i.signal)}}:Object(x.n)("Invalid signal update specification."),t.force&&(A.options={force:!0}),a.forEach((function(t){e.addUpdate(Object(x.o)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):fN(t,e)}}(t,e),A))}))};function RN(t){return{signal:"["+t.map((function(t){return t.scale?'scale("'+t.scale+'")':t.signal}))+"]"}}var UN=function(t){return function(e,n,r){return nN(t,n,e||void 0,r)}},xN=UN("aggregate"),kN=UN("axisticks"),ON=UN("bound"),NN=UN("collect"),DN=UN("compare"),GN=UN("datajoin"),_N=UN("encode"),MN=UN("expression"),TN=(UN("extent"),UN("facet")),jN=UN("field"),LN=UN("key"),VN=UN("legendentries"),ZN=UN("load"),PN=UN("mark"),WN=UN("multiextent"),JN=UN("multivalues"),HN=UN("overlap"),YN=UN("params"),XN=UN("prefacet"),zN=UN("projection"),KN=UN("proxy"),qN=UN("relay"),$N=UN("render"),tD=UN("scale"),eD=UN("sieve"),nD=UN("sortitems"),rD=UN("viewlayout"),iD=UN("values"),oD=0,aD={min:"min",max:"max",count:"sum"};function AD(t,e){var n,r,i=e.getScale(t.name).params;for(n in i.domain=lD(t.domain,t,e),null!=t.range&&(i.range=function t(e,n,r){var i=e.range,o=n.config.range;if(i.signal)return n.signalRef(i.signal);if(Object(x.H)(i)){if(o&&Object(x.v)(o,i))return e=Object(x.o)({},e,{range:o[i]}),t(e,n,r);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=EI(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(x.n)("Unrecognized scale range value: "+Object(x.Z)(i))}else{if(i.scheme)return r.scheme=Object(x.A)(i.scheme)?cD(i.scheme,n):sD(i.scheme,n),i.extent&&(r.schemeExtent=cD(i.extent,n)),void(i.count&&(r.schemeCount=sD(i.count,n)));if(i.step)return void(r.rangeStep=sD(i.step,n));if(EI(e.type)&&!Object(x.A)(i))return lD(i,e,n);Object(x.A)(i)||Object(x.n)("Unsupported range type: "+Object(x.Z)(i))}return i.map((function(t){return(Object(x.A)(t)?cD:sD)(t,n)}))}(t,e,i)),null!=t.interpolate&&function(t,e){e.interpolate=sD(t.type||t),null!=t.gamma&&(e.interpolateGamma=sD(t.gamma))}(t.interpolate,i),null!=t.nice&&(i.nice=(r=t.nice,Object(x.F)(r)?{interval:sD(r.interval),step:sD(r.step)}:sD(r))),null!=t.bins&&(i.bins=function(t,e){return t.signal||Object(x.A)(t)?cD(t,e):e.objectProperty(t)}(t.bins,e)),t)Object(x.v)(i,n)||"name"===n||(i[n]=sD(t[n],e))}function sD(t,e){return Object(x.F)(t)?t.signal?e.signalRef(t.signal):Object(x.n)("Unsupported object: "+Object(x.Z)(t)):t}function cD(t,e){return t.signal?e.signalRef(t.signal):t.map((function(t){return sD(t,e)}))}function uD(t){Object(x.n)("Can not find data set: "+Object(x.Z)(t))}function lD(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(Object(x.A)(t)?gD:t.fields?hD:fD)(t,e,n);null==e.domainMin&&null==e.domainMax||Object(x.n)("No scale domain defined for domainMin/domainMax to override.")}function gD(t,e,n){return t.map((function(t){return sD(t,n)}))}function fD(t,e,n){var r=n.getData(t.data);return r||uD(t.data),EI(e.type)?r.valuesRef(n,t.field,ID(t.sort,!1)):SI(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function hD(t,e,n){var r=t.data,i=t.fields.reduce((function(t,e){return e=Object(x.H)(e)?{data:r,field:e}:Object(x.A)(e)||e.signal?function(t,e){var n="_:vega:_"+oD++,r=NN({});if(Object(x.A)(t))r.value={$ingest:t};else if(t.signal){var i="setdata("+Object(x.Z)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,eD({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t}),[]);return(EI(e.type)?dD:SI(e.type)?pD:CD)(t,n,i)}function dD(t,e,n){var r,i,o,a,A,s=ID(t.sort,!0);return r=n.map((function(t){var n=e.getData(t.data);return n||uD(t.data),n.countsRef(e,t.field,s)})),i={groupby:aN,pulse:r},s&&(o=s.op||"count",A=s.field?sN(o,s.field):"count",i.ops=[aD[o]],i.fields=[e.fieldRef(A)],i.as=[A]),o=e.add(xN(i)),a=e.add(NN({pulse:iN(o)})),A=e.add(iD({field:aN,sort:e.sortRef(s),pulse:iN(a)})),iN(A)}function ID(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!aD[t.op]&&Object(x.n)("Multiple domain scales can not be sorted using "+t.op):Object(x.n)("No field provided for sort aggregate op: "+t.op):Object(x.F)(t)?t.field="key":t={field:"key"}),t}function pD(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||uD(t.data),n.domainRef(e,t.field)}));return iN(e.add(JN({values:r})))}function CD(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||uD(t.data),n.extentRef(e,t.field)}));return iN(e.add(WN({extents:r})))}function yD(t,e,n){return Object(x.A)(t)?t.map((function(t){return yD(t,e,n)})):Object(x.F)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:Object(x.n)("Unsupported parameter object: "+Object(x.Z)(t)):t}var vD="value",BD=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],mD={name:1,style:1,interactive:1},bD={value:0},ED={value:1},QD=function(t){return t.type="group",t.interactive=t.interactive||!1,t};function FD(t,e){var n=function(n,r){return lN(t[n],lN(e[n],r))};return n.isVertical=function(n){return"vertical"===lN(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection))},n.gradientLength=function(){return lN(t.gradientLength,e.gradientLength||e.gradientWidth)},n.gradientThickness=function(){return lN(t.gradientThickness,e.gradientThickness||e.gradientHeight)},n.entryColumns=function(){return lN(t.columns,lN(e.columns,+n.isVertical(!0)))},n}function wD(t,e){var n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function SD(t,e,n){return"item.anchor === '".concat("start","' ? ").concat(t," : item.anchor === '").concat("end","' ? ").concat(e," : ").concat(n)}var RD=SD(Object(x.Z)("left"),Object(x.Z)("right"),Object(x.Z)("center"));function UD(t,e){return e?t?Object(x.F)(t)?Object.assign({},t,{offset:UD(t.offset,e)}):{value:t,offset:e}:e:t}var xD=function(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=LO(t.encode,e,mD)):t.interactive=!1,t},kD=function(t,e,n,r){var i,o,a,A,s,c,u=FD(t,n),l=u.isVertical(),g=u.gradientThickness(),f=u.gradientLength();return l?(a=[0,1],A=[0,0],s=g,c=f):(a=[0,0],A=[1,0],s=f,c=g),jO(i={enter:o={opacity:bD,x:bD,y:bD,width:MO(s),height:MO(c)},update:Object(x.o)({},o,{opacity:ED,fill:{gradient:e,start:a,stop:A}}),exit:{opacity:bD}},{stroke:u("gradientStrokeColor"),strokeWidth:u("gradientStrokeWidth")},{opacity:u("gradientOpacity")}),xD({type:"rect",role:"legend-gradient",encode:i},r)},OD=function(t,e,n,r,i){var o,a,A,s,c,u,l=FD(t,n),g=l.isVertical(),f=l.gradientThickness(),h=l.gradientLength(),d="";return g?(A="y",c="y2",s="x",u="width",d="1-"):(A="x",c="x2",s="y",u="height"),(a={opacity:bD,fill:{scale:e,field:vD}})[A]={signal:d+"datum.perc",mult:h},a[s]=bD,a[c]={signal:d+"datum.perc2",mult:h},a[u]=MO(f),jO(o={enter:a,update:Object(x.o)({},a,{opacity:ED}),exit:{opacity:bD}},{stroke:l("gradientStrokeColor"),strokeWidth:l("gradientStrokeWidth")},{opacity:l("gradientOpacity")}),xD({type:"rect",role:"legend-band",key:vD,from:i,encode:o},r)},ND="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),DD="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"'),GD=function(t,e,n,r){var i,o,a,A,s,c=FD(t,e),u=c.isVertical(),l=MO(c.gradientThickness()),g=c.gradientLength(),f=c("labelOverlap"),h="";return jO(i={enter:o={opacity:bD},update:a={opacity:ED,text:{field:"label"}},exit:{opacity:bD}},{fill:c("labelColor"),fillOpacity:c("labelOpacity"),font:c("labelFont"),fontSize:c("labelFontSize"),fontStyle:c("labelFontStyle"),fontWeight:c("labelFontWeight"),limit:lN(t.labelLimit,e.gradientLabelLimit)}),u?(o.align={value:"left"},o.baseline=a.baseline={signal:DD},A="y",s="x",h="1-"):(o.align=a.align={signal:ND},o.baseline={value:"top"},A="x",s="y"),o[A]=a[A]={signal:h+"datum.perc",mult:g},o[s]=a[s]=l,l.offset=lN(t.labelOffset,e.gradientLabelOffset)||0,f=f?{separation:c("labelSeparation"),method:f,order:"datum.index"}:void 0,xD({type:"text",role:"legend-label",style:"guide-label",key:vD,from:r,encode:i,overlap:f},n)},_D=function(t,e,n,r,i){var o,a,A,s,c,u,l,g=FD(t,e),f=n.entries,h=!(!f||!f.interactive),d=f?f.name:void 0,I=g("clipHeight"),p=g("symbolOffset"),C={data:"value"},y={},v="(".concat(i,") ? datum.").concat("offset"," : datum.").concat("size"),B=I?MO(I):{field:"size"},m="datum.".concat("index"),b="max(1, ".concat(i,")");B.mult=.5,y={enter:o={opacity:bD,x:{signal:v,mult:.5,offset:p},y:B},update:a={opacity:ED,x:o.x,y:o.y},exit:{opacity:bD}};var E=null,Q=null;return t.fill||(E=e.symbolBaseFillColor,Q=e.symbolBaseStrokeColor),jO(y,{fill:g("symbolFillColor",E),shape:g("symbolType"),size:g("symbolSize"),stroke:g("symbolStrokeColor",Q),strokeDash:g("symbolDash"),strokeDashOffset:g("symbolDashOffset"),strokeWidth:g("symbolStrokeWidth")},{opacity:g("symbolOpacity")}),BD.forEach((function(e){t[e]&&(a[e]=o[e]={scale:t[e],field:vD})})),s=xD({type:"symbol",role:"legend-symbol",key:vD,from:C,clip:!!I||void 0,encode:y},n.symbols),(A=MO(p)).offset=g("labelOffset"),jO(y={enter:o={opacity:bD,x:{signal:v,offset:A},y:B},update:a={opacity:ED,text:{field:"label"},x:o.x,y:o.y},exit:{opacity:bD}},{align:g("labelAlign"),baseline:g("labelBaseline"),fill:g("labelColor"),fillOpacity:g("labelOpacity"),font:g("labelFont"),fontSize:g("labelFontSize"),fontStyle:g("labelFontStyle"),fontWeight:g("labelFontWeight"),limit:g("labelLimit")}),c=xD({type:"text",role:"legend-label",style:"guide-label",key:vD,from:C,encode:y},n.labels),y={enter:{noBound:{value:!I},width:bD,height:I?MO(I):bD,opacity:bD},exit:{opacity:bD},update:a={opacity:ED,row:{signal:null},column:{signal:null}}},g.isVertical(!0)?(u="ceil(item.mark.items.length / ".concat(b,")"),a.row.signal="".concat(m,"%").concat(u),a.column.signal="floor(".concat(m," / ").concat(u,")"),l={field:["row",m]}):(a.row.signal="floor(".concat(m," / ").concat(b,")"),a.column.signal="".concat(m," % ").concat(b),l={field:m}),a.column.signal="(".concat(i,")?").concat(a.column.signal,":").concat(m),QD({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:LO(y,f,mD),marks:[s,c],name:d,interactive:h,sort:l})};var MD='item.orient === "left"',TD='item.orient === "right"',jD="(".concat(MD," || ").concat(TD,")"),LD="datum.vgrad && ".concat(jD),VD=SD('"top"','"bottom"','"middle"'),ZD=SD('"right"','"left"','"center"'),PD="datum.vgrad && ".concat(TD," ? (").concat(ZD,") : (").concat(jD," && !(datum.vgrad && ").concat(MD,')) ? "left" : ').concat(RD),WD="item._anchor || (".concat(jD,' ? "middle" : "start")'),JD="".concat(LD," ? (").concat(MD," ? -90 : 90) : 0"),HD="".concat(jD," ? (datum.vgrad ? (").concat(TD,' ? "bottom" : "top") : ').concat(VD,') : "top"'),YD=function(t,e){var n;return Object(x.F)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+XD(t.path)+")":t.sphere&&(n="geoShape("+XD(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t};function XD(t){return Object(x.F)(t)&&t.signal?t.signal:Object(x.Z)(t)}var zD=function(t){var e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?"group"===t.type?"scope":e||"mark":e},KD=function(t){return{marktype:t.type,name:t.name||void 0,role:t.role||zD(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}},qD=function(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t},$D=function(t,e){var n=pa(t.type);n||Object(x.n)("Unrecognized transform type: "+Object(x.Z)(t.type));var r=nN(n.type.toLowerCase(),null,tG(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r};function tG(t,e,n){var r,i,o,a={};for(i=0,o=t.params.length;i<o;++i)a[(r=t.params[i]).name]=eG(r,e,n);return a}function eG(t,e,n){var r=t.type,i=e[t.name];return"index"===r?function(t,e,n){Object(x.H)(e.from)||Object(x.n)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==i?"param"===r?function(t,e,n){var r=e[t.name];return t.array?(Object(x.A)(r)||Object(x.n)("Expected an array of sub-parameters. Instead: "+Object(x.Z)(r)),r.map((function(e){return rG(t,e,n)}))):rG(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!cN(i)?i.map((function(e){return nG(t,e,n)})):nG(t,i,n):void(t.required&&Object(x.n)("Missing required "+Object(x.Z)(e.type)+" parameter: "+Object(x.Z)(t.name)))}function nG(t,e,n){var r=t.type;if(cN(e))return iG(r)?Object(x.n)("Expression references can not be signals."):oG(r)?n.fieldRef(e):aG(r)?n.compareRef(e):n.signalRef(e.signal);var i,o=t.expr||oG(r);return o&&((i=e)&&i.expr)?n.exprRef(e.expr,e.as):o&&function(t){return t&&t.field}(e)?oN(e.field,e.as):iG(r)?sO(e,n):function(t){return"data"===t}(r)?iN(n.getData(e).values):oG(r)?oN(e):aG(r)?n.compareRef(e):e}function rG(t,e,n){var r,i,o,a,A;for(a=0,A=t.params.length;a<A;++a){for(o in(i=t.params[a]).key)if(i.key[o]!==e[o]){i=null;break}if(i)break}return i||Object(x.n)("Unsupported parameter: "+Object(x.Z)(e)),r=Object(x.o)(tG(i,e,n),i.key),iN(n.add(YN(r)))}function iG(t){return"expr"===t}function oG(t){return"field"===t}function aG(t){return"compare"===t}function AG(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:iN(e.getData(t.data).output)}function sG(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}sG.fromEntries=function(t,e){var n=e.length,r=1,i=e[0],o=e[n-1],a=e[n-2],A=null;for(i&&"load"===i.type&&(i=e[1]),t.add(e[0]);r<n;++r)e[r].params.pulse=iN(e[r-1]),t.add(e[r]),"aggregate"===e[r].type&&(A=e[r]);return new sG(t,i,a,o,A)};var cG=sG.prototype;function uG(t){return Object(x.H)(t)?t:null}function lG(t,e,n){var r,i=sN(n.op,n.field);if(e.ops){for(var o=0,a=e.as.length;o<a;++o)if(e.as[o]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((r=n.op.signal)?t.signalRef(r):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(i))}function gG(t,e,n,r,i,o,a){var A,s,c=e[n]||(e[n]={}),u=function(t){return Object(x.F)(t)?("descending"===t.order?"-":"+")+sN(t.op,t.field):""}(o),l=uG(i);if(null!=l&&(t=e.scope,A=c[l+=u?"|"+u:""]),!A){var g=o?{field:aN,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:iN(e.output)};u&&(g.sort=t.sortRef(o)),s=t.add(nN(r,void 0,g)),a&&(e.index[i]=s),A=iN(s),null!=l&&(c[l]=A)}return A}cG.countsRef=function(t,e,n){var r,i,o,a=this.counts||(this.counts={}),A=uG(e);return null!=A&&(t=this.scope,r=a[A]),r?n&&n.field&&lG(t,r.agg.params,n):(o={groupby:t.fieldRef(e,"key"),pulse:iN(this.output)},n&&n.field&&lG(t,o,n),i=t.add(xN(o)),r=t.add(NN({pulse:iN(i)})),r={agg:i,ref:iN(r)},null!=A&&(a[A]=r)),r.ref},cG.tuplesRef=function(){return iN(this.values)},cG.extentRef=function(t,e){return gG(t,this,"extent","extent",e,!1)},cG.domainRef=function(t,e){return gG(t,this,"domain","values",e,!1)},cG.valuesRef=function(t,e,n){return gG(t,this,"vals","values",e,n||!0)},cG.lookupRef=function(t,e){return gG(t,this,"lookup","tupleindex",e,!1)},cG.indataRef=function(t,e){return gG(t,this,"indata","tupleindex",e,!0,!0)};var fG=function(t,e,n){var r,i,o=t.remove,a=t.insert,A=t.toggle,s=t.modify,c=t.values,u=e.add(rN());r="if("+t.trigger+',modify("'+n+'",'+[a,o,A,s,c].map((function(t){return null==t?"null":t})).join(",")+"),0)",i=sO(r,e),u.update=i.$expr,u.params=i.$params},hG=function(t,e){var n,r,i,o,a,A,s,c,u,l,g,f,h,d,I=zD(t),p="group"===t.type,C=t.from&&t.from.facet,y=t.layout||"scope"===I||"frame"===I,v="mark"===I||y||C,B=t.overlap;i=function(t,e,n){var r,i,o,a,A;return t?(r=t.facet)&&(e||Object(x.n)("Only group marks can be faceted."),null!=r.field?a=A=AG(r,n):(t.data?A=iN(n.getData(t.data).aggregate):((o=$D(Object(x.o)({type:"aggregate",groupby:Object(x.i)(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),o.params.pulse=AG(r,n),a=A=iN(n.add(o))),i=n.keyRef(r.groupby,!0))):a=iN(n.add(NN(null,[{}]))),a||(a=AG(t,n)),{key:i,pulse:a,parent:A}}(t.from,p,e),l=iN(r=e.add(GN({key:i.key||(t.key?oN(t.key):void 0),pulse:i.pulse,clean:!p}))),r=o=e.add(NN({pulse:l})),r=e.add(PN({markdef:KD(t),interactive:qD(t.interactive,e),clip:YD(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:iN(r)})),g=iN(r),(r=a=e.add(_N(XO(t.encode,t.type,I,t.style,e,{mod:!1,pulse:g})))).params.parent=e.encode(),t.transform&&t.transform.forEach((function(t){var n=$D(t,e),i=n.metadata;(i.generates||i.changes)&&Object(x.n)("Mark transforms should not generate new data."),i.nomod||(a.params.mod=!0),n.params.pulse=iN(r),e.add(r=n)})),t.sort&&(r=e.add(nD({sort:e.compareRef(t.sort),pulse:iN(r)}))),f=iN(r),(C||y)&&(h=iN(y=e.add(rD({layout:e.objectProperty(t.layout),legends:e.legends,mark:g,pulse:f})))),d=iN(A=e.add(ON({mark:g,pulse:h||f}))),p&&(v&&((n=e.operators).pop(),y&&n.pop()),e.pushState(f,h||d,l),C?function(t,e,n){var r,i,o,a,A=t.from.facet,s=A.name,c=AG(A,e);A.name||Object(x.n)("Facet must have a name: "+Object(x.Z)(A)),A.data||Object(x.n)("Facet must reference a data set: "+Object(x.Z)(A)),A.field?a=e.add(XN({field:e.fieldRef(A.field),pulse:c})):A.groupby?a=e.add(TN({key:e.keyRef(A.groupby),group:iN(e.proxy(n.parent)),pulse:c})):Object(x.n)("Facet must specify groupby or field: "+Object(x.Z)(A)),i=(r=e.fork()).add(NN()),o=r.add(eD({pulse:iN(i)})),r.addData(s,new sG(r,i,i,o)),r.addSignal("parent",null),a.params.subflow={$subflow:r.parse(t).toRuntime()}}(t,e,i):v?function(t,e,n){var r=e.add(XN({pulse:n.pulse})),i=e.fork();i.add(eD()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,i):e.parse(t),e.popState(),v&&(y&&n.push(y),n.push(A))),B&&(d=function(t,e,n){var r,i=t.method,o=t.bound,a=t.separation,A={separation:cN(a)?n.signalRef(a.signal):a,method:cN(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(A.sort=n.compareRef({field:t.order}));o&&(r=o.tolerance,A.boundTolerance=cN(r)?n.signalRef(r.signal):+r,A.boundScale=n.scaleRef(o.scale),A.boundOrient=o.orient);return iN(n.add(HN(A)))}(B,d,e)),s=e.add($N({pulse:d})),c=e.add(eD({pulse:iN(s)},void 0,e.parent())),null!=t.name&&(u=t.name,e.addData(u,new sG(e,o,s,c)),t.on&&t.on.forEach((function(t){(t.insert||t.remove||t.toggle)&&Object(x.n)("Marks only support modify triggers."),fG(t,e,u)})))};var dG=function(t,e){var n,r,i,o,a,A,s,c,u=e.config.legend,l=t.encode||{},g=l.legend||{},f=g.name||void 0,h=g.interactive,d=g.style,I=FD(t,u),p={},C=0;return BD.forEach((function(e){return t[e]?(p[e]=t[e],C=C||t[e]):0})),C||Object(x.n)("Missing valid scale for legend."),a=function(t,e){var n=t.type||"symbol";t.type||1!==function(t){return BD.reduce((function(e,n){return e+(t[n]?1:0)}),0)}(t)||!t.fill&&!t.stroke||(n=bI(e)?"gradient":QI(e)?"discrete":"symbol");return"gradient"!==n?n:QI(e)?"discrete":"gradient"}(t,e.scaleType(C)),A={title:null!=t.title,scales:p,type:a,vgrad:"symbol"!==a&&I.isVertical()},s=iN(e.add(NN(null,[A]))),g=LO(function(t,e,n){var r={enter:{},update:{}};return jO(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}(I,t,u),g,mD),n={enter:{x:{value:0},y:{value:0}}},c=iN(e.add(VN(i={type:a,scale:e.scaleRef(C),count:e.objectProperty(I("tickCount")),limit:e.property(I("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),"gradient"===a?(o=[kD(t,C,u,l.gradient),GD(t,u,l.labels,c)],i.count=i.count||e.signalRef("max(2,2*floor((".concat(gN(I.gradientLength()),")/100))"))):"discrete"===a?o=[OD(t,C,u,l.gradient,c),GD(t,u,l.labels,c)]:(r=function(t,e){var n=FD(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,u),o=[_D(t,u,l,c,gN(r.columns))],i.size=function(t,e,n){var r=gN(IG("size",t,n)),i=gN(IG("strokeWidth",t,n)),o=gN(function(t,e,n){return wD("fontSize",t)||function(t,e,n){var r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,"guide-label"));return sO("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,o[0].marks)),o=[QD({role:"legend-entry",from:s,encode:n,marks:o,layout:r,interactive:h})],A.title&&o.push(function(t,e,n,r){var i,o=FD(t,e);return jO(i={enter:{opacity:bD},update:{opacity:ED,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:bD}},{orient:o("titleOrient"),_anchor:o("titleAnchor"),anchor:{signal:WD},angle:{signal:JD},align:{signal:PD},baseline:{signal:HD},text:t.title,fill:o("titleColor"),fillOpacity:o("titleOpacity"),font:o("titleFont"),fontSize:o("titleFontSize"),fontStyle:o("titleFontStyle"),fontWeight:o("titleFontWeight"),limit:o("titleLimit"),lineHeight:o("titleLineHeight")},{align:o("titleAlign"),baseline:o("titleBaseline")}),xD({type:"text",role:"legend-title",style:"guide-title",from:r,encode:i},n)}(t,u,l.title,s)),hG(QD({role:"legend",from:s,encode:g,marks:o,aria:I("aria"),description:I("description"),zindex:I("zindex"),name:f,interactive:h,style:d}),e)};function IG(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):wD(t,n[0].encode)}var pG='item.orient==="'.concat("left",'"?-90:item.orient==="').concat("right",'"?90:0'),CG=function(t,e){var n,r,i=FD(t=Object(x.H)(t)?{text:t}:t,e.config.title),o=t.encode||{},a=o.group||{},A=a.name||void 0,s=a.interactive,c=a.style,u=[];return n={},r=iN(e.add(NN(null,[n]))),u.push(function(t,e,n,r){var i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jO(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),xD({type:"text",role:"title-text",style:"group-title",from:r,encode:a},n)}(t,i,function(t){var e=t.encode;return e&&e.title||Object(x.o)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),r)),t.subtitle&&u.push(function(t,e,n,r){var i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jO(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),xD({type:"text",role:"title-subtitle",style:"group-subtitle",from:r,encode:a},n)}(t,i,o.subtitle,r)),hG(QD({role:"title",from:r,encode:yG(i,a),marks:u,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:A,interactive:s,style:c}),e)};function yG(t,e){var n={enter:{},update:{}};return jO(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:RD},angle:{signal:pG},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),LO(n,e,mD)}function vG(t,e){var n=[];t.transform&&t.transform.forEach((function(t){n.push($D(t,e))})),t.on&&t.on.forEach((function(n){fG(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){var r,i,o,a,A,s=[],c=null,u=!1,l=!1;t.values?uN(t.values)||uN(t.format)?(s.push(mG(e,t)),s.push(c=BG())):s.push(c=BG({$ingest:t.values,$format:t.format})):t.url?uN(t.url)||uN(t.format)?(s.push(mG(e,t)),s.push(c=BG())):s.push(c=BG({$request:t.url,$format:t.format})):t.source&&(c=r=Object(x.i)(t.source).map((function(t){return iN(e.getData(t).output)})),s.push(null));for(i=0,o=n.length;i<o;++i)a=n[i],A=a.metadata,c||A.source||s.push(c=BG()),s.push(a),A.generates&&(l=!0),A.modifies&&!l&&(u=!0),A.source?c=a:A.changes&&(c=null);r&&(o=r.length-1,s[0]=qN({derive:u,pulse:o?r:r[0]}),(u||o)&&s.splice(1,0,BG()));c||s.push(BG());return s.push(eD({})),s}(t,e,n))}function BG(t){var e=NN({},t);return e.metadata={source:!0},e}function mG(t,e){return ZN({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}var bG=function(t){return"bottom"===t||"top"===t},EG=function(t,e,n){return cN(t)?UG(t.signal,e,n):"left"===t||"top"===t?e:n},QG=function(t,e,n){return cN(t)?SG(t.signal,e,n):bG(t)?e:n},FG=function(t,e,n){return cN(t)?RG(t.signal,e,n):bG(t)?n:e},wG=function(t,e,n){return cN(t)?xG(t.signal,e,n):"top"===t?{value:e}:{value:n}},SG=function(t,e,n){return OG("".concat(t," === '").concat("top","' || ").concat(t," === '").concat("bottom","'"),e,n)},RG=function(t,e,n){return OG("".concat(t," !== '").concat("top","' && ").concat(t," !== '").concat("bottom","'"),e,n)},UG=function(t,e,n){return DG("".concat(t," === '").concat("left","' || ").concat(t," === '").concat("top","'"),e,n)},xG=function(t,e,n){return DG("".concat(t," === '").concat("top","'"),e,n)},kG=function(t,e,n){return DG("".concat(t," === '").concat("right","'"),e,n)},OG=function(t,e,n){return e=null!=e?MO(e):e,n=null!=n?MO(n):n,NG(e)&&NG(n)?(e=e?e.signal||Object(x.Z)(e.value):null,n=n?n.signal||Object(x.Z)(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[Object(x.o)({test:t},e)].concat(n||[])},NG=function(t){return null==t||1===Object.keys(t).length},DG=function(t,e,n){return{signal:"".concat(t," ? (").concat(GG(e),") : (").concat(GG(n),")")}},GG=function(t){return cN(t)?t.signal:null==t?null:Object(x.Z)(t)},_G=function(t,e){var n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function MG(t,e,n,r){var i;if(e&&Object(x.v)(e,t))return e[t];if(Object(x.v)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r["guide-title"][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r["guide-label"][i]}return null}function TG(t){var e,n={},r=Object(U.a)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i)for(var o in i)n[o]=1}}catch(a){r.e(a)}finally{r.f()}return Object.keys(n)}function jG(t,e){return{scale:t.scale,range:e}}var LG=function(t,e,n,r,i){var o,a,A,s,c,u,l,g,f=FD(t,e),h=t.orient,d=t.gridScale,I=EG(h,1,-1),p=function(t,e){if(1===e);else if(Object(x.F)(t)){for(var n=t=Object(x.o)({},t);null!=n.mult;){if(!Object(x.F)(n.mult))return n.mult=cN(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=Object(x.o)({},n.mult)}n.mult=e}else t=cN(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,I);return jO(o={enter:a={opacity:bD},update:s={opacity:ED},exit:A={opacity:bD}},{stroke:f("gridColor"),strokeCap:f("gridCap"),strokeDash:f("gridDash"),strokeDashOffset:f("gridDashOffset"),strokeOpacity:f("gridOpacity"),strokeWidth:f("gridWidth")}),c={scale:t.scale,field:vD,band:i.band,extra:i.extra,offset:i.offset,round:f("tickRound")},g=QG(h,{signal:"height"},{signal:"width"}),u=d?{scale:d,range:0,mult:I,offset:p}:{value:0,offset:p},l=d?{scale:d,range:1,mult:I,offset:p}:Object(x.o)(g,{mult:I,offset:p}),a.x=s.x=QG(h,c,u),a.y=s.y=FG(h,c,u),a.x2=s.x2=FG(h,l),a.y2=s.y2=QG(h,l),A.x=QG(h,c),A.y=FG(h,c),xD({type:"rule",role:"axis-grid",key:vD,from:r,encode:o},n)};function VG(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}var ZG=function(t,e,n,r,i,o){var a,A,s,c,u,l,g,f,h,d,I=FD(t,e),p=t.orient,C=t.scale,y=EG(p,-1,1),v=gN(I("labelFlush")),B=gN(I("labelFlushOffset")),m=0===v||!!v,b=I("labelAlign"),E=I("labelBaseline");return(c=MO(i)).mult=y,c.offset=MO(I("labelPadding")||0),c.offset.mult=y,u={scale:C,field:vD,band:.5,offset:UD(o.offset,I("labelOffset"))},l=QG(p,m?VG(C,v,'"left"','"right"','"center"'):{value:"center"},function(t,e,n){return cN(t)?kG(t.signal,e,n):"right"===t?{value:e}:{value:n}}(p,"left","right")),g=QG(p,wG(p,"bottom","top"),m?VG(C,v,'"top"','"bottom"','"middle"'):{value:"middle"}),d=VG(C,v,"-(".concat(B,")"),B,0),m=m&&B,jO(a={enter:A={opacity:bD,x:QG(p,u,c),y:FG(p,u,c)},update:s={opacity:ED,text:{field:"label"},x:A.x,y:A.y,align:l,baseline:g},exit:{opacity:bD,x:A.x,y:A.y}},{dx:!b&&m?QG(p,d):null,dy:!E&&m?FG(p,d):null}),jO(a,{angle:I("labelAngle"),fill:I("labelColor"),fillOpacity:I("labelOpacity"),font:I("labelFont"),fontSize:I("labelFontSize"),fontWeight:I("labelFontWeight"),fontStyle:I("labelFontStyle"),limit:I("labelLimit"),lineHeight:I("labelLineHeight")},{align:b,baseline:E}),f=I("labelBound"),h=(h=I("labelOverlap"))||f?{separation:I("labelSeparation"),method:h,order:"datum.index",bound:f?{scale:C,orient:p,tolerance:f}:null}:void 0,s.align!==l&&(s.align=_G(s.align,l)),s.baseline!==g&&(s.baseline=_G(s.baseline,g)),xD({type:"text",role:"axis-label",style:"guide-label",key:vD,from:r,encode:a,overlap:h},n)},PG=function(t,e,n,r){var i,o,a,A,s=FD(t,e),c=t.orient,u=EG(c,-1,1);return i={enter:o={opacity:bD,anchor:MO(s("titleAnchor",null)),align:{signal:RD}},update:a=Object(x.o)({},o,{opacity:ED,text:MO(t.title)}),exit:{opacity:bD}},A={signal:'lerp(range("'.concat(t.scale,'"), ').concat(SD(0,1,.5),")")},a.x=QG(c,A),a.y=FG(c,A),o.angle=QG(c,bD,function(t,e){return 0===e?0:cN(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e}}(u,90)),o.baseline=QG(c,wG(c,"bottom","top"),{value:"bottom"}),a.angle=o.angle,a.baseline=o.baseline,jO(i,{fill:s("titleColor"),fillOpacity:s("titleOpacity"),font:s("titleFont"),fontSize:s("titleFontSize"),fontStyle:s("titleFontStyle"),fontWeight:s("titleFontWeight"),limit:s("titleLimit"),lineHeight:s("titleLineHeight")},{align:s("titleAlign"),angle:s("titleAngle"),baseline:s("titleBaseline")}),function(t,e,n,r){var i=function(t,e){return null!=t?(n.update[e]=_G(MO(t),n.update[e]),!1):!VO(e,r)},o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?MO(a):QG(e,MO(a),MO(o))}(s,c,i,n),i.update.align=_G(i.update.align,o.align),i.update.angle=_G(i.update.angle,o.angle),i.update.baseline=_G(i.update.baseline,o.baseline),xD({type:"text",role:"axis-title",style:"guide-title",from:r,encode:i},n)};var WG=function(t,e){var n,r,i,o,a,A=function(t,e){var n,r,i,o,a,A,s,c,u=e.config,l=u.style,g=u.axis,f="band"===e.scaleType(t.scale)&&u.axisBand,h=t.orient;if(cN(h)){var d=TG([u.axisX,u.axisY]),I=TG([u.axisTop,u.axisBottom,u.axisLeft,u.axisRight]);n={};var p,C=Object(U.a)(d);try{for(C.s();!(p=C.n()).done;)n[i=p.value]=QG(h,MG(i,u.axisX,g,l),MG(i,u.axisY,g,l))}catch(B){C.e(B)}finally{C.f()}r={};var y,v=Object(U.a)(I);try{for(v.s();!(y=v.n()).done;)r[i=y.value]=(o=h.signal,a=MG(i,u.axisTop,g,l),A=MG(i,u.axisBottom,g,l),s=MG(i,u.axisLeft,g,l),c=MG(i,u.axisRight,g,l),{signal:(null!=s?"".concat(o," === '").concat("left","' ? (").concat(GG(s),") : "):"")+(null!=A?"".concat(o," === '").concat("bottom","' ? (").concat(GG(A),") : "):"")+(null!=c?"".concat(o," === '").concat("right","' ? (").concat(GG(c),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(GG(a),") : "):"")+"(null)"})}catch(B){v.e(B)}finally{v.f()}}else n="top"===h||"bottom"===h?u.axisX:u.axisY,r=u["axis"+h[0].toUpperCase()+h.slice(1)];return n||r||f?Object(x.o)({},g,n,r,f):g}(t,e),s=t.encode||{},c=s.axis||{},u=c.name||void 0,l=c.interactive,g=c.style,f=FD(t,A),h=function(t){var e,n,r=t("tickBand"),i=t("tickOffset");return r?r.signal?(e={signal:"(".concat(r.signal,") === 'extent' ? 1 : 0.5")},n={signal:"(".concat(r.signal,") === 'extent'")},Object(x.F)(i)||(i={signal:"(".concat(r.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===r?(e=1,n=!0,i=0):(e=.5,n=!1):(e=t("bandPosition"),n=t("tickExtra")),{extra:n,band:e,offset:i}}(f);return n={scale:t.scale,ticks:!!f("ticks"),labels:!!f("labels"),grid:!!f("grid"),domain:!!f("domain"),title:null!=t.title},r=iN(e.add(NN({},[n]))),c=LO(function(t,e){var n={enter:{},update:{}};return jO(n,{orient:t("orient"),offset:t("offset")||0,position:lN(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}(f,t),c,mD),i=iN(e.add(kN({scale:e.scaleRef(t.scale),extra:e.property(h.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),a=[],n.grid&&a.push(LG(t,A,s.grid,i,h)),n.ticks&&(o=f("tickSize"),a.push(function(t,e,n,r,i,o){var a,A,s,c,u,l,g=FD(t,e),f=t.orient,h=EG(f,-1,1);return jO(a={enter:A={opacity:bD},update:c={opacity:ED},exit:s={opacity:bD}},{stroke:g("tickColor"),strokeCap:g("tickCap"),strokeDash:g("tickDash"),strokeDashOffset:g("tickDashOffset"),strokeOpacity:g("tickOpacity"),strokeWidth:g("tickWidth")}),(u=MO(i)).mult=h,l={scale:t.scale,field:vD,band:o.band,extra:o.extra,offset:o.offset,round:g("tickRound")},c.y=A.y=QG(f,bD,l),c.y2=A.y2=QG(f,u),s.x=QG(f,l),c.x=A.x=FG(f,bD,l),c.x2=A.x2=FG(f,u),s.y=FG(f,l),xD({type:"rule",role:"axis-tick",key:vD,from:r,encode:a},n)}(t,A,s.ticks,i,o,h))),n.labels&&(o=n.ticks?o:0,a.push(ZG(t,A,s.labels,i,o,h))),n.domain&&a.push(function(t,e,n,r){var i,o,a,A=FD(t,e),s=t.orient;jO(i={enter:o={opacity:bD},update:a={opacity:ED},exit:{opacity:bD}},{stroke:A("domainColor"),strokeCap:A("domainCap"),strokeDash:A("domainDash"),strokeDashOffset:A("domainDashOffset"),strokeWidth:A("domainWidth"),strokeOpacity:A("domainOpacity")});var c=jG(t,0),u=jG(t,1);return o.x=a.x=QG(s,c,bD),o.x2=a.x2=QG(s,u),o.y=a.y=FG(s,c,bD),o.y2=a.y2=FG(s,u),xD({type:"rule",role:"axis-domain",from:r,encode:i},n)}(t,A,s.domain,r)),n.title&&a.push(PG(t,A,s.title,r)),hG(QD({role:"axis",from:r,encode:c,marks:a,aria:f("aria"),description:f("description"),zindex:f("zindex"),name:u,interactive:l,style:g}),e)};var JG=function(t,e,n){var r=Object(x.i)(t.signals),i=Object(x.i)(t.scales);return n||r.forEach((function(t){return tN(t,e)})),Object(x.i)(t.projections).forEach((function(t){return function(t,e){var n=e.config.projection||{},r={};for(var i in t)"name"!==i&&(r[i]=yD(t[i],i,e));for(i in n)null==r[i]&&(r[i]=yD(n[i],i,e));e.addProjection(t.name,r)}(t,e)})),i.forEach((function(t){return function(t,e){var n=t.type||"linear";BI(n)||Object(x.n)("Unrecognized scale type: "+Object(x.Z)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)})),Object(x.i)(t.data).forEach((function(t){return vG(t,e)})),i.forEach((function(t){return AD(t,e)})),(n||r).forEach((function(t){return function(t,e){var n=e.getSignal(t.name),r=t.update;t.init&&(r?Object(x.n)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=sO(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((function(t){SN(t,e,n.id)}))}(t,e)})),Object(x.i)(t.axes).forEach((function(t){return WG(t,e)})),Object(x.i)(t.marks).forEach((function(t){return hG(t,e)})),Object(x.i)(t.legends).forEach((function(t){return dG(t,e)})),t.title&&CG(t.title,e),e.parseLambdas(),e};function HG(t,e){var n=e.config,r=iN(e.root=e.add(rN())),i=function(t,e){var n=function(n){return lN(t[n],e[n])},r=[YG("background",n("background")),YG("autosize",DO(n("autosize"))),YG("padding",_O(n("padding"))),YG("width",n("width")||0),YG("height",n("height")||0)],i=r.reduce((function(t,e){return t[e.name]=e,t}),{}),o={};return Object(x.i)(t.signals).forEach((function(t){Object(x.v)(i,t.name)?t=Object(x.o)(i[t.name],t):r.push(t),o[t.name]=t})),Object(x.i)(e.signals).forEach((function(t){Object(x.v)(o,t.name)||Object(x.v)(i,t.name)||r.push(t)})),r}(t,n);i.forEach((function(t){return tN(t,e)})),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;var o=e.add(NN()),a=e.add(_N(XO(function(t){return LO({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t)}(t.encode),"group","frame",t.style,e,{pulse:iN(o)}))),A=e.add(rD({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:iN(a)}));e.operators.pop(),e.pushState(iN(a),iN(A),null),JG(t,e,i),e.operators.push(A);var s=e.add(ON({mark:r,pulse:iN(A)}));return s=e.add($N({pulse:iN(s)})),s=e.add(eD({pulse:iN(s)})),e.addData("root",new sG(e,o,o,s)),e}function YG(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function XG(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function zG(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}var KG=XG.prototype=zG.prototype;function qG(t){return(Object(x.A)(t)?$G:t_)(t)}function $G(t){for(var e,n="[",r=0,i=t.length;r<i;++r)e=t[r],n+=(r>0?",":"")+(Object(x.F)(e)?e.signal||qG(e):Object(x.Z)(e));return n+"]"}function t_(t){var e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+Object(x.Z)(e)+":"+(Object(x.F)(n)?n.signal||qG(n):Object(x.Z)(n));return r+"}"}KG.parse=function(t){return JG(t,this)},KG.fork=function(){return new zG(this)},KG.isSubscope=function(){return this._subid>0},KG.toRuntime=function(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},KG.id=function(){return(this._subid?this._subid+":":0)+this._id++},KG.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((function(e){e.$ref=t.id})),t.refs=null),t},KG.proxy=function(t){var e=t instanceof eN?iN(t):t;return this.add(KN({value:e}))},KG.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},KG.addUpdate=function(t){return this.updates.push(t),t},KG.finish=function(){var t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){var r;t&&((r=t.data||(t.data={}))[e]||(r[e]=[])).push(n)}for(t in this.data)for(var r in n((e=this.data[t]).input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values"),e.index)n(e.index[r],t,"index:"+r);return this},KG.pushState=function(t,e,n){this._encode.push(iN(this.add(eD({pulse:t})))),this._parent.push(e),this._lookup.push(n?iN(this.proxy(n)):null),this._markpath.push(-1)},KG.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},KG.parent=function(){return Object(x.U)(this._parent)},KG.encode=function(){return Object(x.U)(this._encode)},KG.lookup=function(){return Object(x.U)(this._lookup)},KG.markpath=function(){var t=this._markpath;return++t[t.length-1]},KG.fieldRef=function(t,e){if(Object(x.H)(t))return oN(t,e);t.signal||Object(x.n)("Unsupported field reference: "+Object(x.Z)(t));var n,r=t.signal,i=this.field[r];return i||(n={name:this.signalRef(r)},e&&(n.as=e),this.field[r]=i=iN(this.add(jN(n)))),i},KG.compareRef=function(t){function e(t){return cN(t)?(r=!0,n.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(r=!0,n.exprRef(t.expr)):t}var n=this,r=!1,i=Object(x.i)(t.field).map(e),o=Object(x.i)(t.order).map(e);return r?iN(this.add(DN({fields:i,orders:o}))):AN(i,o)},KG.keyRef=function(t,e){var n=this.signals,r=!1;return t=Object(x.i)(t).map((function(t){return cN(t)?(r=!0,iN(n[t.signal])):t})),r?iN(this.add(LN({fields:t,flat:e}))):function(t,e){var n={$key:t};return e&&(n.$flat=!0),n}(t,e)},KG.sortRef=function(t){if(!t)return t;var e=sN(t.op,t.field),n=t.order||"ascending";return n.signal?iN(this.add(DN({fields:e,orders:this.signalRef(n.signal)}))):AN(e,n)},KG.event=function(t,e){var n=t+":"+e;if(!this.events[n]){var r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},KG.hasOwnSignal=function(t){return Object(x.v)(this.signals,t)},KG.addSignal=function(t,e){this.hasOwnSignal(t)&&Object(x.n)("Duplicate signal name: "+Object(x.Z)(t));var n=e instanceof eN?e:this.add(rN(e));return this.signals[t]=n},KG.getSignal=function(t){return this.signals[t]||Object(x.n)("Unrecognized signal name: "+Object(x.Z)(t)),this.signals[t]},KG.signalRef=function(t){return this.signals[t]?iN(this.signals[t]):(Object(x.v)(this.lambdas,t)||(this.lambdas[t]=this.add(rN(null))),iN(this.lambdas[t]))},KG.parseLambdas=function(){for(var t=Object.keys(this.lambdas),e=0,n=t.length;e<n;++e){var r=t[e],i=sO(r,this),o=this.lambdas[r];o.params=i.$params,o.update=i.$expr}},KG.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},KG.objectProperty=function(t){return t&&Object(x.F)(t)?this.signalRef(t.signal||qG(t)):t},KG.exprRef=function(t,e){var n={expr:sO(t,this)};return e&&(n.expr.$name=e),iN(this.add(MN(n)))},KG.addBinding=function(t,e){this.bindings||Object(x.n)("Nested signals do not support binding: "+Object(x.Z)(t)),this.bindings.push(Object(x.o)({signal:t},e))},KG.addScaleProj=function(t,e){Object(x.v)(this.scales,t)&&Object(x.n)("Duplicate scale or projection name: "+Object(x.Z)(t)),this.scales[t]=this.add(e)},KG.addScale=function(t,e){this.addScaleProj(t,tD(e))},KG.addProjection=function(t,e){this.addScaleProj(t,zN(e))},KG.getScale=function(t){return this.scales[t]||Object(x.n)("Unrecognized scale name: "+Object(x.Z)(t)),this.scales[t]},KG.projectionRef=KG.scaleRef=function(t){return iN(this.getScale(t))},KG.projectionType=KG.scaleType=function(t){return this.getScale(t).params.type},KG.addData=function(t,e){return Object(x.v)(this.data,t)&&Object(x.n)("Duplicate data set name: "+Object(x.Z)(t)),this.data[t]=e},KG.getData=function(t){return this.data[t]||Object(x.n)("Undefined data set name: "+Object(x.Z)(t)),this.data[t]},KG.addDataPipeline=function(t,e){return Object(x.v)(this.data,t)&&Object(x.n)("Duplicate data set name: "+Object(x.Z)(t)),this.addData(t,sG.fromEntries(this,e))};var e_=function(t,e,n){return Object(x.F)(t)||Object(x.n)("Input Vega specification must be an object."),HG(t,new XG(e=Object(x.N)({description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},trail:{fill:"#4c78a8",size:2},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}},e,t.config),n)).toRuntime()};Object(x.o)(Ia,o,A,s,c,u,l,g,f,h,d);var n_=n(1107);function r_(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}Object.create;Object.create;n(1359);var i_=n(1108),o_=n.n(i_),a_=n(538),A_=n.n(a_),s_=n(497),c_=n.n(s_);function u_(t){return!!t.or}function l_(t){return!!t.and}function g_(t){return!!t.not}function f_(t,e){return g_(t)?{not:f_(t.not,e)}:l_(t)?{and:t.and.map((function(t){return f_(t,e)}))}:u_(t)?{or:t.or.map((function(t){return f_(t,e)}))}:e(t)}var h_=A_.a,d_=o_.a;function I_(t,e){var n,r={},i=Object(U.a)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;Object(x.v)(t,o)&&(r[o]=t[o])}}catch(a){i.e(a)}finally{i.f()}return r}function p_(t,e){var n,r=Object.assign({},t),i=Object(U.a)(e);try{for(i.s();!(n=i.n()).done;){delete r[n.value]}}catch(o){i.e(o)}finally{i.f()}return r}Set.prototype.toJSON=function(){return"Set(".concat(Object(B.a)(this).map((function(t){return c_()(t)})).join(","),")")};var C_=c_.a;function y_(t){if(Object(x.E)(t))return t;var e=Object(x.H)(t)?t:c_()(t);if(e.length<250)return e;for(var n=0,r=0;r<e.length;r++){n=(n<<5)-n+e.charCodeAt(r),n&=n}return n}function v_(t){return!1===t||null===t}function B_(t,e){return t.indexOf(e)>-1}function m_(t,e){var n,r=0,i=Object(U.a)(t.entries());try{for(i.s();!(n=i.n()).done;){var o=Object(QA.a)(n.value,2),a=o[0];if(e(o[1],a,r++))return!0}}catch(A){i.e(A)}finally{i.f()}return!1}function b_(t,e){var n,r=0,i=Object(U.a)(t.entries());try{for(i.s();!(n=i.n()).done;){var o=Object(QA.a)(n.value,2),a=o[0];if(!e(o[1],a,r++))return!1}}catch(A){i.e(A)}finally{i.f()}return!0}function E_(t,e){var n,r=Object(U.a)(U_(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;Object(x.jb)(t,i,e[i],!0)}}catch(o){r.e(o)}finally{r.f()}}function Q_(t,e){var n,r,i=[],o={},a=Object(U.a)(t);try{for(a.s();!(r=a.n()).done;){var A=r.value;(n=e(A))in o||(o[n]=1,i.push(A))}}catch(s){a.e(s)}finally{a.f()}return i}function F_(t,e){var n,r=Object(U.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e.has(i))return!0}}catch(o){r.e(o)}finally{r.f()}return!1}function w_(t){var e,n=new Set,r=Object(U.a)(t);try{var i=function(){var t,r=e.value,i=Object(x.Y)(r).map((function(t,e){return 0===e?t:"[".concat(t,"]")})),o=i.map((function(t,e){return i.slice(0,e+1).join("")})),a=Object(U.a)(o);try{for(a.s();!(t=a.n()).done;){var A=t.value;n.add(A)}}catch(s){a.e(s)}finally{a.f()}};for(r.s();!(e=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}return n}function S_(t,e){return void 0===t||void 0===e||F_(w_(t),w_(e))}function R_(t){return 0===U_(t).length}var U_=Object.keys,x_=Object.values;function k_(t){var e=[];for(var n in t)Object(x.v)(t,n)&&e.push({key:n,value:t[n]});return e}function O_(t){return!0===t||!1===t}function N_(t){var e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function D_(t,e){return g_(t)?"!("+D_(t.not,e)+")":l_(t)?"("+t.and.map((function(t){return D_(t,e)})).join(") && (")+")":u_(t)?"("+t.or.map((function(t){return D_(t,e)})).join(") || (")+")":e(t)}function G_(t,e){if(0===e.length)return!0;var n=e.shift();return n in t&&G_(t[n],e)&&delete t[n],R_(t)}function __(t){return t.charAt(0).toUpperCase()+t.substr(1)}function M_(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum",n=Object(x.Y)(t),r=[],i=1;i<=n.length;i++){var o="[".concat(n.slice(0,i).map(x.Z).join("]["),"]");r.push("".concat(e).concat(o))}return r.join(" && ")}function T_(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";return"".concat(e,"[").concat(Object(x.Z)(Object(x.Y)(t).join(".")),"]")}function j_(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function L_(t){return"".concat(Object(x.Y)(t).map(j_).join("\\."))}function V_(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Z_(t){return"".concat(Object(x.Y)(t).join("."))}function P_(t){return t?Object(x.Y)(t).length:0}function W_(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];if(void 0!==o)return o}}var J_=42;function H_(t){var e=++J_;return t?String(t)+e:e}function Y_(t){return function(t){return 0===t.indexOf("__")}(t)?t:"__".concat(t)}function X_(t){if(void 0!==t)return(t%360+360)%360}function z_(t){return!!Object(x.E)(t)||!isNaN(t)&&!isNaN(parseFloat(t))}var K_={domainColor:{part:"domain",vgProp:"stroke"},labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDash"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDash"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"},titleColor:{part:"title",vgProp:"fill"},title:null};function q_(t){return t&&t.condition}var $_=["domain","grid","labels","ticks","title"],tM={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},eM={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},nM=Object.assign(Object.assign({},eM),{style:1,labelExpr:1,encoding:1});function rM(t){return!!nM[t]}U_(nM);var iM={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},oM=iM.arc,aM=iM.area,AM=iM.bar,sM=iM.image,cM=iM.line,uM=iM.point,lM=iM.rect,gM=iM.rule,fM=iM.text,hM=iM.tick,dM=iM.trail,IM=iM.circle,pM=iM.square,CM=iM.geoshape;function yM(t){return B_(["line","area","trail"],t)}function vM(t){return B_(["rect","bar","image","arc"],t)}var BM=U_(iM);function mM(t){return t.type}Object(x.db)(BM);var bM=[].concat(["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],["fill","fillOpacity"]),EM=U_({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),QM={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},FM={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},wM={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function SM(t){return"mark"in t}var RM=function(){function t(e,n){Object(F.a)(this,t),this.name=e,this.run=n}return Object(w.a)(t,[{key:"hasMatchingType",value:function(t){return!!SM(t)&&(mM(e=t.mark)?e.type:e)===this.name;var e}}]),t}(),UM={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},xM={count:1,min:1,max:1};function kM(t){return!!t&&!!t.argmin}function OM(t){return!!t&&!!t.argmax}U_(UM);function NM(t){return Object(x.H)(t)&&!!UM[t]}var DM=["count","valid","missing","distinct"];function GM(t){return Object(x.H)(t)&&B_(DM,t)}var _M=["count","sum","distinct","valid","missing"],MM=Object(x.db)(["mean","average","median","q1","q3","min","max"]),TM="row",jM="column",LM="radius",VM="theta",ZM="theta2",PM="color",WM="fill",JM="stroke",HM="shape",YM="size",XM={theta:1,theta2:1,radius:1,radius2:1};function zM(t){return t in XM}var KM={longitude:1,longitude2:1,latitude:1,latitude2:1};var qM=U_(KM),$M=Object.assign(Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),XM),KM),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1});function tT(t){return t===PM||t===WM||t===JM}var eT={row:1,column:1,facet:1},nT=U_(eT),rT=Object.assign(Object.assign({},$M),eT),iT=U_(rT),oT=(rT.order,rT.detail,rT.tooltip,r_(rT,["order","detail","tooltip"])),aT=(oT.row,oT.column,oT.facet,r_(oT,["row","column","facet"]));U_(oT),U_(aT);function AT(t){return!!rT[t]}var sT=["x2","y2","latitude2","longitude2",ZM,"radius2"];function cT(t){return uT(t)!==t}function uT(t){switch(t){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude";case ZM:return VM;case"radius2":return LM}return t}function lT(t){if(zM(t))switch(t){case VM:return"startAngle";case ZM:return"endAngle";case LM:return"outerRadius";case"radius2":return"innerRadius"}return t}function gT(t){switch(t){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2";case VM:return ZM;case LM:return"radius2"}}function fT(t){switch(t){case"x":case"x2":return"width";case"y":case"y2":return"height"}}U_($M),$M.x,$M.y,$M.x2,$M.y2,$M.latitude,$M.longitude,$M.latitude2,$M.longitude2,$M.theta,$M.theta2,$M.radius,$M.radius2;var hT=r_($M,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]),dT=U_(hT),IT={x:1,y:1},pT=U_(IT);function CT(t){return t in IT}var yT={theta:1,radius:1},vT=U_(yT);function BT(t){return"width"===t?"x":"y"}hT.text,hT.tooltip,hT.href,hT.url,hT.description,hT.detail,hT.key,hT.order;var mT=r_(hT,["text","tooltip","href","url","description","detail","key","order"]),bT=U_(mT);var ET=Object.assign(Object.assign(Object.assign({},IT),yT),mT),QT=U_(ET);function FT(t){return!!ET[t]}function wT(t,e){return function(t){switch(t){case PM:case WM:case JM:case"description":case"detail":case"key":case"tooltip":case"href":case"order":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"facet":case TM:case jM:return ST;case"x":case"y":case"latitude":case"longitude":return RT;case"x2":case"y2":case"latitude2":case"longitude2":return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case YM:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case"strokeDash":return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case HM:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"angle":return{point:"always",square:"always",text:"always"};case"url":return{image:"always"};case VM:case LM:return{text:"always",arc:"always"};case ZM:case"radius2":return{arc:"always"}}}(t)[e]}var ST={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},RT=r_(ST,["geoshape"]);function UT(t){switch(t){case"x":case"y":case VM:case LM:case YM:case"angle":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"x2":case"y2":case ZM:case"radius2":return;case"facet":case TM:case jM:case HM:case"strokeDash":case"text":case"tooltip":case"href":case"url":case"description":return"discrete";case PM:case WM:case JM:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function xT(t){return Object(x.B)(t)&&(t=HZ(t,void 0)),"bin"+U_(t).map((function(e){return DT(t[e])?N_("_".concat(e,"_").concat(Object.entries(t[e]))):N_("_".concat(e,"_").concat(t[e]))})).join("")}function kT(t){return!0===t||NT(t)&&!t.binned}function OT(t){return"binned"===t||NT(t)&&!0===t.binned}function NT(t){return Object(x.F)(t)}function DT(t){return null===t||void 0===t?void 0:t.selection}function GT(t){switch(t){case TM:case jM:case YM:case PM:case WM:case JM:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case HM:return 6;case"strokeDash":return 4;default:return 10}}var _T=n(377);function MT(t){return"Invalid specification ".concat(JSON.stringify(t),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}var TT='Autosize "fit" only works for single views and layered views.';function jT(t){return"".concat("width"==t?"Width":"Height",' "container" only works for single views and layered views.')}function LT(t){var e="width"==t?"x":"y";return"".concat("width"==t?"Width":"Height",' "container" only works well with autosize "fit" or "fit-').concat(e,'".')}function VT(t){return t?'Dropping "fit-'.concat(t,'" because spec has discrete ').concat(fT(t),"."):'Dropping "fit" because spec has discrete size.'}function ZT(t){return'Cannot project a selection on encoding channel "'.concat(t,'", which has no field.')}function PT(t,e){return'Cannot project a selection on encoding channel "'.concat(t,'" as it uses an aggregate function ("').concat(e,'").')}function WT(t){return'The "nearest" transform is not supported for '.concat(t," marks.")}function JT(t){return"Selection not supported for ".concat(t," yet.")}function HT(t){return'Cannot find a selection named "'.concat(t,'".')}var YT="Scale bindings are currently only supported for scales with unbinned, continuous domains.",XT="Legend bindings are only supported for selections over an individual field or encoding channel.";function zT(t){return'Cannot define and lookup the "'.concat(t,'" selection in the same view. ')+"Try moving the lookup into a second, layered view?"}function KT(t){return'Unknown repeated value "'.concat(t,'".')}function qT(t){return'The "columns" property cannot be used when "'.concat(t,'" has nested row/column.')}var $T="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function tj(t){return'Unrecognized parse "'.concat(t,'".')}function ej(t,e,n){return'An ancestor parsed field "'.concat(t,'" as ').concat(n," but a child wants to parse the field as ").concat(e,".")}function nj(t){return"Ignoring an invalid transform: ".concat(C_(t),".")}var rj='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function ij(t){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(t," are dropped.")}function oj(t){return"Layer's shared ".concat(t.join(",")," channel ").concat(1===t.length?"is":"are"," overriden.")}function aj(t){var e=t.parentProjection,n=t.projection;return"Layer's shared projection ".concat(C_(e)," is overridden by a child projection ").concat(C_(n),".")}var Aj="Arc marks uses theta channel rather than angle, replacing angle with theta.";function sj(t,e,n){return"Channel ".concat(t," is a ").concat(e,". Converted to {value: ").concat(C_(n),"}.")}function cj(t){return'Invalid field type "'.concat(t,'".')}function uj(t,e){return'Invalid field type "'.concat(t,'" for aggregate: "').concat(e,'", using "quantitative" instead.')}function lj(t){return'Invalid aggregation operator "'.concat(t,'".')}function gj(t,e){return'Missing type for channel "'.concat(t,'", using "').concat(e,'" instead.')}function fj(t,e){var n=e.fill,r=e.stroke;return"Dropping color ".concat(t," as the plot also has ").concat(n&&r?"fill and stroke":n?"fill":"stroke",".")}function hj(t,e){return"Dropping ".concat(C_(t),' from channel "').concat(e,'" since it does not contain any data field, datum, value, or signal.')}function dj(t,e,n){return"".concat(t,"-encoding with type ").concat(e," is deprecated. Replacing with ").concat(n,"-encoding.")}var Ij="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function pj(t,e,n){return"".concat(t,' dropped as it is incompatible with "').concat(e,'"').concat(n?" when ".concat(n):"",".")}function Cj(t){return"".concat(t,"-encoding is dropped as ").concat(t," is not a valid encoding channel.")}function yj(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned).")}function vj(t){return"Facet encoding dropped as ".concat(t.join(" and ")," ").concat(t.length>1?"are":"is"," also specified.")}function Bj(t,e){return'Using discrete channel "'.concat(t,'" to encode "').concat(e,'" field can be misleading as it does not encode ').concat("ordinal"===e?"order":"magnitude",".")}function mj(t,e){return"Line mark is for continuous lines and thus cannot be used with ".concat(t&&e?"x2 and y2":t?"x2":"y2",". We will use the rule mark (line segments) instead.")}function bj(t,e){return'Specified orient "'.concat(t,'" overridden with "').concat(e,'".')}var Ej="Custom domain scale cannot be unioned with default field-based domain.",Qj='Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.';function Fj(t){return'Cannot use the scale property "'.concat(t,'" with non-color channel.')}function wj(t){return"Using unaggregated domain with raw field has no effect (".concat(C_(t),").")}function Sj(t){return'Unaggregated domain not applicable for "'.concat(t,'" since it produces values outside the origin domain of the source data.')}function Rj(t){return"Unaggregated domain is currently unsupported for log scale (".concat(C_(t),").")}function Uj(t){return'Cannot apply size to non-oriented mark "'.concat(t,'".')}function xj(t,e,n){return'Channel "'.concat(t,'" does not work with "').concat(e,'" scale. We are using "').concat(n,'" scale instead.')}function kj(t,e){return'FieldDef does not work with "'.concat(t,'" scale. We are using "').concat(e,'" scale instead.')}function Oj(t,e,n){return"".concat(n,"-scale's \"").concat(e,'" is dropped as it does not work with ').concat(t," scale.")}function Nj(t,e){return'Scale type "'.concat(e,'" does not work with mark "').concat(t,'".')}function Dj(t){return'The step for "'.concat(t,'" is dropped because the ').concat("width"===t?"x":"y"," is continuous.")}function Gj(t,e,n,r){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(C_(n)," and ").concat(C_(r),"). Using ").concat(C_(n),".")}function _j(t,e,n,r){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(C_(n)," and ").concat(C_(r),"). Using the union of the two domains.")}function Mj(t){return'Setting the scale to be independent for "'.concat(t,'" means we also have to set the guide (axis or legend) to be independent.')}function Tj(t){return"Dropping sort property ".concat(C_(t),' as unioned domains only support boolean or op "count", "min", and "max".')}var jj="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Lj="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Vj="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Zj="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.",Pj="Invalid channel for axis.";function Wj(t){return'Cannot stack "'.concat(t,'" if there is already "').concat(t,'2".')}function Jj(t){return"Cannot stack non-linear scale (".concat(t,").")}function Hj(t){return'Stacking is applied even though the aggregate function is non-summative ("'.concat(t,'").')}function Yj(t,e){return"Invalid ".concat(t,": ").concat(C_(e),".")}function Xj(t){return"Dropping day from datetime ".concat(C_(t)," as day cannot be combined with other units.")}function zj(t,e){return"".concat(e?"extent ":"").concat(e&&t?"and ":"").concat(t?"center ":"").concat(e&&t?"are ":"is ","not needed when data are aggregated.")}function Kj(t,e,n){return"".concat(t," is not usually used with ").concat(e," for ").concat(n,".")}function qj(t,e){return"Continuous axis should not have customized aggregation function ".concat(t,"; ").concat(e," already agregates the axis.")}function $j(t,e){return"Center is not needed to be specified in ".concat(e," when extent is ").concat(t,".")}function tL(t){return"1D error band does not support ".concat(t,".")}function eL(t){return"Channel ".concat(t,' is required for "binned" bin.')}function nL(t){return"Domain for ".concat(t," is required for threshold scale.")}var rL=Object(x.K)(x.e),iL=rL;function oL(t){return iL=t}function aL(){return iL=rL}function AL(){var t;(t=iL).warn.apply(t,arguments)}function sL(t){if(t&&Object(x.F)(t)){var e,n=Object(U.a)(CL);try{for(n.s();!(e=n.n()).done;){if(e.value in t)return!0}}catch(r){n.e(r)}finally{n.f()}}return!1}var cL=["january","february","march","april","may","june","july","august","september","october","november","december"],uL=cL.map((function(t){return t.substr(0,3)})),lL=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],gL=lL.map((function(t){return t.substr(0,3)}));function fL(t,e){var n=[];if(e&&void 0!==t.day&&U_(t).length>1&&(AL(p.droppedDay(t)),delete(t=d_(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){var r=e?function(t){if(z_(t)&&(t=+t),Object(x.E)(t))return t-1;var e=t.toLowerCase(),n=cL.indexOf(e);if(-1!==n)return n;var r=e.substr(0,3),i=uL.indexOf(r);if(-1!==i)return i;throw new Error(p.invalidTimeUnit("month",t))}(t.month):t.month;n.push(r)}else if(void 0!==t.quarter){var i=e?function(t){if(z_(t)&&(t=+t),Object(x.E)(t))return t>4&&AL(p.invalidTimeUnit("quarter",t)),t-1;throw new Error(p.invalidTimeUnit("quarter",t))}(t.quarter):t.quarter;n.push(Object(x.E)(i)?3*i:i+"*3")}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){var o=e?function(t){if(z_(t)&&(t=+t),Object(x.E)(t))return t%7;var e=t.toLowerCase(),n=lL.indexOf(e);if(-1!==n)return n;var r=e.substr(0,3),i=gL.indexOf(r);if(-1!==i)return i;throw new Error(p.invalidTimeUnit("day",t))}(t.day):t.day;n.push(Object(x.E)(o)?o+1:o+"+1")}else n.push(1);for(var a=0,A=["hours","minutes","seconds","milliseconds"];a<A.length;a++){var s=t[A[a]];n.push("undefined"===typeof s?0:s)}return n}function hL(t){var e=fL(t,!0).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}function dL(t){var e=fL(t,!1).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}function IL(t){var e=fL(t,!0);return t.utc?+new Date(Date.UTC.apply(Date,Object(B.a)(e))):+Object(_T.a)(Date,Object(B.a)(e))}var pL={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},CL=U_(pL);function yL(t){return t.startsWith("utc")}var vL={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function BL(t){var e,n=[],r=Object(U.a)(CL);try{for(r.s();!(e=r.n()).done;){var i=e.value;mL(t,i)&&n.push(i)}}catch(o){r.e(o)}finally{r.f()}return n}function mL(t,e){var n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function bL(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1},i=r.end,o=M_(e),a=yL(t)?"utc":"";function A(t){return"quarter"===t?"(".concat(a,"quarter(").concat(o,")-1)"):"".concat(a).concat(t,"(").concat(o,")")}var s,c={},u=Object(U.a)(CL);try{for(u.s();!(s=u.n()).done;){var l=s.value;mL(t,l)&&(c[l]=A(l),n=l)}}catch(g){u.e(g)}finally{u.f()}return i&&(c[n]+="+1"),dL(c)}function EL(t){if(t){var e=BL(t);return"timeUnitSpecifier(".concat(c_()(e),", ").concat(c_()(vL),")")}}function QL(t){var e;if(t)return Object(x.H)(t)?e={unit:t}:Object(x.F)(t)&&(e=Object.assign(Object.assign({},t),t.unit?{unit:t.unit}:{})),yL(e.unit)&&(e.utc=!0,e.unit=e.unit.substr(3)),e}function FL(t){var e=QL(t),n=e.utc,r=r_(e,["utc"]);return r.unit?(n?"utc":"")+U_(r).map((function(t){return N_("".concat("unit"===t?"":"_".concat(t,"_")).concat(r[t]))})).join(""):(n?"utc":"")+"timeunit"+U_(r).map((function(t){return N_("_".concat(t,"_").concat(r[t]))})).join("")}function wL(t){return t&&!!t.signal}function SL(t){return!!t.step}function RL(t){return!Object(x.A)(t)&&("field"in t&&"data"in t)}var UL=U_({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1}),xL={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},kL=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function OL(t){return t&&!!t.field&&void 0!==t.equal}function NL(t){return t&&!!t.field&&void 0!==t.lt}function DL(t){return t&&!!t.field&&void 0!==t.lte}function GL(t){return t&&!!t.field&&void 0!==t.gt}function _L(t){return t&&!!t.field&&void 0!==t.gte}function ML(t){if(t&&t.field){if(Object(x.A)(t.range)&&2===t.range.length)return!0;if(wL(t.range))return!0}return!1}function TL(t){return t&&!!t.field&&(Object(x.A)(t.oneOf)||Object(x.A)(t.in))}function jL(t){return t&&!!t.field&&void 0!==t.valid}function LL(t){return TL(t)||OL(t)||ML(t)||NL(t)||GL(t)||DL(t)||_L(t)}function VL(t,e){return zZ(t,{timeUnit:e,wrapTime:!0})}function ZL(t,e){return t.map((function(t){return VL(t,e)}))}function PL(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.field,i=null===(e=QL(t.timeUnit))||void 0===e?void 0:e.unit,o=i?"time("+bL(i,r)+")":UZ(t,{expr:"datum"});if(OL(t))return o+"==="+VL(t.equal,i);if(NL(t)){var a=t.lt;return"".concat(o,"<").concat(VL(a,i))}if(GL(t)){var A=t.gt;return"".concat(o,">").concat(VL(A,i))}if(DL(t)){var s=t.lte;return"".concat(o,"<=").concat(VL(s,i))}if(_L(t)){var c=t.gte;return"".concat(o,">=").concat(VL(c,i))}if(TL(t))return"indexof([".concat(ZL(t.oneOf,i).join(","),"], ").concat(o,") !== -1");if(jL(t))return WL(o,t.valid);if(ML(t)){var u=t.range,l=wL(u)?{signal:"".concat(u.signal,"[0]")}:u[0],g=wL(u)?{signal:"".concat(u.signal,"[1]")}:u[1];if(null!==l&&null!==g&&n)return"inrange("+o+", ["+VL(l,i)+", "+VL(g,i)+"])";var f=[];return null!==l&&f.push("".concat(o," >= ").concat(VL(l,i))),null!==g&&f.push("".concat(o," <= ").concat(VL(g,i))),f.length>0?f.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(JSON.stringify(t)))}function WL(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?"isValid(".concat(t,") && isFinite(+").concat(t,")"):"!isValid(".concat(t,") || !isFinite(+").concat(t,")")}function JL(t){var e;return LL(t)&&t.timeUnit?Object.assign(Object.assign({},t),{timeUnit:null===(e=QL(t.timeUnit))||void 0===e?void 0:e.unit}):t}var HL={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};var YL=HL.quantitative,XL=HL.ordinal,zL=HL.temporal,KL=HL.nominal,qL=HL.geojson,$L=U_(HL);var tV="linear",eV="log",nV="pow",rV="sqrt",iV="symlog",oV="time",aV="utc",AV="quantile",sV="quantize",cV="threshold",uV="point",lV="band",gV={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},fV=U_(gV);function hV(t,e){var n=gV[t],r=gV[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}var dV={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function IV(t){return dV[t]}var pV=["linear","log","pow","sqrt","symlog","time","utc"],CV=Object(x.db)(pV),yV=Object(x.db)(["linear","log","pow","sqrt","symlog"]);var vV=Object(x.db)(["quantile","quantize","threshold"]),BV=pV.concat(["quantile","quantize","threshold","sequential","identity"]),mV=Object(x.db)(BV),bV=Object(x.db)(["ordinal","bin-ordinal","point","band"]);function EV(t){return t in bV}function QV(t){return t in mV}function FV(t){return t in CV}function wV(t){return t in vV}function SV(t){return null===t||void 0===t?void 0:t.selection}var RV={type:1,domain:1,domainMid:1,align:1,range:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},UV=(U_(RV),r_(RV,["type","domain","range","scheme"])),xV=U_(UV);!function(){var t,e,n={},r=Object(U.a)(iT);try{for(r.s();!(e=r.n()).done;){var i,o=e.value,a=Object(U.a)($L);try{for(a.s();!(i=a.n()).done;){var A,s=i.value,c=Object(U.a)(fV);try{for(c.s();!(A=c.n()).done;){var u=A.value,l=GV(o,s);DV(o,u)&&NV(u,s)&&(n[l]=null!==(t=n[l])&&void 0!==t?t:[],n[l].push(u))}}catch(g){c.e(g)}finally{c.f()}}}catch(g){a.e(g)}finally{a.f()}}}catch(g){r.e(g)}finally{r.f()}}();function kV(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!B_(["point","band","identity"],t);case"bins":return!B_(["point","band","identity","ordinal"],t);case"round":return FV(t)||"band"===t||"point"===t;case"padding":return FV(t)||B_(["point","band"],t);case"paddingOuter":case"align":return B_(["point","band"],t);case"paddingInner":return"band"===t;case"domainMid":case"clamp":return FV(t);case"nice":return FV(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return QV(t)&&!B_(["log","time","utc","threshold","quantile"],t)}}function OV(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return tT(t)?void 0:p.cannotUseScalePropertyWithNonColor(t);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"reverse":case"round":case"clamp":case"zero":return}}function NV(t,e){return B_([XL,KL],e)?void 0===t||EV(t):e===zL?B_([oV,aV,void 0],t):e!==YL||B_([eV,nV,rV,iV,AV,sV,cV,tV,void 0],t)}function DV(t,e){if(!FT(t))return!1;switch(t){case"x":case"y":case VM:case LM:return FV(e)||B_(["band","point"],e);case YM:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"angle":return FV(e)||wV(e)||B_(["band","point","ordinal"],e);case PM:case WM:case JM:return"band"!==e;case"strokeDash":return"ordinal"===e||wV(e);case HM:return"ordinal"===e}}function GV(t,e){return t+"_"+e}function _V(t){var e=t.channel,n=t.channelDef,r=t.markDef,i=t.scale,o=t.config,a=ZV(t);return pZ(n)&&!GM(n.aggregate)&&i&&FV(i.get("type"))&&!1===i.get("zero")?MV({fieldDef:n,channel:e,markDef:r,ref:a,config:o}):a}function MV(t){var e=t.fieldDef,n=t.channel,r=t.markDef,i=t.ref,o=t.config;return yM(r.type)||null===oP("invalid",r,o)?i:[TV(e,n),i]}function TV(t,e){var n=jV(t,!0),r="y"===uT(e)?{field:{group:"height"}}:{value:0};return Object.assign({test:n},r)}function jV(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return WL(Object(x.H)(t)?t:UZ(t,{expr:"datum"}),!e)}function LV(t,e,n,r){var i={};if(e&&(i.scale=e),yZ(t)){var o=t.datum;sL(o)?i.signal=hL(o):wL(o)?i.signal=o.signal:i.value=o}else i.field=UZ(t,n);if(r){var a=r.offset,A=r.band;a&&(i.offset=a),A&&(i.band=A)}return i}function VV(t){var e=t.scaleName,n=t.fieldOrDatumDef,r=t.fieldOrDatumDef2,i=t.offset,o=t.startSuffix,a=t.band,A=void 0===a?.5:a,s=0<A&&A<1?"datum":void 0,c=UZ(n,{expr:s,suffix:o}),u=void 0!==r?UZ(r,{expr:s}):UZ(n,{suffix:"end",expr:s}),l={};if(0===A||1===A){l.scale=e;var g=0===A?c:u;l.field=g}else{var f="".concat(A," * ").concat(c," + ").concat(1-A," * ").concat(u);l.signal='scale("'.concat(e,'", ').concat(f,")")}return i&&(l.offset=i),l}function ZV(t){var e,n=t.channel,r=t.channelDef,i=t.channel2Def,o=t.markDef,a=t.config,A=t.scaleName,s=t.scale,c=t.stack,u=t.offset,l=t.defaultRef,g=t.band;if(r){if(mZ(r)){if(bZ(r)){g=null!==g&&void 0!==g?g:gZ({channel:n,fieldDef:r,fieldDef2:i,markDef:o,stack:c,config:a,isMidPoint:!0});var f=r.bin,h=r.timeUnit,d=r.type;if(kT(f)||g&&h&&d===zL)return c&&c.impute?LV(r,A,{binSuffix:"mid"},{offset:u}):g?VV({scaleName:A,fieldOrDatumDef:r,band:g,offset:u}):LV(r,A,qZ(r,n)?{binSuffix:"range"}:{},{offset:u});if(OT(f)){if(pZ(i))return VV({scaleName:A,fieldOrDatumDef:r,fieldOrDatumDef2:i,band:g,offset:u});var I="x"===n?"x2":"y2";AL(p.channelRequiredForBinned(I))}}var C=null===s||void 0===s?void 0:s.get("type");return LV(r,A,EV(C)?{binSuffix:"range"}:{},{offset:u,band:"band"===C?null!==(e=null!==g&&void 0!==g?g:r.band)&&void 0!==e?e:.5:void 0})}if(EZ(r)){var y=r.value,v=u?{offset:u}:{};return Object.assign(Object.assign({},PV(n,y)),v)}}return Object(x.D)(l)&&(l=l()),l?Object.assign(Object.assign({},l),u?{offset:u}:{}):l}function PV(t,e){return B_(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:B_(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:eP(e)}function WV(t){return t&&"number"!==t&&"time"!==t}function JV(t,e,n){return"".concat(t,"(").concat(e).concat(n?", ".concat(JSON.stringify(n)):"",")")}function HV(t){var e,n,r=t.fieldOrDatumDef,i=t.format,o=t.formatType,a=t.expr,A=t.normalizeStack,s=t.config;if(WV(o))return XV({fieldOrDatumDef:r,format:i,formatType:o,expr:a,config:s});var c=YV(r,a,A);if(XZ(r)){var u=function(t,e,n,r,i){return!e||n?(n=Object(x.H)(n)?n:r,"".concat(i?"utc":"time","Format(").concat(t,", '").concat(n,"')")):function(t,e,n){if(t){var r=EL(t),i=n||yL(t);return"".concat(i?"utc":"time","Format(").concat(e,", ").concat(r,")")}}(e,t,i)}(c,pZ(r)?null===(e=QL(r.timeUnit))||void 0===e?void 0:e.unit:void 0,i,s.timeFormat,QZ(r)&&(null===(n=r.scale)||void 0===n?void 0:n.type)===aV);return u?{signal:u}:void 0}return i=qV(CZ(r),i,s),pZ(r)&&kT(r.bin)?{signal:eZ(c,UZ(r,{expr:a,binSuffix:"end"}),i,o,s)}:i||"quantitative"===CZ(r)?{signal:"".concat($V(c,i))}:{signal:"isValid(".concat(c,") ? ").concat(c,' : ""+').concat(c)}}function YV(t,e,n){return pZ(t)?n?"".concat(UZ(t,{expr:e,suffix:"end"}),"-").concat(UZ(t,{expr:e,suffix:"start"})):UZ(t,{expr:e}):function(t){var e=t.datum;return sL(e)?hL(e):"".concat(JSON.stringify(e))}(t)}function XV(t){var e=t.fieldOrDatumDef,n=t.format,r=t.formatType,i=t.expr,o=t.normalizeStack,a=t.config,A=t.field;return A=null!==A&&void 0!==A?A:YV(e,i,o),pZ(e)&&kT(e.bin)?{signal:eZ(A,UZ(e,{expr:i,binSuffix:"end"}),n,r,a)}:{signal:JV(r,A,n)}}function zV(t,e,n,r,i,o){var a;if(!WV(r))return XZ(t)?function(t,e,n,r){if(t)return t;if(e)return{signal:EL(e)};return r?void 0:n.timeFormat}(n,pZ(t)?null===(a=QL(t.timeUnit))||void 0===a?void 0:a.unit:void 0,i,o):qV(e,n,i)}function KV(t,e,n){return t&&(wL(t)||"number"===t||"time"===t)?t:XZ(e)&&"time"!==n&&"utc"!==n?"time":void 0}function qV(t,e,n){return Object(x.H)(e)?e:t===YL?n.numberFormat:void 0}function $V(t,e){return"format(".concat(t,', "').concat(e||"",'")')}function tZ(t,e,n,r){var i;return WV(n)?JV(n,t,e):$V(t,null!==(i=Object(x.H)(e)?e:void 0)&&void 0!==i?i:r.numberFormat)}function eZ(t,e,n,r,i){var o=tZ(t,n,r,i),a=tZ(e,n,r,i);return"".concat(WL(t,!1),' ? "null" : ').concat(o,' + "').concat(" \u2013 ",'" + ').concat(a)}var nZ={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function rZ(t){return t in nZ}function iZ(t){return!!t&&!!t.encoding}function oZ(t){return!!t&&("count"===t.op||!!t.field)}function aZ(t){return!!t&&Object(x.A)(t)}function AZ(t){return"row"in t||"column"in t}function sZ(t){return!!t&&"header"in t}function cZ(t){return"facet"in t}function uZ(t){var e=t.field,n=t.timeUnit,r=t.bin,i=t.aggregate;return Object.assign(Object.assign(Object.assign(Object.assign({},n?{timeUnit:n}:{}),r?{bin:r}:{}),i?{aggregate:i}:{}),{field:e})}function lZ(t){return bZ(t)&&"sort"in t}function gZ(t){var e=t.channel,n=t.fieldDef,r=t.fieldDef2,i=t.markDef,o=t.stack,a=t.config,A=t.isMidPoint;if(mZ(n)&&void 0!==n.band)return n.band;if(pZ(n)){var s=n.timeUnit,c=n.bin;if(s&&!r)return A?aP("timeUnitBandPosition",i,a):vM(i.type)?aP("timeUnitBand",i,a):0;if(kT(c))return vM(i.type)&&!A?1:.5}return(null===o||void 0===o?void 0:o.fieldChannel)===e&&A?.5:void 0}function fZ(t,e,n,r,i,o){return!!(kT(e.bin)||e.timeUnit&&bZ(e)&&"temporal"===e.type)&&!!gZ({channel:t,fieldDef:e,fieldDef2:n,stack:r,markDef:i,config:o})}function hZ(t){return!!t&&"condition"in t}function dZ(t){var e=t&&t.condition;return!!e&&!Object(x.A)(e)&&pZ(e)}function IZ(t){var e=t&&t.condition;return!!e&&!Object(x.A)(e)&&mZ(e)}function pZ(t){return!!t&&(!!t.field||"count"===t.aggregate)}function CZ(t){return t&&t.type}function yZ(t){return!!t&&"datum"in t}function vZ(t){return bZ(t)&&kZ(t)||BZ(t)}function BZ(t){return yZ(t)&&Object(x.E)(t.datum)}function mZ(t){return pZ(t)||yZ(t)}function bZ(t){return!!t&&("field"in t&&"type"in t||"count"===t.aggregate)}function EZ(t){return t&&"value"in t&&"value"in t}function QZ(t){return!!t&&("scale"in t||"sort"in t)}function FZ(t){return t&&("axis"in t||"stack"in t||"impute"in t)}function wZ(t){return!!t&&"legend"in t}function SZ(t){return!!t&&("format"in t||"formatType"in t)}function RZ(t){return"op"in t}function UZ(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.field,a=i.prefix,A=i.suffix,s="";if(OZ(t))o=Y_("count");else{var c;if(!i.nofn)if(RZ(t))c=t.op;else{var u=t.bin,l=t.aggregate,g=t.timeUnit;kT(u)?(c=xT(u),A=(null!==(e=i.binSuffix)&&void 0!==e?e:"")+(null!==(n=i.suffix)&&void 0!==n?n:"")):l?OM(l)?(s='["'.concat(o,'"]'),o="argmax_".concat(l.argmax)):kM(l)?(s='["'.concat(o,'"]'),o="argmin_".concat(l.argmin)):c=String(l):g&&(c=FL(g),A=(!B_(["range","mid"],i.binSuffix)&&i.binSuffix||"")+(null!==(r=i.suffix)&&void 0!==r?r:""))}c&&(o=o?"".concat(c,"_").concat(o):c)}return A&&(o="".concat(o,"_").concat(A)),a&&(o="".concat(a,"_").concat(o)),i.forAs?Z_(o):i.expr?T_(o,i.expr)+s:L_(o)+s}function xZ(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return pZ(t)&&!!t.bin;case"temporal":return!1}throw new Error(p.invalidFieldType(t.type))}function kZ(t){return!xZ(t)}function OZ(t){return"count"===t.aggregate}var NZ=function(t,e){switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){var e=t.aggregate,n=t.bin,r=t.timeUnit,i=t.field;if(OM(e))return"".concat(i," for argmax(").concat(e.argmax,")");if(kM(e))return"".concat(i," for argmin(").concat(e.argmin,")");var o=QL(r),a=e||(null===o||void 0===o?void 0:o.unit)||(null===o||void 0===o?void 0:o.maxbins)&&"timeunit"||kT(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(t);default:return function(t,e){var n,r=t.field,i=t.bin,o=t.timeUnit,a=t.aggregate;if("count"===a)return e.countTitle;if(kT(i))return"".concat(r," (binned)");if(o){var A=null===(n=QL(o))||void 0===n?void 0:n.unit;if(A)return"".concat(r," (").concat(BL(A).join("-"),")")}else if(a)return OM(a)?"".concat(r," for max ").concat(a.argmax):kM(a)?"".concat(r," for min ").concat(a.argmin):"".concat(__(a)," of ").concat(r);return r}(t,e)}},DZ=NZ;function GZ(t){DZ=t}function _Z(){GZ(NZ)}function MZ(t,e,n){var r,i,o=n.allowDisabling,a=n.includeDefault,A=void 0===a||a,s=(null!==(r=TZ(t))&&void 0!==r?r:{}).title;if(!pZ(t))return s;var c=t,u=A?jZ(c,e):void 0;return o?W_(s,c.title,u):null!==(i=null!==s&&void 0!==s?s:c.title)&&void 0!==i?i:u}function TZ(t){return FZ(t)&&t.axis?t.axis:wZ(t)&&t.legend?t.legend:sZ(t)&&t.header?t.header:void 0}function jZ(t,e){return DZ(t,e)}function LZ(t){var e;if(SZ(t))return{format:t.format,formatType:t.formatType};var n=null!==(e=TZ(t))&&void 0!==e?e:{};return{format:n.format,formatType:n.formatType}}function VZ(t){return pZ(t)?t:dZ(t)?t.condition:void 0}function ZZ(t){return mZ(t)?t:IZ(t)?t.condition:void 0}function PZ(t,e,n){if(Object(x.H)(t)||Object(x.E)(t)||Object(x.B)(t)){var r=Object(x.H)(t)?"string":Object(x.E)(t)?"number":"boolean";return AL(p.primitiveChannelDef(e,r,t)),{value:t}}return mZ(t)?WZ(t,e,n):IZ(t)?Object.assign(Object.assign({},t),{condition:WZ(t.condition,e,n)}):t}function WZ(t,e,n){if(SZ(t)){t.format;var r=t.formatType,i=r_(t,["format","formatType"]);if(WV(r)&&!n.customFormatTypes)return AL(p.customFormatTypeNotAllowed(e)),WZ(i,e,n)}else{var o=FZ(t)?"axis":wZ(t)?"legend":sZ(t)?"header":null;if(o&&t[o]){var a=t[o],A=(a.format,a.formatType),s=r_(a,["format","formatType"]);if(WV(A)&&!n.customFormatTypes)return AL(p.customFormatTypeNotAllowed(e)),WZ(Object.assign(Object.assign({},t),Object(v.a)({},o,s)),e,n)}}return pZ(t)?JZ(t,e):function(t){var e=t.type;if(e)return t;var n=t.datum;return e=Object(x.E)(n)?"quantitative":Object(x.H)(n)?"nominal":sL(n)?"temporal":void 0,Object.assign(Object.assign({},t),{type:e})}(t)}function JZ(t,e){var n=t.aggregate,r=t.timeUnit,i=t.bin,o=t.field,a=Object.assign({},t);if(!n||NM(n)||OM(n)||kM(n)||(AL(p.invalidAggregate(n)),delete a.aggregate),r&&(a.timeUnit=QL(r)),o&&(a.field="".concat(o)),kT(i)&&(a.bin=HZ(i,e)),OT(i)&&!CT(e)&&AL("Channel ".concat(e,' should not be used with "binned" bin.')),bZ(a)){var A=a.type,s=function(t){if(t)switch(t=t.toLowerCase()){case"q":case YL:return"quantitative";case"t":case zL:return"temporal";case"o":case XL:return"ordinal";case"n":case KL:return"nominal";case qL:return"geojson"}}(A);A!==s&&(a.type=s),"quantitative"!==A&&GM(n)&&(AL(p.invalidFieldTypeForCountAggregate(A,n)),a.type="quantitative")}else if(!cT(e)){var c=function(t,e){if(t.timeUnit)return"temporal";if(kT(t.bin))return"quantitative";switch(UT(e)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}(a,e);AL(p.missingFieldType(e,c)),a.type=c}if(bZ(a)){var u=function(t,e){var n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:"Channel ".concat(e," should not be used with a geojson data.")};switch(e){case TM:case jM:case"facet":return kZ(t)?{compatible:!1,warning:p.facetChannelShouldBeDiscrete(e)}:YZ;case"x":case"y":case PM:case WM:case JM:case"text":case"detail":case"key":case"tooltip":case"href":case"url":case"angle":case VM:case LM:case"description":return YZ;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==YL?{compatible:!1,warning:"Channel ".concat(e," should be used with a quantitative field only, not ").concat(t.type," field.")}:YZ;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case YM:case ZM:case"radius2":case"x2":case"y2":return"nominal"!==n||t.sort?YZ:{compatible:!1,warning:"Channel ".concat(e," should not be used with an unsorted discrete field.")};case"strokeDash":return B_(["ordinal","nominal"],t.type)?YZ:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case HM:return B_(["ordinal","nominal","geojson"],t.type)?YZ:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==t.type||"sort"in t?YZ:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(a,e),l=u.compatible,g=u.warning;l||AL(g)}if(lZ(a)&&Object(x.H)(a.sort)){var f=a.sort;if(rZ(f))return Object.assign(Object.assign({},a),{sort:{encoding:f}});var h=f.substr(1);if("-"===f.charAt(0)&&rZ(h))return Object.assign(Object.assign({},a),{sort:{encoding:h,order:"descending"}})}if(sZ(a)){var d=a.header,I=d.orient,C=r_(d,["orient"]);if(I)return Object.assign(Object.assign({},a),{header:Object.assign(Object.assign({},C),{labelOrient:d.labelOrient||I,titleOrient:d.titleOrient||I})})}return a}function HZ(t,e){return Object(x.B)(t)?{maxbins:GT(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:Object.assign(Object.assign({},t),{maxbins:GT(e)})}var YZ={compatible:!0};function XZ(t){var e,n=LZ(t).formatType;return"time"===n||!n&&((e=t)&&("temporal"===e.type||pZ(e)&&!!e.timeUnit))}function zZ(t,e){var n,r,i=e.timeUnit,o=e.type,a=e.wrapTime,A=e.undefinedIfExprNotRequired,s=i&&(null===(n=QL(i))||void 0===n?void 0:n.unit),c=s||"temporal"===o;return wL(t)?r=t.signal:sL(t)?(c=!0,r=hL(t)):(Object(x.H)(t)||Object(x.E)(t))&&c&&(r="datetime(".concat(JSON.stringify(t),")"),function(t){return!!pL[t]}(s)&&(Object(x.E)(t)&&t<1e4||Object(x.H)(t)&&isNaN(Date.parse(t)))&&(r=hL(Object(v.a)({},s,t)))),r?a&&c?"time(".concat(r,")"):r:A?void 0:JSON.stringify(t)}function KZ(t,e){var n=t.type;return e.map((function(e){var r=zZ(e,{timeUnit:pZ(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:e}))}function qZ(t,e){return kT(t.bin)?FT(e)&&B_(["ordinal","nominal"],t.type):(console.warn("Only call this method for binned field defs."),!1)}function $Z(t){var e=t.anchor,n=t.frame,r=t.offset,i=t.orient,o=t.color,a=t.subtitleColor,A=t.subtitleFont,s=t.subtitleFontSize,c=t.subtitleFontStyle,u=t.subtitleFontWeight,l=t.subtitleLineHeight,g=t.subtitlePadding,f=r_(t,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]),h=Object.assign(Object.assign({},f),o?{fill:o}:{}),d=Object.assign(Object.assign(Object.assign(Object.assign({},e?{anchor:e}:{}),n?{frame:n}:{}),r?{offset:r}:{}),i?{orient:i}:{}),I=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a?{subtitleColor:a}:{}),A?{subtitleFont:A}:{}),s?{subtitleFontSize:s}:{}),c?{subtitleFontStyle:c}:{}),u?{subtitleFontWeight:u}:{}),l?{subtitleLineHeight:l}:{}),g?{subtitlePadding:g}:{});return{titleMarkConfig:h,subtitleMarkConfig:I_(h,["align","baseline","dx","dy","limit"]),nonMark:d,subtitle:I}}function tP(t){return Object(x.H)(t)||Object(x.A)(t)&&Object(x.H)(t[0])}function eP(t){return wL(t)?t:void 0!==t?{value:t}:void 0}function nP(t){return wL(t)?t.signal:Object(x.Z)(t.value)}function rP(t){return wL(t)?t.signal:null==t?null:Object(x.Z)(t)}function iP(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function oP(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.vgChannel,o=r.ignoreVgConfig;return i&&void 0!==e[i]?e[i]:void 0!==e[t]?e[t]:!o||i&&i!==t?aP(t,e,n,r):void 0}function aP(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.vgChannel;return W_(i?AP(t,e,n.style):void 0,AP(t,e,n.style),i?n[e.type][i]:void 0,n[e.type][t],i?n.mark[i]:n.mark[t])}function AP(t,e,n){return sP(t,iP(e),n)}function sP(t,e,n){var r;e=Object(x.i)(e);var i,o=Object(U.a)(e);try{for(o.s();!(i=o.n()).done;){var a=n[i.value];a&&void 0!==a[t]&&(r=a[t])}}catch(A){o.e(A)}finally{o.f()}return r}function cP(t,e){return Object(x.i)(t).reduce((function(t,n){var r;return t.field.push(UZ(n,e)),t.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),t}),{field:[],order:[]})}function uP(t,e){var n=Object(B.a)(t);return e.forEach((function(t){var e,r=Object(U.a)(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(h_(i,t))return}}catch(o){r.e(o)}finally{r.f()}n.push(t)})),n}function lP(t,e){return h_(t,e)||!e?t:t?[].concat(Object(B.a)(Object(x.i)(t)),Object(B.a)(Object(x.i)(e))).join(", "):e}function gP(t,e){var n=t.value,r=e.value;if(null==n||null===r)return{explicit:t.explicit,value:null};if((tP(n)||wL(n))&&(tP(r)||wL(r)))return{explicit:t.explicit,value:lP(n,r)};if(tP(n)||wL(n))return{explicit:t.explicit,value:n};if(tP(r)||wL(r))return{explicit:t.explicit,value:r};if(!tP(n)&&!wL(n)&&!tP(r)&&!wL(r))return{explicit:t.explicit,value:uP(n,r)};throw new Error("It should never reach here")}function fP(t,e){var n=t&&t[e];return!!n&&(Object(x.A)(n)?m_(n,(function(t){return!!t.field})):pZ(n)||dZ(n))}function hP(t){return m_(iT,(function(e){if(fP(t,e)){var n=t[e];if(Object(x.A)(n))return m_(n,(function(t){return!!t.aggregate}));var r=VZ(n);return r&&!!r.aggregate}return!1}))}function dP(t,e){var n=[],r=[],i=[],o=[],a={};return CP(t,(function(A,s){if(pZ(A)){var c=A.field,u=A.aggregate,l=A.bin,g=A.timeUnit,f=r_(A,["field","aggregate","bin","timeUnit"]);if(u||g||l){var h,d=TZ(A),I=d&&d.title,p=UZ(A,{forAs:!0}),C=Object.assign(Object.assign(Object.assign({},I?[]:{title:MZ(A,e,{allowDisabling:!0})}),f),{field:p});if(u){if(OM(u)?(h="argmax",p=UZ({op:"argmax",field:u.argmax},{forAs:!0}),C.field="".concat(p,".").concat(c)):kM(u)?(h="argmin",p=UZ({op:"argmin",field:u.argmin},{forAs:!0}),C.field="".concat(p,".").concat(c)):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(h=u),h){var y={op:h,as:p};c&&(y.field=c),o.push(y)}}else if(n.push(p),bZ(A)&&kT(l)){if(r.push({bin:l,field:c,as:p}),n.push(UZ(A,{binSuffix:"end"})),qZ(A,s)&&n.push(UZ(A,{binSuffix:"range"})),CT(s)){var v={field:p+"_end"};a[s+"2"]=v}C.bin="binned",cT(s)||(C.type=YL)}else if(g){i.push({timeUnit:g,field:c,as:p});var B=bZ(A)&&A.type!==zL&&"time";B&&("text"===s||"tooltip"===s?C.formatType=B:!function(t){return!!hT[t]}(s)?CT(s)&&(C.axis=Object.assign({formatType:B},C.axis)):C.legend=Object.assign({formatType:B},C.legend))}a[s]=C}else n.push(c),a[s]=t[s]}else a[s]=t[s]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function IP(t,e,n){var r=e.type;return U_(t).reduce((function(i,o){if(!AT(o))return AL(p.invalidEncodingChannel(o)),i;var a=t[o];if("angle"!==o||"arc"!==r||t.theta||(AL(p.REPLACE_ANGLE_WITH_THETA),o=VM),!function(t,e,n){var r=wT(e,n);if(!r)return!1;if("binned"===r){var i=t["x2"===e?"x":"y"];return!!(pZ(i)&&pZ(t[e])&&OT(i.bin))}return!0}(t,o,r))return AL(p.incompatibleChannel(o,r)),i;if(o===YM&&"line"===r){var A=VZ(t[o]);if(null===A||void 0===A?void 0:A.aggregate)return AL(p.LINE_WITH_VARYING_SIZE),i}if(o===PM&&(e.filled?"fill"in t:"stroke"in t))return AL(p.droppingColor("encoding",{fill:"fill"in t,stroke:"stroke"in t})),i;if("detail"===o||"order"===o&&!Object(x.A)(a)&&!EZ(a)||"tooltip"===o&&Object(x.A)(a))a&&(i[o]=Object(x.i)(a).reduce((function(t,e){return pZ(e)?t.push(JZ(e,o)):AL(p.emptyFieldDef(e,o)),t}),[]));else{if("tooltip"===o&&null===a)i[o]=null;else if(!pZ(a)&&!yZ(a)&&!EZ(a)&&!hZ(a)&&!wL(a))return AL(p.emptyFieldDef(a,o)),i;i[o]=PZ(a,o,n)}return i}),{})}function pP(t){var e,n=[],r=Object(U.a)(U_(t));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(fP(t,i)){var o,a=t[i],A=Object(x.i)(a),s=Object(U.a)(A);try{for(s.s();!(o=s.n()).done;){var c=o.value;pZ(c)?n.push(c):dZ(c)&&n.push(c.condition)}}catch(u){s.e(u)}finally{s.f()}}}}catch(u){r.e(u)}finally{r.f()}return n}function CP(t,e,n){if(t){var r,i=Object(U.a)(U_(t));try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t[o];if(Object(x.A)(a)){var A,s=Object(U.a)(a);try{for(s.s();!(A=s.n()).done;){var c=A.value;e.call(n,c,o)}}catch(u){s.e(u)}finally{s.f()}}else e.call(n,a,o)}}catch(u){i.e(u)}finally{i.f()}}}function yP(t,e,n,r){return t?U_(t).reduce((function(n,i){var o=t[i];return Object(x.A)(o)?o.reduce((function(t,n){return e.call(r,t,n,i)}),n):e.call(r,n,o,i)}),n):n}function vP(t,e){return U_(e).reduce((function(n,r){switch(r){case"x":case"y":case"href":case"description":case"url":case"x2":case"y2":case VM:case ZM:case LM:case"radius2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case HM:case"angle":case"tooltip":return n;case"order":if("line"===t||"trail"===t)return n;case"detail":case"key":var i=e[r];if(Object(x.A)(i)||pZ(i)){var o,a=Object(U.a)(Object(x.i)(i));try{for(a.s();!(o=a.n()).done;){var A=o.value;A.aggregate||n.push(UZ(A,{}))}}catch(c){a.e(c)}finally{a.f()}}return n;case YM:if("trail"===t)return n;case PM:case WM:case JM:case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":var s=VZ(e[r]);return s&&!s.aggregate&&n.push(UZ(s,{})),n}}),[])}function BP(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in n)return{tooltip:n.tooltip};var i=t.map((function(t){var n=t.fieldPrefix,i=t.titlePrefix,o=r?" of ".concat(e.field):"";return{field:n+e.field,type:e.type,title:wL(i)?{signal:i+'"'.concat(escape(o),'"')}:i+o}}));return{tooltip:[].concat(Object(B.a)(i),Object(B.a)(pP(n)))}}function mP(t){var e=t.axis,n=t.title,r=t.field;return e&&void 0!==e.title?void 0:W_(n,r)}function bP(t,e,n,r,i){var o=n.scale,a=n.axis;return function(A){var s=A.partName,c=A.mark,u=A.positionPrefix,l=A.endPositionPrefix,g=void 0===l?void 0:l,f=A.aria,h=A.extraEncoding,d=void 0===h?{}:h,I=mP(n);return EP(t,s,i,f,{mark:c,encoding:Object.assign(Object.assign(Object.assign(Object(v.a)({},e,Object.assign(Object.assign(Object.assign({field:u+"_"+n.field,type:n.type},void 0!==I?{title:I}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})),Object(x.H)(g)?Object(v.a)({},e+"2",{field:g+"_"+n.field}):{}),r),d)})}}function EP(t,e,n,r,i){var o=t.clip,a=t.color,A=t.opacity,s=t.type;return t[e]||void 0===t[e]&&n[e]?[Object.assign(Object.assign({},i),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[e]),o?{clip:o}:{}),a?{color:a}:{}),A?{opacity:A}:{}),mM(i.mark)?i.mark:{type:i.mark}),{style:"".concat(s,"-").concat(e)}),Object(x.B)(t[e])?{}:t[e]),!1===r?{aria:r}:{})})]:[]}function QP(t,e,n){var r=t.encoding,i="vertical"===e?"y":"x",o=r[i],a=r[i+"2"],A=r[i+"Error"],s=r[i+"Error2"];return{continuousAxisChannelDef:FP(o,n),continuousAxisChannelDef2:FP(a,n),continuousAxisChannelDefError:FP(A,n),continuousAxisChannelDefError2:FP(s,n),continuousAxis:i}}function FP(t,e){if(t&&t.aggregate){var n=t.aggregate,r=r_(t,["aggregate"]);return n!==e&&AL(p.errorBarContinuousAxisHasCustomizedAggregate(n,e)),r}return t}function wP(t,e){var n=t.mark,r=t.encoding,i=r.x,o=r.y;if(vZ(i)){if(vZ(o)){var a=pZ(i)&&i.aggregate,A=pZ(o)&&o.aggregate;if(a||A!==e){if(A||a!==e){if(a===e&&A===e)throw new Error("Both x and y cannot have aggregate");return mM(n)&&n.orient?n.orient:"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(vZ(o))return"vertical";throw new Error("Need a valid continuous axis for "+e+"s")}var SP=new RM("boxplot",UP);function RP(t){return Object(x.E)(t)?"tukey":t}function UP(t,e){var n,r,i=e.config,o=t.mark,a=(t.encoding,t.selection),A=(t.projection,r_(t,["mark","encoding","selection","projection"])),s=mM(o)?o:{type:o};a&&AL(p.selectionNotSupported("boxplot"));var c,u=null!==(n=s.extent)&&void 0!==n?n:i.boxplot.extent,l=oP("size",s,i),g=RP(u),f=function(t,e,n){var r=wP(t,"boxplot"),i=QP(t,r,"boxplot"),o=i.continuousAxisChannelDef,a=i.continuousAxis,A=o.field,s=RP(e),c=[].concat(Object(B.a)(xP(A)),[{op:"median",field:A,as:"mid_box_"+A},{op:"min",field:A,as:("min-max"===s?"lower_whisker_":"min_")+A},{op:"max",field:A,as:("min-max"===s?"upper_whisker_":"max_")+A}]),u="min-max"===s||"tukey"===s?[]:[{calculate:'datum["upper_box_'.concat(A,'"] - datum["lower_box_').concat(A,'"]'),as:"iqr_"+A},{calculate:'min(datum["upper_box_'.concat(A,'"] + datum["iqr_').concat(A,'"] * ').concat(e,', datum["max_').concat(A,'"])'),as:"upper_whisker_"+A},{calculate:'max(datum["lower_box_'.concat(A,'"] - datum["iqr_').concat(A,'"] * ').concat(e,', datum["min_').concat(A,'"])'),as:"lower_whisker_"+A}],l=t.encoding,g=a,f=(l[g],function(t){var e,n,r=t.tooltip,i=r_(t,["tooltip"]);if(!r)return{filteredEncoding:t};if(Object(x.A)(r)){var o,a=Object(U.a)(r);try{for(a.s();!(o=a.n()).done;){var A=o.value;A.aggregate?(e||(e=[]),e.push(A)):(n||(n=[]),n.push(A))}}catch(s){a.e(s)}finally{a.f()}e&&(i.tooltip=e)}else r.aggregate?i.tooltip=r:n=r;return Object(x.A)(n)&&1===n.length&&(n=n[0]),{customTooltipWithoutAggregatedField:n,filteredEncoding:i}}(r_(l,["symbol"===typeof g?g:g+""]))),h=f.customTooltipWithoutAggregatedField,d=dP(f.filteredEncoding,n),I=d.bins,p=d.timeUnits,C=d.aggregate,y=d.groupby,v=d.encoding,m="vertical"===r?"horizontal":"vertical",b=r;return{transform:[].concat(Object(B.a)(I),Object(B.a)(p),[{aggregate:[].concat(Object(B.a)(C),Object(B.a)(c)),groupby:y}],u),groupby:y,aggregate:C,continuousAxisChannelDef:o,continuousAxis:a,encodingWithoutContinuousAxis:v,ticksOrient:m,boxOrient:b,customTooltipWithoutAggregatedField:h}}(t,u,i),h=f.transform,d=f.continuousAxisChannelDef,I=f.continuousAxis,C=f.groupby,y=f.aggregate,m=f.encodingWithoutContinuousAxis,b=f.ticksOrient,E=f.boxOrient,Q=f.customTooltipWithoutAggregatedField,F=(m.color,m.size),w=r_(m,["color","size"]),S=function(t){return bP(s,I,d,t,i.boxplot)},R=S(w),k=S(m),O=S(Object.assign(Object.assign({},w),F?{size:F}:{})),N=BP([{fieldPrefix:"min-max"===g?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===g?"lower_whisker_":"min_",titlePrefix:"Min"}],d,m),D={type:"tick",color:"black",opacity:1,orient:b,invalid:null},G="min-max"===g?N:BP([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],d,m),_=[].concat(Object(B.a)(R({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",aria:!1,extraEncoding:G})),Object(B.a)(R({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",aria:!1,extraEncoding:G})),Object(B.a)(R({partName:"ticks",mark:D,positionPrefix:"lower_whisker",aria:!1,extraEncoding:G})),Object(B.a)(R({partName:"ticks",mark:D,positionPrefix:"upper_whisker",aria:!1,extraEncoding:G}))),M=[].concat(Object(B.a)("tukey"!==g?_:[]),Object(B.a)(k({partName:"box",mark:Object.assign(Object.assign({type:"bar"},l?{size:l}:{}),{orient:E,invalid:null}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",aria:!1,extraEncoding:N})),Object(B.a)(O({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(x.F)(i.boxplot.median)&&i.boxplot.median.color?{color:i.boxplot.median.color}:{}),l?{size:l}:{}),{orient:b,ariaRoleDescription:"box"}),positionPrefix:"mid_box",extraEncoding:N})));if("min-max"!==g){var T='datum["lower_box_'.concat(d.field,'"]'),j='datum["upper_box_'.concat(d.field,'"]'),L="(".concat(j," - ").concat(T,")"),V="".concat(T," - ").concat(u," * ").concat(L),Z="".concat(j," + ").concat(u," * ").concat(L),P='datum["'.concat(d.field,'"]'),W={joinaggregate:xP(d.field),groupby:C},J=void 0;"tukey"===g&&(J={transform:[{filter:"(".concat(V," <= ").concat(P,") && (").concat(P," <= ").concat(Z,")")},{aggregate:[{op:"min",field:d.field,as:"lower_whisker_"+d.field},{op:"max",field:d.field,as:"upper_whisker_"+d.field},{op:"min",field:"lower_box_"+d.field,as:"lower_box_"+d.field},{op:"max",field:"upper_box_"+d.field,as:"upper_box_"+d.field}].concat(Object(B.a)(y)),groupby:C}],layer:_});w.tooltip;var H=r_(w,["tooltip"]),Y=d.scale,X=d.axis,z=mP(d),K=EP(s,"outliers",i.boxplot,!0,{transform:[{filter:"(".concat(P," < ").concat(V,") || (").concat(P," > ").concat(Z,")")}],mark:"point",encoding:Object.assign(Object.assign(Object(v.a)({},I,Object.assign(Object.assign(Object.assign({field:d.field,type:d.type},void 0!==z?{title:z}:{}),void 0!==Y?{scale:Y}:{}),void 0!==X?{axis:X}:{})),H),Q?{tooltip:Q}:{})})[0];K&&J?c={transform:[W],layer:[K,J]}:K?(c=K).transform.unshift(W):J&&(c=J).transform.unshift(W)}return c?Object.assign(Object.assign({},A),{layer:[c,{transform:h,layer:M}]}):Object.assign(Object.assign({},A),{transform:(null!==(r=A.transform)&&void 0!==r?r:[]).concat(h),layer:M})}function xP(t){return[{op:"q1",field:t,as:"lower_box_"+t},{op:"q3",field:t,as:"upper_box_"+t}]}var kP=new RM("errorbar",OP);function OP(t,e){var n=e.config,r=DP(t,"errorbar",n),i=r.transform,o=r.continuousAxisChannelDef,a=r.continuousAxis,A=r.encodingWithoutContinuousAxis,s=r.ticksOrient,c=r.markDef,u=r.outerSpec,l=r.tooltipEncoding,g=bP(c,a,o,A,n.errorbar),f={type:"tick",orient:s},h=[].concat(Object(B.a)(g({partName:"ticks",mark:f,positionPrefix:"lower",aria:!1,extraEncoding:l})),Object(B.a)(g({partName:"ticks",mark:f,positionPrefix:"upper",aria:!1,extraEncoding:l})),Object(B.a)(g({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar"},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})));return Object.assign(Object.assign(Object.assign({},u),{transform:i}),h.length>1?{layer:h}:Object.assign({},h[0]))}function NP(t,e){var n=t.encoding;if(function(t){return(mZ(t.x)||mZ(t.y))&&!mZ(t.x2)&&!mZ(t.y2)&&!mZ(t.xError)&&!mZ(t.xError2)&&!mZ(t.yError)&&!mZ(t.yError2)}(n))return{orient:wP(t,e),inputType:"raw"};var r=function(t){return mZ(t.x2)||mZ(t.y2)}(n),i=function(t){return mZ(t.xError)||mZ(t.xError2)||mZ(t.yError)||mZ(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error("".concat(e," cannot be both type aggregated-upper-lower and aggregated-error"));var A=n.x2,s=n.y2;if(mZ(A)&&mZ(s))throw new Error("".concat(e," cannot have both x2 and y2"));if(mZ(A)){if(vZ(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(e))}if(mZ(s)){if(vZ(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in ".concat(e))}throw new Error("No ranged axis")}var c=n.xError,u=n.xError2,l=n.yError,g=n.yError2;if(mZ(u)&&!mZ(c))throw new Error("".concat(e," cannot have xError2 without xError"));if(mZ(g)&&!mZ(l))throw new Error("".concat(e," cannot have yError2 without yError"));if(mZ(c)&&mZ(l))throw new Error("".concat(e," cannot have both xError and yError with both are quantiative"));if(mZ(c)){if(vZ(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(mZ(l)){if(vZ(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}function DP(t,e,n){var r,i=t.mark,o=t.encoding,a=t.selection,A=(t.projection,r_(t,["mark","encoding","selection","projection"])),s=mM(i)?i:{type:i};a&&AL(p.selectionNotSupported(e));var c=NP(t,e),u=c.orient,l=c.inputType,g=QP(t,u,e),f=g.continuousAxisChannelDef,h=g.continuousAxisChannelDef2,d=g.continuousAxisChannelDefError,I=g.continuousAxisChannelDefError2,C=g.continuousAxis,y=function(t,e,n,r,i,o,a,A){var s,c=[],u=[],l=e.field,g=!1;if("raw"===o){var f,h,d,I=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":A.errorbar.center,C=t.extent?t.extent:"mean"===I?"stderr":"iqr";if("median"===I!==("iqr"===C)&&AL(p.errorBarCenterIsUsedWithWrongExtent(I,C,a)),"stderr"===C||"stdev"===C)c=[{op:C,field:l,as:"extent_"+l},{op:I,field:l,as:"center_"+l}],u=[{calculate:'datum["center_'.concat(l,'"] + datum["extent_').concat(l,'"]'),as:"upper_"+l},{calculate:'datum["center_'.concat(l,'"] - datum["extent_').concat(l,'"]'),as:"lower_"+l}],s=[{fieldPrefix:"center_",titlePrefix:__(I)},{fieldPrefix:"upper_",titlePrefix:GP(I,C,"+")},{fieldPrefix:"lower_",titlePrefix:GP(I,C,"-")}],g=!0;else t.center&&t.extent&&AL(p.errorBarCenterIsNotNeeded(t.extent,a)),"ci"===C?(f="mean",h="ci0",d="ci1"):(f="median",h="q1",d="q3"),c=[{op:h,field:l,as:"lower_"+l},{op:d,field:l,as:"upper_"+l},{op:f,field:l,as:"center_"+l}],s=[{fieldPrefix:"upper_",titlePrefix:MZ({field:l,aggregate:d,type:"quantitative"},A,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:MZ({field:l,aggregate:h,type:"quantitative"},A,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:MZ({field:l,aggregate:f,type:"quantitative"},A,{allowDisabling:!1})}]}else{(t.center||t.extent)&&AL(p.errorBarCenterAndExtentAreNotNeeded(t.center,t.extent)),"aggregated-upper-lower"===o?(s=[],u=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_"+l},{calculate:'datum["'.concat(l,'"]'),as:"lower_"+l}]):"aggregated-error"===o&&(s=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:'datum["'.concat(l,'"] + datum["').concat(r.field,'"]'),as:"upper_"+l}],i?u.push({calculate:'datum["'.concat(l,'"] + datum["').concat(i.field,'"]'),as:"lower_"+l}):u.push({calculate:'datum["'.concat(l,'"] - datum["').concat(r.field,'"]'),as:"lower_"+l}));var y,v=Object(U.a)(u);try{for(v.s();!(y=v.n()).done;){var B=y.value;s.push({fieldPrefix:B.as.substring(0,6),titlePrefix:V_(V_(B.calculate,'datum["',""),'"]',"")})}}catch(m){v.e(m)}finally{v.f()}}return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:s,tooltipTitleWithFieldName:g}}(s,f,h,d,I,l,e,n),v=y.errorBarSpecificAggregate,m=y.postAggregateCalculates,b=y.tooltipSummary,E=y.tooltipTitleWithFieldName,Q=o,F=C,w=(Q[F],"x"===C?"x2":"y2"),S=(Q[w],"x"===C?"xError":"yError"),R=(Q[S],"x"===C?"xError2":"yError2"),x=(Q[R],dP(r_(Q,["symbol"===typeof F?F:F+"","symbol"===typeof w?w:w+"","symbol"===typeof S?S:S+"","symbol"===typeof R?R:R+""]),n)),k=x.bins,O=x.timeUnits,N=x.aggregate,D=x.groupby,G=x.encoding,_=[].concat(Object(B.a)(N),Object(B.a)(v)),M="raw"!==l?[]:D,T=BP(b,f,G,E);return{transform:[].concat(Object(B.a)(null!==(r=A.transform)&&void 0!==r?r:[]),Object(B.a)(k),Object(B.a)(O),Object(B.a)(0===_.length?[]:[{aggregate:_,groupby:M}]),Object(B.a)(m)),groupby:M,continuousAxisChannelDef:f,continuousAxis:C,encodingWithoutContinuousAxis:G,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:s,outerSpec:A,tooltipEncoding:T}}function GP(t,e,n){return __(t)+" "+n+" "+e}var _P=new RM("errorband",MP);function MP(t,e){var n=e.config,r=DP(t,"errorband",n),i=r.transform,o=r.continuousAxisChannelDef,a=r.continuousAxis,A=r.encodingWithoutContinuousAxis,s=r.markDef,c=r.outerSpec,u=r.tooltipEncoding,l=s,g=bP(l,a,o,A,n.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y,h={type:f?"area":"rect"},d={type:f?"line":"rule"},I=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(h=Object.assign(Object.assign(Object.assign({},h),I),{ariaRoleDescription:"errorband"}),d=Object.assign(Object.assign({},d),I)):l.interpolate?AL(p.errorBand1DNotSupport("interpolate")):l.tension&&AL(p.errorBand1DNotSupport("tension")),Object.assign(Object.assign({},c),{transform:i,layer:[].concat(Object(B.a)(g({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})),Object(B.a)(g({partName:"borders",mark:d,positionPrefix:"lower",aria:!1,extraEncoding:u})),Object(B.a)(g({partName:"borders",mark:d,positionPrefix:"upper",aria:!1,extraEncoding:u})))})}var TP={};function jP(t,e,n){var r=new RM(t,e);TP[t]={normalizer:r,parts:n}}jP("boxplot",UP,["box","median","outliers","rule","ticks"]),jP("errorbar",OP,["ticks","rule"]),jP("errorband",MP,["band","borders"]);var LP=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],VP=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ZP={fillColor:{part:"legend",vgProp:"fill"},gradientStrokeColor:{part:"gradient",vgProp:"stroke"},labelColor:{part:"labels",vgProp:"fill"},strokeColor:{part:"legend",vgProp:"stroke"},symbolFillColor:{part:"symbols",vgProp:"fill"},symbolStrokeColor:{part:"symbols",vgProp:"stroke"},titleColor:{part:"title",vgProp:"fill"}},PP={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},WP=(U_(PP),{single:{on:"click",fields:["_vgsid_"],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:["_vgsid_"],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}});function JP(t){return!!t&&("legend"===t||!!t.legend)}function HP(t){return JP(t)&&Object(x.F)(t)}function YP(t){return"concat"in t}function XP(t){return"vconcat"in t}function zP(t){return"hconcat"in t}function KP(t){return Object(x.F)(t)&&void 0!==t.step}function qP(t){return t.view||t.width||t.height}var $P=U_({align:1,bounds:1,center:1,columns:1,spacing:1});function tW(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function eW(t,e){var n=nW(t,e);return KP(n)?n.step:rW}function nW(t,e){var n;return W_(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}var rW=20;var iW={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:rW},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:FM,circle:{},geoshape:{},image:{},line:{},point:{},rect:wM,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:WP,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},oW=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],aW={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},AW={blue:oW[0],orange:oW[1],red:oW[2],teal:oW[3],green:oW[4],yellow:oW[5],purple:oW[6],pink:oW[7],brown:oW[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function sW(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{signals:[{name:"color",value:Object(x.F)(t)?Object.assign(Object.assign({},AW),t):AW}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function cW(t){return{signals:[{name:"fontSize",value:Object(x.F)(t)?Object.assign(Object.assign({},aW),t):aW}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function uW(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}function lW(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.color,n=t.font,r=t.fontSize,i=r_(t,["color","font","fontSize"]);return Object(x.N)({},iW,n?uW(n):{},e?sW(e):{},r?cW(r):{},i||{})}var gW=["view"].concat(Object(B.a)(BM)),fW=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],hW=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function dW(t){t=d_(t);var e,n=Object(U.a)(fW);try{for(n.s();!(e=n.n()).done;){delete t[e.value]}}catch(b){n.e(b)}finally{n.f()}if(t.axis)for(var r in t.axis)q_(t.axis[r])&&delete t.axis[r];if(t.legend){var i,o=Object(U.a)(LP);try{for(o.s();!(i=o.n()).done;){var a=i.value;delete t.legend[a]}}catch(b){o.e(b)}finally{o.f()}}if(t.mark){var A,s=Object(U.a)(EM);try{for(s.s();!(A=s.n()).done;){var c=A.value;delete t.mark[c]}}catch(b){s.e(b)}finally{s.f()}t.mark.tooltip&&Object(x.F)(t.mark.tooltip)&&delete t.mark.tooltip}var u,l=Object(U.a)(gW);try{for(l.s();!(u=l.n()).done;){var g,f=u.value,h=Object(U.a)(EM);try{for(h.s();!(g=h.n()).done;){var d=g.value;delete t[f][d]}}catch(b){h.e(b)}finally{h.f()}var I=hW[f];if(I){var p,C=Object(U.a)(I);try{for(C.s();!(p=C.n()).done;){var y=p.value;delete t[f][y]}}catch(b){C.e(b)}finally{C.f()}}IW(t,f)}}catch(b){l.e(b)}finally{l.f()}var v,B=Object(U.a)(U_(TP));try{for(B.s();!(v=B.n()).done;){delete t[v.value]}}catch(b){B.e(b)}finally{B.f()}for(var m in function(t){var e=$Z(t.title),n=e.titleMarkConfig,r=e.subtitleMarkConfig,i=e.subtitle;R_(n)||(t.style["group-title"]=Object.assign(Object.assign({},t.style["group-title"]),n));R_(r)||(t.style["group-subtitle"]=Object.assign(Object.assign({},t.style["group-subtitle"]),r));R_(i)?delete t.title:t.title=i}(t),t)Object(x.F)(t[m])&&R_(t[m])&&delete t[m];return R_(t)?void 0:t}function IW(t,e,n,r){var i=r?t[e][r]:t[e];"view"===e&&(n="cell");var o=Object.assign(Object.assign({},i),t.style[null!==n&&void 0!==n?n:e]);R_(o)||(t.style[null!==n&&void 0!==n?n:e]=o),r||delete t[e]}function pW(t){return"layer"in t}var CW=n(74),yW=n(90),vW=function(){function t(){Object(F.a)(this,t)}return Object(w.a)(t,[{key:"map",value:function(t,e){return cZ(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):zP(t)?this.mapHConcat(t,e):XP(t)?this.mapVConcat(t,e):YP(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}},{key:"mapLayerOrUnit",value:function(t,e){if(pW(t))return this.mapLayer(t,e);if(SM(t))return this.mapUnit(t,e);throw new Error(p.invalidSpec(t))}},{key:"mapLayer",value:function(t,e){var n=this;return Object.assign(Object.assign({},t),{layer:t.layer.map((function(t){return n.mapLayerOrUnit(t,e)}))})}},{key:"mapHConcat",value:function(t,e){var n=this;return Object.assign(Object.assign({},t),{hconcat:t.hconcat.map((function(t){return n.map(t,e)}))})}},{key:"mapVConcat",value:function(t,e){var n=this;return Object.assign(Object.assign({},t),{vconcat:t.vconcat.map((function(t){return n.map(t,e)}))})}},{key:"mapConcat",value:function(t,e){var n=this,r=t.concat,i=r_(t,["concat"]);return Object.assign(Object.assign({},i),{concat:r.map((function(t){return n.map(t,e)}))})}},{key:"mapFacet",value:function(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}},{key:"mapRepeat",value:function(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}}]),t}(),BW={zero:1,center:1,normalize:1};function mW(t){return t in BW}var bW=new Set([oM,AM,aM,gM,uM,IM,pM,cM,fM,hM]),EW=new Set([AM,aM,oM]);function QW(t,e){var n,r,i="x"===e?"y":"radius",o=t[e],a=t[i];if(pZ(o)&&pZ(a))if("quantitative"===CZ(o)&&"quantitative"===CZ(a)){if(o.stack)return e;if(a.stack)return i;var A=pZ(o)&&!!o.aggregate;if(A!==(pZ(a)&&!!a.aggregate))return A?e:i;var s=null===(n=o.scale)||void 0===n?void 0:n.type,c=null===(r=a.scale)||void 0===r?void 0:r.type;if(s&&"linear"!==s)return i;if(c&&"linear"!==c)return e}else{if("quantitative"===CZ(o))return e;if("quantitative"===CZ(a))return i}else{if("quantitative"===CZ(o))return e;if("quantitative"===CZ(a))return i}}function FW(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function wW(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=mM(t)?t.type:t;if(!bW.has(r))return null;var i=QW(e,"x")||QW(e,"theta");if(!i)return null;var o=e[i],a=pZ(o)?UZ(o,{}):void 0,A=FW(i),s=e[A],c=pZ(s)?UZ(s,{}):void 0;c===a&&(c=void 0,s=void 0,A=void 0);var u,l=dT.reduce((function(t,n){if("tooltip"!==n&&fP(e,n)){var r,i=e[n],o=Object(U.a)(Object(x.i)(i));try{for(o.s();!(r=o.n()).done;){var a=VZ(r.value);if(!a.aggregate){var A=UZ(a,{});A&&A===c||t.push({channel:n,fieldDef:a})}}}catch(s){o.e(s)}finally{o.f()}}return t}),[]);if(void 0!==o.stack?u=Object(x.B)(o.stack)?o.stack?"zero":null:o.stack:l.length>0&&EW.has(r)&&(u="zero"),!u||!mW(u))return null;if(hP(e)&&0===l.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==tV){if(n.disallowNonLinearStack)return null;AL(p.cannotStackNonLinearScale(o.scale.type))}return mZ(e[gT(i)])?(void 0!==o.stack&&AL(p.cannotStackRangedMark(i)),null):(pZ(o)&&o.aggregate&&!B_(_M,o.aggregate)&&AL(p.stackNonSummativeAggregate(o.aggregate)),{groupbyChannel:s?A:void 0,groupbyField:c,fieldChannel:i,impute:null!==o.impute&&yM(r),stackBy:l,offset:u})}function SW(t){t.point,t.line;var e=r_(t,["point","line"]);return U_(e).length>1?e:e.type}function RW(t){for(var e=0,n=["line","area","rule","trail"];e<n.length;e++){var r=n[e];t[r]&&(t=Object.assign(Object.assign({},t),Object(v.a)({},r,p_(t[r],["point","line"]))))}return t}function UW(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"transparent"===t.point?{opacity:0}:t.point?Object(x.F)(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?Object(x.F)(e.point)?e.point:{}:void 0}function xW(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}var kW=function(){function t(){Object(F.a)(this,t),this.name="path-overlay"}return Object(w.a)(t,[{key:"hasMatchingType",value:function(t,e){if(SM(t)){var n=t.mark,r=t.encoding,i=mM(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!UW(i,e[i.type],r);case"area":return!!UW(i,e[i.type],r)||!!xW(i,e[i.type])}}return!1}},{key:"run",value:function(t,e,n){var r=e.config,i=t.selection,o=t.projection,a=t.encoding,A=t.mark,s=r_(t,["selection","projection","encoding","mark"]),c=mM(A)?A:{type:A},u=UW(c,r[c.type],a),l="area"===c.type&&xW(c,r[c.type]),g=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:SW(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:p_(a,["shape"])})],f=wW(c,a),h=a;if(f){var d=f.fieldChannel,I=f.offset;h=Object.assign(Object.assign({},a),Object(v.a)({},d,Object.assign(Object.assign({},a[d]),I?{stack:I}:{})))}return l&&g.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},I_(c,["clip","interpolate","tension","tooltip"])),l),encoding:h})),u&&g.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},I_(c,["clip","tooltip"])),u),encoding:h})),n(Object.assign(Object.assign({},s),{layer:g}),Object.assign(Object.assign({},e),{config:RW(r)}))}}]),t}(),OW=function(){function t(){Object(F.a)(this,t),this.name="RangeStep"}return Object(w.a)(t,[{key:"hasMatchingType",value:function(t){var e;if(SM(t)&&t.encoding){var n,r=Object(U.a)(pT);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=t.encoding[i];if(o&&mZ(o)&&(null===(e=null===o||void 0===o?void 0:o.scale)||void 0===e?void 0:e.rangeStep))return!0}}catch(a){r.e(a)}finally{r.f()}}return!1}},{key:"run",value:function(t){var e,n,r={},i=Object.assign({},t.encoding),o=Object(U.a)(pT);try{for(o.s();!(n=o.n()).done;){var a=n.value,A=fT(a),s=i[a];if(s&&mZ(s)&&(null===(e=null===s||void 0===s?void 0:s.scale)||void 0===e?void 0:e.rangeStep)){var c=s.scale,u=r_(s,["scale"]),l=c,g=(l.rangeStep,r_(l,["rangeStep"]));r[A]={step:c.rangeStep},AL(p.RANGE_STEP_DEPRECATED),i=Object.assign(Object.assign({},i),Object(v.a)({},a,Object.assign(Object.assign({},u),R_(g)?{}:{scale:g})))}}}catch(f){o.e(f)}finally{o.f()}return Object.assign(Object.assign(Object.assign({},r),t),{encoding:i})}}]),t}();function NW(t,e){return e?AZ(t)?jW(t,e):_W(t,e):t}function DW(t,e){return e?jW(t,e):t}function GW(t,e,n){var r,i=e[t];return(r=i)&&!Object(x.H)(r)&&"repeat"in r?i.repeat in n?Object.assign(Object.assign({},e),Object(v.a)({},t,n[i.repeat])):void AL(p.noSuchRepeatedValue(i.repeat)):e}function _W(t,e){if(void 0!==(t=GW("field",t,e))){if(null===t)return null;if(lZ(t)&&oZ(t.sort)){var n=GW("field",t.sort,e);t=Object.assign(Object.assign({},t),n?{sort:n}:{})}return t}}function MW(t,e){if(pZ(t))return _W(t,e);var n=GW("datum",t,e);return n===t||n.type||(n.type="nominal"),n}function TW(t,e){if(!mZ(t)){if(IZ(t)){var n=MW(t.condition,e);if(n)return Object.assign(Object.assign({},t),{condition:n});t.condition;return r_(t,["condition"])}return t}var r=MW(t,e);return r||(hZ(t)?{condition:t.condition}:void 0)}function jW(t,e){var n={};for(var r in t)if(Object(x.v)(t,r)){var i=t[r];if(Object(x.A)(i))n[r]=i.map((function(t){return TW(t,e)})).filter((function(t){return t}));else{var o=TW(i,e);void 0!==o&&(n[r]=o)}}return n}var LW=function(){function t(){Object(F.a)(this,t),this.name="RuleForRangedLine"}return Object(w.a)(t,[{key:"hasMatchingType",value:function(t){if(SM(t)){var e=t.encoding;if("line"===t.mark){var n,r=Object(U.a)(sT);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e[uT(i)];if(e[i]&&(pZ(o)&&!OT(o.bin)||yZ(o)))return!0}}catch(a){r.e(a)}finally{r.f()}}}return!1}},{key:"run",value:function(t,e,n){var r=t.encoding;return AL(p.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign(Object.assign({},t),{mark:"rule"}),e)}}]),t}();function VW(t){var e=t.parentEncoding,n=t.encoding;if(e&&n){var r=U_(e).reduce((function(t,e){return n[e]&&t.push(e),t}),[]);r.length>0&&AL(p.encodingOverridden(r))}var i=Object.assign(Object.assign({},null!==e&&void 0!==e?e:{}),null!==n&&void 0!==n?n:{});return R_(i)?void 0:i}function ZW(t){var e=t.parentProjection,n=t.projection;return e&&n&&AL(p.projectionOverridden({parentProjection:e,projection:n})),null!==n&&void 0!==n?n:e}function PW(t,e){void 0===e&&(e=lW(t.config));var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return WW.map(t,{config:e})}(t,e),r=function(t,e,n){var r=e.width,i=e.height,o=SM(t)||pW(t),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(AL(p.containerSizeNonSingle("width")),r=void 0),"container"==i&&(AL(p.containerSizeNonSingle("height")),i=void 0));var A=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?JW(n.autosize):{}),JW(t.autosize));"fit"!==A.type||o||(AL(p.FIT_NON_SINGLE),A.type="pad");"container"==r&&"fit"!=A.type&&"fit-x"!=A.type&&AL(p.containerSizeNotCompatibleWithAutosize("width"));"container"==i&&"fit"!=A.type&&"fit-y"!=A.type&&AL(p.containerSizeNotCompatibleWithAutosize("height"));if(h_(A,{type:"pad"}))return;return A}(n,{width:t.width,height:t.height,autosize:t.autosize},e);return Object.assign(Object.assign({},n),r?{autosize:r}:{})}var WW=new(function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t;return Object(F.a)(this,n),(t=e.apply(this,arguments)).nonFacetUnitNormalizers=[SP,kP,_P,new kW,new LW,new OW],t}return Object(w.a)(n,[{key:"map",value:function(t,e){if(SM(t)){var r=fP(t.encoding,TM),i=fP(t.encoding,jM),o=fP(t.encoding,"facet");if(r||i||o)return this.mapFacetedUnit(t,e)}return Object(yW.a)(Object(CW.a)(n.prototype),"map",this).call(this,t,e)}},{key:"mapUnit",value:function(t,e){var n=e.parentEncoding,r=e.parentProjection,i=Object.assign(Object.assign({},t),{encoding:DW(t.encoding,e.repeater)});if(n||r)return this.mapUnitWithParentEncodingOrProjection(i,e);var o,a=this.mapLayerOrUnit.bind(this),A=Object(U.a)(this.nonFacetUnitNormalizers);try{for(A.s();!(o=A.n()).done;){var s=o.value;if(s.hasMatchingType(i,e.config))return s.run(i,e,a)}}catch(c){A.e(c)}finally{A.f()}return i}},{key:"mapRepeat",value:function(t,e){return function(t){return!Object(x.A)(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}},{key:"mapLayerRepeat",value:function(t,e){var n=this,r=t.repeat,i=t.spec,o=r_(t,["repeat","spec"]),a=r.row,A=r.column,s=r.layer,c=e.repeater,u=void 0===c?{}:c,l=e.repeaterPrefix,g=void 0===l?"":l;return a||A?this.mapRepeat(Object.assign(Object.assign({},t),{repeat:Object.assign(Object.assign({},a?{row:a}:{}),A?{column:A}:{}),spec:{repeat:{layer:s},spec:i}}),e):Object.assign(Object.assign({},o),{layer:s.map((function(t){var r=Object.assign(Object.assign({},u),{layer:t}),o=(i.name||"")+g+"child__layer_".concat(N_(t)),a=n.mapLayerOrUnit(i,Object.assign(Object.assign({},e),{repeater:r,repeaterPrefix:o}));return a.name=o,a}))})}},{key:"mapNonLayerRepeat",value:function(t,e){var n,r=t,i=r.repeat,o=r.spec,a=r.data,A=r_(t,["repeat","spec","data"]);!Object(x.A)(i)&&t.columns&&(t=p_(t,["columns"]),AL(p.columnsNotSupportByRowCol("repeat")));var s,c=[],u=e.repeater,l=void 0===u?{}:u,g=e.repeaterPrefix,f=void 0===g?"":g,h=!Object(x.A)(i)&&i.row||[l?l.row:null],d=!Object(x.A)(i)&&i.column||[l?l.column:null],I=Object(x.A)(i)&&i||[l?l.repeat:null],C=Object(U.a)(I);try{for(C.s();!(s=C.n()).done;){var y,v=s.value,B=Object(U.a)(h);try{for(B.s();!(y=B.n()).done;){var m,b=y.value,E=Object(U.a)(d);try{for(E.s();!(m=E.n()).done;){var Q=m.value,F={repeat:v,row:b,column:Q,layer:l.layer},w=(o.name||"")+f+"child__"+(Object(x.A)(i)?"".concat(N_(v)):(i.row?"row_".concat(N_(b)):"")+(i.column?"column_".concat(N_(Q)):"")),S=this.map(o,Object.assign(Object.assign({},e),{repeater:F,repeaterPrefix:w}));S.name=w,c.push(p_(S,["data"]))}}catch(k){E.e(k)}finally{E.f()}}}catch(k){B.e(k)}finally{B.f()}}}catch(k){C.e(k)}finally{C.f()}var R=Object(x.A)(i)?t.columns:i.column?i.column.length:1;return Object.assign(Object.assign({data:null!==(n=o.data)&&void 0!==n?n:a,align:"all"},A),{columns:R,concat:c})}},{key:"mapFacet",value:function(t,e){return AZ(t.facet)&&t.columns&&(t=p_(t,["columns"]),AL(p.columnsNotSupportByRowCol("facet"))),Object(yW.a)(Object(CW.a)(n.prototype),"mapFacet",this).call(this,t,e)}},{key:"mapUnitWithParentEncodingOrProjection",value:function(t,e){var n=t.encoding,r=t.projection,i=e.parentEncoding,o=e.parentProjection,a=e.config,A=ZW({parentProjection:o,projection:r}),s=VW({parentEncoding:i,encoding:DW(n,e.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},t),A?{projection:A}:{}),s?{encoding:s}:{}),{config:a})}},{key:"mapFacetedUnit",value:function(t,e){var n=t.encoding,r=n.row,i=n.column,o=n.facet,a=r_(n,["row","column","facet"]),A=t.mark,s=t.width,c=t.projection,u=t.height,l=t.view,g=t.selection,f=(t.encoding,r_(t,["mark","width","projection","height","view","selection","encoding"])),h=this.getFacetMappingAndLayout({row:r,column:i,facet:o},e),d=h.facetMapping,I=h.layout,p=DW(a,e.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},f),I),{facet:d,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s?{width:s}:{}),u?{height:u}:{}),l?{view:l}:{}),c?{projection:c}:{}),{mark:A,encoding:p}),g?{selection:g}:{})}),e)}},{key:"getFacetMappingAndLayout",value:function(t,e){var n,r=t.row,i=t.column,o=t.facet;if(r||i){o&&AL(p.facetChannelDropped([].concat(Object(B.a)(r?[TM]:[]),Object(B.a)(i?[jM]:[]))));for(var a={},A={},s=0,c=[TM,jM];s<c.length;s++){var u=c[s],l=t[u];if(l){l.align,l.center,l.spacing,l.columns;var g=r_(l,["align","center","spacing","columns"]);a[u]=g;for(var f=0,h=["align","center","spacing"];f<h.length;f++){var d=h[f];void 0!==l[d]&&(A[d]=null!==(n=A[d])&&void 0!==n?n:{},A[d][u]=l[d])}}}return{facetMapping:a,layout:A}}var I=o.align,C=o.center,y=o.spacing,v=o.columns;return{facetMapping:NW(r_(o,["align","center","spacing","columns"]),e.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},I?{align:I}:{}),C?{center:C}:{}),y?{spacing:y}:{}),v?{columns:v}:{})}}},{key:"mapLayer",value:function(t,e){var r=e.parentEncoding,i=e.parentProjection,o=r_(e,["parentEncoding","parentProjection"]),a=t.encoding,A=t.projection,s=r_(t,["encoding","projection"]),c=Object.assign(Object.assign({},o),{parentEncoding:VW({parentEncoding:r,encoding:a}),parentProjection:ZW({parentProjection:i,projection:A})});return Object(yW.a)(Object(CW.a)(n.prototype),"mapLayer",this).call(this,s,c)}}]),n}(vW));function JW(t){return Object(x.H)(t)?{type:t}:null!==t&&void 0!==t?t:{}}var HW=["background","padding"];function YW(t){return HW.reduce((function(e,n){return t&&void 0!==t[n]&&(e[n]=t[n]),e}),{})}var XW=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(F.a)(this,t),this.explicit=e,this.implicit=n}return Object(w.a)(t,[{key:"clone",value:function(){return new t(d_(this.explicit),d_(this.implicit))}},{key:"combine",value:function(){return Object.assign(Object.assign({},this.explicit),this.implicit)}},{key:"get",value:function(t){return W_(this.explicit[t],this.implicit[t])}},{key:"getWithExplicit",value:function(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}},{key:"setWithExplicit",value:function(t,e){void 0!==e.value&&this.set(t,e.value,e.explicit)}},{key:"set",value:function(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}},{key:"copyKeyFromSplit",value:function(t,e){void 0!==e.explicit[t]?this.set(t,e.explicit[t],!0):void 0!==e.implicit[t]&&this.set(t,e.implicit[t],!1)}},{key:"copyKeyFromObject",value:function(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}},{key:"copyAll",value:function(t){var e,n=Object(U.a)(U_(t.combine()));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=t.getWithExplicit(r);this.setWithExplicit(r,i)}}catch(o){n.e(o)}finally{n.f()}}}]),t}();function zW(t){return{explicit:!0,value:t}}function KW(t){return{explicit:!1,value:t}}function qW(t){return function(e,n,r,i){var o=t(e.value,n.value);return o>0?e:o<0?n:$W(e,n,r,i)}}function $W(t,e,n,r){return t.explicit&&e.explicit&&AL(p.mergeConflictingProperty(n,r,t.value,e.value)),t}function tJ(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:$W;return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:h_(t.value,e.value)?t:i(t,e,n,r)}var eJ=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(F.a)(this,n),(t=e.call(this,r,i)).explicit=r,t.implicit=i,t.parseNothing=o,t}return Object(w.a)(n,[{key:"clone",value:function(){var t=Object(yW.a)(Object(CW.a)(n.prototype),"clone",this).call(this);return t.parseNothing=this.parseNothing,t}}]),n}(XW);function nJ(t){return"url"in t}function rJ(t){return"values"in t}function iJ(t){return"name"in t&&!nJ(t)&&!rJ(t)&&!oJ(t)}function oJ(t){return t&&(aJ(t)||AJ(t)||sJ(t))}function aJ(t){return"sequence"in t}function AJ(t){return"sphere"in t}function sJ(t){return"graticule"in t}var cJ="main";function uJ(t){return"filter"in t}function lJ(t){return"lookup"in t}function gJ(t){return"pivot"in t}function fJ(t){return"density"in t}function hJ(t){return"quantile"in t}function dJ(t){return"regression"in t}function IJ(t){return"loess"in t}function pJ(t){return"sample"in t}function CJ(t){return"window"in t}function yJ(t){return"joinaggregate"in t}function vJ(t){return"flatten"in t}function BJ(t){return"calculate"in t}function mJ(t){return"bin"in t}function bJ(t){return"impute"in t}function EJ(t){return"timeUnit"in t}function QJ(t){return"aggregate"in t}function FJ(t){return"stack"in t}function wJ(t){return"fold"in t}function SJ(t,e,n,r){var i=hZ(e)&&e.condition,o=r(e);if(i){var a=Object(x.i)(i).map((function(e){var n=r(e),i=function(t){return t.selection}(e)?TH(t,e.selection):LH(t,e.test);return Object.assign({test:i},n)}));return Object(v.a)({},n,[].concat(Object(B.a)(a),Object(B.a)(void 0!==o?[o]:[])))}return void 0!==o?Object(v.a)({},n,o):{}}function RJ(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=t.encoding[e];return SJ(t,n,e,(function(e){return UJ(e,t.config)}))}function UJ(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(t){if(EZ(t))return eP(t.value);if(mZ(t)){var r=LZ(t),i=r.format,o=r.formatType;return HV({fieldOrDatumDef:t,format:i,formatType:o,expr:n,config:e})}}}function xJ(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.encoding,r=t.markDef,i=t.config,o=t.stack,a=n.tooltip;if(Object(x.A)(a))return{tooltip:OJ({tooltip:a},o,i,e)};var A=e.reactiveGeom?"datum.datum":"datum";return SJ(t,a,"tooltip",(function(t){var a=UJ(t,i,A);if(a)return a;if(null!==t){var s=oP("tooltip",r,i);return!0===s&&(s={content:"encoding"}),Object(x.H)(s)?{value:s}:Object(x.F)(s)?"encoding"===s.content?OJ(n,o,i,e):{signal:A}:void 0}}))}function kJ(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.reactiveGeom,o={},a=i?"datum.datum":"datum",A=[];function s(r,i){var s,c=uT(i),u=bZ(r)?r:Object.assign(Object.assign({},r),{type:t[c].type}),l=Object(x.i)(MZ(u,n,{allowDisabling:!1})).join(", ");if(CT(i)){var g="x"===i?"x2":"y2",f=VZ(t[g]);if(OT(u.bin)&&f){var h=UZ(u,{expr:a}),d=UZ(f,{expr:a}),I=LZ(u);s=eZ(h,d,I.format,I.formatType,n),o[g]=!0}else if(e&&e.fieldChannel===i&&"normalize"===e.offset){var p=LZ(u);s=HV({fieldOrDatumDef:u,format:p.format,formatType:p.formatType,expr:a,config:n,normalizeStack:!0}).signal}}s=null!==s&&void 0!==s?s:UJ(u,n,a).signal,A.push({channel:i,key:l,value:s})}CP(t,(function(t,e){pZ(t)?s(t,e):dZ(t)&&s(t.condition,e)}));for(var c={},u=0,l=A;u<l.length;u++){var g=l[u],f=g.channel,h=g.key,d=g.value;o[f]||c[h]||(c[Object(x.Z)(h)]=d)}return c}function OJ(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.reactiveGeom,o=kJ(t,e,n,{reactiveGeom:i}),a=k_(o).map((function(t){var e=t.key,n=t.value;return"".concat(e,": ").concat(n)}));return a.length>0?{signal:"{".concat(a.join(", "),"}")}:void 0}function NJ(t){var e=oP("aria",t.markDef,t.config);return!1===e?{}:Object.assign(Object.assign(Object.assign({},e?{aria:e}:{}),function(t){var e=t.mark,n=t.markDef,r=t.config;if(!1===r.aria)return{};var i=oP("ariaRoleDescription",n,r);if(null!=i)return{ariaRoleDescription:{value:i}};return e in xL?{}:{ariaRoleDescription:{value:e}}}(t)),function(t){var e=t.encoding,n=t.markDef,r=t.config,i=t.stack,o=e.description;if(o)return SJ(t,o,"description",(function(e){return UJ(e,t.config)}));var a=oP("description",n,r);if(null!=a)return{description:eP(a)};if(!1===r.aria)return{};var A=kJ(e,i,r);if(R_(A))return;return{description:{signal:k_(A).map((function(t){var e=t.key,n=t.value;return"".concat(e,' + ": " + (').concat(n,")")})).join(' + "; " + ')}}}(t))}function DJ(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.markDef,i=e.encoding,o=e.config,a=n.vgChannel,A=n.defaultRef,s=n.defaultValue;void 0===A&&void 0!==(s=null!==s&&void 0!==s?s:oP(t,r,o,{vgChannel:a,ignoreVgConfig:!0}))&&(A=eP(s));var c=i[t];return SJ(e,c,null!==a&&void 0!==a?a:t,(function(n){return ZV({channel:t,channelDef:n,markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:A})}))}function GJ(t){var e,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0},a=t.markDef,A=t.encoding,s=t.config,c=a.type,u=null!==(e=o.filled)&&void 0!==e?e:oP("filled",a,s),l=B_(["bar","point","circle","square","geoshape"],c)?"transparent":void 0,g=null!==(r=null!==(n=oP(!0===u?"color":void 0,a,s,{vgChannel:"fill"}))&&void 0!==n?n:s.mark[!0===u&&"color"])&&void 0!==r?r:l,f=null!==(i=oP(!1===u?"color":void 0,a,s,{vgChannel:"stroke"}))&&void 0!==i?i:s.mark[!1===u&&"color"],h=u?"fill":"stroke",d=Object.assign(Object.assign({},g?{fill:eP(g)}:{}),f?{stroke:eP(f)}:{});return a.color&&(u?a.fill:a.stroke)&&AL(p.droppingColor("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},d),DJ("color",t,{vgChannel:h,defaultValue:u?g:f})),DJ("fill",t,{defaultValue:A.fill?g:void 0})),DJ("stroke",t,{defaultValue:A.stroke?f:void 0}))}function _J(t,e){var n=e[function(t){switch(t){case"x":return"xOffset";case"y":return"yOffset";case"x2":return"x2Offset";case"y2":return"y2Offset";case VM:return"thetaOffset";case LM:return"radiusOffset";case ZM:return"theta2Offset";case"radius2":return"radius2Offset"}}(t)];if(n)return n}function MJ(t,e,n){var r=n.defaultPos,i=n.vgChannel,o=n.isMidPoint,a=e.encoding,A=e.markDef,s=e.config,c=e.stack,u=a[t],l=a[gT(t)],g=e.scaleName(t),f=e.getScaleComponent(t),h=_J(t,A),d=TJ({model:e,defaultPos:r,channel:t,scaleName:g,scale:f}),I=!u&&CT(t)&&(a.latitude||a.longitude)?{field:e.getName(t)}:function(t){var e=t.channel,n=t.channelDef,r=t.isMidPoint,i=t.scaleName,o=t.stack,a=t.offset,A=t.markDef,s=t.config;if(mZ(n)&&o&&e===o.fieldChannel){if(pZ(n)){var c=gZ({channel:e,fieldDef:n,isMidPoint:r,markDef:A,stack:o,config:s});if(void 0!==c)return VV({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:c,offset:a})}return LV(n,i,{suffix:"end"},{offset:a})}return _V(t)}({channel:t,channelDef:u,channel2Def:l,markDef:A,config:s,isMidPoint:o,scaleName:g,scale:f,stack:c,offset:h,defaultRef:d});return I?Object(v.a)({},i||t,I):void 0}function TJ(t){var e=t.model,n=t.defaultPos,r=t.channel,i=t.scaleName,o=t.scale,a=e.markDef,A=e.config;return function(){var t=uT(r),s=lT(r),c=oP(r,a,A,{vgChannel:s});if(void 0!==c)return PV(r,c);switch(n){case"zeroOrMin":case"zeroOrMax":if(i){var u=o.get("type");if(B_([eV,oV,aV],u));else if(o.domainDefinitelyIncludesZero())return{scale:i,value:0}}if("zeroOrMin"===n)return"y"===t?{field:{group:"height"}}:{value:0};switch(t){case"radius":return{signal:"min(".concat(e.width.signal,",").concat(e.height.signal,")/2")};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":var l=e[fT(r)];return Object.assign(Object.assign({},l),{mult:.5})}}}var jJ={left:"x",center:"xc",right:"x2"},LJ={top:"y",middle:"yc",bottom:"y2"};function VJ(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===t||"theta"===t)return lT(t);var i="x"===t?"align":"baseline",o=oP(i,e,n);return"x"===t?jJ[o||("top"===r?"left":"center")]:LJ[o||r]}function ZJ(t,e,n){var r=n.defaultPos,i=n.defaultPos2;return n.range?PJ(t,e,{defaultPos:r,defaultPos2:i}):MJ(t,e,{defaultPos:r})}function PJ(t,e,n){var r=n.defaultPos,i=n.defaultPos2,o=e.markDef,a=e.config,A=gT(t),s=fT(t),c=function(t,e,n){var r,i=t.encoding,o=t.mark,a=t.markDef,A=t.stack,s=t.config,c=uT(n),u=fT(n),l=lT(n),g=i[c],f=t.scaleName(c),h=t.getScaleComponent(c),d=_J(n in i||n in a?n:c,t.markDef);if(!g&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude))return Object(v.a)({},l,{field:t.getName(n)});var I=function(t){var e=t.channel,n=t.channelDef,r=t.channel2Def,i=t.markDef,o=t.config,a=t.scaleName,A=t.scale,s=t.stack,c=t.offset,u=t.defaultRef;if(mZ(n)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return LV(n,a,{suffix:"start"},{offset:c});return _V({channel:e,channelDef:r,scaleName:a,scale:A,stack:s,markDef:i,config:o,offset:c,defaultRef:u})}({channel:n,channelDef:g,channel2Def:i[n],markDef:a,config:s,scaleName:f,scale:h,stack:A,offset:d,defaultRef:void 0});if(void 0!==I)return Object(v.a)({},l,I);return WJ(n,a)||WJ(n,(r={},Object(v.a)(r,n,AP(n,a,s.style)),Object(v.a)(r,u,AP(u,a,s.style)),r))||WJ(n,s[o])||WJ(n,s.mark)||Object(v.a)({},l,TJ({model:t,defaultPos:e,channel:n,scaleName:f,scale:h})())}(e,i,A),u=c[s]?VJ(t,o,a):lT(t);return Object.assign(Object.assign({},MJ(t,e,{defaultPos:r,vgChannel:u})),c)}function WJ(t,e){var n=fT(t),r=lT(t);return void 0!==e[r]?Object(v.a)({},r,PV(t,e[r])):void 0!==e[t]?Object(v.a)({},r,PV(t,e[t])):e[n]?Object(v.a)({},n,PV(t,e[n])):void 0}function JJ(t,e,n){var r,i,o,a,A=t.config,s=t.encoding,c=t.markDef,u=t.stack,l=gT(e),g=fT(e),f=s[e],h=s[l],d=t.getScaleComponent(e),I=d?d.get("type"):void 0,C=t.scaleName(e),y=c.orient,B=null!==(i=null!==(r=s[g])&&void 0!==r?r:s.size)&&void 0!==i?i:oP("size",c,A,{vgChannel:g}),m="bar"===n&&("x"===e?"vertical"===y:"horizontal"===y);if(pZ(f)&&(kT(f.bin)||OT(f.bin)||f.timeUnit&&!h)&&!B&&!EV(I)){var b=gZ({channel:e,fieldDef:f,stack:u,markDef:c,config:A}),E=null===(o=t.component.axes[e])||void 0===o?void 0:o[0];return function(t){var e,n=t.fieldDef,r=t.fieldDef2,i=t.channel,o=t.band,a=t.scaleName,A=t.markDef,s=t.spacing,c=void 0===s?0:s,u=t.axisTranslate,l=t.reverse,g=t.config,f=gT(i),h=lT(i),d=lT(f),I=_J(i,A);if(kT(n.bin)||n.timeUnit)return e={},Object(v.a)(e,d,YJ({channel:i,fieldDef:n,scaleName:a,markDef:A,band:(1-o)/2,offset:HJ(f,c,l,u,I),config:g})),Object(v.a)(e,h,YJ({channel:i,fieldDef:n,scaleName:a,markDef:A,band:1-(1-o)/2,offset:HJ(i,c,l,u,I),config:g})),e;if(OT(n.bin)){var C,y,B=LV(n,a,{},{offset:HJ(f,c,l,u,I)});if(pZ(r))return C={},Object(v.a)(C,d,B),Object(v.a)(C,h,LV(r,a,{},{offset:HJ(i,c,l,u,I)})),C;if(NT(n.bin)&&n.bin.step)return y={},Object(v.a)(y,d,B),Object(v.a)(y,h,{signal:'scale("'.concat(a,'", ').concat(UZ(n,{expr:"datum"})," + ").concat(n.bin.step,")"),offset:HJ(i,c,l,u,I)}),y}return void AL(p.channelRequiredForBinned(f))}({fieldDef:f,fieldDef2:h,channel:e,markDef:c,scaleName:C,band:b,axisTranslate:null!==(a=null===E||void 0===E?void 0:E.get("translate"))&&void 0!==a?a:.5,spacing:CT(e)?oP("binSpacing",c,A):void 0,reverse:d.get("reverse"),config:A})}return(mZ(f)&&EV(I)||m)&&!h?function(t,e,n,r){var i,o,a=r.markDef,A=r.encoding,s=r.config,c=r.stack,u=a.orient,l=r.scaleName(n),g=r.getScaleComponent(n),f=fT(n),h=gT(n),d="horizontal"===u&&"y"===n||"vertical"===u&&"x"===n,I=oP(d?"size":f,a,s,{vgChannel:f});(A.size||void 0!==I)&&(d?o=DJ("size",r,{vgChannel:f,defaultValue:I}):AL(p.cannotApplySizeToNonOrientedMark(a.type)));var C=null!==(i=mZ(e)?gZ({channel:n,fieldDef:e,markDef:a,stack:c,config:s}):void 0)&&void 0!==i?i:1;o=o||Object(v.a)({},f,function(t,e,n,r,i,o){if(r){var a=r.get("type");if("point"===a||"band"===a){if(void 0!==i[t].discreteBandSize)return{value:i[t].discreteBandSize};if(a===uV){var A=r.get("range");return SL(A)&&Object(x.E)(A.step)?{value:A.step-2}:{value:rW-2}}return{scale:n,band:o}}return{value:i[t].continuousBandSize}}var s=eW(i.view,e),c=W_(i[t].discreteBandSize,s-2);return void 0!==c?{value:c}:void 0}(t,f,l,g,s,C));var y="band"!==(null===g||void 0===g?void 0:g.get("type"))||!("band"in o[f]),B=VJ(n,a,s,y?"middle":"top"),m=_J(n,a),b=_V({channel:n,channelDef:e,markDef:a,config:s,scaleName:l,scale:g,stack:c,offset:m,defaultRef:TJ({model:r,defaultPos:"mid",channel:n,scaleName:l,scale:g}),band:y?.5:(1-C)/2});if(f)return Object.assign(Object(v.a)({},B,b),o);var E,Q=lT(h),F=o[f],w=m?Object.assign(Object.assign({},F),{offset:m}):F;return E={},Object(v.a)(E,B,b),Object(v.a)(E,Q,Object(x.A)(b)?[b[0],Object.assign(Object.assign({},b[1]),{offset:w})]:Object.assign(Object.assign({},b),{offset:w})),E}(n,f,e,t):PJ(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function HJ(t,e,n,r,i){if(zM(t))return 0;var o="x"===t||"y2"===t?-e/2:e/2;if(wL(n)){var a=rP(i);return{signal:"".concat(n.signal," ? ").concat(r-o).concat(a?"-"+a:""," : ").concat(r+o).concat(a?"+"+a:"")}}if(wL(i)){var A=r+(n?-o:o);return{signal:"".concat(A||"").concat(n?" - ":A?" + ":"").concat(i.signal)}}return i=i||0,r+(n?-i-o:+i+o)}function YJ(t){var e=t.channel,n=t.fieldDef,r=t.scaleName,i=t.markDef,o=t.band,a=t.offset,A=t.config;return MV({fieldDef:n,channel:e,markDef:i,ref:VV({scaleName:r,fieldOrDatumDef:n,band:o,offset:a}),config:A})}var XJ=new Set(["aria"]);function zJ(t,e){var n="include"===e.color?GJ(t):{},r=n.fill,i=void 0===r?void 0:r,o=n.stroke,a=void 0===o?void 0:o;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(t,e){return UL.reduce((function(n,r){return XJ.has(r)||void 0===t[r]||"ignore"===e[r]||(n[r]=eP(t[r])),n}),{})}(t.markDef,e)),KJ(t,"fill",i)),KJ(t,"stroke",a)),DJ("opacity",t)),DJ("fillOpacity",t)),DJ("strokeOpacity",t)),DJ("strokeWidth",t)),DJ("strokeDash",t)),xJ(t)),RJ(t,"href")),NJ(t))}function KJ(t,e,n){var r=t.config,i=t.mark;if("hide"===oP("invalid",t.markDef,r)&&n&&!yM(i)){var o=function(t,e){var n=e.invalid,r=void 0!==n&&n,i=e.channels.reduce((function(e,n){var r=t.getScaleComponent(n);if(r){var i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&QV(i)&&(e[o]=!0)}return e}),{}),o=U_(i);if(o.length>0){var a=r?"||":"&&";return o.map((function(t){return jV(t,r)})).join(" ".concat(a," "))}return}(t,{invalid:!0,channels:QT});if(o)return Object(v.a)({},e,[{test:o,value:null}].concat(Object(B.a)(Object(x.i)(n))))}return n?Object(v.a)({},e,n):{}}function qJ(t){var e=t.config;if(oP("invalid",t.markDef,e)){var n=function(t,e){var n=e.invalid,r=void 0!==n&&n,i=e.channels.reduce((function(e,n){var r=t.getScaleComponent(n);if(r){var i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&QV(i)&&(e[o]=!0)}return e}),{}),o=U_(i);if(o.length>0){var a=r?"||":"&&";return o.map((function(t){return jV(t,r)})).join(" ".concat(a," "))}return}(t,{channels:pT});if(n)return{defined:{signal:n}}}return{}}function $J(t,e){if(void 0!==e)return Object(v.a)({},t,eP(e))}var tH={has:function(t){return"interval"!==t.type&&t.nearest},parse:function(t,e){if(e.events){var n,r=Object(U.a)(e.events);try{for(r.s();!(n=r.n()).done;){n.value.markname=t.getName("voronoi")}}catch(i){r.e(i)}finally{r.f()}}},marks:function(t,e,n){var r=e.project.hasChannel,i=r.x,o=r.y,a=t.mark;if(yM(a))return AL(p.nearestNotSupportForContinuous(a)),n;var A={name:t.getName("voronoi"),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},xJ(t,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:i||!o?"datum.datum.x || 0":"0"},y:{expr:o||!i?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]},s=0,c=!1;return n.forEach((function(e,n){var r,i=null!==(r=e.name)&&void 0!==r?r:"";i===t.component.mark[0].name?s=n:i.indexOf("voronoi")>=0&&(c=!0)})),c||n.splice(s+1,0,A),n}},eH=function(){function t(e,n){Object(F.a)(this,t),this.debugName=n,this._children=[],this._parent=null,e&&(this.parent=e)}return Object(w.a)(t,[{key:"clone",value:function(){throw new Error("Cannot clone node")}},{key:"numChildren",value:function(){return this._children.length}},{key:"addChild",value:function(t,e){this._children.indexOf(t)>-1?console.warn("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return this._children.splice(e,1),e}},{key:"remove",value:function(){var t,e=this._parent.removeChild(this),n=Object(U.a)(this._children);try{for(n.s();!(t=n.n()).done;){var r=t.value;r._parent=this._parent,this._parent.addChild(r,e++)}}catch(i){n.e(i)}finally{n.f()}}},{key:"insertAsParentOf",value:function(t){var e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}},{key:"swapWithParent",value:function(){var t,e=this._parent,n=e.parent,r=Object(U.a)(this._children);try{for(r.s();!(t=r.n()).done;){t.value.parent=e}}catch(i){r.e(i)}finally{r.f()}this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=n,e.parent=this}},{key:"parent",get:function(){return this._parent},set:function(t){this._parent=t,t&&t.addChild(this)}},{key:"children",get:function(){return this._children}}]),t}(),nH=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;return Object(F.a)(this,n),(a=e.call(this,t,r)).type=i,a.refCounts=o,a._source=a._name=r,a.refCounts&&!(a._name in a.refCounts)&&(a.refCounts[a._name]=0),a}return Object(w.a)(n,[{key:"clone",value:function(){var t=new this.constructor;return t.debugName="clone_"+this.debugName,t._source=this._source,t._name="clone_"+this._name,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}},{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){return new Set}},{key:"hash",value:function(){return void 0===this._hash&&(this._hash="Output ".concat(H_())),this._hash}},{key:"getSource",value:function(){return this.refCounts[this._name]++,this._source}},{key:"isRequired",value:function(){return!!this.refCounts[this._name]}},{key:"setSource",value:function(t){this._source=t}}]),n}(eH),rH=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).formula=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.formula))}},{key:"merge",value:function(t){for(var e in this.formula=Object.assign({},this.formula),t.formula)this.formula[e]&&!t.formula[e].band||(this.formula[e]=t.formula[e]);var n,r=Object(U.a)(t.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.removeChild(i),i.parent=this}}catch(o){r.e(o)}finally{r.f()}t.remove()}},{key:"producedFields",value:function(){return new Set(x_(this.formula).map((function(t){return t.as})))}},{key:"dependentFields",value:function(){return new Set(x_(this.formula).map((function(t){return t.field})))}},{key:"hash",value:function(){return"TimeUnit ".concat(y_(this.formula))}},{key:"assemble",value:function(){var t,e=[],n=Object(U.a)(x_(this.formula));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.field,o=r.as,a=QL(r.timeUnit),A=a.unit,s=a.utc,c=r_(a,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:L_(i),type:"timeunit"},A?{units:BL(A)}:{}),s?{timezone:"utc"}:{}),c),{as:[o,"".concat(o,"_end")]}))}}catch(u){n.e(u)}finally{n.f()}return e}}],[{key:"makeFromEncoding",value:function(t,e){var r=e.reduceFieldDef((function(t,n,r){var i=n.field,o=n.timeUnit,a=Iz(e)?e.encoding[gT(r)]:void 0,A=Iz(e)&&fZ(r,n,a,e.stack,e.markDef,e.config);if(o){var s=UZ(n,{forAs:!0});t[y_({as:s,field:i,timeUnit:o})]=Object.assign({as:s,field:i,timeUnit:o},A?{band:!0}:{})}return t}),{});return R_(r)?null:new n(t,r)}},{key:"makeFromTransform",value:function(t,e){var r=Object.assign({},e),i=r.timeUnit,o=r_(r,["timeUnit"]),a=QL(i),A=Object.assign(Object.assign({},o),{timeUnit:a});return new n(t,Object(v.a)({},y_(A),A))}}]),n}(eH),iH=function t(){Object(F.a)(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.items=n,this.hasChannel={},this.hasField={}},oH={has:function(t){return"single"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!JP(t.bind)},parse:function(t,e,n,r){r.on||delete e.events,r.clear||delete e.clear},topLevelSignals:function(t,e,n){var r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],A=tH.has(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((function(t,i){var s,c,u=N_("".concat(r,"_").concat(t.field));n.filter((function(t){return t.name===u})).length||n.unshift(Object.assign(Object.assign({name:u},a?{init:yH(a[i])}:{value:null}),{on:e.events?[{events:e.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(A,"[").concat(Object(x.Z)(t.field),"] : null")}]:[],bind:null!==(c=null!==(s=o[t.field])&&void 0!==s?s:o[t.channel])&&void 0!==c?c:o}))})),n},signals:function(t,e,n){var r=e.name,i=e.project,o=n.filter((function(t){return t.name===r+RH}))[0],a=r+"_tuple_fields",A=i.items.map((function(t){return N_("".concat(r,"_").concat(t.field))})),s=A.map((function(t){return"".concat(t," !== null")})).join(" && ");return A.length&&(o.update="".concat(s," ? {fields: ").concat(a,", values: [").concat(A.join(", "),"]} : null")),delete o.value,delete o.on,n}},aH={has:function(t){return"multi"===t.type&&!!t.toggle},signals:function(t,e,n){return n.concat({name:e.name+"_toggle",value:!1,on:[{events:e.events,update:e.toggle}]})},modifyExpr:function(t,e){var n=e.name+RH,r=e.name+"_toggle";return"".concat(r," ? null : ").concat(n,", ")+("global"===e.resolve?"".concat(r," ? null : true, "):"".concat(r," ? null : {unit: ").concat(DH(t),"}, "))+"".concat(r," ? ").concat(n," : null")}},AH={has:function(t){return void 0!==t.clear&&!1!==t.clear},parse:function(t,e,n){n.clear&&(e.clear=Object(x.H)(n.clear)?vN(n.clear,"scope"):n.clear)},topLevelSignals:function(t,e,n){if(oH.has(e)){var r,i=Object(U.a)(e.project.items);try{var o=function(){var t=r.value,i=n.findIndex((function(n){return n.name===N_("".concat(e.name,"_").concat(t.field))}));-1!==i&&n[i].on.push({events:e.clear,update:"null"})};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}return n},signals:function(t,e,n){function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type){var i,o=Object(U.a)(e.project.items);try{var a=function(){var t=i.value,e=n.findIndex((function(e){return e.name===t.signals.visual}));(r(e,"[0, 0]"),-1===e)&&r(n.findIndex((function(e){return e.name===t.signals.data})),"null")};for(o.s();!(i=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}else{var A=n.findIndex((function(t){return t.name===e.name+RH}));r(A,"null"),aH.has(e)&&r(A=n.findIndex((function(t){return t.name===e.name+"_toggle"})),"false")}return n}},sH={has:function(t){return"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind},parse:function(t,e){var n,r=e.scales=[],i=Object(U.a)(e.project.items);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.channel;if(FT(a)){var A=t.getScaleComponent(a),s=A?A.get("type"):void 0;if(A&&QV(s)){var c={selection:e.name,field:o.field};A.set("selectionExtent",c,!0),r.push(o)}else AL(p.SCALE_BINDINGS_CONTINUOUS)}}}catch(u){i.e(u)}finally{i.f()}},topLevelSignals:function(t,e,n){var r=e.scales.filter((function(t){return 0===n.filter((function(e){return e.name===t.signals.data})).length}));if(!t.parent||uH(t)||0===r.length)return n;var i=n.filter((function(t){return t.name===e.name}))[0],o=i.update;if(o.indexOf(xH)>=0)i.update="{".concat(r.map((function(t){return"".concat(Object(x.Z)(t.field),": ").concat(t.signals.data)})).join(", "),"}");else{var a,A=Object(U.a)(r);try{for(A.s();!(a=A.n()).done;){var s=a.value,c="".concat(Object(x.Z)(s.field),": ").concat(s.signals.data);o.indexOf(c)<0&&(o="".concat(o.substring(0,o.length-1),", ").concat(c,"}"))}}catch(u){A.e(u)}finally{A.f()}i.update=o}return n.concat(r.map((function(t){return{name:t.signals.data}})))},signals:function(t,e,n){if(t.parent&&!uH(t)){var r,i=Object(U.a)(e.scales);try{var o=function(){var t=r.value,e=n.filter((function(e){return e.name===t.signals.data}))[0];e.push="outer",delete e.value,delete e.update};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}return n}};function cH(t,e){var n=Object(x.Z)(t.scaleName(e));return"domain(".concat(n,")")}function uH(t){var e;return t.parent&&yz(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:uH(t.parent.parent))}var lH={has:function(t){var e="global"===t.resolve&&t.bind&&JP(t.bind),n=1===t.project.items.length&&"_vgsid_"!==t.project.items[0].field;return e&&!n&&AL(p.LEGEND_BINDINGS_PROJECT_LENGTH),e&&n},parse:function(t,e,n,r){var i;if(r.on||delete e.events,r.clear||delete e.clear,r.on||r.clear){var o,a='event.item && indexof(event.item.mark.role, "legend") < 0',A=Object(U.a)(e.events);try{for(A.s();!(o=A.n()).done;){var s=o.value;s.filter=Object(x.i)(null!==(i=s.filter)&&void 0!==i?i:[]),s.filter.indexOf(a)<0&&s.filter.push(a)}}catch(l){A.e(l)}finally{A.f()}}var c=HP(e.bind)?e.bind.legend:"click",u=Object(x.H)(c)?vN(c,"view"):Object(x.i)(c);e.bind={legend:{merge:u}}},topLevelSignals:function(t,e,n){var r,i=e.name,o=HP(e.bind)&&e.bind.legend,a=function(t){return function(e){var n=d_(e);return n.markname=t,n}},A=Object(U.a)(e.project.items);try{var s=function(){var t=r.value;if(!t.hasLegend)return"continue";var A="".concat(N_(t.field),"_legend"),s="".concat(i,"_").concat(A);if(0===n.filter((function(t){return t.name===s})).length){var c=o.merge.map(a("".concat(A,"_symbols"))).concat(o.merge.map(a("".concat(A,"_labels")))).concat(o.merge.map(a("".concat(A,"_entries"))));n.unshift(Object.assign(Object.assign({name:s},e.init?{}:{value:null}),{on:[{events:c,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:o.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]}))}};for(A.s();!(r=A.n()).done;)s()}catch(c){A.e(c)}finally{A.f()}return n},signals:function(t,e,n){var r=e.name,i=e.project,o=n.find((function(t){return t.name===r+RH})),a=r+"_tuple_fields",A=i.items.filter((function(t){return t.hasLegend})).map((function(t){return N_("".concat(r,"_").concat(N_(t.field),"_legend"))})),s=A.map((function(t){return"".concat(t," !== null")})).join(" && "),c="".concat(s," ? {fields: ").concat(a,", values: [").concat(A.join(", "),"]} : null");e.events&&A.length>0?o.on.push({events:A.map((function(t){return{signal:t}})),update:c}):A.length>0&&(o.update=c,delete o.value,delete o.on);var u=n.find((function(t){return t.name===r+"_toggle"})),l=HP(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push(Object.assign(Object.assign({},u.on[0]),{events:l})):u.on[0].events=l),n}};var gH="_translate_delta",fH={has:function(t){return"interval"===t.type&&t.translate},signals:function(t,e,n){var r=e.name,i=sH.has(e),o=r+"_translate_anchor",a=e.project.hasChannel,A=a.x,s=a.y,c=vN(e.translate,"scope");return i||(c=c.map((function(t){return t.between[0].markname=r+mH,t}))),n.push({name:o,value:{},on:[{events:c.map((function(t){return t.between[0]})),update:"{x: x(unit), y: y(unit)"+(void 0!==A?", extent_x: "+(i?cH(t,"x"):"slice(".concat(A.signals.visual,")")):"")+(void 0!==s?", extent_y: "+(i?cH(t,"y"):"slice(".concat(s.signals.visual,")")):"")+"}"}]},{name:r+gH,value:{},on:[{events:c,update:"{x: ".concat(o,".x - x(unit), y: ").concat(o,".y - y(unit)}")}]}),void 0!==A&&hH(t,e,A,"width",n),void 0!==s&&hH(t,e,s,"height",n),n}};function hH(t,e,n,r,i){var o,a=e.name,A=a+"_translate_anchor",s=a+gH,c=n.channel,u=sH.has(e),l=i.filter((function(t){return t.name===n.signals[u?"data":"visual"]}))[0],g=t.getSizeSignalRef(r).signal,f=t.getScaleComponent(c),h=f.get("type"),d=u&&"x"===c?"-":"",I="".concat(A,".extent_").concat(c),p="".concat(d).concat(s,".").concat(c," / ")+(u?"".concat(g):"span(".concat(I,")")),C="".concat(u?"log"===h?"panLog":"pow"===h?"panPow":"panLinear":"panLinear","(").concat(I,", ").concat(p)+(u&&"pow"===h?", ".concat(null!==(o=f.get("exponent"))&&void 0!==o?o:1):"")+")";l.on.push({events:{signal:s},update:u?C:"clampRange(".concat(C,", 0, ").concat(g,")")})}var dH={has:function(t){return"interval"===t.type&&t.zoom},signals:function(t,e,n){var r=e.name,i=sH.has(e),o=r+"_zoom_delta",a=e.project.hasChannel,A=a.x,s=a.y,c=Object(x.Z)(t.scaleName("x")),u=Object(x.Z)(t.scaleName("y")),l=vN(e.zoom,"scope");return i||(l=l.map((function(t){return t.markname=r+mH,t}))),n.push({name:r+"_zoom_anchor",on:[{events:l,update:i?"{"+[c?"x: invert(".concat(c,", x(unit))"):"",u?"y: invert(".concat(u,", y(unit))"):""].filter((function(t){return!!t})).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==A&&IH(t,e,A,"width",n),void 0!==s&&IH(t,e,s,"height",n),n}};function IH(t,e,n,r,i){var o,a=e.name,A=n.channel,s=sH.has(e),c=i.filter((function(t){return t.name===n.signals[s?"data":"visual"]}))[0],u=t.getSizeSignalRef(r).signal,l=t.getScaleComponent(A),g=l.get("type"),f=s?cH(t,A):c.name,h=a+"_zoom_delta",d="".concat(a).concat("_zoom_anchor",".").concat(A),I="".concat(s?"log"===g?"zoomLog":"pow"===g?"zoomPow":"zoomLinear":"zoomLinear","(").concat(f,", ").concat(d,", ").concat(h)+(s&&"pow"===g?", ".concat(null!==(o=l.get("exponent"))&&void 0!==o?o:1):"")+")";c.on.push({events:{signal:h},update:s?I:"clampRange(".concat(I,", 0, ").concat(u,")")})}var pH=[{has:function(){return!0},parse:function(t,e,n){var r,i,o,a=e.name,A=null!==(r=e.project)&&void 0!==r?r:e.project=new iH,s={},c={},u=new Set,l=function(t,e){for(var n="visual"===e?t.channel:t.field,r=N_("".concat(a,"_").concat(n)),i=1;u.has(r);i++)r=N_("".concat(a,"_").concat(n,"_").concat(i));return u.add(r),Object(v.a)({},e,r)};if(!n.fields&&!n.encodings){var g=t.config.selection[n.type];if(n.init){var f,h=Object(U.a)(Object(x.i)(n.init));try{for(h.s();!(f=h.n()).done;){var d,I=f.value,C=Object(U.a)(U_(I));try{for(C.s();!(d=C.n()).done;){var y=d.value;aT[y]?(n.encodings||(n.encodings=[])).push(y):"interval"===n.type?(AL('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=g.encodings):(n.fields||(n.fields=[])).push(y)}}catch(_){C.e(_)}finally{C.f()}}}catch(_){h.e(_)}finally{h.f()}}else n.encodings=g.encodings,n.fields=g.fields}var B,m=Object(U.a)(null!==(i=n.fields)&&void 0!==i?i:[]);try{for(m.s();!(B=m.n()).done;){var b=B.value,E={type:"E",field:b};E.signals=Object.assign({},l(E,"data")),A.items.push(E),A.hasField[b]=E}}catch(_){m.e(_)}finally{m.f()}var Q,F=Object(U.a)(null!==(o=n.encodings)&&void 0!==o?o:[]);try{for(F.s();!(Q=F.n()).done;){var w=Q.value,S=t.fieldDef(w);if(S){var R=S.field;if(S.aggregate){AL(p.cannotProjectAggregate(w,S.aggregate));continue}if(!R){AL(p.cannotProjectOnChannelWithoutField(w));continue}if(S.timeUnit){R=t.vgField(w);var k={timeUnit:S.timeUnit,as:R,field:S.field};c[y_(k)]=k}if(!s[R]){var O="E";if("interval"===e.type)QV(t.getScaleComponent(w).get("type"))&&(O="R");else S.bin&&(O="R-RE");var N={field:R,channel:w,type:O};N.signals=Object.assign(Object.assign({},l(N,"data")),l(N,"visual")),A.items.push(s[R]=N),A.hasField[R]=A.hasChannel[w]=s[R]}}else AL(p.cannotProjectOnChannelWithoutField(w))}}catch(_){F.e(_)}finally{F.f()}if(n.init){var D=function(t){return A.items.map((function(e){return void 0!==t[e.channel]?t[e.channel]:t[e.field]}))};if("interval"===n.type)e.init=D(n.init);else{var G=Object(x.i)(n.init);e.init=G.map(D)}}R_(c)||(A.timeUnit=new rH(null,c))},signals:function(t,e,n){var r=e.name+"_tuple_fields";return n.filter((function(t){return t.name===r})).length>0?n:n.concat({name:r,value:e.project.items.map((function(t){t.signals,t.hasLegend;var e=r_(t,["signals","hasLegend"]);return e.field=L_(e.field),e}))})}},aH,sH,lH,fH,dH,oH,tH,AH];function CH(t,e){var n,r=Object(U.a)(pH);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.has(t)&&e(i)}}catch(o){r.e(o)}finally{r.f()}}function yH(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x.x;if(Object(x.A)(t)){var r=t.map((function(t){return yH(t,e,n)}));return e?"[".concat(r.join(", "),"]"):r}return sL(t)?n(e?hL(t):IL(t)):e?n(JSON.stringify(t)):t}function vH(t,e){return OH(t,(function(n,r){e=r.marks?r.marks(t,n,e):e,CH(n,(function(r){r.marks&&(e=r.marks(t,n,e))}))})),e}function BH(t){return t.map((function(t){return t.on&&!t.on.length&&delete t.on,t}))}var mH="_brush",bH={signals:function(t,e){var n=e.name,r=n+"_tuple_fields",i=sH.has(e),o=[],a=[],A=[];if(e.translate&&!i){var s="!event.item || event.item.mark.name !== ".concat(Object(x.Z)(n+mH));EH(e,(function(t,e){var n,r=Object(x.i)(null!==(n=e.between[0].filter)&&void 0!==n?n:e.between[0].filter=[]);return r.indexOf(s)<0&&r.push(s),t}))}e.project.items.forEach((function(n,r){var i=n.channel;if("x"===i||"y"===i){var s=e.init?e.init[r]:null,c=function(t,e,n,r){var i=n.channel,o=n.signals.visual,a=n.signals.data,A=sH.has(e),s=Object(x.Z)(t.scaleName(i)),c=t.getScaleComponent(i),u=c?c.get("type"):void 0,l=function(t){return"scale(".concat(s,", ").concat(t,")")},g=t.getSizeSignalRef("x"===i?"width":"height").signal,f="".concat(i,"(unit)"),h=EH(e,(function(t,e){return[].concat(Object(B.a)(t),[{events:e.between[0],update:"[".concat(f,", ").concat(f,"]")},{events:e,update:"[".concat(o,"[0], clamp(").concat(f,", 0, ").concat(g,")]")}])}));return h.push({events:{signal:e.name+"_scale_trigger"},update:QV(u)?"[".concat(l("".concat(a,"[0]")),", ").concat(l("".concat(a,"[1]")),"]"):"[0, 0]"}),A?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:yH(r,!0,l)}:{value:[]}),{on:h}),Object.assign(Object.assign({name:a},r?{init:yH(r)}:{}),{on:[{events:{signal:o},update:"".concat(o,"[0] === ").concat(o,"[1] ? null : invert(").concat(s,", ").concat(o,")")}]})]}(t,e,n,s),u=n.signals.data,l=n.signals.visual,g=Object(x.Z)(t.scaleName(i)),f=QV(t.getScaleComponent(i).get("type"))?"+":"";o.push.apply(o,Object(B.a)(c)),a.push(u),A.push({scaleName:t.scaleName(i),expr:"(!isArray(".concat(u,") || ")+"(".concat(f,"invert(").concat(g,", ").concat(l,")[0] === ").concat(f).concat(u,"[0] && ")+"".concat(f,"invert(").concat(g,", ").concat(l,")[1] === ").concat(f).concat(u,"[1]))")})}else AL("Interval selections only support x and y encoding channels.")})),i||o.push({name:n+"_scale_trigger",value:{},on:[{events:A.map((function(t){return{scale:t.scaleName}})),update:A.map((function(t){return t.expr})).join(" && ")+" ? ".concat(n+"_scale_trigger"," : {}")}]});var c=e.init,u="unit: ".concat(DH(t),", fields: ").concat(r,", values");return o.concat(Object.assign(Object.assign({name:n+RH},c?{init:"{".concat(u,": ").concat(yH(c),"}")}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+" ? {".concat(u,": [").concat(a,"]} : null")}]}))},modifyExpr:function(t,e){return e.name+RH+", "+("global"===e.resolve?"true":"{unit: ".concat(DH(t),"}"))},marks:function(t,e,n){var r=e.name,i=e.project.hasChannel,o=i.x,a=i.y,A=o&&o.signals.visual,s=a&&a.signals.visual,c="data(".concat(Object(x.Z)(e.name+SH),")");if(sH.has(e))return n;var u={x:void 0!==o?{signal:"".concat(A,"[0]")}:{value:0},y:void 0!==a?{signal:"".concat(s,"[0]")}:{value:0},x2:void 0!==o?{signal:"".concat(A,"[1]")}:{field:{group:"width"}},y2:void 0!==a?{signal:"".concat(s,"[1]")}:{field:{group:"height"}}};if("global"===e.resolve){var l,g=Object(U.a)(U_(u));try{for(g.s();!(l=g.n()).done;){var f=l.value;u[f]=[Object.assign({test:"".concat(c,".length && ").concat(c,"[0].unit === ").concat(DH(t))},u[f]),{value:0}]}}catch(v){g.e(v)}finally{g.f()}}var h=e.mark,d=h.fill,I=h.fillOpacity,p=h.cursor,C=r_(h,["fill","fillOpacity","cursor"]),y=U_(C).reduce((function(t,e){return t[e]=[{test:[void 0!==o&&"".concat(A,"[0] !== ").concat(A,"[1]"),void 0!==a&&"".concat(s,"[0] !== ").concat(s,"[1]")].filter((function(t){return t})).join(" && "),value:C[e]},{value:null}],t}),{});return[{name:r+mH+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:d},fillOpacity:{value:I}},update:u}}].concat(Object(B.a)(n),[{name:r+mH,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},p?{cursor:{value:p}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},u),y)}}])}};function EH(t,e){return t.events.reduce((function(t,n){return n.between?e(t,n):(AL("".concat(n," is not an ordered event stream for interval selections.")),t)}),[])}function QH(t,e){var n=e.name,r=n+"_tuple_fields",i=e.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map((function(e){var n=t.fieldDef(e.channel);return n&&n.bin?"[".concat(o,"[").concat(Object(x.Z)(t.vgField(e.channel,{})),"], ")+"".concat(o,"[").concat(Object(x.Z)(t.vgField(e.channel,{binSuffix:"end"})),"]]"):"".concat(o,"[").concat(Object(x.Z)(e.field),"]")})).join(", "),A="unit: ".concat(DH(t),", fields: ").concat(r,", values"),s=e.events;return[{name:n+RH,on:s?[{events:s,update:"datum && item().mark.marktype !== 'group' ? {".concat(A,": [").concat(a,"]} : null"),force:!0}]:[]}]}var FH={signals:QH,modifyExpr:function(t,e){return e.name+RH+", "+("global"===e.resolve?"null":"{unit: ".concat(DH(t),"}"))}},wH={signals:QH,modifyExpr:function(t,e){return e.name+RH+", "+("global"===e.resolve?"true":"{unit: ".concat(DH(t),"}"))}},SH="_store",RH="_tuple",UH="_modify",xH="vlSelectionResolve",kH={single:wH,multi:FH,interval:bH};function OH(t,e){var n=t.component.selection;if(n){var r,i=Object(U.a)(x_(n));try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!0===e(o,kH[o.type]))break}}catch(a){i.e(a)}finally{i.f()}}}function NH(t){for(var e=t.parent;e&&!pz(e);)e=e.parent;return e}function DH(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},n=e.escape,r=n?Object(x.Z)(t.name):t.name,i=NH(t);if(i){var o,a=i.facet,A=Object(U.a)(nT);try{for(A.s();!(o=A.n()).done;){var s=o.value;a[s]&&(r+=" + '__facet_".concat(s,"_' + (facet[").concat(Object(x.Z)(i.vgField(s)),"])"))}}catch(c){A.e(c)}finally{A.f()}}return r}function GH(t){var e=!1;return OH(t,(function(t){e=e||t.project.items.some((function(t){return"_vgsid_"===t.field}))})),e}function _H(t){var e=hU(t),n=new Set;return e.visit((function(t){"MemberExpression"===t.type&&function t(e){return"MemberExpression"===e.object.type?t(e.object):"datum"===e.object.name}(t)&&n.add(function t(e){var n=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(n.push.apply(n,Object(B.a)(t(e.object))),n.push.apply(n,Object(B.a)(t(e.property)))),n)}(t).slice(1).join("."))})),n}var MH=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i){var o;return Object(F.a)(this,n),(o=e.call(this,t)).model=r,o.filter=i,o.expr=LH(o.model,o.filter,Object(D.a)(o)),o._dependentFields=_H(o.expr),o}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,this.model,d_(this.filter))}},{key:"dependentFields",value:function(){return this._dependentFields}},{key:"producedFields",value:function(){return new Set}},{key:"assemble",value:function(){return{type:"filter",expr:this.expr}}},{key:"hash",value:function(){return"Filter ".concat(this.expr)}}]),n}(eH);function TH(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum",i=[];function o(e){var o=N_(e),a=t.getSelectionComponent(o,e),A=Object(x.Z)(o+SH);if(a.project.timeUnit){var s=null!==n&&void 0!==n?n:t.component.data.raw,c=a.project.timeUnit.clone();s.parent?c.insertAsParentOf(s):s.parent=c}return"none"!==a.empty&&i.push(A),"vlSelectionTest(".concat(A,", ").concat(r)+("global"===a.resolve?")":", ".concat(Object(x.Z)(a.resolve),")"))}var a=D_(e,o);return(i.length?"!("+i.map((function(t){return"length(data(".concat(t,"))")})).join(" || ")+") || ":"")+"(".concat(a,")")}function jH(t,e){var n=e.encoding,r=e.field;if(n||r){if(n&&!r){var i=t.project.items.filter((function(t){return t.channel===n}));!i.length||i.length>1?(r=t.project.items[0].field,AL((i.length?"Multiple ":"No ")+"matching ".concat(Object(x.Z)(n)," encoding found for selection ").concat(Object(x.Z)(e.selection),". ")+'Using "field": '.concat(Object(x.Z)(r),"."))):r=i[0].field}}else r=t.project.items[0].field,t.project.items.length>1&&AL('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat(Object(x.Z)(r),"."));return"".concat(t.name,"[").concat(Object(x.Z)(r),"]")}function LH(t,e,n){return D_(e,(function(e){return Object(x.H)(e)?e:function(t){return null===t||void 0===t?void 0:t.selection}(e)?TH(t,e.selection,n):PL(e)}))}function VH(t,e){if(t)return Object(x.A)(t)&&!tP(t)?t.map((function(t){return jZ(t,e)})).join(", "):t}function ZH(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}function PH(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1},i=t.combine(),o=i.disable,a=i.orient,A=i.scale,s=i.labelExpr,c=i.title,u=i.zindex,l=r_(i,["disable","orient","scale","labelExpr","title","zindex"]);if(!o){for(var g in l){var f=tM[g],h=l[g];if(f&&f!==e&&"both"!==f)delete l[g];else if(q_(h)){var d=h.condition,I=r_(h,["condition"]),p=Object(x.i)(d),C=K_[g];if(C){var y=C.vgProp,v=C.part,m=[].concat(Object(B.a)(p.map((function(t){var e=t.test,n=r_(t,["test"]);return Object.assign({test:LH(null,e)},n)}))),[I]);ZH(l,v,y,m),delete l[g]}else if(null===C){var b={signal:p.map((function(t){var e=t.test,n=r_(t,["test"]);return"".concat(LH(null,e)," ? ").concat(nP(n)," : ")})).join("")+nP(I)};l[g]=b}}else if(wL(h)){var E=K_[g];if(E){var Q=E.vgProp,F=E.part;ZH(l,F,Q,h),delete l[g]}}}if("grid"===e){if(!l.grid)return;if(l.encode){var w=l.encode.grid;l.encode=Object.assign({},w?{grid:w}:{}),R_(l.encode)&&delete l.encode}return Object.assign(Object.assign({scale:A,orient:a},l),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:W_(u,0)})}if(r.header||!t.mainExtracted){if(void 0!==s&&ZH(l,"labels","text",{signal:s}),null===l.labelAlign&&delete l.labelAlign,l.encode){var S,R=Object(U.a)($_);try{for(R.s();!(S=R.n()).done;){var k=S.value;t.hasAxisPart(k)||delete l.encode[k]}}catch(N){R.e(N)}finally{R.f()}R_(l.encode)&&delete l.encode}var O=VH(c,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:A,orient:a,grid:!1},O?{title:O}:{}),l),!1===n.aria?{aria:!1}:{}),{zindex:W_(u,0)})}}}function WH(t){var e,n=t.component.axes,r=[],i=Object(U.a)(pT);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(n[o]){var a,A=Object(U.a)(n[o]);try{for(A.s();!(a=A.n()).done;){var s=a.value;if(!s.get("disable")&&!s.get("gridScale")){var c="x"===o?"height":"width",u=t.getSizeSignalRef(c).signal;c!==u&&r.push({name:c,update:u})}}}catch(l){A.e(l)}finally{A.f()}}}}catch(l){i.e(l)}finally{i.f()}return r}var JH={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},HH={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},YH=U_(JH),XH=U_(HH);function zH(t,e,n,r){return Object.assign.apply(null,[{}].concat(Object(B.a)(t.map((function(t){if("axisOrient"===t){var i,o="x"===n?"bottom":"left",a=e["x"===n?"axisBottom":"axisLeft"]||{},A=e["x"===n?"axisTop":"axisRight"]||{},s=new Set([].concat(Object(B.a)(U_(a)),Object(B.a)(U_(A)))),c={},u=Object(U.a)(s.values());try{for(u.s();!(i=u.n()).done;){var l=i.value;c[l]={signal:"".concat(r.signal,' === "').concat(o,'" ? ').concat(rP(a[l])," : ").concat(rP(A[l]))}}}catch(g){u.e(g)}finally{u.f()}return c}return e[t]})))))}function KH(t,e,n,r){var i="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:e in yV?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",a=wL(n)?"axisOrient":"axis"+__(n),A=[].concat(i,Object(B.a)(i.map((function(t){return o+t.substr(4)})))),s=["axis",a,o];return{vlOnlyAxisConfig:zH(A,r,t,n),vgAxisConfig:zH(s,r,t,n),axisConfigStyle:qH([].concat(s,Object(B.a)(A)),r)}}function qH(t,e){var n,r,i=[{}],o=Object(U.a)(t);try{for(o.s();!(r=o.n()).done;){var a=null===(n=e[r.value])||void 0===n?void 0:n.style;if(a){a=Object(x.i)(a);var A,s=Object(U.a)(a);try{for(s.s();!(A=s.n()).done;){var c=A.value;i.push(e.style[c])}}catch(u){s.e(u)}finally{s.f()}}}}catch(u){o.e(u)}finally{o.f()}return Object.assign.apply(null,i)}function $H(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=sP(t,n,e.style);if(void 0!==o)return{configFrom:"style",configValue:o};for(var a=0,A=["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"];a<A.length;a++){var s=A[a];if(void 0!==(null===(r=i[s])||void 0===r?void 0:r[t]))return{configFrom:s,configValue:i[s][t]}}return{}}var tY={scale:function(t){var e=t.model,n=t.channel;return e.scaleName(n)},format:function(t){var e=t.fieldOrDatumDef,n=t.config,r=t.axis,i=r.format,o=r.formatType;return zV(e,e.type,i,o,n,!0)},formatType:function(t){var e=t.axis,n=t.fieldOrDatumDef,r=t.scaleType,i=e.formatType;return KV(i,n,r)},grid:function(t){var e,n=t.fieldOrDatumDef,r=t.axis,i=t.scaleType;return(!pZ(n)||!OT(n.bin))&&(null!==(e=r.grid)&&void 0!==e?e:function(t,e){return!EV(t)&&pZ(e)&&!kT(null===e||void 0===e?void 0:e.bin)}(i,n))},gridScale:function(t){return function(t,e){var n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(t.model,t.channel)},labelAlign:function(t){var e=t.axis,n=t.labelAngle,r=t.orient,i=t.channel;return e.labelAlign||rY(n,r,i)},labelAngle:function(t){return t.labelAngle},labelBaseline:function(t){var e=t.axis,n=t.labelAngle,r=t.orient,i=t.channel;return e.labelBaseline||nY(n,r,i)},labelFlush:function(t){var e,n=t.axis,r=t.fieldOrDatumDef,i=t.channel;return null!==(e=n.labelFlush)&&void 0!==e?e:function(t,e){if("x"===e&&B_(["quantitative","temporal"],t))return!0;return}(r.type,i)},labelOverlap:function(t){var e,n=t.axis,r=t.fieldOrDatumDef,i=t.scaleType;return null!==(e=n.labelOverlap)&&void 0!==e?e:function(t,e){if("nominal"!==t)return"log"!==e||"greedy";return}(r.type,i)},orient:function(t){return t.orient},tickCount:function(t){var e,n=t.channel,r=t.model,i=t.axis,o=t.fieldOrDatumDef,a=t.scaleType,A="x"===n?"width":"y"===n?"height":void 0,s=A?r.getSizeSignalRef(A):void 0;return null!==(e=i.tickCount)&&void 0!==e?e:function(t){var e,n=t.fieldOrDatumDef,r=t.scaleType,i=t.size;if(!t.values&&!EV(r)&&"log"!==r){if(pZ(n)){if(kT(n.bin))return{signal:"ceil(".concat(i.signal,"/10)")};if(n.timeUnit&&B_(["month","hours","day","quarter"],null===(e=QL(n.timeUnit))||void 0===e?void 0:e.unit))return}return{signal:"ceil(".concat(i.signal,"/40)")}}return}({fieldOrDatumDef:o,scaleType:a,size:s,values:i.values})},title:function(t){var e=t.axis,n=t.model,r=t.channel;if(void 0!==e.title)return e.title;var i=iY(n,r);if(void 0!==i)return i;var o=n.typedFieldDef(r),a="x"===r?"x2":"y2",A=n.fieldDef(a);return uP(o?[uZ(o)]:[],pZ(A)?[uZ(A)]:[])},values:function(t){return function(t,e){var n=t.values;if(Object(x.A)(n))return KZ(e,n);if(wL(n))return n;return}(t.axis,t.fieldOrDatumDef)},zindex:function(t){var e,n=t.axis,r=t.fieldOrDatumDef,i=t.mark;return null!==(e=n.zindex)&&void 0!==e?e:function(t,e){if("rect"===t&&xZ(e))return 1;return 0}(i,r)}};function eY(t){return"(((".concat(t.signal," % 360) + 360) % 360)")}function nY(t,e,n,r){if(void 0!==t){if("x"===n){if(wL(t)){var i=eY(t),o=wL(e)?"(".concat(e.signal,' === "top")'):"top"===e;return{signal:"(45 < ".concat(i," && ").concat(i," < 135) || (225 < ").concat(i," && ").concat(i,' < 315) ? "middle" :')+"(".concat(i," <= 45 || 315 <= ").concat(i,") === ").concat(o,' ? "bottom" : "top"')}}if(45<t&&t<135||225<t&&t<315)return"middle";if(wL(e)){var a=t<=45||315<=t?"===":"!==";return{signal:"".concat(e.signal," ").concat(a,' "top" ? "bottom" : "top"')}}return(t<=45||315<=t)===("top"===e)?"bottom":"top"}if(wL(t)){var A=eY(t),s=wL(e)?"(".concat(e.signal,' === "left")'):"left"===e,c=r?'"middle"':"null";return{signal:"".concat(A," <= 45 || 315 <= ").concat(A," || (135 <= ").concat(A," && ").concat(A," <= 225) ? ").concat(c," : (45 <= ").concat(A," && ").concat(A," <= 135) === ").concat(s,' ? "top" : "bottom"')}}if(t<=45||315<=t||135<=t&&t<=225)return r?"middle":null;if(wL(e)){var u=45<=t&&t<=135?"===":"!==";return{signal:"".concat(e.signal," ").concat(u,' "left" ? "top" : "bottom"')}}return(45<=t&&t<=135)===("left"===e)?"top":"bottom"}}function rY(t,e,n){if(void 0!==t){var r="x"===n,i=r?0:90,o=r?"bottom":"left";if(wL(t)){var a=eY(t),A=wL(e)?"(".concat(e.signal,' === "').concat(o,'")'):e===o;return{signal:"(".concat(i?"("+a+" + 90)":a," % 180 === 0) ? ").concat(r?null:'"center"'," :")+"(".concat(i," < ").concat(a," && ").concat(a," < ").concat(180+i,") === ").concat(A,' ? "left" : "right"')}}if((t+i)%180===0)return r?null:"center";if(wL(e)){var s=i<t&&t<180+i?"===":"!==",c="".concat(e.signal," ").concat(s,' "').concat(o,'"');return{signal:"".concat(c,' ? "left" : "right"')}}return(i<t&&t<180+i)===(e===o)?"left":"right"}}function iY(t,e){var n="x"===e?"x2":"y2",r=t.fieldDef(e),i=t.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?lP(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}var oY=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i._dependentFields=_H(i.transform.calculate),i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"producedFields",value:function(){return new Set([this.transform.as])}},{key:"dependentFields",value:function(){return this._dependentFields}},{key:"assemble",value:function(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}},{key:"hash",value:function(){return"Calculate ".concat(y_(this.transform))}}],[{key:"parseAllForSortIndex",value:function(t,e){return e.forEachFieldDef((function(e,r){if(QZ(e)&&aZ(e.sort)){var i=e.field,o=e.timeUnit,a=e.sort,A=a.map((function(t,e){return"".concat(PL({field:i,timeUnit:o,equal:t})," ? ").concat(e," : ")})).join("")+a.length;t=new n(t,{calculate:A,as:aY(e,r,{forAs:!0})})}})),t}}]),n}(eH);function aY(t,e,n){return UZ(t,Object.assign({prefix:e,suffix:"sort_index"},null!==n&&void 0!==n?n:{}))}function AY(t,e){return B_(["top","bottom"],e)?"column":B_(["left","right"],e)||"row"===t?"row":"column"}function sY(t,e,n,r){var i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return W_(((null===e||void 0===e?void 0:e.header)||{})[t],i[t],n.header[t])}function cY(t,e,n,r){var i,o={},a=Object(U.a)(t);try{for(a.s();!(i=a.n()).done;){var A=i.value,s=sY(A,e,n,r);void 0!==s&&(o[A]=s)}}catch(c){a.e(c)}finally{a.f()}return o}var uY=["row","column"],lY=["header","footer"];function gY(t,e){var n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,o=cY(["titleAnchor","titleAngle","titleOrient"],i,r,e),a=o.titleAnchor,A=o.titleAngle,s=AY(e,o.titleOrient),c=X_(A);return{name:"".concat(e,"-title"),type:"group",role:"".concat(s,"-title"),title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===e?{orient:"left"}:{}),{style:"guide-title"}),hY(c,s)),fY(s,c,a)),BY(r,i,e,YH,JH))}}function fY(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle";switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}var r=rY(e,"row"===t?"left":"top","row"===t?"y":"x");return r?{align:r}:{}}function hY(t,e){var n=nY(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function dY(t,e){var n,r=t.component.layoutHeaders[e],i=[],o=Object(U.a)(lY);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(r[a]){var A,s=Object(U.a)(r[a]);try{for(s.s();!(A=s.n()).done;){var c=CY(t,e,a,r,A.value);null!=c&&i.push(c)}}catch(u){s.e(u)}finally{s.f()}}}}catch(u){o.e(u)}finally{o.f()}return i}function IY(t,e){var n,r=t.sort;return oZ(r)?{field:UZ(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:Object(x.A)(r)?{field:aY(t,e,{expr:"datum"}),order:"ascending"}:{field:UZ(t,{expr:"datum"}),order:null!==r&&void 0!==r?r:"ascending"}}function pY(t,e,n){var r=cY(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t,n,e),i=r.format,o=r.formatType,a=r.labelAngle,A=r.labelAnchor,s=r.labelOrient,c=r.labelExpr,u=HV({fieldOrDatumDef:t,format:i,formatType:o,expr:"parent",config:n}).signal,l=AY(e,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:c?V_(V_(c,"datum.label",u),"datum.value",UZ(t,{expr:"parent"})):u}},"row"===e?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),hY(a,l)),fY(l,a,A)),BY(n,t,e,XH,HH))}function CY(t,e,n,r,i){if(i){var o=null,a=r.facetFieldDef,A=t.config?t.config:void 0;if(a&&i.labels){var s=cY(["labelOrient"],a,A,e).labelOrient;("row"===e&&!B_(["top","bottom"],s)||"column"===e&&!B_(["left","right"],s))&&(o=pY(a,e,A))}var c=pz(t)&&!AZ(t.facet),u=i.axes,l=(null===u||void 0===u?void 0:u.length)>0;if(o||l){var g="row"===e?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName("".concat(e,"_").concat(n)),type:"group",role:"".concat(e,"-").concat(n)},r.facetFieldDef?{from:{data:t.getName(e+"_domain")},sort:IY(a,e)}:{}),l&&c?{from:{data:t.getName("facet_domain_".concat(e))}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:Object(v.a)({},g,i.sizeSignal)}}:{}),l?{axes:u}:{})}}return null}var yY={column:{start:0,end:1},row:{start:1,end:0}};function vY(t,e){return yY[e][t]}function BY(t,e,n,r,i){var o,a={},A=Object(U.a)(r);try{for(A.s();!(o=A.n()).done;){var s=o.value;if(i[s]){var c=sY(s,e,t,n);void 0!==c&&(a[i[s]]=c)}}}catch(u){A.e(u)}finally{A.f()}return a}function mY(t){return[].concat(Object(B.a)(bY(t,"width")),Object(B.a)(bY(t,"height")),Object(B.a)(bY(t,"childWidth")),Object(B.a)(bY(t,"childHeight")))}function bY(t,e){var n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];var i=t.getSizeSignalRef(e).signal;if("step"===r){var o=t.getScaleComponent(n);if(o){var a=o.get("type"),A=o.get("range");if(EV(a)&&SL(A)){var s=t.scaleName(n);if(pz(t.parent))if("independent"===t.parent.component.resolve.scale[n])return[EY(s,A)];return[EY(s,A),{name:i,update:QY(s,o,"domain('".concat(s,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){var c=i.endsWith("width"),u=c?"containerSize()[0]":"containerSize()[1]",l=tW(t.config.view,c?"width":"height"),g="isFinite(".concat(u,") ? ").concat(u," : ").concat(l);return[{name:i,init:g,on:[{update:g,events:"window:resize"}]}]}return[{name:i,value:r}]}function EY(t,e){return{name:t+"_step",value:e.step}}function QY(t,e,n){var r=e.get("type"),i=e.get("padding"),o=W_(e.get("paddingOuter"),i),a=e.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,"bandspace(".concat(n,", ").concat(a,", ").concat(o,") * ").concat(t,"_step")}function FY(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function wY(t,e){return U_(t).reduce((function(n,r){var i=t[r];return Object.assign(Object.assign({},n),SJ(e,i,r,(function(t){return wL(t)?t:{value:t.value}})))}),{})}function SY(t,e){if(yz(e)||pz(e))return"shared";if(Cz(e))return CT(t)?"independent":"shared";throw new Error("invalid model type for resolve")}function RY(t,e){var n=t.scale[e],r=CT(e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&AL(p.independentScaleMeansIndependentGuide(e)),"independent"):t[r][e]||"shared"}var UY=Object.assign(Object.assign({},PP),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),xY=U_(UY),kY=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return n}(XW),OY={symbols:function(t,e){var n,r,i,o,a,A=e.fieldOrDatumDef,s=e.model,c=e.channel,u=e.legendCmpt;if("symbol"!==e.legendType)return;var l=s.markDef,g=s.encoding,f=s.config,h=s.mark,d=l.filled&&"trail"!==h,I=Object.assign(Object.assign({},function(t,e,n){var r,i=Object(U.a)(n);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=aP(o,e.markDef,e.config);void 0!==a&&(t[o]=eP(a))}}catch(A){i.e(A)}finally{i.f()}return t}({},s,bM)),GJ(s,{filled:d})),p=null!==(n=NY(g.opacity))&&void 0!==n?n:l.opacity;if(I.fill)if("fill"===c||d&&c===PM)delete I.fill;else if(I.fill.field)u.get("symbolFillColor")?delete I.fill:(I.fill=eP(null!==(r=f.legend.symbolBaseFillColor)&&void 0!==r?r:"black"),I.fillOpacity=eP(null!==p&&void 0!==p?p:1));else if(Object(x.A)(I.fill)){var C=null!==(a=null!==(o=DY(null!==(i=g.fill)&&void 0!==i?i:g.color))&&void 0!==o?o:l.fill)&&void 0!==a?a:d&&l.color;C&&(I.fill=eP(C))}if(I.stroke)if("stroke"===c||!d&&c===PM)delete I.stroke;else if(I.stroke.field)delete I.stroke;else if(Object(x.A)(I.stroke)){var y=W_(DY(g.stroke||g.color),l.stroke,d?l.color:void 0);y&&(I.stroke={value:y})}if("opacity"!==c){var v=pZ(A)&&_Y(s,u,A);v?I.opacity=[Object.assign({test:v},eP(null!==p&&void 0!==p?p:1)),eP(f.legend.unselectedOpacity)]:p&&(I.opacity=eP(p))}return R_(I=Object.assign(Object.assign({},I),t))?void 0:I},gradient:function(t,e){var n=e.model;if("gradient"!==e.legendType)return;var r={},i=NY(n.encoding.opacity)||n.markDef.opacity;i&&(r.opacity=eP(i));return R_(r=Object.assign(Object.assign({},r),t))?void 0:r},labels:function(t,e){var n=e.fieldOrDatumDef,r=e.model,i=e.channel,o=e.legendCmpt,a=r.legend(i)||{},A=r.config,s=pZ(n)?_Y(r,o,n):void 0,c=s?[{test:s,value:1},{value:A.legend.unselectedOpacity}]:void 0,u=a.format,l=a.formatType,g=WV(l)?XV({fieldOrDatumDef:n,field:"datum.value",format:u,formatType:l,config:A}):void 0,f=Object.assign(Object.assign(Object.assign({},c?{opacity:c}:{}),g?{text:g}:{}),t);return R_(f)?void 0:f},entries:function(t,e){var n=e.legendCmpt.get("selections");return(null===n||void 0===n?void 0:n.length)?Object.assign(Object.assign({},t),{fill:{value:"transparent"}}):t}};function NY(t){return GY(t,(function(t,e){return Math.max(t,e.value)}))}function DY(t){return GY(t,(function(t,e){return W_(t,e.value)}))}function GY(t,e){return function(t){var e=t&&t.condition;return!!e&&(Object(x.A)(e)||EZ(e))}(t)?Object(x.i)(t.condition).reduce(e,t.value):EZ(t)?t.value:void 0}function _Y(t,e,n){var r=e.get("selections");if(null===r||void 0===r?void 0:r.length){var i=Object(x.Z)(n.field);return r.map((function(t){var e=Object(x.Z)(N_(t)+SH);return"(!length(data(".concat(e,")) || (").concat(t,"[").concat(i,"] && indexof(").concat(t,"[").concat(i,"], datum.value) >= 0))")})).join(" || ")}}var MY={direction:function(t){return t.direction},format:function(t){var e=t.fieldOrDatumDef,n=t.legend,r=t.config,i=n.format,o=n.formatType;return zV(e,e.type,i,o,r,!1)},formatType:function(t){var e=t.legend,n=t.fieldOrDatumDef,r=t.scaleType,i=e.formatType;return KV(i,n,r)},gradientLength:function(t){var e,n,r=t.legend,i=t.legendConfig;return null!==(n=null!==(e=r.gradientLength)&&void 0!==e?e:i.gradientLength)&&void 0!==n?n:function(t){var e=t.legendConfig,n=t.model,r=t.direction,i=t.orient,o=t.scaleType,a=e.gradientHorizontalMaxLength,A=e.gradientHorizontalMinLength,s=e.gradientVerticalMaxLength,c=e.gradientVerticalMinLength;if(FV(o))return"horizontal"===r?"top"===i||"bottom"===i?LY(n,"width",A,a):A:LY(n,"height",c,s);return}(t)},labelOverlap:function(t){var e,n,r=t.legend,i=t.legendConfig,o=t.scaleType;return null!==(n=null!==(e=r.labelOverlap)&&void 0!==e?e:i.labelOverlap)&&void 0!==n?n:function(t){if(B_(["quantile","threshold","log"],t))return"greedy";return}(o)},symbolType:function(t){var e,n=t.legend,r=t.markDef,i=t.channel,o=t.encoding;return null!==(e=n.symbolType)&&void 0!==e?e:function(t,e,n,r){var i;if("shape"!==e){var o=null!==(i=DY(n))&&void 0!==i?i:r;if(o)return o}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(r.type,i,o.shape,r.shape)},title:function(t){return MZ(t.fieldOrDatumDef,t.config,{allowDisabling:!0})},type:function(t){var e=t.legendType,n=t.scaleType;if(tT(t.channel)&&FV(n)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:function(t){var e=t.fieldOrDatumDef;return function(t,e){var n=t.values;if(Object(x.A)(n))return KZ(e,n);if(wL(n))return n;return}(t.legend,e)}};function TY(t){return W_(t.legend.type,function(t){var e=t.channel,n=t.timeUnit,r=t.scaleType;if(tT(e)){if(B_(["quarter","month","day"],n))return"symbol";if(FV(r))return"gradient"}return"symbol"}(t))}function jY(t){var e,n,r=t.legendConfig,i=t.legendType,o=t.orient;return null!==(n=null!==(e=t.legend.direction)&&void 0!==e?e:r[i?"gradientDirection":"symbolDirection"])&&void 0!==n?n:function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(o,i)}function LY(t,e,n,r){var i=t.getSizeSignalRef(e).signal;return{signal:"clamp(".concat(i,", ").concat(n,", ").concat(r,")")}}function VY(t){var e=Iz(t)?function(t){for(var e=t.encoding,n={},r=0,i=[PM].concat(Object(B.a)(VP));r<i.length;r++){var o=i[r],a=ZZ(e[o]);a&&t.getScaleComponent(o)&&(o===HM&&pZ(a)&&a.type===qL||(n[o]=PY(t,o)))}return n}(t):function(t){var e,n=t.component,r=n.legends,i=n.resolve,o=Object(U.a)(t.children);try{for(o.s();!(e=o.n()).done;){var a=e.value;VY(a);var A,s=Object(U.a)(U_(a.component.legends));try{for(s.s();!(A=s.n()).done;){var c=A.value;i.legend[c]=RY(t.component.resolve,c),"shared"===i.legend[c]&&(r[c]=WY(r[c],a.component.legends[c]),r[c]||(i.legend[c]="independent",delete r[c]))}}catch(I){s.e(I)}finally{s.f()}}}catch(I){o.e(I)}finally{o.f()}var u,l=Object(U.a)(U_(r));try{for(l.s();!(u=l.n()).done;){var g,f=u.value,h=Object(U.a)(t.children);try{for(h.s();!(g=h.n()).done;){var d=g.value;d.component.legends[f]&&("shared"===i.legend[f]&&delete d.component.legends[f])}}catch(I){h.e(I)}finally{h.f()}}}catch(I){l.e(I)}finally{l.f()}return r}(t);return t.component.legends=e,e}function ZY(t,e,n,r){switch(e){case"disable":return void 0!==n;case"values":return!!(null===n||void 0===n?void 0:n.values);case"title":if("title"===e&&t===(null===r||void 0===r?void 0:r.title))return!0}return t===(n||{})[e]}function PY(t,e){var n,r,i,o=t.legend(e),a=t.markDef,A=t.encoding,s=t.config,c=s.legend,u=new kY({},function(t,e){var n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:Object(v.a)({},e,n)}(t,e));!function(t,e,n){var r,i=null===(r=t.fieldDef(e))||void 0===r?void 0:r.field;OH(t,(function(t){var r,o,a=null!==(r=t.project.hasField[i])&&void 0!==r?r:t.project.hasChannel[e];if(a&&lH.has(t)){var A=null!==(o=n.get("selections"))&&void 0!==o?o:[];A.push(t.name),n.set("selections",A,!1),a.hasLegend=!0}}))}(t,e,u);var l=void 0!==o?!o:c.disable;if(u.set("disable",l,void 0!==o),l)return u;o=o||{};var g,f=t.getScaleComponent(e).get("type"),h=ZZ(A[e]),d=pZ(h)?null===(n=QL(h.timeUnit))||void 0===n?void 0:n.unit:void 0,I=o.orient||s.legend.orient||"right",p=TY({legend:o,channel:e,timeUnit:d,scaleType:f}),C={legend:o,channel:e,model:t,markDef:a,encoding:A,fieldOrDatumDef:h,legendConfig:c,config:s,scaleType:f,orient:I,legendType:p,direction:jY({legend:o,legendType:p,orient:I,legendConfig:c})},y=Object(U.a)(xY);try{for(y.s();!(g=y.n()).done;){var B=g.value,m=B in MY?MY[B](C):o[B];if(void 0!==m){var b=ZY(m,B,o,t.fieldDef(e));(b||void 0===s.legend[B])&&u.set(B,m,b)}}}catch(N){y.e(N)}finally{y.f()}for(var E=null!==(r=null===o||void 0===o?void 0:o.encoding)&&void 0!==r?r:{},Q=u.get("selections"),F={},w={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:u,legendType:p},S=0,R=["labels","legend","title","symbols","gradient","entries"];S<R.length;S++){var x=R[S],k=wY(null!==(i=E[x])&&void 0!==i?i:{},t),O=x in OY?OY[x](k,w):k;void 0===O||R_(O)||(F[x]=Object.assign(Object.assign(Object.assign({},(null===Q||void 0===Q?void 0:Q.length)&&pZ(h)?{name:"".concat(N_(h.field),"_legend_").concat(x)}:{}),(null===Q||void 0===Q?void 0:Q.length)?{interactive:!!Q}:{}),{update:O}))}return R_(F)||u.set("encode",F,!!(null===o||void 0===o?void 0:o.encoding)),u}function WY(t,e){var n,r,i,o;if(!t)return e.clone();var a=t.getWithExplicit("orient"),A=e.getWithExplicit("orient");if(!a.explicit||!A.explicit||a.value===A.value){var s,c=!1,u=Object(U.a)(xY);try{var l=function(){var n=s.value,r=tJ(t.getWithExplicit(n),e.getWithExplicit(n),n,"legend",(function(t,e){switch(n){case"symbolType":return function(t,e){if("circle"===e.value)return e;return t}(t,e);case"title":return gP(t,e);case"type":return c=!0,KW("symbol")}return $W(t,e,n,"legend")}));t.setWithExplicit(n,r)};for(u.s();!(s=u.n()).done;)l()}catch(g){u.e(g)}finally{u.f()}return c&&((null===(r=null===(n=t.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&G_(t.implicit,["encode","gradient"]),(null===(o=null===(i=t.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&G_(t.explicit,["encode","gradient"])),t}}function JY(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}function HY(t){var e,n=t.component.legends,r={},i=Object(U.a)(U_(n));try{for(i.s();!(e=i.n()).done;){var o=e.value,a=t.getScaleComponent(o),A=C_(a.get("domains"));if(r[A]){var s,c=Object(U.a)(r[A]);try{for(c.s();!(s=c.n()).done;){WY(s.value,n[o])||r[A].push(n[o])}}catch(u){c.e(u)}finally{c.f()}}else r[A]=[n[o].clone()]}}catch(u){i.e(u)}finally{i.f()}return x_(r).flat().map((function(e){return function(t,e){var n,r=t.combine(),i=r.disable,o=r.labelExpr,a=(r.selections,r_(r,["disable","labelExpr","selections"]));if(i)return;!1===e.aria&&void 0==a.aria&&(a.aria=!1);if(null===(n=a.encode)||void 0===n?void 0:n.symbols){var A=a.encode.symbols.update;!A.fill||"transparent"===A.fill.value||A.stroke||a.stroke||(A.stroke={value:"transparent"});var s,c=Object(U.a)(VP);try{for(c.s();!(s=c.n()).done;){var l=s.value;a[l]&&delete A[l]}}catch(u){c.e(u)}finally{c.f()}}a.title||delete a.title;void 0!==o&&JY(a,"labels","text",{signal:o});for(var g in a){var f=a[g];if(wL(f)){var h=ZP[g];if(h){var d=h.vgProp,I=h.part;JY(a,I,d,f),delete a[g]}}}return a}(e,t.config)})).filter((function(t){return void 0!==t}))}function YY(t){return yz(t)||Cz(t)?function(t){return t.children.reduce((function(t,e){return t.concat(e.assembleProjections())}),XY(t))}(t):XY(t)}function XY(t){var e=t.component.projection;if(!e||e.merged)return[];var n=e.combine(),r=n.name;if(e.data){var i={signal:"[".concat(e.size.map((function(t){return t.signal})).join(", "),"]")},o=e.data.reduce((function(e,n){var r=wL(n)?n.signal:"data('".concat(t.lookupDataSource(n),"')");return B_(e,r)||e.push(r),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?"[".concat(o.join(", "),"]"):o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}var zY=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"],KY=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;return Object(F.a)(this,n),(a=e.call(this,Object.assign({},r),{name:t})).specifiedProjection=r,a.size=i,a.data=o,a.merged=!1,a}return Object(w.a)(n,[{key:"isFit",get:function(){return!!this.data}}]),n}(XW);function qY(t){t.component.projection=Iz(t)?function(t){var e;if(t.hasProjection){var n=t.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=r?function(t){for(var e=[],n=t.encoding,r=0,i=[["longitude","latitude"],["longitude2","latitude2"]];r<i.length;r++){var o=i[r];(ZZ(n[o[0]])||ZZ(n[o[1]]))&&e.push({signal:t.getName("geojson_".concat(e.length))})}t.channelHasField(HM)&&t.typedFieldDef(HM).type===qL&&e.push({signal:t.getName("geojson_".concat(e.length))});0===e.length&&e.push(t.requestDataName(cJ));return e}(t):void 0;return new KY(t.projectionName(!0),Object.assign(Object.assign({},null!==(e=t.config.projection)&&void 0!==e?e:{}),null!==n&&void 0!==n?n:{}),i,o)}return}(t):function(t){if(0===t.children.length)return;var e,n,r=Object(U.a)(t.children);try{for(r.s();!(n=r.n()).done;){qY(n.value)}}catch(g){r.e(g)}finally{r.f()}var i=b_(t.children,(function(t){var n=t.component.projection;if(n){if(e){var r=function(t,e){var n=b_(zY,(function(n){return!Object(x.v)(t.explicit,n)&&!Object(x.v)(e.explicit,n)||!(!Object(x.v)(t.explicit,n)||!Object(x.v)(e.explicit,n)||C_(t.get(n))!==C_(e.get(n)))}));if(C_(t.size)===C_(e.size)){if(n)return t;if(C_(t.explicit)===C_({}))return e;if(C_(e.explicit)===C_({}))return t}return null}(e,n);return r&&(e=r),!!r}return e=n,!0}return!0}));if(e&&i){var o,a=t.projectionName(!0),A=new KY(a,e.specifiedProjection,e.size,d_(e.data)),s=Object(U.a)(t.children);try{for(s.s();!(o=s.n()).done;){var c=o.value,u=c.component.projection;if(u){var l;if(u.isFit)(l=A.data).push.apply(l,Object(B.a)(c.component.projection.data));c.renameProjection(u.get("name"),a),u.merged=!0}}}catch(g){s.e(g)}finally{s.f()}return A}return}(t)}var $Y=n(129);function tX(t,e){return"".concat(xT(t),"_").concat(e)}function eX(t,e,n){var r,i=tX(null!==(r=HZ(n,void 0))&&void 0!==r?r:{},e);return t.getName("".concat(i,"_bins"))}function nX(t,e,n){var r,i;r=function(t){return"as"in t}(t)?Object(x.H)(t.as)?[t.as,"".concat(t.as,"_end")]:[t.as[0],t.as[1]]:[UZ(t,{forAs:!0}),UZ(t,{binSuffix:"end",forAs:!0})];var o=Object.assign({},HZ(e,void 0)),a=tX(o,t.field),A=function(t,e){return{signal:t.getName("".concat(e,"_bins")),extentSignal:t.getName("".concat(e,"_extent"))}}(n,a),s=A.signal,c=A.extentSignal;if(DT(o.extent)){var u=o.extent,l=u.selection;i=jH(n.getSelectionComponent(N_(l),l),u),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:t.field,as:[r]},s?{signal:s}:{}),c?{extentSignal:c}:{}),i?{span:i}:{})}}var rX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).bins=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.bins))}},{key:"merge",value:function(t,e){var n,r=Object(U.a)(U_(t.bins));try{for(r.s();!(n=r.n()).done;){var i=n.value;i in this.bins?(e(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=Q_([].concat(Object(B.a)(this.bins[i].as),Object(B.a)(t.bins[i].as)),y_)):this.bins[i]=t.bins[i]}}catch(s){r.e(s)}finally{r.f()}var o,a=Object(U.a)(t.children);try{for(a.s();!(o=a.n()).done;){var A=o.value;t.removeChild(A),A.parent=this}}catch(s){a.e(s)}finally{a.f()}t.remove()}},{key:"producedFields",value:function(){return new Set(x_(this.bins).map((function(t){return t.as})).flat(2))}},{key:"dependentFields",value:function(){return new Set(x_(this.bins).map((function(t){return t.field})))}},{key:"hash",value:function(){return"Bin ".concat(y_(this.bins))}},{key:"assemble",value:function(){return x_(this.bins).flatMap((function(t){var e=[],n=Object($Y.a)(t.as),r=n[0],i=n.slice(1),o=t.bin,a=o.extent,A=r_(o,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:L_(t.field),as:r,signal:t.signal},DT(a)?{extent:null}:{extent:a}),t.span?{span:{signal:"span(".concat(t.span,")")}}:{}),A);!a&&t.extentSignal&&(e.push({type:"extent",field:L_(t.field),signal:t.extentSignal}),s.extent={signal:t.extentSignal}),e.push(s);var c,u=Object(U.a)(i);try{for(u.s();!(c=u.n()).done;)for(var l=c.value,g=0;g<2;g++)e.push({type:"formula",expr:UZ({field:r[g]},{expr:"datum"}),as:l[g]})}catch(f){u.e(f)}finally{u.f()}return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}],[{key:"makeFromEncoding",value:function(t,e){var r=e.reduceFieldDef((function(t,n,r){if(bZ(n)&&kT(n.bin)){var i=nX(n,n.bin,e),o=i.key,a=i.binComponent;t[o]=Object.assign(Object.assign(Object.assign({},a),t[o]),function(t,e,n,r){var i,o;if(qZ(e,n)){var a=Iz(t)&&null!==(o=null!==(i=t.axis(n))&&void 0!==i?i:t.legend(n))&&void 0!==o?o:{},A=UZ(e,{expr:"datum"}),s=UZ(e,{expr:"datum",binSuffix:"end"});return{formulaAs:UZ(e,{binSuffix:"range",forAs:!0}),formula:eZ(A,s,a.format,a.formatType,r)}}return{}}(e,n,r,e.config))}return t}),{});return R_(r)?null:new n(t,r)}},{key:"makeFromTransform",value:function(t,e,r){var i=nX(e,e.bin,r),o=i.key,a=i.binComponent;return new n(t,Object(v.a)({},o,a))}}]),n}(eH),iX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t){var r,i;if(Object(F.a)(this,n),r=e.call(this,null),oJ(t=null!==t&&void 0!==t?t:{name:"source"})||(i=t.format?Object.assign({},p_(t.format,["parse"])):{}),rJ(t))r._data={values:t.values};else if(nJ(t)){if(r._data={url:t.url},!i.type){var o=/(?:\.([^.]+))?$/.exec(t.url)[1];B_(["json","csv","tsv","dsv","topojson"],o)||(o="json"),i.type=o}}else AJ(t)?r._data={values:[{type:"Sphere"}]}:(iJ(t)||oJ(t))&&(r._data={});return r._generator=oJ(t),t.name&&(r._name=t.name),i&&!R_(i)&&(r._data.format=i),r}return Object(w.a)(n,[{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){}},{key:"hasName",value:function(){return!!this._name}},{key:"remove",value:function(){throw new Error("Source nodes are roots and cannot be removed.")}},{key:"hash",value:function(){throw new Error("Cannot hash sources")}},{key:"assemble",value:function(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}},{key:"data",get:function(){return this._data}},{key:"isGenerator",get:function(){return this._generator}},{key:"dataName",get:function(){return this._name},set:function(t){this._name=t}},{key:"parent",set:function(t){throw new Error("Source nodes have to be roots.")}}]),n}(eH);function oX(t){var e,n=Object(U.a)(t);try{for(n.s();!(e=n.n()).done;){var r,i=e.value,o=Object(U.a)(i.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.parent!==i)return console.error("Dataflow graph is inconsistent.",i,a),!1}}catch(A){o.e(A)}finally{o.f()}if(!oX(i.children))return!1}}catch(A){n.e(A)}finally{n.f()}return!0}var aX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).params=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,this.params)}},{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){}},{key:"hash",value:function(){return"Graticule ".concat(y_(this.params))}},{key:"assemble",value:function(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}]),n}(eH),AX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).params=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,this.params)}},{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){var t;return new Set([null!==(t=this.params.as)&&void 0!==t?t:"data"])}},{key:"hash",value:function(){return"Hash ".concat(y_(this.params))}},{key:"assemble",value:function(){return Object.assign({type:"sequence"},this.params)}}]),n}(eH);function sX(t){return t instanceof iX||t instanceof aX||t instanceof AX}var cX=function(){function t(){Object(F.a)(this,t),this._mutated=!1}return Object(w.a)(t,[{key:"setMutated",value:function(){this._mutated=!0}},{key:"mutatedFlag",get:function(){return this._mutated}}]),t}(),uX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t;return Object(F.a)(this,n),(t=e.call(this))._continue=!1,t}return Object(w.a)(n,[{key:"setContinue",value:function(){this._continue=!0}},{key:"reset",value:function(){}},{key:"optimizeNextFromLeaves",value:function(t){if(sX(t))return!1;var e=t.parent;return this.run(t).continueFlag&&this.optimizeNextFromLeaves(e),this.mutatedFlag}},{key:"continueFlag",get:function(){return this._continue}},{key:"flags",get:function(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}},set:function(t){var e=t.continueFlag,n=t.mutatedFlag;e&&this.setContinue(),n&&this.setMutated()}}]),n}(cX),lX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return n}(cX);function gX(t,e,n,r){var i=Iz(r)?r.encoding[gT(e)]:void 0;if(bZ(n)&&Iz(r)&&fZ(e,n,i,r.stack,r.markDef,r.config))t.add(UZ(n,{})),t.add(UZ(n,{suffix:"end"})),n.bin&&qZ(n,e)&&t.add(UZ(n,{binSuffix:"range"}));else if(e in KM){var o=function(t){switch(t){case"latitude":return"y";case"latitude2":return"y2";case"longitude":return"x";case"longitude2":return"x2"}}(e);t.add(r.getName(o))}else t.add(UZ(n));return t}var fX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i){var o;return Object(F.a)(this,n),(o=e.call(this,t)).dimensions=r,o.measures=i,o}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,new Set(this.dimensions),d_(this.measures))}},{key:"merge",value:function(t){return function(t,e){if(t.size!==e.size)return!1;var n,r=Object(U.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!e.has(i))return!1}}catch(o){r.e(o)}finally{r.f()}return!0}(this.dimensions,t.dimensions)?(function(t,e){var n,r,i=Object(U.a)(U_(e));try{for(i.s();!(r=i.n()).done;){var o,a=r.value,A=e[a],s=Object(U.a)(U_(A));try{for(s.s();!(o=s.n()).done;){var c=o.value;a in t?t[a][c]=new Set([].concat(Object(B.a)(null!==(n=t[a][c])&&void 0!==n?n:[]),Object(B.a)(A[c]))):t[a]=Object(v.a)({},c,A[c])}}catch(u){s.e(u)}finally{s.f()}}}catch(u){i.e(u)}finally{i.f()}}(this.measures,t.measures),!0):(function(){var t;(t=iL).debug.apply(t,arguments)}("different dimensions, cannot merge"),!1)}},{key:"addDimensions",value:function(t){t.forEach(this.dimensions.add,this.dimensions)}},{key:"dependentFields",value:function(){return new Set([].concat(Object(B.a)(this.dimensions),Object(B.a)(U_(this.measures))))}},{key:"producedFields",value:function(){var t,e=new Set,n=Object(U.a)(U_(this.measures));try{for(n.s();!(t=n.n()).done;){var r,i=t.value,o=Object(U.a)(U_(this.measures[i]));try{for(o.s();!(r=o.n()).done;){var a=r.value,A=this.measures[i][a];0===A.size?e.add("".concat(a,"_").concat(i)):A.forEach(e.add,e)}}catch(s){o.e(s)}finally{o.f()}}}catch(s){n.e(s)}finally{n.f()}return e}},{key:"hash",value:function(){return"Aggregate ".concat(y_({dimensions:this.dimensions,measures:this.measures}))}},{key:"assemble",value:function(){var t,e=[],n=[],r=[],i=Object(U.a)(U_(this.measures));try{for(i.s();!(t=i.n()).done;){var o,a=t.value,A=Object(U.a)(U_(this.measures[a]));try{for(A.s();!(o=A.n()).done;){var s,c=o.value,u=Object(U.a)(this.measures[a][c]);try{for(u.s();!(s=u.n()).done;){var l=s.value;r.push(l),e.push(c),n.push("*"===a?null:L_(a))}}catch(g){u.e(g)}finally{u.f()}}}catch(g){A.e(g)}finally{A.f()}}}catch(g){i.e(g)}finally{i.f()}return{type:"aggregate",groupby:Object(B.a)(this.dimensions).map(L_),ops:e,fields:n,as:r}}},{key:"groupBy",get:function(){return this.dimensions}}],[{key:"makeFromEncoding",value:function(t,e){var r=!1;e.forEachFieldDef((function(t){t.aggregate&&(r=!0)}));var i={},o=new Set;return r?(e.forEachFieldDef((function(t,n){var r,a,A,s,c=t.aggregate,u=t.field;if(c)if("count"===c)i["*"]=null!==(r=i["*"])&&void 0!==r?r:{},i["*"].count=new Set([UZ(t,{forAs:!0})]);else{if(kM(c)||OM(c)){var l=kM(c)?"argmin":"argmax",g=c[l];i[g]=null!==(a=i[g])&&void 0!==a?a:{},i[g][l]=new Set([UZ({op:l,field:g},{forAs:!0})])}else i[u]=null!==(A=i[u])&&void 0!==A?A:{},i[u][c]=new Set([UZ(t,{forAs:!0})]);FT(n)&&"unaggregated"===e.scaleDomain(n)&&(i[u]=null!==(s=i[u])&&void 0!==s?s:{},i[u].min=new Set([UZ({field:u,aggregate:"min"},{forAs:!0})]),i[u].max=new Set([UZ({field:u,aggregate:"max"},{forAs:!0})]))}else gX(o,n,t,e)})),o.size+U_(i).length===0?null:new n(t,o,i)):null}},{key:"makeFromTransform",value:function(t,e){var r,i,o,a,A=new Set,s={},c=Object(U.a)(e.aggregate);try{for(c.s();!(a=c.n()).done;){var u=a.value,l=u.op,g=u.field,f=u.as;l&&("count"===l?(s["*"]=null!==(r=s["*"])&&void 0!==r?r:{},s["*"].count=new Set([f||UZ(u,{forAs:!0})])):(s[g]=null!==(i=s[g])&&void 0!==i?i:{},s[g][l]=new Set([f||UZ(u,{forAs:!0})])))}}catch(p){c.e(p)}finally{c.f()}var h,d=Object(U.a)(null!==(o=e.groupby)&&void 0!==o?o:[]);try{for(d.s();!(h=d.n()).done;){var I=h.value;A.add(I)}}catch(p){d.e(p)}finally{d.f()}return A.size+U_(s).length===0?null:new n(t,A,s)}}]),n}(eH),hX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;Object(F.a)(this,n),(a=e.call(this,t)).model=r,a.name=i,a.data=o;var A,s=Object(U.a)(nT);try{for(s.s();!(A=s.n()).done;){var c=A.value,u=r.facet[c];if(u){var l=u.bin,g=u.sort;a[c]=Object.assign({name:r.getName("".concat(c,"_domain")),fields:[UZ(u)].concat(Object(B.a)(kT(l)?[UZ(u,{binSuffix:"end"})]:[]))},oZ(g)?{sortField:g}:Object(x.A)(g)?{sortIndexField:aY(u,c)}:{})}}}catch(f){s.e(f)}finally{s.f()}return a.childModel=r.child,a}return Object(w.a)(n,[{key:"hash",value:function(){var t,e="Facet",n=Object(U.a)(nT);try{for(n.s();!(t=n.n()).done;){var r=t.value;this[r]&&(e+=" ".concat(r.charAt(0),":").concat(y_(this[r])))}}catch(i){n.e(i)}finally{n.f()}return e}},{key:"dependentFields",value:function(){var t,e=new Set(this.fields),n=Object(U.a)(nT);try{for(n.s();!(t=n.n()).done;){var r=t.value;this[r]&&(this[r].sortField&&e.add(this[r].sortField.field),this[r].sortIndexField&&e.add(this[r].sortIndexField))}}catch(i){n.e(i)}finally{n.f()}return e}},{key:"producedFields",value:function(){return new Set}},{key:"getSource",value:function(){return this.name}},{key:"getChildIndependentFieldsWithStep",value:function(){var t,e={},n=Object(U.a)(pT);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this.childModel.component.scales[r];if(i&&!i.merged){var o=i.get("type"),a=i.get("range");if(EV(o)&&SL(a)){var A=KX(qX(this.childModel,r));A?e[r]=A:AL("Unknown field for ".concat(r,". Cannot calculate view size."))}}}}catch(s){n.e(s)}finally{n.f()}return e}},{key:"assembleRowColumnHeaderData",value:function(t,e,n){var r={row:"y",column:"x"}[t],i=[],o=[],a=[];n&&n[r]&&(e?(i.push("distinct_".concat(n[r])),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_".concat(n[r])));var A=this[t],s=A.sortField,c=A.sortIndexField;if(s){var u=s.op,l=void 0===u?"min":u,g=s.field;i.push(g),o.push(l),a.push(UZ(s,{forAs:!0}))}else c&&(i.push(c),o.push("max"),a.push(c));return{name:this[t].name,source:null!==e&&void 0!==e?e:this.data,transform:[Object.assign({type:"aggregate",groupby:this[t].fields},i.length?{fields:i,ops:o,as:a}:{})]}}},{key:"assembleFacetHeaderData",value:function(t){var e,n,r,i=this.model.layout.columns,o=this.model.component.layoutHeaders,a=[],A={},s=Object(U.a)(uY);try{for(s.s();!(r=s.n()).done;){var c,u=r.value,l=Object(U.a)(lY);try{for(l.s();!(c=l.n()).done;){var g,f=c.value,h=null!==(e=o[u]&&o[u][f])&&void 0!==e?e:[],d=Object(U.a)(h);try{for(d.s();!(g=d.n()).done;){if((null===(n=g.value.axes)||void 0===n?void 0:n.length)>0){A[u]=!0;break}}}catch(v){d.e(v)}finally{d.f()}}}catch(v){l.e(v)}finally{l.f()}if(A[u]){var I='length(data("'.concat(this.facet.name,'"))'),p="row"===u?i?{signal:"ceil(".concat(I," / ").concat(i,")")}:1:i?{signal:"min(".concat(I,", ").concat(i,")")}:{signal:I};a.push({name:"".concat(this.facet.name,"_").concat(u),transform:[{type:"sequence",start:0,stop:p}]})}}}catch(v){s.e(v)}finally{s.f()}var C=A.row,y=A.column;return(C||y)&&a.unshift(this.assembleRowColumnHeaderData("facet",null,t)),a}},{key:"assemble",value:function(){var t,e,n=[],r=null,i=this.getChildIndependentFieldsWithStep(),o=this.column,a=this.row,A=this.facet;if(o&&a&&(i.x||i.y)){r="cross_".concat(this.column.name,"_").concat(this.row.name);var s=[].concat(null!==(t=i.x)&&void 0!==t?t:[],null!==(e=i.y)&&void 0!==e?e:[]),c=s.map((function(){return"distinct"}));n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:s,ops:c}]})}for(var u=0,l=[jM,TM];u<l.length;u++){var g=l[u];this[g]&&n.push(this.assembleRowColumnHeaderData(g,r,i))}if(A){var f=this.assembleFacetHeaderData(i);f&&n.push.apply(n,Object(B.a)(f))}return n}},{key:"fields",get:function(){var t,e,n=[],r=Object(U.a)(nT);try{for(r.s();!(e=r.n()).done;){var i=e.value;(null===(t=this[i])||void 0===t?void 0:t.fields)&&n.push.apply(n,Object(B.a)(this[i].fields))}}catch(o){r.e(o)}finally{r.f()}return n}}]),n}(eH);function dX(t){return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):t}function IX(t,e){var n=M_(t);if("number"===e)return"toNumber(".concat(n,")");if("boolean"===e)return"toBoolean(".concat(n,")");if("string"===e)return"toString(".concat(n,")");if("date"===e)return"toDate(".concat(n,")");if("flatten"===e)return n;if(0===e.indexOf("date:")){var r=dX(e.slice(5,e.length));return"timeParse(".concat(n,",'").concat(r,"')")}if(0===e.indexOf("utc:")){var i=dX(e.slice(4,e.length));return"utcParse(".concat(n,",'").concat(i,"')")}return AL(p.unrecognizedParse(e)),null}function pX(t){var e={};return function t(e,n){if(g_(e))t(e.not,n);else if(l_(e)){var r,i=Object(U.a)(e.and);try{for(i.s();!(r=i.n()).done;){t(r.value,n)}}catch(A){i.e(A)}finally{i.f()}}else if(u_(e)){var o,a=Object(U.a)(e.or);try{for(a.s();!(o=a.n()).done;){t(o.value,n)}}catch(A){a.e(A)}finally{a.f()}}else n(e)}(t.filter,(function(t){var n;if(LL(t)){var r=null;OL(t)?r=t.equal:ML(t)?r=t.range[0]:TL(t)&&(r=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]),r&&(sL(r)?e[t.field]="date":Object(x.E)(r)?e[t.field]="number":Object(x.H)(r)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function CX(t){var e={};function n(t){var n;XZ(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,Object(x.H)(n)&&B_(["min","max"],n))?e[t.field]="number":P_(t.field)>1?t.field in e||(e[t.field]="flatten"):QZ(t)&&oZ(t.sort)&&P_(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((Iz(t)||pz(t))&&t.forEachFieldDef((function(e,r){if(bZ(e))n(e);else{var i=uT(r),o=t.fieldDef(i);n(Object.assign(Object.assign({},e),{type:o.type}))}})),Iz(t)){var r=t.mark,i=t.markDef,o=t.encoding;if(yM(r)&&!t.encoding.order){var a=o["horizontal"===i.orient?"y":"x"];pZ(a)&&"quantitative"===a.type&&!(a.field in e)&&(e[a.field]="number")}}return e}var yX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t))._parse=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this._parse))}},{key:"hash",value:function(){return"Parse ".concat(y_(this._parse))}},{key:"merge",value:function(t){this._parse=Object.assign(Object.assign({},this._parse),t.parse),t.remove()}},{key:"assembleFormatParse",value:function(){var t,e={},n=Object(U.a)(U_(this._parse));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this._parse[r];1===P_(r)&&(e[r]=i)}}catch(o){n.e(o)}finally{n.f()}return e}},{key:"producedFields",value:function(){return new Set(U_(this._parse))}},{key:"dependentFields",value:function(){return new Set(U_(this._parse))}},{key:"assembleTransforms",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return U_(this._parse).filter((function(t){return!e||P_(t)>1})).map((function(e){var n=IX(e,t._parse[e]);return n?{type:"formula",expr:n,as:Z_(e)}:null})).filter((function(t){return null!==t}))}},{key:"parse",get:function(){return this._parse}}],[{key:"makeExplicit",value:function(t,e,n){var r={},i=e.data;return!oJ(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(t,r,{},n)}},{key:"makeWithAncestors",value:function(t,e,r,i){var o,a=Object(U.a)(U_(r));try{for(a.s();!(o=a.n()).done;){var A=o.value,s=i.getWithExplicit(A);void 0!==s.value&&(s.explicit||s.value===r[A]||"derived"===s.value||"flatten"===r[A]?delete r[A]:AL(p.differentParse(A,r[A],s.value)))}}catch(v){a.e(v)}finally{a.f()}var c,u=Object(U.a)(U_(e));try{for(u.s();!(c=u.n()).done;){var l=c.value,g=i.get(l);void 0!==g&&(g===e[l]?delete e[l]:AL(p.differentParse(l,e[l],g)))}}catch(v){u.e(v)}finally{u.f()}var f=new XW(e,r);i.copyAll(f);var h,d={},I=Object(U.a)(U_(f.combine()));try{for(I.s();!(h=I.n()).done;){var C=h.value,y=f.get(C);null!==y&&(d[C]=y)}}catch(v){I.e(v)}finally{I.f()}return 0===U_(d).length||i.parseNothing?null:new n(t,d)}}]),n}(eH),vX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t){return Object(F.a)(this,n),e.call(this,t)}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null)}}]),Object(w.a)(n,[{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){return new Set(["_vgsid_"])}},{key:"hash",value:function(){return"Identifier"}},{key:"assemble",value:function(){return{type:"identifier",as:"_vgsid_"}}}]),n}(eH),BX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"addDimensions",value:function(t){this.transform.groupby=Q_(this.transform.groupby.concat(t),(function(t){return t}))}},{key:"dependentFields",value:function(){var t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map((function(t){return t.field})).filter((function(t){return void 0!==t})).forEach(t.add,t),t}},{key:"producedFields",value:function(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}},{key:"getDefaultName",value:function(t){var e;return null!==(e=t.as)&&void 0!==e?e:UZ(t)}},{key:"hash",value:function(){return"JoinAggregateTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t,e=[],n=[],r=[],i=Object(U.a)(this.transform.joinaggregate);try{for(i.s();!(t=i.n()).done;){var o=t.value;n.push(o.op),r.push(this.getDefaultName(o)),e.push(void 0===o.field?null:o.field)}}catch(A){i.e(A)}finally{i.f()}var a=this.transform.groupby;return Object.assign({type:"joinaggregate",as:r,ops:n,fields:e},void 0!==a?{groupby:a}:{})}}]),n}(eH);var mX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t))._stack=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this._stack))}},{key:"addDimensions",value:function(t){var e;(e=this._stack.facetby).push.apply(e,Object(B.a)(t))}},{key:"dependentFields",value:function(){var t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}},{key:"producedFields",value:function(){return new Set(this._stack.as)}},{key:"hash",value:function(){return"Stack ".concat(y_(this._stack))}},{key:"getGroupbyFields",value:function(){var t=this._stack,e=t.dimensionFieldDef,n=t.impute,r=t.groupby;return e?e.bin?n?[UZ(e,{binSuffix:"mid"})]:[UZ(e,{}),UZ(e,{binSuffix:"end"})]:[UZ(e)]:null!==r&&void 0!==r?r:[]}},{key:"assemble",value:function(){var t=[],e=this._stack,n=e.facetby,r=e.dimensionFieldDef,i=e.stackField,o=e.stackby,a=e.sort,A=e.offset,s=e.impute,c=e.as;if(s&&r){var u=r.band,l=void 0===u?.5:u;r.bin&&t.push({type:"formula",expr:"".concat(l,"*")+UZ(r,{expr:"datum"})+"+".concat(1-l,"*")+UZ(r,{expr:"datum",binSuffix:"end"}),as:UZ(r,{binSuffix:"mid",forAs:!0})}),t.push({type:"impute",field:i,groupby:[].concat(Object(B.a)(o),Object(B.a)(n)),key:UZ(r,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[].concat(Object(B.a)(this.getGroupbyFields()),Object(B.a)(n)),field:i,sort:a,as:c,offset:A}),t}},{key:"stack",get:function(){return this._stack}}],[{key:"makeFromTransform",value:function(t,e){var r=e.stack,i=e.groupby,o=e.as,a=e.offset,A=void 0===a?"zero":a,s=[],c=[];if(void 0!==e.sort){var u,l=Object(U.a)(e.sort);try{for(l.s();!(u=l.n()).done;){var g=u.value;s.push(g.field),c.push(W_(g.order,"ascending"))}}catch(f){l.e(f)}finally{l.f()}}return new n(t,{stackField:r,groupby:i,offset:A,sort:{field:s,order:c},facetby:[],as:function(t){return Object(x.A)(t)&&t.every((function(t){return Object(x.H)(t)}))&&t.length>1}(o)?o:Object(x.H)(o)?[o,o+"_end"]:[e.stack+"_start",e.stack+"_end"]})}},{key:"makeFromEncoding",value:function(t,e){var r=e.stack,i=e.encoding;if(!r)return null;var o,a=r.groupbyChannel,A=r.fieldChannel,s=r.offset,c=r.impute;a&&(o=VZ(i[a]));var u,l=function(t){return t.stack.stackBy.reduce((function(t,e){var n=UZ(e.fieldDef);return n&&t.push(n),t}),[])}(e),g=e.encoding.order;return u=Object(x.A)(g)||pZ(g)?cP(g):l.reduce((function(t,e){return t.field.push(e),t.order.push("y"===A?"descending":"ascending"),t}),{field:[],order:[]}),new n(t,{dimensionFieldDef:o,stackField:e.vgField(A),facetby:[],stackby:l,sort:u,offset:s,impute:c,as:[e.vgField(A,{suffix:"start",forAs:!0}),e.vgField(A,{suffix:"end",forAs:!0})]})}}]),n}(eH),bX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"addDimensions",value:function(t){this.transform.groupby=Q_(this.transform.groupby.concat(t),(function(t){return t}))}},{key:"dependentFields",value:function(){var t,e,n=new Set;return(null!==(t=this.transform.groupby)&&void 0!==t?t:[]).forEach(n.add,n),(null!==(e=this.transform.sort)&&void 0!==e?e:[]).forEach((function(t){return n.add(t.field)})),this.transform.window.map((function(t){return t.field})).filter((function(t){return void 0!==t})).forEach(n.add,n),n}},{key:"producedFields",value:function(){return new Set(this.transform.window.map(this.getDefaultName))}},{key:"getDefaultName",value:function(t){var e;return null!==(e=t.as)&&void 0!==e?e:UZ(t)}},{key:"hash",value:function(){return"WindowTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t,e,n=[],r=[],i=[],o=[],a=Object(U.a)(this.transform.window);try{for(a.s();!(e=a.n()).done;){var A=e.value;r.push(A.op),i.push(this.getDefaultName(A)),o.push(void 0===A.param?null:A.param),n.push(void 0===A.field?null:A.field)}}catch(p){a.e(p)}finally{a.f()}var s=this.transform.frame,c=this.transform.groupby;if(s&&null===s[0]&&null===s[1]&&r.every((function(t){return NM(t)})))return Object.assign({type:"joinaggregate",as:i,ops:r,fields:n},void 0!==c?{groupby:c}:{});var u=[],l=[];if(void 0!==this.transform.sort){var g,f=Object(U.a)(this.transform.sort);try{for(f.s();!(g=f.n()).done;){var h=g.value;u.push(h.field),l.push(null!==(t=h.order)&&void 0!==t?t:"ascending")}}catch(p){f.e(p)}finally{f.f()}}var d={field:u,order:l},I=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:o,as:i,ops:r,fields:n,sort:d},void 0!==I?{ignorePeers:I}:{}),void 0!==c?{groupby:c}:{}),void 0!==s?{frame:s}:{})}}]),n}(eH),EX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){var e=t.parent;if(t instanceof yX){if(sX(e))return this.flags;if(e.numChildren()>1)return this.setContinue(),this.flags;if(e instanceof yX)this.setMutated(),e.merge(t);else{if(S_(e.producedFields(),t.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),t.swapWithParent()}}return this.setContinue(),this.flags}}]),n}(uX),QX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"mergeNodes",value:function(t,e){var n,r=e.shift(),i=Object(U.a)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.removeChild(o),o.parent=r,o.remove()}}catch(a){i.e(a)}finally{i.f()}}},{key:"run",value:function(t){for(var e=t.children.map((function(t){return t.hash()})),n={},r=0;r<e.length;r++)void 0===n[e[r]]?n[e[r]]=[t.children[r]]:n[e[r]].push(t.children[r]);var i,o=Object(U.a)(U_(n));try{for(o.s();!(i=o.n()).done;){var a=i.value;n[a].length>1&&(this.setMutated(),this.mergeNodes(t,n[a]))}}catch(u){o.e(u)}finally{o.f()}var A,s=Object(U.a)(t.children);try{for(s.s();!(A=s.n()).done;){var c=A.value;this.run(c)}}catch(u){s.e(u)}finally{s.f()}return this.mutatedFlag}}]),n}(lX),FX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){return t instanceof nH||t.numChildren()>0||t instanceof hX||(this.setMutated(),t.remove()),this.flags}}]),n}(uX),wX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t;return Object(F.a)(this,n),(t=e.apply(this,arguments)).fields=new Set,t.prev=null,t}return Object(w.a)(n,[{key:"run",value:function(t){if(this.setContinue(),t instanceof rH){var e=t.producedFields();F_(e,this.fields)?(this.setMutated(),this.prev.remove()):this.fields=new Set([].concat(Object(B.a)(this.fields),Object(B.a)(e))),this.prev=t}return this.flags}},{key:"reset",value:function(){this.fields.clear()}}]),n}(uX),SX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){this.setContinue();var e,n=t.parent.children.filter((function(t){return t instanceof rH})),r=n.pop(),i=Object(U.a)(n);try{for(i.s();!(e=i.n()).done;){var o=e.value;this.setMutated(),r.merge(o)}}catch(a){i.e(a)}finally{i.f()}return this.flags}}]),n}(uX);function RX(t){if(t instanceof hX)if(1!==t.numChildren()||t.children[0]instanceof nH){var e=t.model.component.data.main;!function t(e){if(e instanceof nH&&e.type===cJ&&1===e.numChildren()){var n=e.children[0];n instanceof hX||(n.swapWithParent(),t(e))}}(e);var n,r=(A=t,function t(e){if(!(e instanceof hX)){var n=e.clone();if(n instanceof nH){var r=GX+n.getSource();n.setSource(r),A.model.component.data.outputNodes[r]=n}else(n instanceof fX||n instanceof mX||n instanceof bX||n instanceof BX)&&n.addDimensions(A.fields);var i,o=Object(U.a)(e.children.flatMap(t));try{for(o.s();!(i=o.n()).done;)i.value.parent=n}catch(a){o.e(a)}finally{o.f()}return[n]}return e.children.flatMap(t)}),i=t.children.map(r).flat(),o=Object(U.a)(i);try{for(o.s();!(n=o.n()).done;){n.value.parent=e}}catch(s){o.e(s)}finally{o.f()}}else{var a=t.children[0];(a instanceof fX||a instanceof mX||a instanceof bX||a instanceof BX)&&a.addDimensions(t.fields),a.swapWithParent(),RX(t)}else t.children.map(RX);var A}var UX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.call(this)}return Object(w.a)(n,[{key:"run",value:function(t){t instanceof nH&&!t.isRequired()&&(this.setMutated(),t.remove());var e,n=Object(U.a)(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.run(r)}}catch(i){n.e(i)}finally{n.f()}return this.mutatedFlag}}]),n}(lX),xX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t){var r;return Object(F.a)(this,n),(r=e.call(this)).requiresSelectionId=t&&GH(t),r}return Object(w.a)(n,[{key:"run",value:function(t){t instanceof vX&&(this.requiresSelectionId&&(sX(t.parent)||t.parent instanceof fX||t.parent instanceof yX)||(this.setMutated(),t.remove()));var e,n=Object(U.a)(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.run(r)}}catch(i){n.e(i)}finally{n.f()}return this.mutatedFlag}}]),n}(lX),kX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){var e=t.parent,n=Object(B.a)(e.children),r=e.children.filter((function(t){return t instanceof yX}));if(e.numChildren()>1&&r.length>=1){var i,o={},a=new Set,A=Object(U.a)(r);try{for(A.s();!(i=A.n()).done;){var s,c=i.value.parse,u=Object(U.a)(U_(c));try{for(u.s();!(s=u.n()).done;){var l=s.value;l in o?o[l]!==c[l]&&a.add(l):o[l]=c[l]}}catch(m){u.e(m)}finally{u.f()}}}catch(m){A.e(m)}finally{A.f()}var g,f=Object(U.a)(a);try{for(f.s();!(g=f.n()).done;){delete o[g.value]}}catch(m){f.e(m)}finally{f.f()}if(!R_(o)){this.setMutated();var h,d=new yX(e,o),I=Object(U.a)(n);try{for(I.s();!(h=I.n()).done;){var p=h.value;if(p instanceof yX){var C,y=Object(U.a)(U_(o));try{for(y.s();!(C=y.n()).done;){var v=C.value;delete p.parse[v]}}catch(m){y.e(m)}finally{y.f()}}e.removeChild(p),p.parent=d,p instanceof yX&&0===U_(p.parse).length&&p.remove()}}catch(m){I.e(m)}finally{I.f()}}}return this.setContinue(),this.flags}}]),n}(uX),OX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){var e,n=t.parent,r=n.children.filter((function(t){return t instanceof fX})),i={},o=Object(U.a)(r);try{for(o.s();!(e=o.n()).done;){var a=e.value,A=y_(a.groupBy);A in i||(i[A]=[]),i[A].push(a)}}catch(d){o.e(d)}finally{o.f()}var s,c=Object(U.a)(U_(i));try{for(c.s();!(s=c.n()).done;){var u=i[s.value];if(u.length>1){var l,g=u.pop(),f=Object(U.a)(u);try{for(f.s();!(l=f.n()).done;){var h=l.value;g.merge(h)&&(n.removeChild(h),h.parent=g,h.remove(),this.setMutated())}}catch(d){f.e(d)}finally{f.f()}}}}catch(d){c.e(d)}finally{c.f()}return this.setContinue(),this.flags}}]),n}(uX),NX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t){var r;return Object(F.a)(this,n),(r=e.call(this)).model=t,r}return Object(w.a)(n,[{key:"run",value:function(t){var e,n=t.parent,r=!(sX(n)||n instanceof MH||n instanceof yX||n instanceof vX),i=[],o=[],a=Object(U.a)(n.children);try{for(a.s();!(e=a.n()).done;){var A=e.value;A instanceof rX&&(r&&!S_(n.producedFields(),A.dependentFields())?i.push(A):o.push(A))}}catch(I){a.e(I)}finally{a.f()}if(i.length>0){var s,c=i.pop(),u=Object(U.a)(i);try{for(u.s();!(s=u.n()).done;){var l=s.value;c.merge(l,this.model.renameSignal.bind(this.model))}}catch(I){u.e(I)}finally{u.f()}this.setMutated(),n instanceof rX?n.merge(c,this.model.renameSignal.bind(this.model)):c.swapWithParent()}if(o.length>1){var g,f=o.pop(),h=Object(U.a)(o);try{for(h.s();!(g=h.n()).done;){var d=g.value;f.merge(d,this.model.renameSignal.bind(this.model))}}catch(I){h.e(I)}finally{h.f()}this.setMutated()}return this.setContinue(),this.flags}}]),n}(uX),DX=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"run",value:function(t){var e=t.parent,n=Object(B.a)(e.children);if(!m_(n,(function(t){return t instanceof nH}))||e.numChildren()<=1)return this.setContinue(),this.flags;var r,i,o=[],a=Object(U.a)(n);try{for(a.s();!(i=a.n()).done;){var A=i.value;if(A instanceof nH){for(var s=A;1===s.numChildren();){var c=s.children[0];if(!(c instanceof nH))break;s=c}o.push.apply(o,Object(B.a)(s.children)),r?(e.removeChild(A),A.parent=r.parent,r.parent.removeChild(r),r.parent=s,this.setMutated()):r=s}else o.push(A)}}catch(f){a.e(f)}finally{a.f()}if(o.length){this.setMutated();var u,l=Object(U.a)(o);try{for(l.s();!(u=l.n()).done;){var g=u.value;g.parent.removeChild(g),g.parent=r}}catch(f){l.e(f)}finally{l.f()}}return this.setContinue(),this.flags}}]),n}(uX),GX="scale_";function _X(t){var e=[];function n(t){if(0===t.numChildren())e.push(t);else{var r,i=Object(U.a)(t.children);try{for(i.s();!(r=i.n()).done;){n(r.value)}}catch(o){i.e(o)}finally{i.f()}}}var r,i=Object(U.a)(t);try{for(i.s();!(r=i.n()).done;){n(r.value)}}catch(o){i.e(o)}finally{i.f()}return e}function MX(t){return t}function TX(t,e){return e.map((function(e){if(t instanceof uX){var n=t.optimizeNextFromLeaves(e);return t.reset(),n}return t.run(e)})).some(MX)}function jX(t,e){var n=t.sources,r=new Set;return r.add(TX(new UX,n)),r.add(TX(new xX(e),n)),n=n.filter((function(t){return t.numChildren()>0})),r.add(TX(new FX,_X(n))),n=n.filter((function(t){return t.numChildren()>0})),r.add(TX(new EX,_X(n))),r.add(TX(new NX(e),_X(n))),r.add(TX(new wX,_X(n))),r.add(TX(new kX,_X(n))),r.add(TX(new OX,_X(n))),r.add(TX(new SX,_X(n))),r.add(TX(new QX,n)),r.add(TX(new DX,_X(n))),t.sources=n,r.has(!0)}function LX(t,e){oX(t.sources);for(var n=0,r=0,i=0;i<5&&jX(t,e);i++)n++;t.sources.map(RX);for(var o=0;o<5&&jX(t,e);o++)r++;oX(t.sources),5===Math.max(n,r)&&AL("Maximum optimization runs(".concat(5,") reached."))}var VX=function(){function t(e){Object(F.a)(this,t),Object.defineProperty(this,"signal",{enumerable:!0,get:e})}return Object(w.a)(t,null,[{key:"fromName",value:function(e,n){return new t((function(){return e(n)}))}}]),t}();function ZX(t){Iz(t)?function(t){var e,n=t.component.scales,r=Object(U.a)(U_(n));try{for(r.s();!(e=r.n()).done;){var i=e.value,o=PX(t,i);if(n[i].setWithExplicit("domains",o),YX(t,i),t.component.data.isFaceted){for(var a=t;!pz(a)&&a.parent;)a=a.parent;if("shared"===a.component.resolve.scale[i]){var A,s=Object(U.a)(o.value);try{for(s.s();!(A=s.n()).done;){var c=A.value;RL(c)&&(c.data=GX+c.data.replace(GX,""))}}catch(u){s.e(u)}finally{s.f()}}}}}catch(u){r.e(u)}finally{r.f()}}(t):function(t){var e,n=Object(U.a)(t.children);try{for(n.s();!(e=n.n()).done;){ZX(e.value)}}catch(f){n.e(f)}finally{n.f()}var r,i=t.component.scales,o=Object(U.a)(U_(i));try{for(o.s();!(r=o.n()).done;){var a,A=r.value,s=void 0,c=null,u=Object(U.a)(t.children);try{for(u.s();!(a=u.n()).done;){var l=a.value.component.scales[A];if(l){s=void 0===s?l.getWithExplicit("domains"):tJ(s,l.getWithExplicit("domains"),"domains","scale",zX);var g=l.get("selectionExtent");c&&g&&c.selection!==g.selection&&AL("The same selection must be used to override scale domains in a layered view."),c=g}}}catch(f){u.e(f)}finally{u.f()}i[A].setWithExplicit("domains",s),c&&i[A].set("selectionExtent",c,!0)}}catch(f){o.e(f)}finally{o.f()}}(t)}function PX(t,e){var n=t.getScaleComponent(e).get("type"),r=t.encoding,i=function(t,e,n,r){if("unaggregated"===t){var i=XX(e,n),o=i.valid,a=i.reason;if(!o)return void AL(a)}else if(void 0===t&&r.useUnaggregatedDomain){if(XX(e,n).valid)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]=Object.assign(Object.assign({},t.specifiedScales[e]),{domain:i})),"x"===e&&ZZ(r.x2)?ZZ(r.x)?tJ(JX(n,i,t,"x"),JX(n,i,t,"x2"),"domain","scale",zX):JX(n,i,t,"x2"):"y"===e&&ZZ(r.y2)?ZZ(r.y)?tJ(JX(n,i,t,"y"),JX(n,i,t,"y2"),"domain","scale",zX):JX(n,i,t,"y2"):JX(n,i,t,e)}function WX(t,e,n){var r,i=null===(r=QL(n))||void 0===r?void 0:r.unit;return"temporal"===e||i?function(t,e,n){return t.map((function(t){var r=zZ(t,{timeUnit:n,type:e});return{signal:"{data: ".concat(r,"}")}}))}(t,e,i):[t]}function JX(t,e,n,r){var i=ZZ(n.encoding[r]),o=i.type,a=i.timeUnit;if(function(t){return t&&t.unionWith}(e)){var A=JX(t,void 0,n,r),s=WX(e.unionWith,o,a);return zW([].concat(Object(B.a)(A.value),Object(B.a)(s)))}if(wL(e))return zW([e]);if(e&&"unaggregated"!==e&&!SV(e))return zW(WX(e,o,a));var c=n.stack;if(c&&r===c.fieldChannel){if("normalize"===c.offset)return KW([[0,1]]);var u=n.requestDataName(cJ);return KW([{data:u,field:n.vgField(r,{suffix:"start"})},{data:u,field:n.vgField(r,{suffix:"end"})}])}var l=FT(r)&&pZ(i)?function(t,e,n){if(!EV(n))return;var r=t.fieldDef(e),i=r.sort;if(aZ(i))return{op:"min",field:aY(r,e),order:"ascending"};var o=t.stack,a=o?[].concat(Object(B.a)(o.groupbyField?[o.groupbyField]:[]),Object(B.a)(o.stackBy.map((function(t){return t.fieldDef.field})))):void 0;if(oZ(i)){var A=o&&!B_(a,i.field);return HX(i,A)}if(iZ(i)){var s=i.encoding,c=i.order,u=t.fieldDef(s),l=u.aggregate,g=u.field,f=o&&!B_(a,g);if(kM(l)||OM(l))return HX({field:UZ(u),order:c},f);if(NM(l)||!l)return HX({op:l,field:g,order:c},f)}else{if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(B_(["ascending",void 0],i))return!0}return}(n,r,t):void 0;if(yZ(i))return KW(WX([i.datum],o,a));var g=i;if("unaggregated"===e){var f=n.requestDataName(cJ),h=i.field;return KW([{data:f,field:UZ({field:h,aggregate:"min"})},{data:f,field:UZ({field:h,aggregate:"max"})}])}if(kT(g.bin)){if(EV(t))return KW("bin-ordinal"===t?[]:[{data:O_(l)?n.requestDataName(cJ):n.requestDataName("raw"),field:n.vgField(r,qZ(g,r)?{binSuffix:"range"}:{}),sort:!0!==l&&Object(x.F)(l)?l:{field:n.vgField(r,{}),op:"min"}}]);var d=g.bin;if(kT(d)){var I=eX(n,g.field,d);return KW([new VX((function(){var t=n.getSignalName(I);return"[".concat(t,".start, ").concat(t,".stop]")}))])}return KW([{data:n.requestDataName(cJ),field:n.vgField(r,{})}])}if(g.timeUnit&&B_(["time","utc"],t)&&fZ(r,g,Iz(n)?n.encoding[gT(r)]:void 0,n.stack,n.markDef,n.config)){var p=n.requestDataName(cJ);return KW([{data:p,field:n.vgField(r)},{data:p,field:n.vgField(r,{suffix:"end"})}])}return KW(l?[{data:O_(l)?n.requestDataName(cJ):n.requestDataName("raw"),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(cJ),field:n.vgField(r)}])}function HX(t,e){var n=t.op,r=t.field,i=t.order;return Object.assign(Object.assign({op:null!==n&&void 0!==n?n:e?"sum":"min"},r?{field:L_(r)}:{}),i?{order:i}:{})}function YX(t,e){var n,r=t.component.scales[e],i=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=SV(i)&&i,A=NT(o)&&DT(o.extent)&&o.extent;(a||A)&&r.set("selectionExtent",null!==a&&void 0!==a?a:A,!0)}function XX(t,e){var n=t.aggregate,r=t.type;return n?Object(x.H)(n)&&!MM[n]?{valid:!1,reason:p.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:p.unaggregatedDomainWithLogScale(t)}:{valid:!0}:{valid:!1,reason:p.unaggregateDomainHasNoEffectForRawField(t)}}function zX(t,e,n,r){return t.explicit&&e.explicit&&AL(p.mergeConflictingDomainProperty(n,r,t.value,e.value)),{explicit:t.explicit,value:[].concat(Object(B.a)(t.value),Object(B.a)(e.value))}}function KX(t){if(RL(t)&&Object(x.H)(t.field))return t.field;if(function(t){return!Object(x.A)(t)&&("fields"in t&&!("data"in t))}(t)){var e,n,r=Object(U.a)(t.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(RL(i)&&Object(x.H)(i.field))if(e){if(e!==i.field)return AL(p.FACETED_INDEPENDENT_DIFFERENT_SOURCES),e}else e=i.field}}catch(a){r.e(a)}finally{r.f()}return AL(p.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES),e}if(function(t){return!Object(x.A)(t)&&("fields"in t&&"data"in t)}(t)){AL(p.FACETED_INDEPENDENT_SAME_SOURCE);var o=t.fields[0];return Object(x.H)(o)?o:void 0}}function qX(t,e){return function(t){var e=Q_(t.map((function(t){if(RL(t)){t.sort;return r_(t,["sort"])}return t})),y_),n=Q_(t.map((function(t){if(RL(t)){var e=t.sort;return void 0===e||O_(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}})).filter((function(t){return void 0!==t})),y_);if(0!==e.length){if(1===e.length){var r=t[0];if(RL(r)&&n.length>0){var i=n[0];if(n.length>1)AL(p.MORE_THAN_ONE_SORT),i=!0;else if(Object(x.F)(i)&&"field"in i){var o=i.field;r.field===o&&(i=!i.order||{order:i.order})}return Object.assign(Object.assign({},r),{sort:i})}return r}var a,A=Q_(n.map((function(t){return O_(t)||!("op"in t)||t.op in xM?t:(AL(p.domainSortDropped(t)),!0)})),y_);1===A.length?a=A[0]:A.length>1&&(AL(p.MORE_THAN_ONE_SORT),a=!0);var s=Q_(t.map((function(t){return RL(t)?t.data:null})),(function(t){return t}));return 1===s.length&&null!==s[0]?Object.assign({data:s[0],fields:e.map((function(t){return t.field}))},a?{sort:a}:{}):Object.assign({fields:e},a?{sort:a}:{})}}(t.component.scales[e].get("domains").map((function(e){return RL(e)&&(e.data=t.lookupDataSource(e.data)),e})))}function $X(t){return yz(t)||Cz(t)?t.children.reduce((function(t,e){return t.concat($X(e))}),tz(t)):tz(t)}function tz(t){return U_(t.component.scales).reduce((function(e,n){var r=t.component.scales[n];if(r.merged)return e;var i,o=r.combine(),a=o.name,A=o.type,s=o.selectionExtent,c=(o.domains,o.range,o.reverse),u=r_(o,["name","type","selectionExtent","domains","range","reverse"]),l=function(t,e,n){if(CT(n)&&SL(t))return{step:{signal:e+"_step"}};return t}(o.range,a,n);s&&(i=function(t,e){var n=e.selection;return{signal:jH(t.getSelectionComponent(n,N_(n)),e)}}(t,s));var g=qX(t,n);return e.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:a,type:A},g?{domain:g}:{}),i?{domainRaw:i}:{}),{range:l}),void 0!==c?{reverse:c}:{}),u)),e}),[])}var ez=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,{},{name:t})).merged=!1,i.setWithExplicit("type",r),i}return Object(w.a)(n,[{key:"domainDefinitelyIncludesZero",value:function(){return!1!==this.get("zero")||m_(this.get("domains"),(function(t){return Object(x.A)(t)&&2===t.length&&t[0]<=0&&t[1]>=0}))}}]),n}(XW),nz=["range","scheme"];function rz(t){return"x"===t?"width":"y"===t?"height":void 0}function iz(t,e){var n=t.fieldDef(e);if(n&&n.bin&&kT(n.bin)){var r=eX(t,n.field,n.bin),i=rz(e),o=t.getName(i);return new VX((function(){var e=t.getSignalName(r),n="(".concat(e,".stop - ").concat(e,".start) / ").concat(e,".step");return"".concat(t.getSignalName(o)," / (").concat(n,")")}))}}function oz(t,e){var n,r=e.specifiedScales[t],i=e.size,o=e.getScaleComponent(t).get("type"),a=Object(U.a)(nz);try{for(a.s();!(n=a.n()).done;){var A=n.value;if(void 0!==r[A]){var s=kV(o,A),c=OV(t,A);if(s)if(c)AL(c);else switch(A){case"range":return Object(x.A)(r.range)&&CT(t)?zW(r.range.map((function(t){if("width"===t||"height"===t){var n=e.getName(t),r=e.getSignalName.bind(e);return VX.fromName(r,n)}return t}))):zW(r.range);case"scheme":return zW(az(r[A]))}else AL(p.scalePropertyNotWorkWithScaleType(o,A,t))}}}catch(g){a.e(g)}finally{a.f()}if("x"===t||"y"===t){var u="x"===t?"width":"height",l=i[u];if(KP(l)){if(EV(o))return zW({step:l.step});AL(p.stepDropped(u))}}return KW(function(t,e){var n=e.size,r=e.config,i=e.mark,o=e.encoding,a=e.getSignalName.bind(e),A=ZZ(o[t]).type,s=e.getScaleComponent(t).get("type"),c=e.specifiedScales[t],u=c.domain,l=c.domainMid;switch(t){case"x":case"y":if(B_(["point","band"],s))if("x"!==t||n.width){if("y"===t&&!n.height){var g=nW(r.view,"height");if(KP(g))return g}}else{var f=nW(r.view,"width");if(KP(f))return f}var h=rz(t),d=e.getName(h);return"y"===t&&QV(s)?[VX.fromName(a,d),0]:[0,VX.fromName(a,d)];case YM:var I=e.component.scales[t].get("zero"),C=function t(e,n,r){if(n)return wL(n)?{signal:"".concat(n.signal," ? 0 : ").concat(t(e,!1,r))}:0;switch(e){case"bar":case"tick":return r.scale.minBandSize;case"line":case"trail":case"rule":return r.scale.minStrokeWidth;case"text":return r.scale.minFontSize;case"point":case"square":case"circle":return r.scale.minSize}throw new Error(p.incompatibleChannel("size",e))}(i,I,r),y=function(t,e,n,r){var i={x:iz(n,"x"),y:iz(n,"y")};switch(t){case"bar":case"tick":if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;var o=Az(e,i,r.view);return Object(x.E)(o)?o-1:new VX((function(){return"".concat(o.signal," - 1")}));case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":if(r.scale.maxSize)return r.scale.maxSize;var a=Az(e,i,r.view);return Object(x.E)(a)?Math.pow(.95*a,2):new VX((function(){return"pow(".concat(.95," * ").concat(a.signal,", 2)")}))}throw new Error(p.incompatibleChannel("size",t))}(i,n,e,r);return wV(s)?function(t,e,n){var r=function(){var r=rP(e),i=rP(t),o="(".concat(r," - ").concat(i,") / (").concat(n," - 1)");return"sequence(".concat(i,", ").concat(r," + ").concat(o,", ").concat(o,")")};return wL(e)?new VX(r):{signal:r()}}(C,y,function(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&Object(x.A)(n)?n.length+1:(AL(p.domainRequiredForThresholdScale(r)),3)}}(s,r,u,t)):[C,y];case VM:return[0,2*Math.PI];case"angle":return[0,360];case LM:return[0,new VX((function(){var t=e.getSignalName("width"),n=e.getSignalName("height");return"min(".concat(t,",").concat(n,")/2")}))];case"strokeWidth":return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case"strokeDash":return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case HM:return"symbol";case PM:case WM:case JM:return"ordinal"===s?"nominal"===A?"category":"ordinal":void 0!==l?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case"opacity":case"fillOpacity":case"strokeOpacity":return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel ".concat(t))}(t,e))}function az(t){return function(t){return!Object(x.H)(t)&&!!t.name}(t)?Object.assign({scheme:t.name},p_(t,["name"])):{scheme:t}}function Az(t,e,n){var r=KP(t.width)?t.width.step:eW(n,"width"),i=KP(t.height)?t.height.step:eW(n,"height");return e.x||e.y?new VX((function(){var t=[e.x?e.x.signal:r,e.y?e.y.signal:i];return"min(".concat(t.join(", "),")")})):Math.min(r,i)}function sz(t,e){Iz(t)?function(t,e){var n,r=t.component.scales,i=t.config,o=t.encoding,a=t.markDef,A=t.specifiedScales,s=Object(U.a)(U_(r));try{for(s.s();!(n=s.n()).done;){var c=n.value,u=A[c],l=r[c],g=t.getScaleComponent(c),f=ZZ(o[c]),h=u[e],d=g.get("type"),I=g.get("padding"),C=g.get("paddingInner"),y=kV(d,e),v=OV(c,e);if(void 0!==h&&(y?v&&AL(v):AL(p.scalePropertyNotWorkWithScaleType(d,e,c))),y&&void 0===v)if(void 0!==h)l.copyKeyFromObject(e,u);else{var B=e in cz?cz[e]({model:t,channel:c,fieldOrDatumDef:f,scaleType:d,scalePadding:I,scalePaddingInner:C,domain:u.domain,markDef:a,config:i}):i.scale[e];void 0!==B&&l.set(e,B,!1)}}}catch(m){s.e(m)}finally{s.f()}}(t,e):lz(t,e)}var cz={bins:function(t){var e=t.model,n=t.fieldOrDatumDef;return pZ(n)?function(t,e){var n=e.bin;if(kT(n)){var r=eX(t,e.field,n);return new VX((function(){return t.getSignalName(r)}))}if(OT(n)&&NT(n)&&void 0!==n.step)return{step:n.step};return}(e,n):void 0},interpolate:function(t){return function(t,e){if(B_([PM,WM,JM],t)&&"nominal"!==e)return"hcl";return}(t.channel,t.fieldOrDatumDef.type)},nice:function(t){return function(t,e,n){var r;if((null===(r=VZ(n))||void 0===r?void 0:r.bin)||B_([oV,aV],t))return;return e in IT||void 0}(t.scaleType,t.channel,t.fieldOrDatumDef)},padding:function(t){var e=t.channel,n=t.scaleType,r=t.fieldOrDatumDef,i=t.markDef,o=t.config;return function(t,e,n,r,i,o){if(t in IT){if(FV(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;var a=i.type,A=i.orient;if("bar"===a&&(!pZ(r)||!r.bin&&!r.timeUnit)&&("vertical"===A&&"x"===t||"horizontal"===A&&"y"===t))return o.continuousBandSize}if(e===uV)return n.pointPadding}return}(e,n,o.scale,r,i,o.bar)},paddingInner:function(t){var e=t.scalePadding,n=t.channel,r=t.markDef,i=t.config;return function(t,e,n,r){if(void 0!==t)return;if(e in IT){var i=r.bandPaddingInner,o=r.barBandPaddingInner,a=r.rectBandPaddingInner;return W_(i,"bar"===n?o:a)}return}(e,n,r.type,i.scale)},paddingOuter:function(t){var e=t.scalePadding,n=t.channel,r=t.scaleType,i=t.markDef,o=t.scalePaddingInner,a=t.config;return function(t,e,n,r,i,o){if(void 0!==t)return;if(e in IT){if(n===lV)return W_(o.bandPaddingOuter,wL(i)?{signal:"".concat(i.signal,"/2")}:i/2)}return}(e,n,r,i.type,o,a.scale)},reverse:function(t){var e=t.fieldOrDatumDef,n=t.scaleType,r=t.channel,i=t.config;return function(t,e,n,r){if("x"===n&&void 0!==r.xReverse)return QV(t)&&"descending"===e?wL(r.xReverse)?{signal:"!".concat(r.xReverse.signal)}:!r.xReverse:r.xReverse;if(QV(t)&&"descending"===e)return!0;return}(n,pZ(e)?e.sort:void 0,r,i.scale)},zero:function(t){return function(t,e,n,r,i){if(n&&"unaggregated"!==n&&QV(i)){if(Object(x.A)(n)){var o=n[0],a=n[n.length-1];if(o<=0&&a>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!wV(i))return!0;if((!pZ(e)||!e.bin)&&B_([].concat(Object(B.a)(pT),Object(B.a)(vT)),t)){var A=r.orient;return!B_(["bar","area","line","trail"],r.type)||!("horizontal"===A&&"y"===t||"vertical"===A&&"x"===t)}return!1}(t.channel,t.fieldOrDatumDef,t.domain,t.markDef,t.scaleType)}};function uz(t){Iz(t)?function(t){var e,n=t.component.scales,r=Object(U.a)(QT);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=n[i];if(o){var a=oz(i,t);o.setWithExplicit("range",a)}}}catch(A){r.e(A)}finally{r.f()}}(t):lz(t,"range")}function lz(t,e){var n,r=t.component.scales,i=Object(U.a)(t.children);try{for(i.s();!(n=i.n()).done;){var o=n.value;"range"===e?uz(o):sz(o,e)}}catch(f){i.e(f)}finally{i.f()}var a,A=Object(U.a)(U_(r));try{for(A.s();!(a=A.n()).done;){var s,c=a.value,u=void 0,l=Object(U.a)(t.children);try{for(l.s();!(s=l.n()).done;){var g=s.value.component.scales[c];if(g)u=tJ(u,g.getWithExplicit(e),e,"scale",qW((function(t,n){switch(e){case"range":return t.step&&n.step?t.step-n.step:0}return 0})))}}catch(f){l.e(f)}finally{l.f()}r[c].setWithExplicit(e,u)}}catch(f){A.e(f)}finally{A.f()}}function gz(t,e,n,r){var i=function(t,e,n){var r;switch(e.type){case"nominal":case"ordinal":if(tT(t)||"discrete"===UT(t))return"shape"===t&&"ordinal"===e.type&&AL(p.discreteChannelCannotEncode(t,"ordinal")),"ordinal";if(t in IT){if(B_(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&t in yT)return"band";return void 0!==e.band||FZ(e)&&(null===(r=e.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return tT(t)?"time":"discrete"===UT(t)?(AL(p.discreteChannelCannotEncode(t,"temporal")),"ordinal"):pZ(e)&&e.timeUnit&&QL(e.timeUnit).utc?"utc":"time";case"quantitative":return tT(t)?pZ(e)&&kT(e.bin)?"bin-ordinal":"linear":"discrete"===UT(t)?(AL(p.discreteChannelCannotEncode(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(p.invalidFieldType(e.type))}(e,n,r),o=t.type;return FT(e)?void 0!==o?DV(e,o)?pZ(n)&&!NV(o,n.type)?(AL(p.scaleTypeNotWorkWithFieldDef(o,i)),i):o:(AL(p.scaleTypeNotWorkWithChannel(e,o,i)),i):i:null}function fz(t){Iz(t)?t.component.scales=function(t){var e=t.encoding,n=t.mark;return QT.reduce((function(r,i){var o=ZZ(e[i]);if(o&&n===CM&&i===HM&&o.type===qL)return r;var a=o&&o.scale;if(o&&null!==a&&!1!==a){var A=gz(a=null!==a&&void 0!==a?a:{},i,o,n);r[i]=new ez(t.scaleName(i+"",!0),{value:A,explicit:a.type===A})}return r}),{})}(t):t.component.scales=function(t){var e,n,r=t.component.scales={},i={},o=t.component.resolve,a=Object(U.a)(t.children);try{for(a.s();!(n=a.n()).done;){var A=n.value;fz(A);var s,c=Object(U.a)(U_(A.component.scales));try{for(c.s();!(s=c.n()).done;){var u=s.value;if(o.scale[u]=null!==(e=o.scale[u])&&void 0!==e?e:SY(u,t),"shared"===o.scale[u]){var l=i[u],g=A.component.scales[u].getWithExplicit("type");l?hV(l.value,g.value)?i[u]=tJ(l,g,"type","scale",hz):(o.scale[u]="independent",delete i[u]):i[u]=g}}}catch(m){c.e(m)}finally{c.f()}}}catch(m){a.e(m)}finally{a.f()}var f,h=Object(U.a)(U_(i));try{for(h.s();!(f=h.n()).done;){var d=f.value,I=t.scaleName(d,!0),p=i[d];r[d]=new ez(I,p);var C,y=Object(U.a)(t.children);try{for(y.s();!(C=y.n()).done;){var v=C.value,B=v.component.scales[d];B&&(v.renameScale(B.get("name"),I),B.merged=!0)}}catch(m){y.e(m)}finally{y.f()}}}catch(m){h.e(m)}finally{h.f()}return r}(t)}var hz=qW((function(t,e){return IV(t)-IV(e)}));var dz=function(){function t(){Object(F.a)(this,t),this.nameMap={}}return Object(w.a)(t,[{key:"rename",value:function(t,e){this.nameMap[t]=e}},{key:"has",value:function(t){return void 0!==this.nameMap[t]}},{key:"get",value:function(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}]),t}();function Iz(t){return"unit"===(null===t||void 0===t?void 0:t.type)}function pz(t){return"facet"===(null===t||void 0===t?void 0:t.type)}function Cz(t){return"concat"===(null===t||void 0===t?void 0:t.type)}function yz(t){return"layer"===(null===t||void 0===t?void 0:t.type)}var vz=function(){function t(e,n,r,i,o,a,A){var s,c,u=this;Object(F.a)(this,t),this.type=n,this.parent=r,this.config=o,this.view=A,this.children=[],this.correctDataNames=function(t){return t.from&&t.from.data&&(t.from.data=u.lookupDataSource(t.from.data)),t.from&&t.from.facet&&t.from.facet.data&&(t.from.facet.data=u.lookupDataSource(t.from.facet.data)),t},this.parent=r,this.config=o,this.name=null!==(s=e.name)&&void 0!==s?s:i,this.title=tP(e.title)?{text:e.title}:e.title,this.scaleNameMap=r?r.scaleNameMap:new dz,this.projectionNameMap=r?r.projectionNameMap:new dz,this.signalNameMap=r?r.signalNameMap:new dz,this.data=e.data,this.description=e.description,this.transforms=(null!==(c=e.transform)&&void 0!==c?c:[]).map((function(t){return uJ(t)?{filter:f_(t.filter,JL)}:t})),this.layout="layer"===n||"unit"===n?{}:function(t,e,n){var r,i,o=n[e],a={},A=o.spacing,s=o.columns;void 0!==A&&(a.spacing=A),void 0!==s&&(cZ(t)&&!AZ(t.facet)||YP(t))&&(a.columns=s),XP(t)&&(a.columns=1);var c,u=Object(U.a)($P);try{for(u.s();!(c=u.n()).done;){var l=c.value;if(void 0!==t[l])if("spacing"===l){var g=t[l];a[l]=Object(x.E)(g)?g:{row:null!==(r=g.row)&&void 0!==r?r:A,column:null!==(i=g.column)&&void 0!==i?i:A}}else a[l]=t[l]}}catch(f){u.e(f)}finally{u.f()}return a}(e,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:cZ(e)||r&&r.component.data.isFaceted&&void 0===e.data},layoutSize:new XW,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},a?d_(a):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}return Object(w.a)(t,[{key:"parse",value:function(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}},{key:"parseScale",value:function(){!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.ignoreRange;fz(t),ZX(t);var r,i=Object(U.a)(xV);try{for(i.s();!(r=i.n()).done;){var o=r.value;sz(t,o)}}catch(a){i.e(a)}finally{i.f()}n||uz(t)}(this)}},{key:"parseProjection",value:function(){qY(this)}},{key:"renameTopLevelLayoutSizeSignal",value:function(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}},{key:"parseLegends",value:function(){VY(this)}},{key:"assembleGroupStyle",value:function(){var t,e;if("unit"===this.type||"layer"===this.type)return null!==(e=null===(t=this.view)||void 0===t?void 0:t.style)&&void 0!==e?e:"cell"}},{key:"assembleEncodeFromView",value:function(t){t.style;var e,n=r_(t,["style"]),r={},i=Object(U.a)(U_(n));try{for(i.s();!(e=i.n()).done;){var o=e.value,a=n[o];void 0!==a&&(r[o]=eP(a))}}catch(A){i.e(A)}finally{i.f()}return r}},{key:"assembleGroupEncodeEntry",value:function(t){var e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),t||(this.description&&(e.description=eP(this.description)),"unit"!==this.type&&"layer"!==this.type)?R_(e)?void 0:e:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!==e&&void 0!==e?e:{})}},{key:"assembleLayout",value:function(){if(this.layout){var t=this.layout,e=t.spacing,n=r_(t,["spacing"]),r=this.component,i=this.config,o=function(t,e){var n,r={},i=Object(U.a)(nT);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t[o];if(null===a||void 0===a?void 0:a.facetFieldDef){var A=cY(["titleAnchor","titleOrient"],a.facetFieldDef,e,o),s=A.titleAnchor,c=AY(o,A.titleOrient),u=vY(s,c);void 0!==u&&(r[c]=u)}}}catch(l){i.e(l)}finally{i.f()}return R_(r)?void 0:r}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}}},{key:"assembleDefaultLayout",value:function(){return{}}},{key:"assembleHeaderMarks",value:function(){var t,e=this.component.layoutHeaders,n=[],r=Object(U.a)(nT);try{for(r.s();!(t=r.n()).done;){var i=t.value;e[i].title&&n.push(gY(this,i))}}catch(s){r.e(s)}finally{r.f()}var o,a=Object(U.a)(uY);try{for(a.s();!(o=a.n()).done;){var A=o.value;n=n.concat(dY(this,A))}}catch(s){a.e(s)}finally{a.f()}return n}},{key:"assembleAxes",value:function(){return function(t,e){var n=t.x,r=void 0===n?[]:n,i=t.y,o=void 0===i?[]:i;return[].concat(Object(B.a)(r.map((function(t){return PH(t,"grid",e)}))),Object(B.a)(o.map((function(t){return PH(t,"grid",e)}))),Object(B.a)(r.map((function(t){return PH(t,"main",e)}))),Object(B.a)(o.map((function(t){return PH(t,"main",e)})))).filter((function(t){return t}))}(this.component.axes,this.config)}},{key:"assembleLegends",value:function(){return HY(this)}},{key:"assembleProjections",value:function(){return YY(this)}},{key:"assembleTitle",value:function(){var t,e,n,r=null!==(t=this.title)&&void 0!==t?t:{},i=r.encoding,o=r_(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},$Z(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return B_(["unit","layer"],this.type)?B_(["middle",void 0],a.anchor)&&(a.frame=null!==(e=a.frame)&&void 0!==e?e:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",R_(a)?void 0:a}},{key:"assembleGroup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);var n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());var r=!this.parent||pz(this.parent)?$X(this):[];r.length>0&&(e.scales=r);var i=this.assembleAxes();i.length>0&&(e.axes=i);var o=this.assembleLegends();return o.length>0&&(e.legends=o),e}},{key:"getName",value:function(t){return N_((this.name?this.name+"_":"")+t)}},{key:"requestDataName",value:function(t){var e,n=this.getName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(null!==(e=r[n])&&void 0!==e?e:0)+1,n}},{key:"getSizeSignalRef",value:function(t){if(pz(this.parent)){var e=BT(FY(t)),n=this.component.scales[e];if(n&&!n.merged){var r=n.get("type"),i=n.get("range");if(EV(r)&&SL(i)){var o=n.get("name"),a=KX(qX(this,e));return a?{signal:QY(o,n,UZ({aggregate:"distinct",field:a},{expr:"datum"}))}:(AL("Unknown field for ".concat(e,". Cannot calculate view size.")),null)}}}return{signal:this.signalNameMap.get(this.getName(t))}}},{key:"lookupDataSource",value:function(t){var e=this.component.data.outputNodes[t];return e?e.getSource():t}},{key:"getSignalName",value:function(t){return this.signalNameMap.get(t)}},{key:"renameSignal",value:function(t,e){this.signalNameMap.rename(t,e)}},{key:"renameScale",value:function(t,e){this.scaleNameMap.rename(t,e)}},{key:"renameProjection",value:function(t,e){this.projectionNameMap.rename(t,e)}},{key:"scaleName",value:function(t,e){return e?this.getName(t):AT(t)&&FT(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}},{key:"projectionName",value:function(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}},{key:"getScaleComponent",value:function(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");var e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}},{key:"getSelectionComponent",value:function(t,e){var n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(p.selectionNotFound(e));return n}},{key:"hasAxisOrientSignalRef",value:function(){var t,e;return(null===(t=this.component.axes.x)||void 0===t?void 0:t.some((function(t){return t.hasOrientSignalRef()})))||(null===(e=this.component.axes.y)||void 0===e?void 0:e.some((function(t){return t.hasOrientSignalRef()})))}},{key:"width",get:function(){return this.getSizeSignalRef("width")}},{key:"height",get:function(){return this.getSizeSignalRef("height")}}]),t}(),Bz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"vgField",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.fieldDef(t);if(n)return UZ(n,e)}},{key:"reduceFieldDef",value:function(t,e){return yP(this.getMapping(),(function(e,n,r){var i=VZ(n);return i?t(e,i,r):e}),e)}},{key:"forEachFieldDef",value:function(t,e){CP(this.getMapping(),(function(e,n){var r=VZ(e);r&&t(r,n)}),e)}}]),n}(vz),mz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i,o,a,A;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var s=null!==(o=i.transform.as)&&void 0!==o?o:[void 0,void 0];return i.transform.as=[null!==(a=s[0])&&void 0!==a?a:"value",null!==(A=s[1])&&void 0!==A?A:"density"],i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.density].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"DensityTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform,e=t.density,n=r_(t,["density"]);return Object.assign({type:"kde",field:e},n)}}]),n}(eH),bz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).filter=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,Object.assign({},this.filter))}},{key:"dependentFields",value:function(){return new Set(U_(this.filter))}},{key:"producedFields",value:function(){return new Set}},{key:"hash",value:function(){return"FilterInvalid ".concat(y_(this.filter))}},{key:"assemble",value:function(){var t=this,e=U_(this.filter).reduce((function(e,n){var r=t.filter[n],i=UZ(r,{expr:"datum"});return null!==r&&("temporal"===r.type?e.push("(isDate(".concat(i,") || (isValid(").concat(i,") && isFinite(+").concat(i,")))")):"quantitative"===r.type&&(e.push("isValid(".concat(i,")")),e.push("isFinite(+".concat(i,")")))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}],[{key:"make",value:function(t,e){var r=e.config,i=e.mark;if("filter"!==oP("invalid",e.markDef,r))return null;var o=e.reduceFieldDef((function(t,n,r){var o=FT(r)&&e.getScaleComponent(r);o&&(QV(o.get("type"))&&"count"!==n.aggregate&&!yM(i)&&(t[n.field]=n));return t}),{});return U_(o).length?new n(t,o):null}}]),n}(eH),Ez=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var o=i.transform,a=o.flatten,A=o.as,s=void 0===A?[]:A;return i.transform.as=a.map((function(t,e){var n;return null!==(n=s[e])&&void 0!==n?n:t})),i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(this.parent,d_(this.transform))}},{key:"dependentFields",value:function(){return new Set(this.transform.flatten)}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"FlattenTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform;return{type:"flatten",fields:t.flatten,as:t.as}}}]),n}(eH),Qz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i,o,a,A;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var s=null!==(o=i.transform.as)&&void 0!==o?o:[void 0,void 0];return i.transform.as=[null!==(a=s[0])&&void 0!==a?a:"key",null!==(A=s[1])&&void 0!==A?A:"value"],i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){return new Set(this.transform.fold)}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"FoldTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform;return{type:"fold",fields:t.fold,as:t.as}}}]),n}(eH),Fz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;return Object(F.a)(this,n),(a=e.call(this,t)).fields=r,a.geojson=i,a.signal=o,a}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.fields),this.geojson,this.signal)}},{key:"dependentFields",value:function(){var t,e=(null!==(t=this.fields)&&void 0!==t?t:[]).filter(x.H);return new Set([].concat(Object(B.a)(this.geojson?[this.geojson]:[]),Object(B.a)(e)))}},{key:"producedFields",value:function(){return new Set}},{key:"hash",value:function(){return"GeoJSON ".concat(this.geojson," ").concat(this.signal," ").concat(y_(this.fields))}},{key:"assemble",value:function(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}],[{key:"parseAll",value:function(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;for(var r=0,i=0,o=[["longitude","latitude"],["longitude2","latitude2"]];i<o.length;i++){var a=o[i].map((function(t){var n=ZZ(e.encoding[t]);return pZ(n)?n.field:yZ(n)?{expr:"".concat(n.datum)}:EZ(n)?{expr:"".concat(n.value)}:void 0}));(a[0]||a[1])&&(t=new n(t,a,null,e.getName("geojson_".concat(r++))))}if(e.channelHasField(HM)){var A=e.typedFieldDef(HM);A.type===qL&&(t=new n(t,null,A.field,e.getName("geojson_".concat(r++))))}return t}}]),n}(eH),wz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;return Object(F.a)(this,n),(a=e.call(this,t)).projection=r,a.fields=i,a.as=o,a}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,this.projection,d_(this.fields),d_(this.as))}},{key:"dependentFields",value:function(){return new Set(this.fields.filter(x.H))}},{key:"producedFields",value:function(){return new Set(this.as)}},{key:"hash",value:function(){return"Geopoint ".concat(this.projection," ").concat(y_(this.fields)," ").concat(y_(this.as))}},{key:"assemble",value:function(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}],[{key:"parseAll",value:function(t,e){if(!e.projectionName())return t;for(var r=0,i=[["longitude","latitude"],["longitude2","latitude2"]];r<i.length;r++){var o=i[r],a=o.map((function(t){var n=ZZ(e.encoding[t]);return pZ(n)?n.field:yZ(n)?{expr:"".concat(n.datum)}:EZ(n)?{expr:"".concat(n.value)}:void 0})),A="longitude2"===o[0]?"2":"";(a[0]||a[1])&&(t=new n(t,e.projectionName(),a,[e.getName("x"+A),e.getName("y"+A)]))}return t}}]),n}(eH),Sz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.impute,this.transform.key].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"producedFields",value:function(){return new Set([this.transform.impute])}},{key:"processSequence",value:function(t){var e=t.start,n=void 0===e?0:e,r=t.stop,i=t.step,o=[n,r].concat(Object(B.a)(i?[i]:[])).join(",");return{signal:"sequence(".concat(o,")")}}},{key:"hash",value:function(){return"Impute ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t,e=this.transform,n=e.impute,r=e.key,i=e.keyvals,o=e.method,a=e.groupby,A=e.value,s=e.frame,c=void 0===s?[null,null]:s,u=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:n,key:r},i?{keyvals:(t=i,void 0!==(null===t||void 0===t?void 0:t.stop)?this.processSequence(i):i)}:{}),{method:"value"}),a?{groupby:a}:{}),{value:o&&"value"!==o?null:A});return o&&"value"!==o?[u,Object.assign({type:"window",as:["imputed_".concat(n,"_value")],ops:[o],fields:[n],frame:c,ignorePeers:!1},a?{groupby:a}:{}),{type:"formula",expr:"datum.".concat(n," === null ? datum.imputed_").concat(n,"_value : datum.").concat(n),as:n}]:[u]}}],[{key:"makeFromTransform",value:function(t,e){return new n(t,e)}},{key:"makeFromEncoding",value:function(t,e){var r=e.encoding,i=r.x,o=r.y;if(pZ(i)&&pZ(o)){var a=i.impute?i:o.impute?o:void 0;if(void 0===a)return;var A=i.impute?o:o.impute?i:void 0,s=a.impute,c=s.method,u=s.value,l=s.frame,g=s.keyvals,f=vP(e.mark,r);return new n(t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:a.field,key:A.field},c?{method:c}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==g?{keyvals:g}:{}),f.length?{groupby:f}:{}))}return null}}]),n}(eH),Rz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i,o,a,A;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var s=null!==(o=i.transform.as)&&void 0!==o?o:[void 0,void 0];return i.transform.as=[null!==(a=s[0])&&void 0!==a?a:r.on,null!==(A=s[1])&&void 0!==A?A:r.loess],i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.loess,this.transform.on].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"LoessTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform,e=t.loess,n=t.on,r=r_(t,["loess","on"]);return Object.assign({type:"loess",x:n,y:e},r)}}]),n}(eH),Uz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i){var o;return Object(F.a)(this,n),(o=e.call(this,t)).transform=r,o.secondary=i,o}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform),this.secondary)}},{key:"dependentFields",value:function(){return new Set([this.transform.lookup])}},{key:"producedFields",value:function(){return new Set(this.transform.as?Object(x.i)(this.transform.as):this.transform.from.fields)}},{key:"hash",value:function(){return"Lookup ".concat(y_({transform:this.transform,secondary:this.secondary}))}},{key:"assemble",value:function(){var t;if(this.transform.from.fields)t=Object.assign({values:this.transform.from.fields},this.transform.as?{as:Object(x.i)(this.transform.as)}:{});else{var e=this.transform.as;Object(x.H)(e)||(AL(p.NO_FIELDS_NEEDS_AS),e="_lookup"),t={as:[e]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},t),this.transform.default?{default:this.transform.default}:{})}}],[{key:"make",value:function(t,e,r,i){var o=e.component.data.sources,a=r.from,A=null;if(function(t){return"data"in t}(a)){var s=Jz(a.data,o);s||(s=new iX(a.data),o.push(s));var c=e.getName("lookup_".concat(i));A=new nH(s,c,"lookup",e.component.data.outputNodeRefCounts),e.component.data.outputNodes[c]=A}else if(function(t){return"selection"in t}(a)){var u=a.selection;if(r=Object.assign({as:u},r),!(A=e.getSelectionComponent(N_(u),u).materialized))throw new Error(p.noSameUnitLookup(u))}return new n(t,r,A.getSource())}}]),n}(eH),xz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i,o,a,A;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var s=null!==(o=i.transform.as)&&void 0!==o?o:[void 0,void 0];return i.transform.as=[null!==(a=s[0])&&void 0!==a?a:"prob",null!==(A=s[1])&&void 0!==A?A:"value"],i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.quantile].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"QuantileTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform,e=t.quantile,n=r_(t,["quantile"]);return Object.assign({type:"quantile",field:e},n)}}]),n}(eH),kz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i,o,a,A;Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i.transform=d_(r);var s=null!==(o=i.transform.as)&&void 0!==o?o:[void 0,void 0];return i.transform.as=[null!==(a=s[0])&&void 0!==a?a:r.on,null!==(A=s[1])&&void 0!==A?A:r.regression],i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.regression,this.transform.on].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"producedFields",value:function(){return new Set(this.transform.as)}},{key:"hash",value:function(){return"RegressionTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform,e=t.regression,n=t.on,r=r_(t,["regression","on"]);return Object.assign({type:"regression",x:n,y:e},r)}}]),n}(eH),Oz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"addDimensions",value:function(t){var e;this.transform.groupby=Q_((null!==(e=this.transform.groupby)&&void 0!==e?e:[]).concat(t),(function(t){return t}))}},{key:"producedFields",value:function(){}},{key:"dependentFields",value:function(){var t;return new Set([this.transform.pivot,this.transform.value].concat(Object(B.a)(null!==(t=this.transform.groupby)&&void 0!==t?t:[])))}},{key:"hash",value:function(){return"PivotTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){var t=this.transform,e=t.pivot,n=t.value,r=t.groupby,i=t.limit,o=t.op;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:n},void 0!==i?{limit:i}:{}),void 0!==o?{op:o}:{}),void 0!==r?{groupby:r}:{})}}]),n}(eH),Nz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r){var i;return Object(F.a)(this,n),(i=e.call(this,t)).transform=r,i}return Object(w.a)(n,[{key:"clone",value:function(){return new n(null,d_(this.transform))}},{key:"dependentFields",value:function(){return new Set}},{key:"producedFields",value:function(){return new Set}},{key:"hash",value:function(){return"SampleTransform ".concat(y_(this.transform))}},{key:"assemble",value:function(){return{type:"sample",size:this.transform.sample}}}]),n}(eH);function Dz(t){var e=0;return function n(r,i){var o,a,A;if(r instanceof iX&&(r.isGenerator||nJ(r.data)||(t.push(i),i={name:null,source:i.name,transform:[]})),r instanceof yX&&(r.parent instanceof iX&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),(a=i.transform).push.apply(a,Object(B.a)(r.assembleTransforms(!0)))):(A=i.transform).push.apply(A,Object(B.a)(r.assembleTransforms()))),r instanceof hX){i.name||(i.name="data_".concat(e++)),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source;var s,c=Object(U.a)(r.assemble());try{for(c.s();!(s=c.n()).done;){var u=s.value;t.push(u)}}catch(d){c.e(d)}finally{c.f()}}else{var l;if((r instanceof aX||r instanceof AX||r instanceof bz||r instanceof MH||r instanceof oY||r instanceof wz||r instanceof Fz||r instanceof fX||r instanceof Uz||r instanceof bX||r instanceof BX||r instanceof Qz||r instanceof Ez||r instanceof mz||r instanceof Rz||r instanceof xz||r instanceof kz||r instanceof vX||r instanceof Nz||r instanceof Oz)&&i.transform.push(r.assemble()),r instanceof rX||r instanceof rH||r instanceof Sz||r instanceof mX)(l=i.transform).push.apply(l,Object(B.a)(r.assemble()));if(r instanceof nH)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof nH)r.setSource(i.name);else{if(i.name||(i.name="data_".concat(e++)),r.setSource(i.name),1===r.numChildren())t.push(i),i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof nH&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:i.name||(i.name="data_".concat(e++));var g=i.name;!i.source||i.transform.length>0?t.push(i):g=i.source;var f,h=Object(U.a)(r.children);try{for(h.s();!(f=h.n()).done;){n(f.value,{name:null,source:g,transform:[]})}}catch(d){h.e(d)}finally{h.f()}}}}}function Gz(t,e){var n,r,i,o=[],a=Dz(o),A=0,s=Object(U.a)(t.sources);try{for(s.s();!(i=s.n()).done;){var c=i.value;c.hasName()||(c.dataName="source_".concat(A++));var u=c.assemble();a(c,u)}}catch(R){s.e(R)}finally{s.f()}for(var l=0,g=o;l<g.length;l++){var f=g[l];0===f.transform.length&&delete f.transform}var h,d=0,I=Object(U.a)(o.entries());try{for(I.s();!(h=I.n()).done;){var p=Object(QA.a)(h.value,2),C=p[0],y=p[1];0!==(null!==(n=y.transform)&&void 0!==n?n:[]).length||y.source||o.splice(d++,0,o.splice(C,1)[0])}}catch(R){I.e(R)}finally{I.f()}for(var v=0,B=o;v<B.length;v++){var m,b=B[v],E=Object(U.a)(null!==(r=b.transform)&&void 0!==r?r:[]);try{for(E.s();!(m=E.n()).done;){var Q=m.value;"lookup"===Q.type&&(Q.from=t.outputNodes[Q.from].getSource())}}catch(R){E.e(R)}finally{E.f()}}for(var F=0,w=o;F<w.length;F++){var S=w[F];S.name in e&&(S.values=e[S.name])}return o}function _z(t,e){var n,r=t.facet,i=t.config,o=t.child,a=t.component;if(t.channelHasField(e)){var A=r[e],s=sY("title",null,i,e),c=MZ(A,i,{allowDisabling:!0,includeDefault:void 0===s||!!s});o.component.layoutHeaders[e].title&&(c=Object(x.A)(c)?c.join(", "):c,c+=" / "+o.component.layoutHeaders[e].title,o.component.layoutHeaders[e].title=null);var u=sY("labelOrient",A,i,e),l=W_((null!==(n=A.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),g=B_(["bottom","right"],u)?"footer":"header";a.layoutHeaders[e]=Object(v.a)({title:c,facetFieldDef:A},g,"facet"===e?[]:[Mz(t,e,l)])}}function Mz(t,e,n){var r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function Tz(t,e){var n,r,i=t.child;if(i.component.axes[e]){var o=t.component,a=o.layoutHeaders,A=o.resolve;if(A.axis[e]=RY(A,e),"shared"===A.axis[e]){var s,c="x"===e?"column":"row",u=a[c],l=Object(U.a)(i.component.axes[e]);try{for(l.s();!(s=l.n()).done;){var g=s.value,f="top"===(r=g.get("orient"))||"left"===r||wL(r)?"header":"footer";u[f]=null!==(n=u[f])&&void 0!==n?n:[Mz(t,c,!1)];var h=PH(g,"main",t.config,{header:!0});h&&u[f][0].axes.push(h),g.mainExtracted=!0}}catch(d){l.e(d)}finally{l.f()}}}}function jz(t){Lz(t);var e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";Vz(t,e),Vz(t,n)}function Lz(t){var e,n=Object(U.a)(t.children);try{for(n.s();!(e=n.n()).done;){e.value.parseLayoutSize()}}catch(r){n.e(r)}finally{n.f()}}function Vz(t,e){var n,r,i=FY(e),o=BT(i),a=t.component.resolve,A=t.component.layoutSize,s=Object(U.a)(t.children);try{for(s.s();!(r=s.n()).done;){var c=r.value.component.layoutSize.getWithExplicit(i),u=a.scale[o];if("independent"===u&&"step"===c.value){n=void 0;break}if(n){if("independent"===u&&n.value!==c.value){n=void 0;break}n=tJ(n,c,i,"")}else n=c}}catch(h){s.e(h)}finally{s.f()}if(n){var l,g=Object(U.a)(t.children);try{for(g.s();!(l=g.n()).done;){var f=l.value;t.renameSignal(f.getName(i),t.getName(e)),f.component.layoutSize.set(i,"merged",!1)}}catch(h){g.e(h)}finally{g.f()}A.setWithExplicit(e,n)}else A.setWithExplicit(e,{explicit:!1,value:void 0})}function Zz(t,e){var n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){var o=i.get("type"),a=i.get("range");if(EV(o)){var A=nW(r.view,e);return SL(a)||KP(A)?"step":A}return tW(r.view,e)}if(t.hasProjection||"arc"===t.mark)return tW(r.view,e);var s=nW(r.view,e);return KP(s)?s.step:s}function Pz(t,e,n){return UZ(e,Object.assign({suffix:"by_".concat(UZ(t))},null!==n&&void 0!==n?n:{}))}var Wz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a;return Object(F.a)(this,n),(a=e.call(this,t,"facet",r,i,o,t.resolve)).child=CK(t.spec,Object(D.a)(a),a.getName("child"),void 0,o),a.children=[a.child],a.facet=a.initFacet(t.facet,o),a}return Object(w.a)(n,[{key:"initFacet",value:function(t,e){return AZ(t)?yP(t,(function(t,n,r){return B_([TM,jM],r)?void 0===n.field?(AL(p.emptyFieldDef(n,r)),t):(t[r]=PZ(n,r,e),t):(AL(p.incompatibleChannel(r,"facet")),t)}),{}):{facet:PZ(t,"facet",e)}}},{key:"channelHasField",value:function(t){return!!this.facet[t]}},{key:"fieldDef",value:function(t){return this.facet[t]}},{key:"parseData",value:function(){this.component.data=Yz(this),this.child.parseData()}},{key:"parseLayoutSize",value:function(){Lz(this)}},{key:"parseSelections",value:function(){this.child.parseSelections(),this.component.selection=this.child.component.selection}},{key:"parseMarkGroup",value:function(){this.child.parseMarkGroup()}},{key:"parseAxesAndHeaders",value:function(){this.child.parseAxesAndHeaders(),function(t){var e,n=Object(U.a)(nT);try{for(n.s();!(e=n.n()).done;){_z(t,e.value)}}catch(r){n.e(r)}finally{n.f()}Tz(t,"x"),Tz(t,"y")}(this)}},{key:"assembleSelectionTopLevelSignals",value:function(t){return this.child.assembleSelectionTopLevelSignals(t)}},{key:"assembleSignals",value:function(){return this.child.assembleSignals(),[]}},{key:"assembleSelectionData",value:function(t){return this.child.assembleSelectionData(t)}},{key:"getHeaderLayoutMixins",value:function(){var t,e,n,r,i={},o=Object(U.a)(nT);try{for(o.s();!(r=o.n()).done;){var a,A=r.value,s=Object(U.a)(lY);try{for(s.s();!(a=s.n()).done;){var c=a.value,u=this.component.layoutHeaders[A],l=u[c],g=u.facetFieldDef;if(g){var f=sY("titleOrient",g,this.config,A);if(B_(["right","bottom"],f)){var h=AY(A,f);i.titleAnchor=null!==(t=i.titleAnchor)&&void 0!==t?t:{},i.titleAnchor[h]="end"}}if(null===l||void 0===l?void 0:l[0]){var d="row"===A?"height":"width",I="header"===c?"headerBand":"footerBand";"facet"===A||this.child.component.layoutSize.get(d)||(i[I]=null!==(e=i[I])&&void 0!==e?e:{},i[I][A]=.5),u.title&&(i.offset=null!==(n=i.offset)&&void 0!==n?n:{},i.offset["row"===A?"rowTitle":"columnTitle"]=10)}}}catch(p){s.e(p)}finally{s.f()}}}catch(p){o.e(p)}finally{o.f()}return i}},{key:"assembleDefaultLayout",value:function(){var t=this.facet,e=t.column,n=t.row,r=e?this.columnDistinctSignal():n?1:void 0,i="all";return(n||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),r?{columns:r}:{}),{bounds:"full",align:i})}},{key:"assembleLayoutSignals",value:function(){return this.child.assembleLayoutSignals()}},{key:"columnDistinctSignal",value:function(){if(!(this.parent&&this.parent instanceof n)){var t=this.getName("column_domain");return{signal:"length(data('".concat(t,"'))")}}}},{key:"assembleGroup",value:function(t){return this.parent&&this.parent instanceof n?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:UZ(this.facet.column,{prefix:"distinct"})}}}}:{}),Object(yW.a)(Object(CW.a)(n.prototype),"assembleGroup",this).call(this,t)):Object(yW.a)(Object(CW.a)(n.prototype),"assembleGroup",this).call(this,t)}},{key:"getCardinalityAggregateForChild",value:function(){var t=[],e=[],r=[];if(this.child instanceof n){if(this.child.channelHasField("column")){var i=UZ(this.child.facet.column);t.push(i),e.push("distinct"),r.push("distinct_".concat(i))}}else{var o,a=Object(U.a)(pT);try{for(a.s();!(o=a.n()).done;){var A=o.value,s=this.child.component.scales[A];if(s&&!s.merged){var c=s.get("type"),u=s.get("range");if(EV(c)&&SL(u)){var l=KX(qX(this.child,A));l?(t.push(l),e.push("distinct"),r.push("distinct_".concat(l))):AL("Unknown field for ".concat(A,". Cannot calculate view size."))}}}}catch(g){a.e(g)}finally{a.f()}}return{fields:t,ops:e,as:r}}},{key:"assembleFacet",value:function(){var t,e=this.component.data.facetRoot,n=e.name,r=e.data,i=this.facet,o=i.row,a=i.column,A=this.getCardinalityAggregateForChild(),s=A.fields,c=A.ops,u=A.as,l=[],g=Object(U.a)(nT);try{for(g.s();!(t=g.n()).done;){var f=t.value,h=this.facet[f];if(h){l.push(UZ(h));var d=h.bin,I=h.sort;if(kT(d)&&l.push(UZ(h,{binSuffix:"end"})),oZ(I)){var p=I.field,C=I.op,y=void 0===C?"min":C,v=Pz(h,I);o&&a?(s.push(v),c.push("max"),u.push(v)):(s.push(p),c.push(y),u.push(v))}else if(Object(x.A)(I)){var B=aY(h,f);s.push(B),c.push("max"),u.push(B)}}}}catch(b){g.e(b)}finally{g.f()}var m=!!o&&!!a;return Object.assign({name:n,data:r,groupby:l},m||s.length>0?{aggregate:Object.assign(Object.assign({},m?{cross:m}:{}),s.length?{fields:s,ops:c,as:u}:{})}:{})}},{key:"facetSortFields",value:function(t){var e=this.facet[t];return e?oZ(e.sort)?[Pz(e,e.sort,{expr:"datum"})]:Object(x.A)(e.sort)?[aY(e,t,{expr:"datum"})]:[UZ(e,{expr:"datum"})]:[]}},{key:"facetSortOrder",value:function(t){var e=this.facet[t];if(e){var n=e.sort;return[(oZ(n)?n.order:!Object(x.A)(n)&&n)||"ascending"]}return[]}},{key:"assembleLabelTitle",value:function(){var t=this.facet,e=this.config;if(t.facet)return pY(t.facet,"facet",e);var n,r={row:["top","bottom"],column:["left","right"]},i=Object(U.a)(uY);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(t[o]){var a=sY("labelOrient",t[o],e,o);if(B_(r[o],a))return pY(t[o],o,e)}}}catch(A){i.e(A)}finally{i.f()}}},{key:"assembleMarks",value:function(){var t=this,e=this.child,n=function(t){var e,n=[],r=Dz(n),i=Object(U.a)(t.children);try{for(i.s();!(e=i.n()).done;){r(e.value,{source:t.name,name:null,transform:[]})}}catch(o){i.e(o)}finally{i.f()}return n}(this.component.data.facetRoot),r=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),o=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},i?{title:i}:{}),o?{style:o}:{}),{from:{facet:this.assembleFacet()},sort:{field:nT.map((function(e){return t.facetSortFields(e)})).flat(),order:nT.map((function(e){return t.facetSortOrder(e)})).flat()}}),n.length>0?{data:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup(function(t,e){if(t.component.selection&&U_(t.component.selection).length){var n=Object(x.Z)(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:vN("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(n,").datum")}]})}return BH(e)}(this,[])))]}},{key:"getMapping",value:function(){return this.facet}}]),n}(Bz);function Jz(t,e){var n,r,i,o,a,A,s,c,u,l,g,f=Object(U.a)(e);try{for(f.s();!(g=f.n()).done;){var h=g.value,d=h.data;if((!t.name||!h.hasName()||t.name===h.dataName)&&((!(null===(n=t.format)||void 0===n?void 0:n.mesh)||!(null===(r=d.format)||void 0===r?void 0:r.feature))&&(!(null===(i=t.format)||void 0===i?void 0:i.feature)&&!(null===(o=d.format)||void 0===o?void 0:o.feature)||(null===(a=t.format)||void 0===a?void 0:a.feature)===(null===(A=d.format)||void 0===A?void 0:A.feature))&&(!(null===(s=t.format)||void 0===s?void 0:s.mesh)&&!(null===(c=d.format)||void 0===c?void 0:c.mesh)||(null===(u=t.format)||void 0===u?void 0:u.mesh)===(null===(l=d.format)||void 0===l?void 0:l.mesh))))if(rJ(t)&&rJ(d)){if(h_(t.values,d.values))return h}else if(nJ(t)&&nJ(d)){if(t.url===d.url)return h}else if(iJ(t)&&t.name===h.dataName)return h}}catch(I){f.e(I)}finally{f.f()}return null}function Hz(t,e){if(t.data||!t.parent){if(null===t.data){var n=new iX({values:[]});return e.push(n),n}var r=Jz(t.data,e);if(r)return oJ(t.data)||(r.data.format=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];E_(t,null!==a&&void 0!==a?a:{})}return t}({},t.data.format,r.data.format)),!r.hasName()&&t.data.name&&(r.dataName=t.data.name),r;var i=new iX(t.data);return e.push(i),i}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function Yz(t){var e,n,r,i,o,a,A,s,c,u,l=Hz(t,t.component.data.sources),g=t.component.data,f=g.outputNodes,h=g.outputNodeRefCounts,d=t.parent?t.parent.component.data.ancestorParse.clone():new eJ,I=t.data;oJ(I)?(aJ(I)?l=new AX(l,I.sequence):sJ(I)&&(l=new aX(l,I.graticule)),d.parseNothing=!0):null===(null===(e=null===I||void 0===I?void 0:I.format)||void 0===e?void 0:e.parse)&&(d.parseNothing=!0),l=null!==(n=yX.makeExplicit(l,t,d))&&void 0!==n?n:l,l=new vX(l);var C=t.parent&&yz(t.parent);(Iz(t)||pz(t))&&C&&(l=null!==(r=rX.makeFromEncoding(l,t))&&void 0!==r?r:l),t.transforms.length>0&&(l=function(t,e,n){var r,i,o,a=0,A=Object(U.a)(e.transforms);try{for(A.s();!(o=A.n()).done;){var s=o.value,c=void 0,u=void 0;if(BJ(s))u=t=new oY(t,s),c="derived";else if(uJ(s)){var l=pX(s);u=t=null!==(r=yX.makeWithAncestors(t,{},l,n))&&void 0!==r?r:t,t=new MH(t,e,s.filter)}else if(mJ(s))u=t=rX.makeFromTransform(t,s,e),c="number";else if(EJ(s)){c="date",void 0===n.getWithExplicit(s.field).value&&(t=new yX(t,Object(v.a)({},s.field,c)),n.set(s.field,c,!1)),u=t=rH.makeFromTransform(t,s)}else if(QJ(s))u=t=fX.makeFromTransform(t,s),c="number",GH(e)&&(t=new vX(t));else if(lJ(s))u=t=Uz.make(t,e,s,a++),c="derived";else if(CJ(s))u=t=new bX(t,s),c="number";else if(yJ(s))u=t=new BX(t,s),c="number";else if(FJ(s))u=t=mX.makeFromTransform(t,s),c="derived";else if(wJ(s))u=t=new Qz(t,s),c="derived";else if(vJ(s))u=t=new Ez(t,s),c="derived";else if(gJ(s))u=t=new Oz(t,s),c="derived";else if(pJ(s))t=new Nz(t,s);else if(bJ(s))u=t=Sz.makeFromTransform(t,s),c="derived";else if(fJ(s))u=t=new mz(t,s),c="derived";else if(hJ(s))u=t=new xz(t,s),c="derived";else if(dJ(s))u=t=new kz(t,s),c="derived";else{if(!IJ(s)){AL(p.invalidTransformIgnored(s));continue}u=t=new Rz(t,s),c="derived"}if(u&&void 0!==c){var g,f=Object(U.a)(null!==(i=u.producedFields())&&void 0!==i?i:[]);try{for(f.s();!(g=f.n()).done;){var h=g.value;n.set(h,c,!1)}}catch(d){f.e(d)}finally{f.f()}}}}catch(d){A.e(d)}finally{A.f()}return t}(l,t,d));var y=function(t){var e={};if(Iz(t)&&t.component.selection){var n,r=Object(U.a)(U_(t.component.selection));try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=t.component.selection[o],A=Object(U.a)(a.project.items);try{for(A.s();!(i=A.n()).done;){var s=i.value;!s.channel&&P_(s.field)>1&&(e[s.field]="flatten")}}catch(c){A.e(c)}finally{A.f()}}}catch(c){r.e(c)}finally{r.f()}}return e}(t),B=CX(t);l=null!==(i=yX.makeWithAncestors(l,{},Object.assign(Object.assign({},y),B),d))&&void 0!==i?i:l,Iz(t)&&(l=Fz.parseAll(l,t),l=wz.parseAll(l,t)),(Iz(t)||pz(t))&&(C||(l=null!==(o=rX.makeFromEncoding(l,t))&&void 0!==o?o:l),l=null!==(a=rH.makeFromEncoding(l,t))&&void 0!==a?a:l,l=oY.parseAllForSortIndex(l,t));var m=t.getName("raw"),b=new nH(l,m,"raw",h);if(f[m]=b,l=b,Iz(t)){var E=fX.makeFromEncoding(l,t);E&&(l=E,GH(t)&&(l=new vX(l))),l=null!==(A=Sz.makeFromEncoding(l,t))&&void 0!==A?A:l,l=null!==(s=mX.makeFromEncoding(l,t))&&void 0!==s?s:l}Iz(t)&&(l=null!==(c=bz.make(l,t))&&void 0!==c?c:l);var Q=t.getName(cJ),F=new nH(l,Q,cJ,h);f[Q]=F,l=F,Iz(t)&&function(t,e){OH(t,(function(n){var r=n.name,i=t.getName("lookup_".concat(r));t.component.data.outputNodes[i]=n.materialized=new nH(new MH(e,t,{selection:r}),i,"lookup",t.component.data.outputNodeRefCounts)}))}(t,F);var w=null;if(pz(t)){var S=t.getName("facet");l=null!==(u=function(t,e){var n=e.row,r=e.column;if(n&&r){for(var i=null,o=0,a=[n,r];o<a.length;o++){var A=a[o];if(oZ(A.sort)){var s=A.sort,c=s.field,u=s.op;t=i=new BX(t,{joinaggregate:[{op:void 0===u?"min":u,field:c,as:Pz(A,A.sort,{forAs:!0})}],groupby:[UZ(A)]})}}return i}return null}(l,t.facet))&&void 0!==u?u:l,w=new hX(l,t,S,F.getSource()),f[S]=w}return Object.assign(Object.assign({},t.component.data),{outputNodes:f,outputNodeRefCounts:h,raw:b,main:F,facetRoot:w,ancestorParse:d})}var Xz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o){var a,A,s,c,u;return Object(F.a)(this,n),a=e.call(this,t,"concat",r,i,o,t.resolve),"shared"!==(null===(s=null===(A=t.resolve)||void 0===A?void 0:A.axis)||void 0===s?void 0:s.x)&&"shared"!==(null===(u=null===(c=t.resolve)||void 0===c?void 0:c.axis)||void 0===u?void 0:u.y)||AL(p.CONCAT_CANNOT_SHARE_AXIS),a.children=a.getChildren(t).map((function(t,e){return CK(t,Object(D.a)(a),a.getName("concat_"+e),void 0,o)})),a}return Object(w.a)(n,[{key:"parseData",value:function(){this.component.data=Yz(this);var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){t.value.parseData()}}catch(n){e.e(n)}finally{e.f()}}},{key:"parseSelections",value:function(){this.component.selection={};var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.parseSelections();var r,i=Object(U.a)(U_(n.component.selection));try{for(i.s();!(r=i.n()).done;){var o=r.value;this.component.selection[o]=n.component.selection[o]}}catch(a){i.e(a)}finally{i.f()}}}catch(a){e.e(a)}finally{e.f()}}},{key:"parseMarkGroup",value:function(){var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){t.value.parseMarkGroup()}}catch(n){e.e(n)}finally{e.f()}}},{key:"parseAxesAndHeaders",value:function(){var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){t.value.parseAxesAndHeaders()}}catch(n){e.e(n)}finally{e.f()}}},{key:"getChildren",value:function(t){return XP(t)?t.vconcat:zP(t)?t.hconcat:t.concat}},{key:"parseLayoutSize",value:function(){jz(this)}},{key:"parseAxisGroup",value:function(){return null}},{key:"assembleSelectionTopLevelSignals",value:function(t){return this.children.reduce((function(t,e){return e.assembleSelectionTopLevelSignals(t)}),t)}},{key:"assembleSignals",value:function(){return this.children.forEach((function(t){return t.assembleSignals()})),[]}},{key:"assembleLayoutSignals",value:function(){var t,e=mY(this),n=Object(U.a)(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push.apply(e,Object(B.a)(r.assembleLayoutSignals()))}}catch(i){n.e(i)}finally{n.f()}return e}},{key:"assembleSelectionData",value:function(t){return this.children.reduce((function(t,e){return e.assembleSelectionData(t)}),t)}},{key:"assembleMarks",value:function(){return this.children.map((function(t){var e=t.assembleTitle(),n=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:t.getName("group")},e?{title:e}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),t.assembleGroup())}))}},{key:"assembleDefaultLayout",value:function(){var t=this.layout.columns;return Object.assign(Object.assign({},null!=t?{columns:t}:{}),{bounds:"full",align:"each"})}}]),n}(vz);var zz=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},eM),{labelExpr:1,encode:1}),Kz=U_(zz),qz=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(F.a)(this,n),(t=e.call(this)).explicit=r,t.implicit=i,t.mainExtracted=o,t}return Object(w.a)(n,[{key:"clone",value:function(){return new n(d_(this.explicit),d_(this.implicit),this.mainExtracted)}},{key:"hasAxisPart",value:function(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}},{key:"hasOrientSignalRef",value:function(){return wL(this.explicit.orient)}}]),n}(XW);var $z={bottom:"top",top:"bottom",left:"right",right:"left"};function tK(t,e){if(!t)return e.map((function(t){return t.clone()}));if(t.length===e.length){for(var n=t.length,r=0;r<n;r++){var i=t[r],o=e[r];if(!!i!==!!o)return;if(i&&o){var a=i.getWithExplicit("orient"),A=o.getWithExplicit("orient");if(a.explicit&&A.explicit&&a.value!==A.value)return;t[r]=eK(i,o)}}return t}}function eK(t,e){var n,r=Object(U.a)(Kz);try{var i=function(){var r=n.value,i=tJ(t.getWithExplicit(r),e.getWithExplicit(r),r,"axis",(function(t,e){switch(r){case"title":return gP(t,e);case"gridScale":return{explicit:t.explicit,value:W_(t.value,e.value)}}return $W(t,e,r,"axis")}));t.setWithExplicit(r,i)};for(r.s();!(n=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}return t}function nK(t,e,n,r,i){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(wL(n.labelAngle)?n.labelAngle:X_(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===iY(r,i))return!0}return t===n[e]}var rK=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function iK(t,e){var n,r,i,o=e.axis(t),a=new qz,A=ZZ(e.encoding[t]),s=e.mark,c=e.config,u=(null===o||void 0===o?void 0:o.orient)||(null===(n=c["x"===t?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=c.axis)||void 0===r?void 0:r.orient)||function(t){return"x"===t?"bottom":"left"}(t),l=e.getScaleComponent(t).get("type"),g=KH(t,l,u,e.config),f=void 0!==o?!o:$H("disable",c,null===o||void 0===o?void 0:o.style,g).configValue;if(a.set("disable",f,void 0!==o),f)return a;var h,d=function(t,e,n,r,i){var o=null===e||void 0===e?void 0:e.labelAngle;if(void 0!==o)return wL(o)?o:X_(o);var a=$H("labelAngle",t.config,null===e||void 0===e?void 0:e.style,i).configValue;return void 0!==a?X_(a):"x"===n&&B_([KL,XL],r.type)?270:void 0}(e,o=o||{},t,A,g),I={fieldOrDatumDef:A,axis:o,channel:t,model:e,scaleType:l,orient:u,labelAngle:d,mark:s,config:c},p=Object(U.a)(Kz);try{for(p.s();!(h=p.n()).done;){var C=h.value,y=C in tY?tY[C](I):rM(C)?o[C]:void 0,v=void 0!==y,B=nK(y,C,o,e,t);if(v&&B)a.set(C,y,B);else{var m=rM(C)&&"values"!==C?$H(C,e.config,o.style,g):{},b=m.configValue,E=void 0===b?void 0:b,Q=m.configFrom,F=void 0===Q?void 0:Q,w=void 0!==E;v&&!w?a.set(C,y,B):("vgAxisConfig"!==F||rK.has(C)&&w||q_(E)||wL(E))&&a.set(C,E,!1)}}}catch(x){p.e(x)}finally{p.f()}var S=null!==(i=o.encoding)&&void 0!==i?i:{},R=$_.reduce((function(n,r){var i;if(!a.hasAxisPart(r))return n;var o=wY(null!==(i=S[r])&&void 0!==i?i:{},e),A="labels"===r?function(t,e,n){var r,i=t.encoding,o=t.config,a=null!==(r=ZZ(i[e]))&&void 0!==r?r:ZZ(i[gT(e)]),A=t.axis(e)||{},s=A.format,c=A.formatType;return WV(c)?Object.assign({text:XV({fieldOrDatumDef:a,field:"datum.value",format:s,formatType:c,config:o})},n):n}(e,t,o):o;return void 0===A||R_(A)||(n[r]={update:A}),n}),{});return R_(R)||a.set("encode",R,!!o.encoding||void 0!==o.labelAngle),a}function oK(t){var e,n=t.encoding,r=t.size,i=Object(U.a)(pT);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=fT(o);KP(r[a])&&vZ(n[o])&&(delete r[a],AL(p.stepDropped(a)))}}catch(A){i.e(A)}finally{i.f()}return r}function aK(t,e,n,r){var i=r.graticule,o=mM(t)?Object.assign({},t):{type:t},a=oP("orient",o,n);if(o.orient=function(t,e,n){switch(t){case uM:case IM:case pM:case fM:case lM:case sM:return}var r=e.x,i=e.y,o=e.x2,a=e.y2;switch(t){case AM:if(pZ(r)&&(OT(r.bin)||pZ(i)&&i.aggregate&&!r.aggregate))return"vertical";if(pZ(i)&&(OT(i.bin)||pZ(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(pZ(r)&&r.type===YL&&!kT(r.bin)||BZ(r)))return"horizontal";if(!a&&(pZ(i)&&i.type===YL&&!kT(i.bin)||BZ(i)))return"vertical"}case gM:if(o&&(!pZ(r)||!OT(r.bin))&&a&&(!pZ(i)||!OT(i.bin)))return;case aM:if(a)return pZ(i)&&OT(i.bin)?"horizontal":"vertical";if(o)return pZ(r)&&OT(r.bin)?"vertical":"horizontal";if(t===gM){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case cM:case hM:var A=vZ(r),s=vZ(i);if(A&&!s)return"tick"!==t?"horizontal":"vertical";if(!A&&s)return"tick"!==t?"vertical":"horizontal";if(A&&s){var c=r,u=i,l=c.type===zL,g=u.type===zL;return l&&!g?"tick"!==t?"vertical":"horizontal":!l&&g?"tick"!==t?"horizontal":"vertical":!c.aggregate&&u.aggregate?"tick"!==t?"vertical":"horizontal":c.aggregate&&!u.aggregate?"tick"!==t?"horizontal":"vertical":n||"vertical"}return n||void 0}return"vertical"}(o.type,e,a),void 0!==a&&a!==o.orient&&AL(p.orientOverridden(o.orient,a)),"bar"===o.type&&o.orient){var A=oP("cornerRadiusEnd",o,n);if(void 0!==A){var s,c="horizontal"===o.orient&&e.x2||"vertical"===o.orient&&e.y2?["cornerRadius"]:QM[o.orient],u=Object(U.a)(c);try{for(u.s();!(s=u.n()).done;){o[s.value]=A}}catch(l){u.e(l)}finally{u.f()}void 0!==o.cornerRadiusEnd&&delete o.cornerRadiusEnd}}return void 0===oP("opacity",o,n)&&(o.opacity=function(t,e){if(B_([uM,hM,IM,pM],t)&&!hP(e))return.7;return}(o.type,e)),void 0===o.filled&&(o.filled=!i&&function(t,e){var n=aP("filled",t,e),r=t.type;return W_(n,r!==uM&&r!==cM&&r!==gM)}(o,n)),void 0===oP("cursor",o,n)&&(o.cursor=function(t,e,n){if(e.href||t.href||oP("href",t,n))return"pointer";return t.cursor}(o,e,n)),o}function AK(t,e){t.config;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),MJ("x",t,{defaultPos:"mid"})),MJ("y",t,{defaultPos:"mid"})),DJ("size",t)),DJ("angle",t)),function(t,e,n){if(n)return{shape:{value:n}};return DJ("shape",t)}(t,0,e))}function sK(t){var e,n=t.config,r=t.markDef,i=r.orient,o="horizontal"===i?"width":"height",a=t.getScaleComponent("horizontal"===i?"x":"y"),A=null!==(e=oP("size",r,n,{vgChannel:o}))&&void 0!==e?e:n.tick.bandSize;if(void 0!==A)return A;var s=a?a.get("range"):void 0;return s&&SL(s)&&Object(x.E)(s.step)?3*s.step/4:3*eW(n.view,o)/4}var cK={arc:{vgMark:"arc",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),MJ("x",t,{defaultPos:"mid"})),MJ("y",t,{defaultPos:"mid"})),JJ(t,"radius","arc")),JJ(t,"theta","arc"))}},area:{vgMark:"area",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),ZJ("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient})),ZJ("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient})),qJ(t))}},bar:{vgMark:"rect",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),JJ(t,"x","bar")),JJ(t,"y","bar"))}},circle:{vgMark:"symbol",encodeEntry:function(t){return AK(t,"circle")}},geoshape:{vgMark:"shape",encodeEntry:function(t){return Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}))},postEncodingTransform:function(t){var e=t.encoding.shape;return[Object.assign({type:"geoshape",projection:t.projectionName()},e&&pZ(e)&&e.type===qL?{field:UZ(e,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),JJ(t,"x","image")),JJ(t,"y","image")),RJ(t,"url"))}},line:{vgMark:"line",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),MJ("x",t,{defaultPos:"mid"})),MJ("y",t,{defaultPos:"mid"})),DJ("size",t,{vgChannel:"strokeWidth"})),qJ(t))}},point:{vgMark:"symbol",encodeEntry:function(t){return AK(t)}},rect:{vgMark:"rect",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),JJ(t,"x","rect")),JJ(t,"y","rect"))}},rule:{vgMark:"rule",encodeEntry:function(t){var e=t.markDef.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),ZJ("x",t,{defaultPos:"horizontal"===e?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==e})),ZJ("y",t,{defaultPos:"vertical"===e?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==e})),DJ("size",t,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:function(t){return AK(t,"square")}},text:{vgMark:"text",encodeEntry:function(t){var e=t.config;t.encoding;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),MJ("x",t,{defaultPos:"mid"})),MJ("y",t,{defaultPos:"mid"})),RJ(t)),DJ("size",t,{vgChannel:"fontSize"})),DJ("angle",t)),$J("align",function(t,e,n){if(void 0===oP("align",t,n))return"center";return}(t.markDef,0,e))),$J("baseline",function(t,e,n){if(void 0===oP("baseline",t,n))return"middle";return}(t.markDef,0,e))),MJ("radius",t,{defaultPos:null,isMidPoint:!0})),MJ("theta",t,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:function(t){var e=t.config,n=t.markDef,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),MJ("x",t,{defaultPos:"mid",vgChannel:"xc"})),MJ("y",t,{defaultPos:"mid",vgChannel:"yc"})),DJ("size",t,{defaultValue:sK(t),vgChannel:i})),Object(v.a)({},o,eP(oP("thickness",n,e))))}},trail:{vgMark:"trail",encodeEntry:function(t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zJ(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),MJ("x",t,{defaultPos:"mid"})),MJ("y",t,{defaultPos:"mid"})),DJ("size",t)),qJ(t))}}};function uK(t){return B_([cM,aM,dM],t.mark)?function(t){var e=vP(t.mark,t.encoding),n=gK(t,{fromPrefix:e.length>0?"faceted_path_":""});return e.length>0?[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+t.requestDataName(cJ),data:t.requestDataName(cJ),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:n}]:n}(t):B_([AM],t.mark)?function(t){var e=kL.some((function(e){return oP(e,t.markDef,t.config)}));if(t.stack&&!t.fieldDef("size")&&e){var n,r,i=gK(t,{fromPrefix:"stack_group_"}),o=Object(QA.a)(i,1)[0],a=t.scaleName(t.stack.fieldChannel),A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.vgField(t.stack.fieldChannel,e)},s=function(t,e){var n=[A({prefix:"min",suffix:"start",expr:e}),A({prefix:"max",suffix:"start",expr:e}),A({prefix:"min",suffix:"end",expr:e}),A({prefix:"max",suffix:"end",expr:e})];return"".concat(t,"(").concat(n.map((function(t){return"scale('".concat(a,"',").concat(t,")")})).join(","),")")};"x"===t.stack.fieldChannel?(n=Object.assign(Object.assign({},I_(o.encode.update,["y","yc","y2","height"].concat(Object(B.a)(kL)))),{x:{signal:s("min","datum")},x2:{signal:s("max","datum")},clip:{value:!0}}),r={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},o.encode.update=Object.assign(Object.assign({},p_(o.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(n=Object.assign(Object.assign({},I_(o.encode.update,["x","xc","x2","width"])),{y:{signal:s("min","datum")},y2:{signal:s("max","datum")},clip:{value:!0}}),r={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},o.encode.update=Object.assign(Object.assign({},p_(o.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));var c,u=Object(U.a)(kL);try{for(u.s();!(c=u.n()).done;){var l=c.value,g=aP(l,t.markDef,t.config);o.encode.update[l]?(n[l]=o.encode.update[l],delete o.encode.update[l]):g&&(n[l]=eP(g)),g&&(o.encode.update[l]={value:0})}}catch(d){u.e(d)}finally{u.f()}var f=t.fieldDef(t.stack.groupbyChannel),h=UZ(f)?[UZ(f)]:[];((null===f||void 0===f?void 0:f.bin)||(null===f||void 0===f?void 0:f.timeUnit))&&h.push(UZ(f,{binSuffix:"end"}));return(n=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((function(e,n){if(o.encode.update[n])return Object.assign(Object.assign({},e),Object(v.a)({},n,o.encode.update[n]));var r=aP(n,t.markDef,t.config);return void 0!==r?Object.assign(Object.assign({},e),Object(v.a)({},n,eP(r))):e}),n)).stroke&&(n.strokeForeground={value:!0},n.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName(cJ),name:"stack_group_"+t.requestDataName(cJ),groupby:h,aggregate:{fields:[A({suffix:"start"}),A({suffix:"start"}),A({suffix:"end"}),A({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:n},marks:[{type:"group",encode:{update:r},marks:[o]}]}]}return gK(t)}(t):gK(t)}function lK(t){var e=t.encoding,n=t.stack,r=t.mark,i=t.markDef,o=t.config,a=e.order;if(!(!Object(x.A)(a)&&EZ(a)&&v_(a.value)||!a&&v_(oP("order",i,o)))){if((Object(x.A)(a)||pZ(a))&&!n)return cP(a,{expr:"datum"});if(yM(r)){var A="horizontal"===i.orient?"y":"x",s=e[A];if(pZ(s)){var c=s.sort;return Object(x.A)(c)?{field:UZ(s,{prefix:A,suffix:"sort_index",expr:"datum"})}:oZ(c)?{field:UZ({aggregate:hP(t.encoding)?c.op:void 0,field:c.field},{expr:"datum"})}:iZ(c)?{field:UZ(t.fieldDef(c.encoding),{expr:"datum"}),order:c.order}:null===c?void 0:{field:UZ(s,{binSuffix:t.stack&&t.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}function gK(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""},n=t.mark,r=t.markDef,i=t.config,o=W_(r.clip,fK(t),hK(t)),a=iP(r),A=t.encoding.key,s=lK(t),c=dK(t),u=oP("aria",r,i),l=cK[n].postEncodingTransform?cK[n].postEncodingTransform(t):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName("marks"),type:cK[n].vgMark},o?{clip:!0}:{}),a?{style:a}:{}),A?{key:A.field}:{}),s?{sort:s}:{}),c||{}),!1===u?{aria:u}:{}),{from:{data:e.fromPrefix+t.requestDataName(cJ)},encode:{update:cK[n].encodeEntry(t)}}),l?{transform:l}:{})]}function fK(t){var e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(e&&e.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}function hK(t){var e=t.component.projection;return!(!e||e.isFit)||void 0}function dK(t){if(!t.component.selection)return null;for(var e=U_(t.component.selection).length,n=e,r=t.parent;r&&0===n;)n=U_(r.component.selection).length,r=r.parent;return n?{interactive:e>0}:null}var IK=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i){var o,a,A,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;Object(F.a)(this,n),(o=e.call(this,t,"unit",r,i,c,void 0,qP(t)?t.view:void 0)).specifiedScales={},o.specifiedAxes={},o.specifiedLegends={},o.specifiedProjection={},o.selection={},o.children=[];var u=mM(t.mark)?t.mark.type:t.mark;o.markDef=aK(t.mark,null!==(a=t.encoding)&&void 0!==a?a:{},c,{graticule:t.data&&sJ(t.data)});var l=o.encoding=IP(null!==(A=t.encoding)&&void 0!==A?A:{},o.markDef,c);return o.size=oK({encoding:l,size:qP(t)?Object.assign(Object.assign(Object.assign({},s),t.width?{width:t.width}:{}),t.height?{height:t.height}:{}):s}),o.stack=wW(u,l),o.specifiedScales=o.initScales(u,l),o.specifiedAxes=o.initAxes(l),o.specifiedLegends=o.initLegend(l),o.specifiedProjection=t.projection,o.selection=t.selection,o}return Object(w.a)(n,[{key:"scaleDomain",value:function(t){var e=this.specifiedScales[t];return e?e.domain:void 0}},{key:"axis",value:function(t){return this.specifiedAxes[t]}},{key:"legend",value:function(t){return this.specifiedLegends[t]}},{key:"initScales",value:function(t,e){return QT.reduce((function(t,n){var r,i=ZZ(e[n]);return i&&(t[n]=null!==(r=i.scale)&&void 0!==r?r:{}),t}),{})}},{key:"initAxes",value:function(t){return pT.reduce((function(e,n){var r=t[n];if(mZ(r)||"x"===n&&mZ(t.x2)||"y"===n&&mZ(t.y2)){var i=mZ(r)?r.axis:void 0;e[n]=i?Object.assign({},i):i}return e}),{})}},{key:"initLegend",value:function(t){return bT.reduce((function(e,n){var r=ZZ(t[n]);if(r&&function(t){switch(t){case PM:case WM:case JM:case YM:case HM:case"opacity":case"strokeWidth":case"strokeDash":return!0;case"fillOpacity":case"strokeOpacity":case"angle":return!1}}(n)){var i=r.legend;e[n]=i?Object.assign({},i):i}return e}),{})}},{key:"parseData",value:function(){this.component.data=Yz(this)}},{key:"parseLayoutSize",value:function(){!function(t){var e,n=t.size,r=t.component,i=Object(U.a)(pT);try{for(i.s();!(e=i.n()).done;){var o=fT(e.value);if(n[o]){var a=n[o];r.layoutSize.set(o,KP(a)?"step":a,!0)}else{var A=Zz(t,o);r.layoutSize.set(o,A,!1)}}}catch(s){i.e(s)}finally{i.f()}}(this)}},{key:"parseSelections",value:function(){this.component.selection=function(t,e){var n,r,i={},o=t.config.selection,a=Object(U.a)(U_(null!==e&&void 0!==e?e:{}));try{var A=function(){var a=r.value,A=d_(e[a]),s=o[A.type],c=(s.fields,s.encodings,r_(s,["fields","encodings"]));for(var u in c)"encodings"===u&&A.fields||"fields"===u&&A.encodings||("mark"===u&&(A[u]=Object.assign(Object.assign({},c[u]),A[u])),void 0!==A[u]&&!0!==A[u]||(A[u]=null!==(n=c[u])&&void 0!==n?n:A[u]));var l=N_(a),g=i[l]=Object.assign(Object.assign({},A),{name:l,events:Object(x.H)(A.on)?vN(A.on,"scope"):d_(A.on)});CH(g,(function(n){n.has(g)&&n.parse&&n.parse(t,g,A,e[a])}))};for(a.s();!(r=a.n()).done;)A()}catch(s){a.e(s)}finally{a.f()}return i}(this,this.selection)}},{key:"parseMarkGroup",value:function(){this.component.mark=uK(this)}},{key:"parseAxesAndHeaders",value:function(){var t;this.component.axes=(t=this,pT.reduce((function(e,n){return t.component.scales[n]&&(e[n]=[iK(n,t)]),e}),{}))}},{key:"assembleSelectionTopLevelSignals",value:function(t){return function(t,e){var n=!1;return OH(t,(function(r,i){var o=r.name,a=Object(x.Z)(o+SH);if(0===e.filter((function(t){return t.name===o})).length){var A="global"===r.resolve?"union":r.resolve,s="multi"===r.type?", true)":")";e.push({name:r.name,update:"".concat(xH,"(").concat(a,", ").concat(Object(x.Z)(A)).concat(s)})}n=!0,i.topLevelSignals&&(e=i.topLevelSignals(t,r,e)),CH(r,(function(n){n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))}))})),n&&0===e.filter((function(t){return"unit"===t.name})).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),BH(e)}(this,t)}},{key:"assembleSignals",value:function(){return[].concat(Object(B.a)(WH(this)),Object(B.a)((e=[],OH(t=this,(function(n,r){var i,o=n.name,a=r.modifyExpr(t,n);(i=e).push.apply(i,Object(B.a)(r.signals(t,n))),CH(n,(function(r){r.signals&&(e=r.signals(t,n,e)),r.modifyExpr&&(a=r.modifyExpr(t,n,a))})),e.push({name:o+UH,on:[{events:{signal:n.name+RH},update:"modify(".concat(Object(x.Z)(n.name+SH),", ").concat(a,")")}]})})),BH(e))));var t,e}},{key:"assembleSelectionData",value:function(t){return function(t,e){var n=Object(B.a)(e);return OH(t,(function(e){var r={name:e.name+SH};if(e.init){var i=e.project.items.map((function(t){t.signals;return r_(t,["signals"])})),o=e.init.map((function(t){return yH(t,!1)}));r.values="interval"===e.type?[{unit:DH(t,{escape:!1}),fields:i,values:o}]:o.map((function(e){return{unit:DH(t,{escape:!1}),fields:i,values:e}}))}n.filter((function(t){return t.name===e.name+SH})).length||n.push(r)})),n}(this,t)}},{key:"assembleLayout",value:function(){return null}},{key:"assembleLayoutSignals",value:function(){return mY(this)}},{key:"assembleMarks",value:function(){var t,e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&yz(this.parent)||(e=vH(this,e)),e.map(this.correctDataNames)}},{key:"getMapping",value:function(){return this.encoding}},{key:"channelHasField",value:function(t){return fP(this.encoding,t)}},{key:"fieldDef",value:function(t){return VZ(this.encoding[t])}},{key:"typedFieldDef",value:function(t){var e=this.fieldDef(t);return bZ(e)?e:null}},{key:"hasProjection",get:function(){var t=this.encoding,e=this.mark===CM,n=t&&qM.some((function(e){return mZ(t[e])}));return e||n}},{key:"mark",get:function(){return this.markDef.type}}]),n}(Bz),pK=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(t,r,i,o,a){var A;Object(F.a)(this,n),A=e.call(this,t,"layer",r,i,a,t.resolve,t.view);var s=Object.assign(Object.assign(Object.assign({},o),t.width?{width:t.width}:{}),t.height?{height:t.height}:{});return A.children=t.layer.map((function(t,e){if(pW(t))return new n(t,Object(D.a)(A),A.getName("layer_"+e),s,a);if(SM(t))return new IK(t,Object(D.a)(A),A.getName("layer_"+e),s,a);throw new Error(p.invalidSpec(t))})),A}return Object(w.a)(n,[{key:"parseData",value:function(){this.component.data=Yz(this);var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){t.value.parseData()}}catch(n){e.e(n)}finally{e.f()}}},{key:"parseLayoutSize",value:function(){var t;Lz(t=this),Vz(t,"width"),Vz(t,"height")}},{key:"parseSelections",value:function(){this.component.selection={};var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.parseSelections();var r,i=Object(U.a)(U_(n.component.selection));try{for(i.s();!(r=i.n()).done;){var o=r.value;this.component.selection[o]=n.component.selection[o]}}catch(a){i.e(a)}finally{i.f()}}}catch(a){e.e(a)}finally{e.f()}}},{key:"parseMarkGroup",value:function(){var t,e=Object(U.a)(this.children);try{for(e.s();!(t=e.n()).done;){t.value.parseMarkGroup()}}catch(n){e.e(n)}finally{e.f()}}},{key:"parseAxesAndHeaders",value:function(){!function(t){var e,n,r=t.component,i=r.axes,o=r.resolve,a={top:0,bottom:0,right:0,left:0},A=Object(U.a)(t.children);try{for(A.s();!(n=A.n()).done;){var s=n.value;s.parseAxesAndHeaders();var c,u=Object(U.a)(U_(s.component.axes));try{for(u.s();!(c=u.n()).done;){var l=c.value;o.axis[l]=RY(t.component.resolve,l),"shared"===o.axis[l]&&(i[l]=tK(i[l],s.component.axes[l]),i[l]||(o.axis[l]="independent",delete i[l]))}}catch(S){u.e(S)}finally{u.f()}}}catch(S){A.e(S)}finally{A.f()}var g,f=Object(U.a)(pT);try{for(f.s();!(g=f.n()).done;){var h,d=g.value,I=Object(U.a)(t.children);try{for(I.s();!(h=I.n()).done;){var p=h.value;if(p.component.axes[d]){if("independent"===o.axis[d]){i[d]=(null!==(e=i[d])&&void 0!==e?e:[]).concat(p.component.axes[d]);var C,y=Object(U.a)(p.component.axes[d]);try{for(y.s();!(C=y.n()).done;){var v=C.value,B=v.getWithExplicit("orient"),m=B.value,b=B.explicit;if(!wL(m)){if(a[m]>0&&!b){var E=$z[m];a[m]>a[E]&&v.set("orient",E,!1)}a[m]++}}}catch(S){y.e(S)}finally{y.f()}}delete p.component.axes[d]}}}catch(S){I.e(S)}finally{I.f()}if("independent"===o.axis[d]&&i[d]&&i[d].length>1){var Q,F=Object(U.a)(i[d]);try{for(F.s();!(Q=F.n()).done;){var w=Q.value;w.get("grid")&&!w.explicit.grid&&(w.implicit.grid=!1)}}catch(S){F.e(S)}finally{F.f()}}}}catch(S){f.e(S)}finally{f.f()}}(this)}},{key:"assembleSelectionTopLevelSignals",value:function(t){return this.children.reduce((function(t,e){return e.assembleSelectionTopLevelSignals(t)}),t)}},{key:"assembleSignals",value:function(){return this.children.reduce((function(t,e){return t.concat(e.assembleSignals())}),WH(this))}},{key:"assembleLayoutSignals",value:function(){return this.children.reduce((function(t,e){return t.concat(e.assembleLayoutSignals())}),mY(this))}},{key:"assembleSelectionData",value:function(t){return this.children.reduce((function(t,e){return e.assembleSelectionData(t)}),t)}},{key:"assembleTitle",value:function(){var t=Object(yW.a)(Object(CW.a)(n.prototype),"assembleTitle",this).call(this);if(t)return t;var e,r=Object(U.a)(this.children);try{for(r.s();!(e=r.n()).done;){if(t=e.value.assembleTitle())return t}}catch(i){r.e(i)}finally{r.f()}}},{key:"assembleLayout",value:function(){return null}},{key:"assembleMarks",value:function(){return function(t,e){var n,r=Object(U.a)(t.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;Iz(i)&&(e=vH(i,e))}}catch(o){r.e(o)}finally{r.f()}return e}(this,this.children.flatMap((function(t){return t.assembleMarks()})))}},{key:"assembleLegends",value:function(){return this.children.reduce((function(t,e){return t.concat(e.assembleLegends())}),HY(this))}}]),n}(vz);function CK(t,e,n,r,i){if(cZ(t))return new Wz(t,e,n,i);if(pW(t))return new pK(t,e,n,r,i);if(SM(t))return new IK(t,e,n,r,i);if(function(t){return XP(t)||zP(t)||YP(t)}(t))return new Xz(t,e,n,i);throw new Error(p.invalidSpec(t))}function yK(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.logger&&oL(e.logger),e.fieldTitle&&GZ(e.fieldTitle);try{var n=lW(Object(x.N)(e.config,t.config)),r=PW(t,n),i=CK(r,null,"",void 0,n);i.parse(),LX(i.component.data,i);var o=BK(i,vK(t,r.autosize,n,i),t.datasets,t.usermeta);return{spec:o,normalized:r}}finally{e.logger&&aL(),e.fieldTitle&&_Z()}}function vK(t,e,n,r){var i,o=r.component.layoutSize.get("width"),a=r.component.layoutSize.get("height");if(void 0===e?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):Object(x.H)(e)&&(e={type:e}),o&&a&&("fit"===(i=e.type)||"fit-x"===i||"fit-y"===i))if("step"===o&&"step"===a)AL(p.droppingFit()),e.type="pad";else if("step"===o||"step"===a){var A="step"===o?"width":"height";AL(p.droppingFit(BT(A)));var s="width"===A?"height":"width";e.type=function(t){return t?"fit-".concat(BT(t)):"fit"}(s)}return Object.assign(Object.assign(Object.assign({},1===U_(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e}),YW(n)),YW(t))}function BK(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,i=t.config?dW(t.config):void 0,o=[].concat(t.assembleSelectionData([]),Gz(t.component.data,n)),a=t.assembleProjections(),A=t.assembleTitle(),s=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0),u=t.assembleLayoutSignals();return u=u.filter((function(t){return"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)})),Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},t.description?{description:t.description}:{}),e),A?{title:A}:{}),s?{style:s}:{}),c?{encode:{update:c}}:{}),{data:o}),a.length>0?{projections:a}:{}),t.assembleGroup([].concat(Object(B.a)(u),Object(B.a)(t.assembleSelectionTopLevelSignals([]))))),i?{config:i}:{}),r?{usermeta:r}:{})}var mK=new(function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){return Object(F.a)(this,n),e.apply(this,arguments)}return Object(w.a)(n,[{key:"mapUnit",value:function(t,e){var n=e.config;if(t.encoding){var r=t.encoding,i=t.transform,o=dP(r,n),a=o.bins,A=o.timeUnits,s=o.aggregate,c=o.groupby,u=o.encoding,l=[].concat(Object(B.a)(i||[]),Object(B.a)(a),Object(B.a)(A),Object(B.a)(0===s.length?[]:[{aggregate:s,groupby:c}]));return Object.assign(Object.assign(Object.assign({},t),l.length>0?{transform:l}:{}),{encoding:u})}return t}}]),n}(vW));function bK(t,e){return mK.map(t,{config:e})}var EK,QK=n_.version,FK=n(914),wK=n.n(FK),SK=n(1109),RK={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},UK={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},xK={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},bar:{binSpacing:2,fill:"#30a2da",stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},kK={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},OK="Benton Gothic Bold, sans-serif",NK={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},DK={background:"#ffffff",title:{anchor:"start",color:"#000000",font:OK,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:OK,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:OK,titleFontSize:13,titleFontWeight:"normal"},range:{category:NK["category-6"],diverging:NK["fireandice-6"],heatmap:NK["fire-7"],ordinal:NK["fire-7"],ramp:NK["fire-7"]}},GK={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},_K={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},MK={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},TK={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:MK["six-groups-cat-1"],diverging:MK["diverging-colors"],heatmap:MK["diverging-colors"],ordinal:MK["six-groups-seq"],ramp:MK["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:null}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}},jK={arc:{fill:"#3366CC"},area:{fill:"#3366CC"},path:{stroke:"#3366CC"},rect:{fill:"#3366CC"},shape:{stroke:"#3366CC"},symbol:{stroke:"#3366CC"},circle:{fill:"#3366CC"},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:"Arial, sans-serif",fontSize:12},"guide-title":{font:"Arial, sans-serif",fontSize:12},"group-title":{font:"Arial, sans-serif",fontSize:12}},title:{font:"Arial, sans-serif",fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:"#ccc",tickColor:"#ccc",domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},LK=SK.version,VK=function(t,e,n){var r=t.open(e),i=new URL(e).origin,o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)},ZK='.vega-embed {\n  position: relative;\n  display: inline-block; }\n  .vega-embed.has-actions {\n    padding-right: 38px; }\n  .vega-embed details:not([open]) > :not(summary) {\n    display: none !important; }\n  .vega-embed summary {\n    list-style: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    padding: 6px;\n    z-index: 1000;\n    background: white;\n    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n    color: #1b1e23;\n    border: 1px solid #aaa;\n    border-radius: 999px;\n    opacity: 0.2;\n    transition: opacity 0.4s ease-in;\n    outline: none;\n    cursor: pointer;\n    line-height: 0px; }\n    .vega-embed summary::-webkit-details-marker {\n      display: none; }\n    .vega-embed summary:active {\n      box-shadow: #aaa 0px 0px 0px 1px inset; }\n    .vega-embed summary svg {\n      width: 14px;\n      height: 14px; }\n  .vega-embed details[open] summary {\n    opacity: 0.7; }\n  .vega-embed:hover summary,\n  .vega-embed:focus summary {\n    opacity: 1 !important;\n    transition: opacity 0.2s ease; }\n  .vega-embed .vega-actions {\n    position: absolute;\n    z-index: 1001;\n    top: 35px;\n    right: -9px;\n    display: flex;\n    flex-direction: column;\n    padding-bottom: 8px;\n    padding-top: 8px;\n    border-radius: 4px;\n    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n    border: 1px solid #d9d9d9;\n    background: white;\n    animation-duration: 0.15s;\n    animation-name: scale-in;\n    animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n    text-align: left; }\n    .vega-embed .vega-actions a {\n      padding: 8px 16px;\n      font-family: sans-serif;\n      font-size: 14px;\n      font-weight: 600;\n      white-space: nowrap;\n      color: #434a56;\n      text-decoration: none; }\n      .vega-embed .vega-actions a:hover {\n        background-color: #f7f7f9;\n        color: black; }\n    .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n      content: "";\n      display: inline-block;\n      position: absolute; }\n    .vega-embed .vega-actions::before {\n      left: auto;\n      right: 14px;\n      top: -16px;\n      border: 8px solid #0000;\n      border-bottom-color: #d9d9d9; }\n    .vega-embed .vega-actions::after {\n      left: auto;\n      right: 15px;\n      top: -14px;\n      border: 7px solid #0000;\n      border-bottom-color: #fff; }\n\n.vega-embed-wrapper {\n  max-width: 100%;\n  overflow: scroll;\n  padding-right: 14px; }\n\n@keyframes scale-in {\n  from {\n    opacity: 0;\n    transform: scale(0.6); }\n  to {\n    opacity: 1;\n    transform: scale(1); } }\n';function PK(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];WK(t,a)}return t}function WK(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object(x.jb)(t,i,e[i],!0)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var JK=I,HK=C,YK="undefined"!==typeof window?window:void 0;void 0===HK&&(null===(EK=null===YK||void 0===YK?void 0:YK.vl)||void 0===EK?void 0:EK.compile)&&(HK=YK.vl);var XK={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},zK={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},KK={vega:"Vega","vega-lite":"Vega-Lite"},qK={vega:JK.version,"vega-lite":HK?HK.version:"not available"},$K={vega:function(t){return t},"vega-lite":function(t,e){return HK.compile(t,{config:e}).spec}},tq='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n  <circle r="2" cy="8" cx="2"></circle>\n  <circle r="2" cy="8" cx="8"></circle>\n  <circle r="2" cy="8" cx="14"></circle>\n</svg>';function eq(t){return"function"===typeof t}function nq(t,e,n,r){var i="<html><head>".concat(e,'</head><body><pre><code class="json">'),o="</code></pre>".concat(n,"</body></html>"),a=window.open("");a.document.write(i+t+o),a.document.title="".concat(KK[r]," JSON Source")}function rq(t,e){var n;if(t.$schema){var r=wK()(t.$schema);e&&e!==r.library&&console.warn("The given visualization spec is written in ".concat(KK[r.library],", but mode argument sets ").concat(null!==(n=KK[e])&&void 0!==n?n:e,"."));var i=r.library;return Object(mt.satisfies)(qK[i],"^".concat(r.version.slice(1)))||console.warn("The input spec uses ".concat(KK[i]," ").concat(r.version,", but the current version of ").concat(KK[i]," is v").concat(qK[i],".")),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!==e&&void 0!==e?e:"vega"}function iq(t){return!(!t||!("load"in t))}function oq(t,e){var n;return P(this,void 0,void 0,Z.a.mark((function r(){var i,o;return Z.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!Object(x.H)(t.config)){r.next=8;break}return r.t1=JSON,r.next=4,e.load(t.config);case 4:r.t2=r.sent,r.t0=r.t1.parse.call(r.t1,r.t2),r.next=9;break;case 8:r.t0=null!==(n=t.config)&&void 0!==n?n:{};case 9:if(i=r.t0,!Object(x.H)(t.patch)){r.next=18;break}return r.t4=JSON,r.next=14,e.load(t.patch);case 14:r.t5=r.sent,r.t3=r.t4.parse.call(r.t4,r.t5),r.next=19;break;case 18:r.t3=t.patch;case 19:return o=r.t3,r.abrupt("return",Object.assign(Object.assign(Object.assign({},t),o?{patch:o}:{}),i?{config:i}:{}));case 21:case"end":return r.stop()}}),r)})))}function aq(t,e){var n,r,i,o,a,A,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;return P(this,void 0,void 0,Z.a.mark((function u(){var l,g,f,h,d,I,p,C,v,B,m,b,E,Q,F,w,S,R,U,k,O,D,G,_,M,T,j,L,V,W,J,H,Y;return Z.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(Y=function(){O&&document.removeEventListener("click",O),F.finalize()},l=s.theme?Object(x.N)(y[s.theme],null!==(n=s.config)&&void 0!==n?n:{}):s.config,g=Object(x.B)(s.actions)?s.actions:PK({},XK,null!==(r=s.actions)&&void 0!==r?r:{}),f=Object.assign(Object.assign({},zK),s.i18n),h=null!==(i=s.renderer)&&void 0!==i?i:"canvas",d=null!==(o=s.logLevel)&&void 0!==o?o:JK.Warn,I=null!==(a=s.downloadFileName)&&void 0!==a?a:"visualization",!1!==s.defaultStyle&&(p="vega-embed-style",document.getElementById(p)||((C=document.createElement("style")).id=p,C.innerText=void 0===s.defaultStyle||!0===s.defaultStyle?ZK.toString():s.defaultStyle,document.head.appendChild(C))),v=rq(e,s.mode),B=$K[v](e,l),"vega-lite"===v&&B.$schema&&(m=wK()(B.$schema),Object(mt.satisfies)(qK.vega,"^".concat(m.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(m.version,", but current version is v").concat(qK.vega,"."))),b="string"===typeof t?document.querySelector(t):t){u.next=14;break}throw Error("".concat(t," does not exist"));case 14:return b.classList.add("vega-embed"),g&&b.classList.add("has-actions"),b.innerHTML="",(E=s.patch)&&(B=E instanceof Function?E(B):At(B,E,!0,!1).newDocument),s.formatLocale&&JK.formatLocale(s.formatLocale),s.timeFormatLocale&&JK.timeFormatLocale(s.timeFormatLocale),Q=JK.parse(B,"vega-lite"===v?{}:l),F=new JK.View(Q,{loader:c,logLevel:d,renderer:h}),!1!==s.tooltip&&(w=eq(s.tooltip)?s.tooltip:new N(!0===s.tooltip?{}:s.tooltip).call,F.tooltip(w)),void 0===(S=s.hover)&&(S="vega"===v),S&&(U=(R="boolean"===typeof S?{}:S).hoverSet,k=R.updateSet,F.hover(U,k)),s&&(null!=s.width&&F.width(s.width),null!=s.height&&F.height(s.height),null!=s.padding&&F.padding(s.padding)),u.next=30,F.initialize(t).runAsync();case 30:if(!1!==g){if(D=b,!1!==s.defaultStyle&&((G=document.createElement("details")).title=f.CLICK_TO_VIEW_ACTIONS,b.append(G),D=G,(_=document.createElement("summary")).innerHTML=tq,G.append(_),O=function(t){G.contains(t.target)||G.removeAttribute("open")},document.addEventListener("click",O)),M=document.createElement("div"),D.append(M),M.classList.add("vega-actions"),!0===g||!1!==g.export)for(T=function(){var t=L[j];if(!0===g||!0===g.export||g.export[t]){var e=f["".concat(t.toUpperCase(),"_ACTION")],n=document.createElement("a");n.text=e,n.href="#",n.target="_blank",n.download="".concat(I,".").concat(t),n.addEventListener("mousedown",(function(e){return P(this,void 0,void 0,Z.a.mark((function n(){var r;return Z.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.preventDefault(),n.next=3,F.toImageURL(t,s.scaleFactor);case 3:r=n.sent,this.href=r;case 5:case"end":return n.stop()}}),n,this)})))})),M.append(n)}},j=0,L=["svg","png"];j<L.length;j++)T();!0!==g&&!1===g.source||((V=document.createElement("a")).text=f.SOURCE_ACTION,V.href="#",V.addEventListener("click",(function(t){var n,r;nq(Bt()(e),null!==(n=s.sourceHeader)&&void 0!==n?n:"",null!==(r=s.sourceFooter)&&void 0!==r?r:"",v),t.preventDefault()})),M.append(V)),"vega-lite"!==v||!0!==g&&!1===g.compiled||((W=document.createElement("a")).text=f.COMPILED_ACTION,W.href="#",W.addEventListener("click",(function(t){var e,n;nq(Bt()(B),null!==(e=s.sourceHeader)&&void 0!==e?e:"",null!==(n=s.sourceFooter)&&void 0!==n?n:"","vega"),t.preventDefault()})),M.append(W)),!0!==g&&!1===g.editor||(J=null!==(A=s.editorUrl)&&void 0!==A?A:"https://vega.github.io/editor/",(H=document.createElement("a")).text=f.EDITOR_ACTION,H.href="#",H.addEventListener("click",(function(t){VK(window,J,{config:l,mode:v,renderer:h,spec:Bt()(e)}),t.preventDefault()})),M.append(H))}return u.abrupt("return",{view:F,spec:e,vgSpec:B,finalize:Y});case 32:case"end":return u.stop()}}),u)})))}function Aq(t,e){Object.keys(e).forEach((function(n){!function(t,e,n){var r;n&&((r=n)&&"[object Function]"==={}.toString.call(r)?n(t.data(e)):t.change(e,JK.changeset().remove((function(){return!0})).insert(n)))}(t,n,e[n])}))}function sq(t){var e=new Set;return t.forEach((function(t){Object.keys(t).forEach((function(t){e.add(t)}))})),e}var cq=function(){};function uq(t,e){var n=Object.keys(e);return n.forEach((function(n){try{t.addSignalListener(n,e[n])}catch(r){console.warn("Cannot add invalid signal listener.",r)}})),n.length>0}function lq(t,e){var n=Object.keys(e);return n.forEach((function(n){try{t.removeSignalListener(n,e[n])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}})),n.length>0}function gq(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fq(){return(fq=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function hq(t){var e=t.spec,n=t.width,r=t.height;return"undefined"!==typeof n&&"undefined"!==typeof r?fq({},e,{width:n,height:r}):"undefined"!==typeof n?fq({},e,{width:n}):"undefined"!==typeof r?fq({},e,{height:r}):e}var dq=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t;Object(F.a)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),gq(Object(D.a)(t),"containerRef",E.a.createRef()),gq(Object(D.a)(t),"viewPromise",void 0),gq(Object(D.a)(t),"handleError",(function(e){var n=t.props.onError;(void 0===n?cq:n)(e),console.warn(e)})),gq(Object(D.a)(t),"modifyView",(function(e){t.viewPromise&&t.viewPromise.then((function(t){return t&&e(t),!0})).catch(t.handleError)})),t}return Object(w.a)(n,[{key:"componentDidMount",value:function(){this.createView()}},{key:"componentDidUpdate",value:function(t){var e=this,n=sq([this.props,t]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),!this.viewPromise||Array.from(n).some((function(n){return e.props[n]!==t[n]})))this.clearView(),this.createView();else{var r=function(t,e){if(t===e)return!1;var n={width:!1,height:!1,isExpensive:!1},r=sq([t,e]);return!r.has("width")||"width"in t&&"width"in e&&t.width===e.width||("width"in t&&"number"===typeof t.width?n.width=t.width:n.isExpensive=!0),!r.has("height")||"height"in t&&"height"in e&&t.height===e.height||("height"in t&&"number"===typeof t.height?n.height=t.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),Object(B.a)(r).some((function(n){return!(n in t)||!(n in e)||!A_()(t[n],e[n])}))&&(n.isExpensive=!0),!(!1===n.width&&!1===n.height&&!n.isExpensive)&&n}(hq(this.props),hq(t)),i=this.props.signalListeners,o=t.signalListeners;if(r)if(r.isExpensive)this.clearView(),this.createView();else{var a=!L(i,o);this.modifyView((function(t){!1!==r.width&&t.width(r.width),!1!==r.height&&t.height(r.height),a&&(o&&lq(t,o),i&&uq(t,i)),t.run()}))}else L(i,o)||this.modifyView((function(t){o&&lq(t,o),i&&uq(t,i),t.run()}))}}},{key:"componentWillUnmount",value:function(){this.clearView()}},{key:"createView",value:function(){var t=this.props,e=t.onNewView,n=t.signalListeners,r=void 0===n?{}:n,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,["spec","onNewView","signalListeners"]);if(this.containerRef.current){var o=hq(this.props);this.viewPromise=function(t,e){var n,r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,void 0,void 0,Z.a.mark((function a(){var A,s,c,u,l;return Z.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(A=iq(o.loader)?o.loader:JK.loader(o.loader),!Object(x.H)(e)){a.next=9;break}return a.t1=JSON,a.next=5,A.load(e);case 5:a.t2=a.sent,a.t0=a.t1.parse.call(a.t1,a.t2),a.next=10;break;case 9:a.t0=e;case 10:return s=a.t0,a.next=13,oq(null!==(n=s.usermeta&&s.usermeta.embedOptions)&&void 0!==n?n:{},A);case 13:return c=a.sent,a.next=16,oq(o,A);case 16:return u=a.sent,l=Object.assign(Object.assign({},PK(u,c)),{config:Object(x.N)(null!==(r=u.config)&&void 0!==r?r:{},null!==(i=c.config)&&void 0!==i?i:{})}),a.next=20,aq(t,s,l,A);case 20:return a.abrupt("return",a.sent);case 21:case"end":return a.stop()}}),a)})))}(this.containerRef.current,o,i).then((function(t){var e=t.view;return uq(e,r)&&e.run(),e})).catch(this.handleError),e&&this.modifyView(e)}}},{key:"clearView",value:function(){return this.modifyView((function(t){t.finalize()})),this.viewPromise=void 0,this}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.style;return E.a.createElement("div",{ref:this.containerRef,className:e,style:n})}}]),n}(E.a.PureComponent);function Iq(){return(Iq=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function pq(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}gq(dq,"propTypes",{className:T.a.string,onError:T.a.func});var Cq=function(t){Object(G.a)(n,t);var e=Object(_.a)(n);function n(){var t;Object(F.a)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),pq(Object(D.a)(t),"vegaEmbed",E.a.createRef()),pq(Object(D.a)(t),"handleNewView",(function(e){t.update();var n=t.props.onNewView;(void 0===n?cq:n)(e)})),t}return Object(w.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(t){L(this.props.data,t.data)||this.update()}},{key:"update",value:function(){var t=this.props.data;t&&this.vegaEmbed.current&&Object.keys(t).length>0&&this.vegaEmbed.current.modifyView((function(e){Aq(e,t),e.resize().run()}))}},{key:"render",value:function(){var t=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(this.props,["data"]);return E.a.createElement(dq,Iq({ref:this.vegaEmbed},t,{onNewView:this.handleNewView}))}}]),n}(E.a.PureComponent);pq(Cq,"defaultProps",{data:{}});var yq="table";function vq(t){return"https://vega.github.io/schema/vega/v5.json"===t.$schema}function Bq(t){var e=t.spec,n=t.data,r=t.signalListeners,i=Object(m.a)({},e,{data:vq(e)?[{name:yq}].concat(Object(B.a)(e.data)):{name:yq}}),o=Object(b.useMemo)((function(){return E.a.createElement(Cq,{spec:i,data:Object(v.a)({},yq,n),signalListeners:r,tooltip:(new N).call,renderer:"canvas",scaleFactor:3})}),[i,n,r]);return i&&n&&n.length>0?E.a.createElement(b.Suspense,{fallback:E.a.createElement("div",null,"Loading...")},o):null}var mq={dark:{background:null,title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},light:{background:null}};n.d(e,"c",(function(){return Bq})),n.d(e,"a",(function(){return yq})),n.d(e,"b",(function(){return mq}))},,function(t,e,n){"use strict";var r=n(526);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,a){if(a!==r){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,A=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,g=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,I=r?Symbol.for("react.memo"):60115,p=r?Symbol.for("react.lazy"):60116,C=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,B=r?Symbol.for("react.scope"):60119;function m(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case l:case g:case a:case s:case A:case h:return t;default:switch(t=t&&t.$$typeof){case u:case f:case p:case I:case c:return t;default:return e}}case o:return e}}}function b(t){return m(t)===g}e.AsyncMode=l,e.ConcurrentMode=g,e.ContextConsumer=u,e.ContextProvider=c,e.Element=i,e.ForwardRef=f,e.Fragment=a,e.Lazy=p,e.Memo=I,e.Portal=o,e.Profiler=s,e.StrictMode=A,e.Suspense=h,e.isAsyncMode=function(t){return b(t)||m(t)===l},e.isConcurrentMode=b,e.isContextConsumer=function(t){return m(t)===u},e.isContextProvider=function(t){return m(t)===c},e.isElement=function(t){return"object"===typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return m(t)===f},e.isFragment=function(t){return m(t)===a},e.isLazy=function(t){return m(t)===p},e.isMemo=function(t){return m(t)===I},e.isPortal=function(t){return m(t)===o},e.isProfiler=function(t){return m(t)===s},e.isStrictMode=function(t){return m(t)===A},e.isSuspense=function(t){return m(t)===h},e.isValidElementType=function(t){return"string"===typeof t||"function"===typeof t||t===a||t===g||t===s||t===A||t===h||t===d||"object"===typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===I||t.$$typeof===c||t.$$typeof===u||t.$$typeof===f||t.$$typeof===y||t.$$typeof===v||t.$$typeof===B||t.$$typeof===C)},e.typeOf=m},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(13),i=n.n(r),o=n(30),a=n(211),A=n(238),s=n(107);function c(t){return u.apply(this,arguments)}function u(){return(u=Object(o.a)(i.a.mark((function t(e){var n,r,o,c,u,l,g,f,h;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],r=[],o=!0,c=!1,t.prev=4,l=Object(a.a)(e);case 6:return t.next=8,l.next();case 8:return g=t.sent,o=g.done,t.next=12,g.value;case 12:if(f=t.sent,o){t.next=19;break}"string"===typeof(h=f)?r.push(h):n.push(h);case 16:o=!0,t.next=6;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(4),c=!0,u=t.t0;case 25:if(t.prev=25,t.prev=26,o||null==l.return){t.next=30;break}return t.next=30,l.return();case 30:if(t.prev=30,!c){t.next=33;break}throw u;case 33:return t.finish(30);case 34:return t.finish(25);case 35:if(!(r.length>0)){t.next=38;break}return Object(s.a)(0===n.length),t.abrupt("return",r.join(""));case 38:return t.abrupt("return",A.b.apply(void 0,n));case 39:case"end":return t.stop()}}),t,null,[[4,21,25,35],[26,,30,34]])})))).apply(this,arguments)}},function(t,e,n){var r=n(131).Uint8Array;t.exports=r},function(t,e,n){var r=n(531),i=n(508),o=n(410);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(507),i=n(200);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(676),i=n(493),o=n(200),a=n(386),A=n(454),s=n(408),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),u=!n&&i(t),l=!n&&!u&&a(t),g=!n&&!u&&!l&&s(t),f=n||u||l||g,h=f?r(t.length,String):[],d=h.length;for(var I in t)!e&&!c.call(t,I)||f&&("length"==I||l&&("offset"==I||"parent"==I)||g&&("buffer"==I||"byteLength"==I||"byteOffset"==I)||A(I,d))||h.push(I);return h}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(194)(n(131),"Set");t.exports=r},function(t,e,n){var r=n(747),i=n(1050),o=n(873),a=Object.defineProperty;e.f=n(515)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(A){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(121);(r=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,A=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,A)}},function(t){var e,n,i=t.length,o=new Array(i),a=new Array(i),A=new Array(i);for(e=0;e<i;++e)n=[t[e][0],t[e][1],t[e][2]],o[e]=n[0]||0,a[e]=n[1]||0,A[e]=n[2]||0;return o=r(o),a=r(a),A=r(A),function(t){return[o(t),a(t),A(t)]}})([[103,0,31],[178,24,43],[214,96,77],[244,165,130],[253,219,199],[247,247,247],[209,229,240],[146,197,222],[67,147,195],[33,102,172],[5,48,97]]);var o=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}([[13,8,135],[16,7,136],[19,7,137],[22,7,138],[25,6,140],[27,6,141],[29,6,142],[32,6,143],[34,6,144],[36,6,145],[38,5,145],[40,5,146],[42,5,147],[44,5,148],[46,5,149],[47,5,150],[49,5,151],[51,5,151],[53,4,152],[55,4,153],[56,4,154],[58,4,154],[60,4,155],[62,4,156],[63,4,156],[65,4,157],[67,3,158],[68,3,158],[70,3,159],[72,3,159],[73,3,160],[75,3,161],[76,2,161],[78,2,162],[80,2,162],[81,2,163],[83,2,163],[85,2,164],[86,1,164],[88,1,164],[89,1,165],[91,1,165],[92,1,166],[94,1,166],[96,1,166],[97,0,167],[99,0,167],[100,0,167],[102,0,167],[103,0,168],[105,0,168],[106,0,168],[108,0,168],[110,0,168],[111,0,168],[113,0,168],[114,1,168],[116,1,168],[117,1,168],[119,1,168],[120,1,168],[122,2,168],[123,2,168],[125,3,168],[126,3,168],[128,4,168],[129,4,167],[131,5,167],[132,5,167],[134,6,166],[135,7,166],[136,8,166],[138,9,165],[139,10,165],[141,11,165],[142,12,164],[143,13,164],[145,14,163],[146,15,163],[148,16,162],[149,17,161],[150,19,161],[152,20,160],[153,21,159],[154,22,159],[156,23,158],[157,24,157],[158,25,157],[160,26,156],[161,27,155],[162,29,154],[163,30,154],[165,31,153],[166,32,152],[167,33,151],[168,34,150],[170,35,149],[171,36,148],[172,38,148],[173,39,147],[174,40,146],[176,41,145],[177,42,144],[178,43,143],[179,44,142],[180,46,141],[181,47,140],[182,48,139],[183,49,138],[184,50,137],[186,51,136],[187,52,136],[188,53,135],[189,55,134],[190,56,133],[191,57,132],[192,58,131],[193,59,130],[194,60,129],[195,61,128],[196,62,127],[197,64,126],[198,65,125],[199,66,124],[200,67,123],[201,68,122],[202,69,122],[203,70,121],[204,71,120],[204,73,119],[205,74,118],[206,75,117],[207,76,116],[208,77,115],[209,78,114],[210,79,113],[211,81,113],[212,82,112],[213,83,111],[213,84,110],[214,85,109],[215,86,108],[216,87,107],[217,88,106],[218,90,106],[218,91,105],[219,92,104],[220,93,103],[221,94,102],[222,95,101],[222,97,100],[223,98,99],[224,99,99],[225,100,98],[226,101,97],[226,102,96],[227,104,95],[228,105,94],[229,106,93],[229,107,93],[230,108,92],[231,110,91],[231,111,90],[232,112,89],[233,113,88],[233,114,87],[234,116,87],[235,117,86],[235,118,85],[236,119,84],[237,121,83],[237,122,82],[238,123,81],[239,124,81],[239,126,80],[240,127,79],[240,128,78],[241,129,77],[241,131,76],[242,132,75],[243,133,75],[243,135,74],[244,136,73],[244,137,72],[245,139,71],[245,140,70],[246,141,69],[246,143,68],[247,144,68],[247,145,67],[247,147,66],[248,148,65],[248,149,64],[249,151,63],[249,152,62],[249,154,62],[250,155,61],[250,156,60],[250,158,59],[251,159,58],[251,161,57],[251,162,56],[252,163,56],[252,165,55],[252,166,54],[252,168,53],[252,169,52],[253,171,51],[253,172,51],[253,174,50],[253,175,49],[253,177,48],[253,178,47],[253,180,47],[253,181,46],[254,183,45],[254,184,44],[254,186,44],[254,187,43],[254,189,42],[254,190,42],[254,192,41],[253,194,41],[253,195,40],[253,197,39],[253,198,39],[253,200,39],[253,202,38],[253,203,38],[252,205,37],[252,206,37],[252,208,37],[252,210,37],[251,211,36],[251,213,36],[251,215,36],[250,216,36],[250,218,36],[249,220,36],[249,221,37],[248,223,37],[248,225,37],[247,226,37],[247,228,37],[246,230,38],[246,232,38],[245,233,38],[245,235,39],[244,237,39],[243,238,39],[243,240,39],[242,242,39],[241,244,38],[241,245,37],[240,247,36],[240,249,33]]);function a(t){var e=t.cellColorEncoding,n=t.expressionMatrix,r=t.geneSelection,a=t.cellSets,A=t.cellSetSelection,s=t.cellSetColor;if("geneSelection"===e&&r&&r.length>=1&&n){var c=r[0],u=o,l=n.cols.indexOf(c);if(-1!==l){var g=n.cols.length;return new Map(n.rows.map((function(t,e){var r=n.matrix[e*g+l];return[t,u(r/255)]})))}}else if("cellSetSelection"===e&&A&&a)return Object(i.n)(a,A,s);return new Map}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(9),i=n(27);function o(t){return t&&"object"===Object(i.a)(t)&&t.constructor===Object}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?Object(r.a)({},t):t;return o(t)&&o(e)&&Object.keys(e).forEach((function(r){"__proto__"!==r&&(o(e[r])&&r in t?i[r]=a(t[r],e[r],n):i[r]=e[r])})),i}},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=n.n(o),A=(n(20),n(65)),s=n(32),c=n(60),u=n(83),l=n(43),g="undefined"!==typeof window?o.useLayoutEffect:o.useEffect;var f=function(t){var e=t.children,n=t.defer,r=void 0!==n&&n,i=t.fallback,a=void 0===i?null:i,A=o.useState(!1),s=A[0],c=A[1];return g((function(){r||c(!0)}),[r]),o.useEffect((function(){r&&c(!0)}),[r]),o.createElement(o.Fragment,null,s?e:a)},h=n(224),d=n(23),I=n(157),p=n(54),C=n(182),y=n(233);function v(t,e){var n=Object.create(null);return t&&o.Children.map(t,(function(t){return t})).forEach((function(t){n[t.key]=function(t){return e&&Object(o.isValidElement)(t)?e(t):t}(t)})),n}function B(t,e,n){return null!=n[e]?n[e]:t.props[e]}function m(t,e,n){var r=v(t.children),i=function(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var r,i=Object.create(null),o=[];for(var a in t)a in e?o.length&&(i[a]=o,o=[]):o.push(a);var A={};for(var s in e){if(i[s])for(r=0;r<i[s].length;r++){var c=i[s][r];A[i[s][r]]=n(c)}A[s]=n(s)}for(r=0;r<o.length;r++)A[o[r]]=n(o[r]);return A}(e,r);return Object.keys(i).forEach((function(a){var A=i[a];if(Object(o.isValidElement)(A)){var s=a in e,c=a in r,u=e[a],l=Object(o.isValidElement)(u)&&!u.props.in;!c||s&&!l?c||!s||l?c&&s&&Object(o.isValidElement)(u)&&(i[a]=Object(o.cloneElement)(A,{onExited:n.bind(null,A),in:u.props.in,exit:B(A,"exit",t),enter:B(A,"enter",t)})):i[a]=Object(o.cloneElement)(A,{in:!1}):i[a]=Object(o.cloneElement)(A,{onExited:n.bind(null,A),in:!0,exit:B(A,"exit",t),enter:B(A,"enter",t)})}})),i}var b=Object.values||function(t){return Object.keys(t).map((function(e){return t[e]}))},E=function(t){function e(e,n){var r,i=(r=t.call(this,e,n)||this).handleExited.bind(Object(p.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}Object(C.a)(e,t);var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(t,e){var n,r,i=e.children,a=e.handleExited;return{children:e.firstRender?(n=t,r=a,v(n.children,(function(t){return Object(o.cloneElement)(t,{onExited:r.bind(null,t),in:!0,appear:B(t,"appear",n),enter:B(t,"enter",n),exit:B(t,"exit",n)})}))):m(t,i,a),firstRender:!1}},n.handleExited=function(t,e){var n=v(this.props.children);t.key in n||(t.props.onExited&&t.props.onExited(e),this.mounted&&this.setState((function(e){var n=Object(r.a)({},e.children);return delete n[t.key],{children:n}})))},n.render=function(){var t=this.props,e=t.component,n=t.childFactory,r=Object(I.a)(t,["component","childFactory"]),i=this.state.contextValue,o=b(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===e?a.a.createElement(y.a.Provider,{value:i},o):a.a.createElement(y.a.Provider,{value:i},a.a.createElement(e,r,o))},e}(a.a.Component);E.propTypes={},E.defaultProps={component:"div",childFactory:function(t){return t}};var Q=E,F="undefined"===typeof window?o.useEffect:o.useLayoutEffect;var w=function(t){var e=t.classes,n=t.pulsate,r=void 0!==n&&n,i=t.rippleX,a=t.rippleY,A=t.rippleSize,c=t.in,l=t.onExited,g=void 0===l?function(){}:l,f=t.timeout,h=o.useState(!1),d=h[0],I=h[1],p=Object(s.a)(e.ripple,e.rippleVisible,r&&e.ripplePulsate),C={width:A,height:A,top:-A/2+a,left:-A/2+i},y=Object(s.a)(e.child,d&&e.childLeaving,r&&e.childPulsate),v=Object(u.a)(g);return F((function(){if(!c){I(!0);var t=setTimeout(v,f);return function(){clearTimeout(t)}}}),[v,c,f]),o.createElement("span",{className:p,style:C},o.createElement("span",{className:y}))},S=o.forwardRef((function(t,e){var n=t.center,a=void 0!==n&&n,A=t.classes,c=t.className,u=Object(i.a)(t,["center","classes","className"]),l=o.useState([]),g=l[0],f=l[1],h=o.useRef(0),I=o.useRef(null);o.useEffect((function(){I.current&&(I.current(),I.current=null)}),[g]);var p=o.useRef(!1),C=o.useRef(null),y=o.useRef(null),v=o.useRef(null);o.useEffect((function(){return function(){clearTimeout(C.current)}}),[]);var B=o.useCallback((function(t){var e=t.pulsate,n=t.rippleX,r=t.rippleY,i=t.rippleSize,a=t.cb;f((function(t){return[].concat(Object(d.a)(t),[o.createElement(w,{key:h.current,classes:A,timeout:550,pulsate:e,rippleX:n,rippleY:r,rippleSize:i})])})),h.current+=1,I.current=a}),[A]),m=o.useCallback((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.pulsate,i=void 0!==r&&r,o=e.center,A=void 0===o?a||e.pulsate:o,s=e.fakeElement,c=void 0!==s&&s;if("mousedown"===t.type&&p.current)p.current=!1;else{"touchstart"===t.type&&(p.current=!0);var u,l,g,f=c?null:v.current,h=f?f.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(A||0===t.clientX&&0===t.clientY||!t.clientX&&!t.touches)u=Math.round(h.width/2),l=Math.round(h.height/2);else{var d=t.clientX?t.clientX:t.touches[0].clientX,I=t.clientY?t.clientY:t.touches[0].clientY;u=Math.round(d-h.left),l=Math.round(I-h.top)}if(A)(g=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(g+=1);else{var m=2*Math.max(Math.abs((f?f.clientWidth:0)-u),u)+2,b=2*Math.max(Math.abs((f?f.clientHeight:0)-l),l)+2;g=Math.sqrt(Math.pow(m,2)+Math.pow(b,2))}t.touches?null===y.current&&(y.current=function(){B({pulsate:i,rippleX:u,rippleY:l,rippleSize:g,cb:n})},C.current=setTimeout((function(){y.current&&(y.current(),y.current=null)}),80)):B({pulsate:i,rippleX:u,rippleY:l,rippleSize:g,cb:n})}}),[a,B]),b=o.useCallback((function(){m({},{pulsate:!0})}),[m]),E=o.useCallback((function(t,e){if(clearTimeout(C.current),"touchend"===t.type&&y.current)return t.persist(),y.current(),y.current=null,void(C.current=setTimeout((function(){E(t,e)})));y.current=null,f((function(t){return t.length>0?t.slice(1):t})),I.current=e}),[]);return o.useImperativeHandle(e,(function(){return{pulsate:b,start:m,stop:E}}),[b,m,E]),o.createElement("span",Object(r.a)({className:Object(s.a)(A.root,c),ref:v},u),o.createElement(Q,{component:null,exit:!0},g))})),R=Object(l.a)((function(t){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(t.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(t.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(t.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(t.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(S)),U=o.forwardRef((function(t,e){var n=t.action,a=t.buttonRef,l=t.centerRipple,g=void 0!==l&&l,d=t.children,I=t.classes,p=t.className,C=t.component,y=void 0===C?"button":C,v=t.disabled,B=void 0!==v&&v,m=t.disableRipple,b=void 0!==m&&m,E=t.disableTouchRipple,Q=void 0!==E&&E,F=t.focusRipple,w=void 0!==F&&F,S=t.focusVisibleClassName,U=t.onBlur,x=t.onClick,k=t.onFocus,O=t.onFocusVisible,N=t.onKeyDown,D=t.onKeyUp,G=t.onMouseDown,_=t.onMouseLeave,M=t.onMouseUp,T=t.onTouchEnd,j=t.onTouchMove,L=t.onTouchStart,V=t.onDragLeave,Z=t.tabIndex,P=void 0===Z?0:Z,W=t.TouchRippleProps,J=t.type,H=void 0===J?"button":J,Y=Object(i.a)(t,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=o.useRef(null);var z=o.useRef(null),K=o.useState(!1),q=K[0],$=K[1];B&&q&&$(!1);var tt=Object(h.a)(),et=tt.isFocusVisible,nt=tt.onBlurVisible,rt=tt.ref;function it(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q;return Object(u.a)((function(r){return e&&e(r),!n&&z.current&&z.current[t](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){$(!0),X.current.focus()}}}),[]),o.useEffect((function(){q&&w&&!b&&z.current.pulsate()}),[b,w,q]);var ot=it("start",G),at=it("stop",V),At=it("stop",M),st=it("stop",(function(t){q&&t.preventDefault(),_&&_(t)})),ct=it("start",L),ut=it("stop",T),lt=it("stop",j),gt=it("stop",(function(t){q&&(nt(t),$(!1)),U&&U(t)}),!1),ft=Object(u.a)((function(t){B||(X.current||(X.current=t.currentTarget),et(t)&&($(!0),O&&O(t)),k&&k(t))})),ht=function(){var t=A.findDOMNode(X.current);return y&&"button"!==y&&!("A"===t.tagName&&t.href)},dt=o.useRef(!1),It=Object(u.a)((function(t){w&&!dt.current&&q&&z.current&&" "===t.key&&(dt.current=!0,t.persist(),z.current.stop(t,(function(){z.current.start(t)}))),t.target===t.currentTarget&&ht()&&" "===t.key&&t.preventDefault(),N&&N(t),t.target===t.currentTarget&&ht()&&"Enter"===t.key&&(t.preventDefault(),x&&x(t))})),pt=Object(u.a)((function(t){w&&" "===t.key&&z.current&&q&&!t.defaultPrevented&&(dt.current=!1,t.persist(),z.current.stop(t,(function(){z.current.pulsate(t)}))),D&&D(t),x&&t.target===t.currentTarget&&ht()&&" "===t.key&&!t.defaultPrevented&&x(t)})),Ct=y;"button"===Ct&&Y.href&&(Ct="a");var yt={};"button"===Ct?(yt.type=H,yt.disabled=B):("a"===Ct&&Y.href||(yt.role="button"),yt["aria-disabled"]=B);var vt=Object(c.a)(a,e),Bt=Object(c.a)(rt,X),mt=Object(c.a)(vt,Bt);return o.createElement(Ct,Object(r.a)({className:Object(s.a)(I.root,p,q&&[I.focusVisible,S],B&&I.disabled),onBlur:gt,onClick:x,onFocus:ft,onKeyDown:It,onKeyUp:pt,onMouseDown:ot,onMouseLeave:st,onMouseUp:At,onDragLeave:at,onTouchEnd:ut,onTouchMove:lt,onTouchStart:ct,ref:mt,tabIndex:B?-1:P},yt,Y),d,o.createElement(f,null,b||B?null:o.createElement(R,Object(r.a)({ref:z,center:g},W))))}));e.a=Object(l.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(U)},function(t,e,n){"use strict";var r=n(28),i=n(9),o=n(0),a=n.n(o),A=n(80),s=n(864),c={set:function(t,e,n,r){var i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:function(t,e,n){var r=t.get(e);return r?r.get(n):void 0},delete:function(t,e,n){t.get(e).delete(n)}},u=n(714),l=n(901),g=-1e9;function f(){return g+=1}n(27);var h=n(540);function d(t){var e="function"===typeof t;return{create:function(n,r){var o;try{o=e?t(n):t}catch(s){throw s}if(!r||!n.overrides||!n.overrides[r])return o;var a=n.overrides[r],A=Object(i.a)({},o);return Object.keys(a).forEach((function(t){A[t]=Object(h.a)(A[t],a[t])})),A},options:{}}}var I={};function p(t,e,n){var r=t.state;if(t.stylesOptions.disableGeneration)return e||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var i=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,i=!0),e!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=e,i=!0),i&&(r.cacheClasses.value=Object(s.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:e,Component:n})),r.cacheClasses.value}function C(t,e){var n=t.state,r=t.theme,o=t.stylesOptions,a=t.stylesCreator,u=t.name;if(!o.disableGeneration){var l=c.get(o.sheetsManager,a,r);l||(l={refs:0,staticSheet:null,dynamicStyles:null},c.set(o.sheetsManager,a,r,l));var g=Object(i.a)({},a.options,{},o,{theme:r,flip:"boolean"===typeof o.flip?o.flip:"rtl"===r.direction});g.generateId=g.serverGenerateClassName||g.generateClassName;var f=o.sheetsRegistry;if(0===l.refs){var h;o.sheetsCache&&(h=c.get(o.sheetsCache,a,r));var d=a.create(r,u);h||((h=o.jss.createStyleSheet(d,Object(i.a)({link:!1},g))).attach(),o.sheetsCache&&c.set(o.sheetsCache,a,r,h)),f&&f.add(h),l.staticSheet=h,l.dynamicStyles=Object(A.d)(d)}if(l.dynamicStyles){var I=o.jss.createStyleSheet(l.dynamicStyles,Object(i.a)({link:!0},g));I.update(e),I.attach(),n.dynamicSheet=I,n.classes=Object(s.a)({baseClasses:l.staticSheet.classes,newClasses:I.classes}),f&&f.add(I)}else n.classes=l.staticSheet.classes;l.refs+=1}}function y(t,e){var n=t.state;n.dynamicSheet&&n.dynamicSheet.update(e)}function v(t){var e=t.state,n=t.theme,r=t.stylesOptions,i=t.stylesCreator;if(!r.disableGeneration){var o=c.get(r.sheetsManager,i,n);o.refs-=1;var a=r.sheetsRegistry;0===o.refs&&(c.delete(r.sheetsManager,i,n),r.jss.removeStyleSheet(o.staticSheet),a&&a.remove(o.staticSheet)),e.dynamicSheet&&(r.jss.removeStyleSheet(e.dynamicSheet),a&&a.remove(e.dynamicSheet))}}function B(t,e){var n,r=a.a.useRef([]),i=a.a.useMemo((function(){return{}}),e);r.current!==i&&(r.current=i,n=t()),a.a.useEffect((function(){return function(){n&&n()}}),[i])}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.name,o=e.classNamePrefix,A=e.Component,s=e.defaultTheme,c=void 0===s?I:s,g=Object(r.a)(e,["name","classNamePrefix","Component","defaultTheme"]),h=d(t),m=n||o||"makeStyles";return h.options={index:f(),name:n,meta:m,classNamePrefix:m},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(u.a)()||c,r=Object(i.a)({},a.a.useContext(l.a),{},g),o=a.a.useRef(),s=a.a.useRef();return B((function(){var i={name:n,state:{},stylesCreator:h,stylesOptions:r,theme:e};return C(i,t),s.current=!1,o.current=i,function(){v(i)}}),[e,h]),a.a.useEffect((function(){s.current&&y(o.current,t),s.current=!0})),p(o.current,t.classes,A)}}n.d(e,"a",(function(){return m}))},function(t,e,n){var r=n(1172);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},function(t,e,n){"use strict";var r=function(){};t.exports=r},,function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(69),o=n(109),a=r(n(797)),A=n(137),s=r(n(796));function c(t,e){var n=o.getCoords(t),r=o.getCoords(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var a=n[0][0],A=n[0][1],s=n[1][0],c=n[1][1],u=r[0][0],l=r[0][1],g=r[1][0],f=r[1][1],h=(f-l)*(s-a)-(g-u)*(c-A),d=(g-u)*(A-l)-(f-l)*(a-u),I=(s-a)*(A-l)-(c-A)*(a-u);if(0===h)return null;var p=d/h,C=I/h;if(p>=0&&p<=1&&C>=0&&C<=1){var y=a+p*(s-a),v=A+p*(c-A);return i.point([y,v])}return null}e.default=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=i.feature(t)),"LineString"===e.type&&(e=i.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var u=c(t,e);return u&&r.push(u),i.featureCollection(r)}var l=s.default();return l.load(a.default(e)),A.featureEach(a.default(t),(function(t){A.featureEach(l.search(t),(function(e){var i=c(t,e);if(i){var a=o.getCoords(i).join(",");n[a]||(n[a]=!0,r.push(i))}}))})),i.featureCollection(r)}},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function A(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.TwoClickPolygonMode=void 0;var l=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(f,t);var e,n,r,l,g=(e=f,function(){var t,n=c(e);if(s()){var r=c(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return A(this,t)});function f(){return i(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"handleClick",value:function(t,e){e.modeConfig&&e.modeConfig.dragToDraw||(this.addClickSequence(t),this.checkAndFinishPolygon(e))}},{key:"handleStartDragging",value:function(t,e){e.modeConfig&&e.modeConfig.dragToDraw&&(this.addClickSequence(t),t.cancelPan())}},{key:"handleStopDragging",value:function(t,e){e.modeConfig&&e.modeConfig.dragToDraw&&(this.addClickSequence(t),this.checkAndFinishPolygon(e))}},{key:"checkAndFinishPolygon",value:function(t){var e=this.getClickSequence(),n=this.getTentativeGuide(t);if(e.length>1&&n&&"Polygon"===n.geometry.type){var r={type:"Feature",properties:{shape:n.properties.shape},geometry:{type:"Polygon",coordinates:n.geometry.coordinates}},i=this.getAddFeatureOrBooleanPolygonAction(r,t);this.resetClickSequence(),i&&t.onEdit(i)}}},{key:"getGuides",value:function(t){var e=t.lastPointerMoveEvent,n=t.modeConfig,r=this.getClickSequence(),i={type:"FeatureCollection",features:[]};if(0===r.length)return i;var o=r[0],a=e.mapCoords,A=this.getTwoClickPolygon(o,a,n);return A&&i.features.push({type:"Feature",properties:{shape:A.properties&&A.properties.shape,guideType:"tentative"},geometry:A.geometry}),i}},{key:"getTwoClickPolygon",value:function(t,e,n){return null}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell"),a(c(f.prototype),"handlePointerMove",this).call(this,t,e)}},{key:"createTentativeFeature",value:function(t){var e,n=t.lastPointerMoveEvent,r=this.getClickSequence(),i=n?[n.mapCoords]:[];return 1===r.length&&(e=this.getTwoClickPolygon(r[0],i[0],t.modeConfig)),e}}])&&o(n.prototype,r),l&&o(n,l),f}(n(155).GeoJsonEditMode);e.TwoClickPolygonMode=l},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.toDeckColor=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[255,0,0,255];if(!Array.isArray(t))return e;return[255*t[0],255*t[1],255*t[2],255*t[3]]},e.recursivelyTraverseNestedArrays=function t(e,n,i){if(!Array.isArray(e[0]))return!0;for(var o=0;o<e.length;o++)if(t(e[o],[].concat(function(t){if(Array.isArray(t))return r(t)}(a=n)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(a)||function(t,e){if(!t)return;if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[o]),i)){i(e,n);break}var a;return!1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(44),c=n(110),u=n(360),l=n(253),g=n(226),f=n(243),h=n(295);function d(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return I(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var C=[0,0,0,255],y={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:function(t){return t.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:C},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0},v=function(t){Object(o.a)(n,t);var e=p(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"initializeState",value:function(){this.state={paths:[]},this.props.getLineDashArray&&s.a.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=this,n=(t.oldProps,t.props,t.changeFlags),r=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(r&&Array.isArray(n.dataChanged)){var i=this.state.paths.slice(),o=n.dataChanged.map((function(t){return Object(h.a)({data:i,getIndex:function(t){return t.__source.index},dataRange:t,replace:e._getPaths(t)})}));this.setState({paths:i,pathsDiff:o})}else r&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,r=n.data,i=n.getPolygon,o=n.positionFormat,a=n._normalize,A=[],s="XY"===o?2:3,u=e.startRow,l=e.endRow,g=Object(c.a)(r,u,l),h=g.iterable,I=g.objectInfo,p=d(h);try{for(p.s();!(t=p.n()).done;){var C=t.value;I.index++;var y=i(C,I);a&&(y=f.b(y,s));var v=y,B=v.holeIndices,m=y.positions||y;if(B)for(var b=0;b<=B.length;b++){var E=m.slice(B[b-1]||0,B[b]||m.length);A.push(this.getSubLayerRow({path:E},C,I.index))}else A.push(this.getSubLayerRow({path:m},C,I.index))}}catch(Q){p.e(Q)}finally{p.f()}return A}},{key:"renderLayers",value:function(){var t=this.props,e=t.data,n=t._dataDiff,r=t.stroked,i=t.filled,o=t.extruded,a=t.wireframe,A=t._normalize,s=t.elevationScale,c=t.transitions,u=t.positionFormat,f=this.props,h=f.lineWidthUnits,d=f.lineWidthScale,I=f.lineWidthMinPixels,p=f.lineWidthMaxPixels,y=f.lineJointRounded,v=f.lineMiterLimit,B=f.lineDashJustified,m=this.props,b=m.getFillColor,E=m.getLineColor,Q=m.getLineWidth,F=m.getLineDashArray,w=m.getElevation,S=m.getPolygon,R=m.updateTriggers,U=m.material,x=this.state,k=x.paths,O=x.pathsDiff,N=this.getSubLayerClass("fill",l.a),D=this.getSubLayerClass("stroke",g.a),G=this.shouldRenderSubLayer("fill",k)&&new N({_dataDiff:n,extruded:o,elevationScale:s,filled:i,wireframe:a,_normalize:A,getElevation:w,getFillColor:b,getLineColor:o&&a?E:C,material:U,transitions:c},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:R.getPolygon,getElevation:R.getElevation,getFillColor:R.getFillColor,lineColors:o&&a,getLineColor:R.getLineColor}}),{data:e,positionFormat:u,getPolygon:S});return[!o&&G,!o&&r&&this.shouldRenderSubLayer("stroke",k)&&new D({_dataDiff:O&&function(){return O},widthUnits:h,widthScale:d,widthMinPixels:I,widthMaxPixels:p,rounded:y,miterLimit:v,dashJustified:B,_pathType:"loop",transitions:c&&{getWidth:c.getLineWidth,getColor:c.getLineColor,getPath:c.getPolygon},getColor:this.getSubLayerAccessor(E),getWidth:this.getSubLayerAccessor(Q),getDashArray:this.getSubLayerAccessor(F)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:R.getLineWidth,getColor:R.getLineColor,getDashArray:R.getLineDashArray}}),{data:k,positionFormat:u,getPath:function(t){return t.path}}),o&&G]}}]),n}(u.a);v.layerName="PolygonLayer",v.defaultProps=y},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(933),l=n(436),g=n(252),f=n(379),h=n(1),d=n(44),I=n(197);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){Object(h.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var v=function(t){Object(a.a)(n,t);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,n);var i=t.id,o=void 0===i?Object(I.c)("column-geometry"):i,a=B(t),A=a.indices,s=a.attributes;return e.call(this,C(C({},t),{},{id:o,indices:A,attributes:s}))}return n}(n(235).a);function B(t){var e=t.radius,n=t.height,r=void 0===n?1:n,i=t.nradial,o=void 0===i?10:i,a=t.vertices;d.a.assert(!a||a.length>=o);for(var A=o+1,s=3*A,c=2*Math.PI/o,u=new Uint16Array(3*o*2),l=new Float32Array(3*s),g=new Float32Array(3*s),f=0,h=0;h<A;h++)for(var I=h*c,p=a&&a[h%o],C=a&&a[(h+1)%o],y=Math.sin(I),v=Math.cos(I),B=0;B<2;B++)l[f+0]=p?p[0]:v*e,l[f+1]=p?p[1]:y*e,l[f+2]=(.5-B)*r,g[f+0]=p?C[0]-p[0]:v,g[f+1]=p?C[1]-p[1]:y,f+=3;for(var m=0;m<A;m++){var b=Math.floor(m/2)*Math.sign(m%2-.5),E=b*c,Q=a&&a[(b+o)%o],F=Math.sin(E),w=Math.cos(E);l[f+0]=Q?Q[0]:w*e,l[f+1]=Q?Q[1]:F*e,l[f+2]=r/2,g[f+2]=1,f+=3}for(var S=0,R=0;R<o;R++)u[S++]=2*R+0,u[S++]=2*R+2,u[S++]=2*R+0,u[S++]=2*R+1,u[S++]=2*R+1,u[S++]=2*R+3;return{indices:u,attributes:{POSITION:{size:3,value:l},NORMAL:{size:3,value:g}}}}function m(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return Q}));var b=[0,0,0,255],E={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:function(t){return t.position}},getFillColor:{type:"accessor",value:b},getLineColor:{type:"accessor",value:b},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}},Q=function(t){Object(a.a)(n,t);var e=m(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"\n#define SHADER_NAME column-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute float instanceElevations;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute float instanceStrokeWidths;\n\nattribute vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nvarying vec4 vColor;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n\n  vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n  mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n  float elevation = 0.0;\n  float strokeOffsetRatio = 1.0;\n\n  if (extruded) {\n    elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n  } else if (isStroke) {\n    float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n      widthMinPixels, widthMaxPixels) / 2.0;\n    strokeOffsetRatio += sign(positions.z) * project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n  }\n  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n  float dotRadius = radius * coverage * shouldRender;\n\n  geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n  geometry.pickingColor = instancePickingColors;\n  vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n  vec3 centroidPosition64Low = instancePositions64Low;\n  vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n  DECKGL_FILTER_SIZE(pos, geometry);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  if (extruded && !isStroke) {\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n    vColor = vec4(lightColor, color.a * opacity);\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n  gl_FragColor = vColor;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a,l.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:b},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:b},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i});var a=i.extensionsChanged;if(a){var A=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(A)}),this.getAttributeManager().invalidateAll()}(a||e.diskResolution!==r.diskResolution||e.vertices!==r.vertices)&&this._updateGeometry(e)}},{key:"getGeometry",value:function(t,e){var n=new v({radius:1,height:2,vertices:e,nradial:t}),r=0;if(e)for(var i=0;i<t;i++){var o=e[i];r+=Math.sqrt(o[0]*o[0]+o[1]*o[1])/t}else r=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*r}),n}},{key:"_getModel",value:function(t){return new f.a(t,Object.assign({},this.getShaders(),{id:this.props.id,isInstanced:!0}))}},{key:"_updateGeometry",value:function(t){var e=t.diskResolution,n=t.vertices,r=this.getGeometry(e,n);this.setState({fillVertexCount:r.attributes.POSITION.value.length/3,wireframeVertexCount:r.indices.value.length}),this.state.model.setProps({geometry:r})}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.lineWidthUnits,o=r.lineWidthScale,a=r.lineWidthMinPixels,A=r.lineWidthMaxPixels,s=r.elevationScale,c=r.extruded,u=r.filled,l=r.stroked,g=r.wireframe,f=r.offset,h=r.coverage,d=r.radius,I=r.angle,p=this.state,C=p.model,y=p.fillVertexCount,v=p.wireframeVertexCount,B=p.edgeDistance,m="pixels"===i?n.metersPerPixel:1;C.setUniforms(Object.assign({},e,{radius:d,angle:I/180*Math.PI,offset:f,extruded:c,coverage:h,elevationScale:s,edgeDistance:B,widthScale:o*m,widthMinPixels:a,widthMaxPixels:A})),c&&g&&(C.setProps({isIndexed:!0}),C.setVertexCount(v).setDrawMode(1).setUniforms({isStroke:!0}).draw()),u&&(C.setProps({isIndexed:!1}),C.setVertexCount(y).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!c&&l&&(C.setProps({isIndexed:!1}),C.setVertexCount(2*y/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}]),n}(g.a);Q.layerName="ColumnLayer",Q.defaultProps=E},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(207)),o=n(69),a=n(137),A=r(n(764)),s=r(n(765));e.default=function(t,e){void 0===e&&(e={});var n=e.maxEdge||1/0,r=function(t){var e=[],n={};return a.featureEach(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");n.hasOwnProperty(r)||(e.push(t),n[r]=!0)}})),o.featureCollection(e)}(t),c=A.default(r);if(c.features=c.features.filter((function(t){var r=t.geometry.coordinates[0][0],o=t.geometry.coordinates[0][1],a=t.geometry.coordinates[0][2],A=i.default(r,o,e),s=i.default(o,a,e),c=i.default(r,a,e);return A<=n&&s<=n&&c<=n})),c.features.length<1)return null;var u=s.default(c);return 1===u.coordinates.length&&(u.coordinates=u.coordinates[0],u.type="Polygon"),o.feature(u)}},function(t,e,n){"use strict";var r=n(0),i=r.createContext();e.a=i},function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new Error("radians is required");return 180*(t%(2*Math.PI))/Math.PI}function i(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function o(t){return!!t&&t.constructor===Object}function a(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function A(t,e){var n=i(t[1]),o=i(e[1]),a=i(e[0]-t[0]);a>Math.PI&&(a-=2*Math.PI),a<-Math.PI&&(a+=2*Math.PI);var A=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(r(Math.atan2(a,A))+360)%360}e.a=function(t,e,n){if(!o(n=n||{}))throw new Error("options is invalid");var r,i=n.final;if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");return(r=i?A(a(e),a(t)):A(a(t),a(e)))>180?-(360-r):r}},function(t,e,n){"use strict";var r={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325};function i(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function o(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return function(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}(i(t,e),n||"kilometers")}function a(t){return!!t&&t.constructor===Object}function A(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}e.a=function(t,e,n){if(!a(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=A(t),s=A(e);return s[0]+=s[0]-i[0]>180?-360:i[0]-s[0]>180?360:0,o(function(t,e,n){var r=n=void 0===n?6371008.8:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,A=Math.abs(e[0]-t[0])*Math.PI/180;A>Math.PI&&(A-=2*Math.PI);var s=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(s)>1e-11?a/s:Math.cos(i);return Math.sqrt(a*a+c*c*A*A)*r}(i,s),"meters",r)}},function(t,e,n){"use strict";var r=n(1138),i=n(870),o=n(1142),a=n(1033),A=n(497),s=n(1143),c=n(1144),u=n(1165),l=n(685);t.exports=p,p.prototype.validate=function(t,e){var n;if("string"==typeof t){if(!(n=this.getSchema(t)))throw new Error('no schema with key or ref "'+t+'"')}else{var r=this._addSchema(t);n=r.validate||this._compile(r)}var i=n(e);!0!==n.$async&&(this.errors=n.errors);return i},p.prototype.compile=function(t,e){var n=this._addSchema(t,void 0,e);return n.validate||this._compile(n)},p.prototype.addSchema=function(t,e,n,r){if(Array.isArray(t)){for(var o=0;o<t.length;o++)this.addSchema(t[o],void 0,n,r);return this}var a=this._getId(t);if(void 0!==a&&"string"!=typeof a)throw new Error("schema id must be string");return b(this,e=i.normalizeId(e||a)),this._schemas[e]=this._addSchema(t,n,r,!0),this},p.prototype.addMetaSchema=function(t,e,n){return this.addSchema(t,e,n,!0),this},p.prototype.validateSchema=function(t,e){var n=t.$schema;if(void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(!(n=n||this._opts.defaultMeta||function(t){var e=t._opts.meta;return t._opts.defaultMeta="object"==typeof e?t._getId(e)||e:t.getSchema(h)?h:void 0,t._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var r=this.validate(n,t);if(!r&&e){var i="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(i);this.logger.error(i)}return r},p.prototype.getSchema=function(t){var e=C(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return function(t,e){var n=i.schema.call(t,{schema:{}},e);if(n){var o=n.schema,A=n.root,s=n.baseId,c=r.call(t,o,A,void 0,s);return t._fragments[e]=new a({ref:e,fragment:!0,schema:o,root:A,baseId:s,validate:c}),c}}(this,t)}},p.prototype.removeSchema=function(t){if(t instanceof RegExp)return y(this,this._schemas,t),y(this,this._refs,t),this;switch(typeof t){case"undefined":return y(this,this._schemas),y(this,this._refs),this._cache.clear(),this;case"string":var e=C(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var n=this._opts.serialize,r=n?n(t):t;this._cache.del(r);var o=this._getId(t);o&&(o=i.normalizeId(o),delete this._schemas[o],delete this._refs[o])}return this},p.prototype.addFormat=function(t,e){"string"==typeof e&&(e=new RegExp(e));return this._formats[t]=e,this},p.prototype.errorsText=function(t,e){if(!(t=t||this.errors))return"No errors";for(var n=void 0===(e=e||{}).separator?", ":e.separator,r=void 0===e.dataVar?"data":e.dataVar,i="",o=0;o<t.length;o++){var a=t[o];a&&(i+=r+a.dataPath+" "+a.message+n)}return i.slice(0,-n.length)},p.prototype._addSchema=function(t,e,n,r){if("object"!=typeof t&&"boolean"!=typeof t)throw new Error("schema should be object or boolean");var o=this._opts.serialize,A=o?o(t):t,s=this._cache.get(A);if(s)return s;r=r||!1!==this._opts.addUsedSchema;var c=i.normalizeId(this._getId(t));c&&r&&b(this,c);var u,l=!1!==this._opts.validateSchema&&!e;l&&!(u=c&&c==i.normalizeId(t.$schema))&&this.validateSchema(t,!0);var g=i.ids.call(this,t),f=new a({id:c,schema:t,localRefs:g,cacheKey:A,meta:n});"#"!=c[0]&&r&&(this._refs[c]=f);this._cache.put(A,f),l&&u&&this.validateSchema(t,!0);return f},p.prototype._compile=function(t,e){if(t.compiling)return t.validate=o,o.schema=t.schema,o.errors=null,o.root=e||o,!0===t.schema.$async&&(o.$async=!0),o;var n,i;t.compiling=!0,t.meta&&(n=this._opts,this._opts=this._metaOpts);try{i=r.call(this,t.schema,e,t.localRefs)}catch(a){throw delete t.validate,a}finally{t.compiling=!1,t.meta&&(this._opts=n)}return t.validate=i,t.refs=i.refs,t.refVal=i.refVal,t.root=i.root,i;function o(){var e=t.validate,n=e.apply(this,arguments);return o.errors=e.errors,n}},p.prototype.compileAsync=n(1166);var g=n(1167);p.prototype.addKeyword=g.add,p.prototype.getKeyword=g.get,p.prototype.removeKeyword=g.remove,p.prototype.validateKeyword=g.validate;var f=n(871);p.ValidationError=f.Validation,p.MissingRefError=f.MissingRef,p.$dataMetaSchema=u;var h="http://json-schema.org/draft-07/schema",d=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],I=["/properties"];function p(t){if(!(this instanceof p))return new p(t);t=this._opts=l.copy(t)||{},function(t){var e=t._opts.logger;if(!1===e)t.logger={log:E,warn:E,error:E};else{if(void 0===e&&(e=console),!("object"==typeof e&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=s(t.format),this._cache=t.cache||new o,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(t){switch(t.schemaId){case"auto":return m;case"id":return v;default:return B}}(t),t.loopRequired=t.loopRequired||1/0,"property"==t.errorDataPath&&(t._errorDataPathProperty=!0),void 0===t.serialize&&(t.serialize=A),this._metaOpts=function(t){for(var e=l.copy(t._opts),n=0;n<d.length;n++)delete e[d[n]];return e}(this),t.formats&&function(t){for(var e in t._opts.formats){var n=t._opts.formats[e];t.addFormat(e,n)}}(this),t.keywords&&function(t){for(var e in t._opts.keywords){var n=t._opts.keywords[e];t.addKeyword(e,n)}}(this),function(t){var e;t._opts.$data&&(e=n(1170),t.addMetaSchema(e,e.$id,!0));if(!1===t._opts.meta)return;var r=n(1039);t._opts.$data&&(r=u(r,I));t.addMetaSchema(r,h,!0),t._refs["http://json-schema.org/schema"]=h}(this),"object"==typeof t.meta&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(t){var e=t._opts.schemas;if(!e)return;if(Array.isArray(e))t.addSchema(e);else for(var n in e)t.addSchema(e[n],n)}(this)}function C(t,e){return e=i.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function y(t,e,n){for(var r in e){var i=e[r];i.meta||n&&!n.test(r)||(t._cache.del(i.cacheKey),delete e[r])}}function v(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function B(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function m(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function b(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function E(){}},function(t,e,n){"use strict";var r,i=n(11),o=n(14),a=n(24),A=n(25),s=n(549),c=n(360),u=n(26),l=n(325),g=n(40),f=n(16),h=n(69),d=n(834),I=n.n(d),p=n(835),C=n.n(p),y=n(836),v=n.n(y),B=n(517),m=n.n(B),b=n(315),E=n(376),Q=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"handleClick",value:function(t,e){e.onEdit({editType:"clearFeatures"})}}]),n}(E.DrawRectangleMode),F=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"handleClick",value:function(t,e){e.onEdit({editType:"clearFeatures"})}}]),n}(E.DrawPolygonByDraggingMode),w=(r={},Object(f.a)(r,b.SELECTION_TYPE.RECTANGLE,Q),Object(f.a)(r,b.SELECTION_TYPE.POLYGON,F),r),S={selectionType:b.SELECTION_TYPE.RECTANGLE,layerIds:[],onSelect:function(){}},R={type:"FeatureCollection",features:[]},U=["lineWidthScale","lineWidthMinPixels","lineWidthMaxPixels","lineWidthUnits","lineJointRounded","lineMiterLimit","pointRadiusScale","pointRadiusMinPixels","pointRadiusMaxPixels","lineDashJustified","getLineColor","getFillColor","getRadius","getLineWidth","getLineDashArray","getTentativeLineDashArray","getTentativeLineColor","getTentativeFillColor","getTentativeLineWidth","editHandlePointRadiusScale","editHandlePointRadiusMinPixels","editHandlePointRadiusMaxPixels","getEditHandlePointColor","getEditHandlePointRadius","modeHandlers"],x=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"_selectPolygonObjects",value:function(t){var e=this.props,n=e.onSelect,r=e.getCellCoords,i=e.cellsQuadTree,o=e.flipY?t.map((function(t){return t.map((function(t){return[t[0],-t[1]]}))})):t,a=Object(h.polygon)(o),A=[];i.visit((function(t,e,n,i,o){var s=[[[e,n],[i,n],[i,o],[e,o],[e,n]]],c=Object(h.polygon)(s),u=C()(c,a),l=I()(c,a),g=v()(c,a);return!(u||l||g)||(t.data&&m()(Object(h.point)(r(t.data[1])),a)&&A.push(t.data),!1)})),n({pickingInfos:A})}},{key:"renderLayers",value:function(){var t=this,e=this.props.onSelect,n=w[this.props.selectionType]||E.ViewMode,r={};return U.forEach((function(e){void 0!==t.props[e]&&(r[e]=t.props[e])})),[new b.EditableGeoJsonLayer(this.getSubLayerProps(Object(u.a)({id:"selection-geojson",pickable:!0,mode:n,modeConfig:{dragToDraw:!0},selectedFeatureIndexes:[],data:R,onEdit:function(n){var r=n.updatedData,i=n.editType;if("addFeature"===i){var o=r.features[0].geometry.coordinates;t._selectPolygonObjects(o)}else"clearFeatures"===i&&e({pickingInfos:[]})}},r)))]}}]),n}(c.a);function k(t){return"base-".concat(t)}function O(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(!t)return[];var A=k(n),s=5/(e+16);return[new x({id:"selection",flipY:a,cellsQuadTree:o,getCellCoords:r,coordinateSystem:g.a.CARTESIAN,selectionType:t,onSelect:function(t){var e=t.pickingInfos.map((function(t){return t[0]}));i&&i(e)},layerIds:[A],getTentativeFillColor:function(){return[255,255,255,95]},getTentativeLineColor:function(){return[143,143,143,255]},getTentativeLineDashArray:function(){return[7,4]},lineWidthMinPixels:2,lineWidthMaxPixels:2,getEditHandlePointColor:function(){return[255,255,255,255]},getEditHandlePointRadius:function(){return s},editHandlePointRadiusScale:1,editHandlePointRadiusMinPixels:s,editHandlePointRadiusMaxPixels:2*s})]}function N(t,e){return function(n){var r=t(n);return[.5*(e[0]-r[0])+r[0],.5*(e[1]-r[1])+r[1],.5*(e[2]-r[2])+r[2]]}}function D(t){var e,n=t.id,r=t.backgroundColor,i=t.getColor,o=t.data,a=t.isSelected,A=Object(l.a)(t,["id","backgroundColor","getColor","data","isSelected"]);return{overlay:Object(u.a)({id:(e=n,"selected-".concat(e)),getFillColor:i,getLineColor:i,data:o.filter(a)},A),base:Object(u.a)({id:k(n),getLineColor:i?N(i,r):void 0,getFillColor:i?N(i,r):void 0,data:o.slice()},A)}}x.layerName="SelectionLayer",x.defaultProps=S;var G=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"renderLayers",value:function(){var t=D(this.props);return[new s.a(t.base),new s.a(t.overlay)]}}]),n}(c.a);G.layerName="SelectablePolygonLayer";var _=n(334),M=function(t){Object(a.a)(n,t);var e=Object(A.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"renderLayers",value:function(){var t=D(this.props);return[new _.a(t.base),new _.a(t.overlay)]}}]),n}(c.a);M.layerName="SelectableScatterplotLayer";n(695),n(694),n(693);n.d(e,"a",(function(){return G})),n.d(e,"b",(function(){return M})),n.d(e,"c",(function(){return O}))},function(t,e,n){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function a(t){return null===t?Nt:t.color}function A(t){return null===t?null:t.parent}function s(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function u(t){return null===t?null:t.right}function l(){this.root_=null,this.size_=0}function g(){}function f(){this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}function h(){}function d(t){this.message=t||""}function I(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var p=function(){};p.prototype.interfaces_=function(){return[]},p.prototype.getClass=function(){return p},p.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var C=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),y=function(){},v={MAX_VALUE:{configurable:!0}};y.isNaN=function(t){return Number.isNaN(t)},y.doubleToLongBits=function(t){return t},y.longBitsToDouble=function(t){return t},y.isInfinite=function(t){return!Number.isFinite(t)},v.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(y,v);var B=function(){},m=function(){},b=function(){},E=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Q={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};E.prototype.setOrdinate=function(t,e){switch(t){case E.X:this.x=e;break;case E.Y:this.y=e;break;case E.Z:this.z=e;break;default:throw new C("Invalid ordinate index: "+t)}},E.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!p.equalsWithTolerance(this.x,e.x,n)&&!!p.equalsWithTolerance(this.y,e.y,n)}},E.prototype.getOrdinate=function(t){switch(t){case E.X:return this.x;case E.Y:return this.y;case E.Z:return this.z}throw new C("Invalid ordinate index: "+t)},E.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||y.isNaN(this.z))&&y.isNaN(t.z)},E.prototype.equals=function(t){return t instanceof E&&this.equals2D(t)},E.prototype.equalInZ=function(t,e){return p.equalsWithTolerance(this.z,t.z,e)},E.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},E.prototype.clone=function(){},E.prototype.copy=function(){return new E(this)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},E.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},E.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},E.prototype.hashCode=function(){var t=17;return 37*(t=37*t+E.hashCode(this.x))+E.hashCode(this.y)},E.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},E.prototype.interfaces_=function(){return[B,m,e]},E.prototype.getClass=function(){return E},E.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=y.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Q.DimensionalComparator.get=function(){return F},Q.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Q.NULL_ORDINATE.get=function(){return y.NaN},Q.X.get=function(){return 0},Q.Y.get=function(){return 1},Q.Z.get=function(){return 2},Object.defineProperties(E,Q);var F=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new C("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};F.prototype.compare=function(t,e){var n=t,r=e,i=F.compare(n.x,r.x);if(0!==i)return i;var o=F.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:F.compare(n.z,r.z)},F.prototype.interfaces_=function(){return[b]},F.prototype.getClass=function(){return F},F.compare=function(t,e){return t<e?-1:t>e?1:y.isNaN(t)?y.isNaN(e)?0:-1:y.isNaN(e)?1:0};var w=function(){};w.prototype.create=function(){},w.prototype.interfaces_=function(){return[]},w.prototype.getClass=function(){return w};var S=function(){},R={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new C("Unknown location value: "+t)},R.INTERIOR.get=function(){return 0},R.BOUNDARY.get=function(){return 1},R.EXTERIOR.get=function(){return 2},R.NONE.get=function(){return-1},Object.defineProperties(S,R);var U=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},x=function(){},k={LOG_10:{configurable:!0}};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.log10=function(t){var e=Math.log(t);return y.isInfinite(e)||y.isNaN(e)?e:e/x.LOG_10},x.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},x.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},x.wrap=function(t,e){return t<0?e- -t%e:t%e},x.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],A=arguments[3],s=i;return o>s&&(s=o),a>s&&(s=a),A>s&&(s=A),s}},x.average=function(t,e){return(t+e)/2},k.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(x,k);var O=function(t){this.str=t};O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str};var N=function(t){this.value=t};N.prototype.intValue=function(){return this.value},N.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},N.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var G=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},_={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};G.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},G.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=G.magnitude(n._hi),i=G.TEN.pow(r);(n=n.divide(i)).gt(G.TEN)?(n=n.divide(G.TEN),r+=1):n.lt(G.ONE)&&(n=n.multiply(G.TEN),r-=1);for(var o=r+1,a=new O,A=G.MAX_PRINT_DIGITS-1,s=0;s<=A;s++){t&&s===o&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var u=!1,l=0;c>9?(u=!0,l="9"):l="0"+c,a.append(l),n=n.subtract(G.valueOf(c)).multiply(G.TEN),u&&n.selfAdd(G.TEN);var g=!0,f=G.magnitude(n._hi);if(f<0&&Math.abs(f)>=A-s&&(g=!1),!g)break}return e[0]=r,a.toString()},G.prototype.sqr=function(){return this.multiply(this)},G.prototype.doubleValue=function(){return this._hi+this._lo},G.prototype.subtract=function(){if(arguments[0]instanceof G){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},G.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},G.prototype.isZero=function(){return 0===this._hi&&0===this._lo},G.prototype.selfSubtract=function(){if(arguments[0]instanceof G){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},G.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},G.prototype.min=function(t){return this.le(t)?this:t},G.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof G){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,A=null,s=null,c=null,u=null,l=null;return s=this._hi/n,l=(i=(c=G.SPLIT*s)-(i=c-s))*(a=(l=G.SPLIT*n)-(a=l-n))-(u=s*n)+i*(A=n-a)+(o=s-i)*a+o*A,l=s+(c=(this._hi-u-l+this._lo-s*r)/n),this._hi=l,this._lo=s-l+c,this}},G.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},G.prototype.divide=function(){if(arguments[0]instanceof G){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,a=null,A=null,s=null;return n=(o=this._hi/t._hi)-(e=(a=G.SPLIT*o)-(e=a-o)),s=e*(r=(s=G.SPLIT*t._hi)-(r=s-t._hi))-(A=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,a=(this._hi-A-s+this._lo-o*t._lo)/t._hi,new G(s=o+a,o-s+a)}if("number"==typeof arguments[0]){var c=arguments[0];return y.isNaN(c)?G.createNaN():G.copy(this).selfDivide(c,0)}},G.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},G.prototype.pow=function(t){if(0===t)return G.valueOf(1);var e=new G(this),n=G.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},G.prototype.ceil=function(){if(this.isNaN())return G.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new G(t,e)},G.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},G.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},G.prototype.setValue=function(){if(arguments[0]instanceof G){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},G.prototype.max=function(t){return this.ge(t)?this:t},G.prototype.sqrt=function(){if(this.isZero())return G.valueOf(0);if(this.isNegative())return G.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=G.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},G.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof G){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,a=null,A=null;return o=(i=this._hi+e)-(a=i-this._hi),r=(A=(o=e-a+(this._hi-o))+this._lo)+(i-(n=i+A)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var s=arguments[0],c=arguments[1],u=null,l=null,g=null,f=null,h=null,d=null,I=null;f=this._hi+s,l=this._lo+c,h=f-(d=f-this._hi),g=l-(I=l-this._lo);var p=(u=f+(d=(h=s-d+(this._hi-h))+l))+(d=(g=c-I+(this._lo-g))+(d+(f-u))),C=d+(u-p);return this._hi=p,this._lo=C,this}},G.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof G){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,A=null,s=null,c=null;i=(s=G.SPLIT*this._hi)-this._hi,c=G.SPLIT*n,i=s-i,o=this._hi-i,a=c-n;var u=(s=this._hi*n)+(c=i*(a=c-a)-s+i*(A=n-a)+o*a+o*A+(this._hi*r+this._lo*n)),l=c+(i=s-u);return this._hi=u,this._lo=l,this}},G.prototype.selfSqr=function(){return this.selfMultiply(this)},G.prototype.floor=function(){if(this.isNaN())return G.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new G(t,e)},G.prototype.negate=function(){return this.isNaN()?this:new G(-this._hi,-this._lo)},G.prototype.clone=function(){},G.prototype.multiply=function(){if(arguments[0]instanceof G){var t=arguments[0];return t.isNaN()?G.createNaN():G.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return y.isNaN(e)?G.createNaN():G.copy(this).selfMultiply(e,0)}},G.prototype.isNaN=function(){return y.isNaN(this._hi)},G.prototype.intValue=function(){return Math.trunc(this._hi)},G.prototype.toString=function(){var t=G.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},G.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+G.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+G.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},G.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,a=null,A=null;t=(n=1/this._hi)-(i=(a=G.SPLIT*n)-(i=a-n)),o=(A=G.SPLIT*this._hi)-this._hi;var s=n+(a=(1-(r=n*this._hi)-(A=i*(o=A-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new G(s,n-s+a)},G.prototype.toSciNotation=function(){if(this.isZero())return G.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=G.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},G.prototype.abs=function(){return this.isNaN()?G.NaN:this.isNegative()?this.negate():new G(this)},G.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},G.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},G.prototype.add=function(){if(arguments[0]instanceof G){var t=arguments[0];return G.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return G.copy(this).selfAdd(e)}},G.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof G){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},G.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},G.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},G.prototype.trunc=function(){return this.isNaN()?G.NaN:this.isPositive()?this.floor():this.ceil()},G.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},G.prototype.interfaces_=function(){return[e,B,m]},G.prototype.getClass=function(){return G},G.sqr=function(t){return G.valueOf(t).selfMultiply(t)},G.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return G.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new G(e)}},G.sqrt=function(t){return G.valueOf(t).sqrt()},G.parse=function(t){for(var e=0,n=t.length;D.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new G,a=0,A=0,s=0;!(e>=n);){var c=t.charAt(e);if(e++,D.isDigit(c)){var u=c-"0";o.selfMultiply(G.TEN),o.selfAdd(u),a++}else{if("."!==c){if("e"===c||"E"===c){var l=t.substring(e);try{s=N.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}A=a}}var g=o,f=a-A-s;if(0===f)g=o;else if(f>0){var h=G.TEN.pow(f);g=o.divide(h)}else if(f<0){var d=G.TEN.pow(-f);g=o.multiply(d)}return r?g.negate():g},G.createNaN=function(){return new G(y.NaN,y.NaN)},G.copy=function(t){return new G(t)},G.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},G.stringOfChar=function(t,e){for(var n=new O,r=0;r<e;r++)n.append(t);return n.toString()},_.PI.get=function(){return new G(3.141592653589793,12246467991473532e-32)},_.TWO_PI.get=function(){return new G(6.283185307179586,24492935982947064e-32)},_.PI_2.get=function(){return new G(1.5707963267948966,6123233995736766e-32)},_.E.get=function(){return new G(2.718281828459045,14456468917292502e-32)},_.NaN.get=function(){return new G(y.NaN,y.NaN)},_.EPS.get=function(){return 123259516440783e-46},_.SPLIT.get=function(){return 134217729},_.MAX_PRINT_DIGITS.get=function(){return 32},_.TEN.get=function(){return G.valueOf(10)},_.ONE.get=function(){return G.valueOf(1)},_.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},_.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(G,_);var M=function(){},T={DP_SAFE_EPSILON:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.orientationIndex=function(t,e,n){var r=M.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=G.valueOf(e.x).selfAdd(-t.x),o=G.valueOf(e.y).selfAdd(-t.y),a=G.valueOf(n.x).selfAdd(-e.x),A=G.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(A).selfSubtract(o.selfMultiply(a)).signum()},M.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},M.intersection=function(t,e,n,r){var i=G.valueOf(r.y).selfSubtract(n.y).selfMultiply(G.valueOf(e.x).selfSubtract(t.x)),o=G.valueOf(r.x).selfSubtract(n.x).selfMultiply(G.valueOf(e.y).selfSubtract(t.y)),a=i.subtract(o),A=G.valueOf(r.x).selfSubtract(n.x).selfMultiply(G.valueOf(t.y).selfSubtract(n.y)),s=G.valueOf(r.y).selfSubtract(n.y).selfMultiply(G.valueOf(t.x).selfSubtract(n.x)),c=A.subtract(s).selfDivide(a).doubleValue(),u=G.valueOf(t.x).selfAdd(G.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),l=G.valueOf(e.x).selfSubtract(t.x).selfMultiply(G.valueOf(t.y).selfSubtract(n.y)),g=G.valueOf(e.y).selfSubtract(t.y).selfMultiply(G.valueOf(t.x).selfSubtract(n.x)),f=l.subtract(g).selfDivide(a).doubleValue(),h=G.valueOf(n.y).selfAdd(G.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new E(u,h)},M.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=i-o;if(i>0){if(o<=0)return M.signum(a);r=i+o}else{if(!(i<0))return M.signum(a);if(o>=0)return M.signum(a);r=-i-o}var A=M.DP_SAFE_EPSILON*r;return a>=A||-a>=A?M.signum(a):2},M.signum=function(t){return t>0?1:t<0?-1:0},T.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(M,T);var j=function(){},L={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};L.X.get=function(){return 0},L.Y.get=function(){return 1},L.Z.get=function(){return 2},L.M.get=function(){return 3},j.prototype.setOrdinate=function(t,e,n){},j.prototype.size=function(){},j.prototype.getOrdinate=function(t,e){},j.prototype.getCoordinate=function(){},j.prototype.getCoordinateCopy=function(t){},j.prototype.getDimension=function(){},j.prototype.getX=function(t){},j.prototype.clone=function(){},j.prototype.expandEnvelope=function(t){},j.prototype.copy=function(){},j.prototype.getY=function(t){},j.prototype.toCoordinateArray=function(){},j.prototype.interfaces_=function(){return[m]},j.prototype.getClass=function(){return j},Object.defineProperties(j,L);var V=function(){},Z=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(V),P=function(){};P.arraycopy=function(t,e,n,r,i){for(var o=0,a=e;a<e+i;a++)n[r+o]=t[a],o++},P.getProperty=function(t){return{"line.separator":"\n"}[t]};var W=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof E&&arguments[1]instanceof E){var a=arguments[0],A=arguments[1];this.x=a.y-A.y,this.y=A.x-a.x,this.w=a.x*A.y-A.x*a.y}}else if(3===arguments.length){var s=arguments[0],c=arguments[1],u=arguments[2];this.x=s,this.y=c,this.w=u}else if(4===arguments.length){var l=arguments[0],g=arguments[1],f=arguments[2],h=arguments[3],d=l.y-g.y,I=g.x-l.x,p=l.x*g.y-g.x*l.y,C=f.y-h.y,y=h.x-f.x,v=f.x*h.y-h.x*f.y;this.x=I*v-y*p,this.y=C*p-d*v,this.w=d*y-C*I}};W.prototype.getY=function(){var t=this.y/this.w;if(y.isNaN(t)||y.isInfinite(t))throw new Z;return t},W.prototype.getX=function(){var t=this.x/this.w;if(y.isNaN(t)||y.isInfinite(t))throw new Z;return t},W.prototype.getCoordinate=function(){var t=new E;return t.x=this.getX(),t.y=this.getY(),t},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W},W.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,A=n.y-r.y,s=r.x-n.x,c=n.x*r.y-r.x*n.y,u=i*s-A*o,l=(o*c-s*a)/u,g=(A*a-i*c)/u;if(y.isNaN(l)||y.isInfinite(l)||y.isNaN(g)||y.isInfinite(g))throw new Z;return new E(l,g)};var J=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],A=arguments[2],s=arguments[3];this.init(o,a,A,s)}},H={serialVersionUID:{configurable:!0}};J.prototype.getArea=function(){return this.getWidth()*this.getHeight()},J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},J.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new J;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new J(e,r,n,i)},J.prototype.isNull=function(){return this._maxx<this._minx},J.prototype.getMaxX=function(){return this._maxx},J.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof J){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},J.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof J){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof E){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},J.prototype.getMinY=function(){return this._miny},J.prototype.getMinX=function(){return this._minx},J.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof J){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},J.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},J.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},J.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},J.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},J.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},J.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},J.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},J.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},J.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},J.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof J){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof E){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},J.prototype.centre=function(){return this.isNull()?null:new E((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},J.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof J){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],A=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),a<A?(this._miny=a,this._maxy=A):(this._miny=A,this._maxy=a)}},J.prototype.getMaxY=function(){return this._maxy},J.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},J.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+E.hashCode(this._minx))+E.hashCode(this._maxx))+E.hashCode(this._miny))+E.hashCode(this._maxy)},J.prototype.interfaces_=function(){return[B,e]},J.prototype.getClass=function(){return J},J.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],A=Math.min(o.x,a.x),s=Math.max(o.x,a.x),c=Math.min(r.x,i.x),u=Math.max(r.x,i.x);return!(c>s)&&!(u<A)&&(A=Math.min(o.y,a.y),s=Math.max(o.y,a.y),c=Math.min(r.y,i.y),u=Math.max(r.y,i.y),!(c>s)&&!(u<A))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(J,H);var Y={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},X=function(t){this.geometryFactory=t||new pe};X.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=Y.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=Y.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},X.prototype.write=function(t){return this.extractGeometry(t)},X.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!z[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+z[e].apply(this,[t])+")"};var z={coordinate:function(t){return t.x+" "+t.y},point:function(t){return z.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+z.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(z.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(z.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+z.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+z.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+z.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+z.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Y.spaces);return this.geometryFactory.createPoint(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Y.spaces),r.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Y.spaces),r.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Y.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Y.parenComma),a=[],A=0,s=o.length;A<s;++A)e=o[A].replace(Y.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===A?i=r:a.push(r);return this.geometryFactory.createPolygon(i,a)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Y.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},q=function(t){this.parser=new X(t)};q.prototype.write=function(t){return this.parser.write(t)},q.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var $=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(t=arguments[0],e=arguments[1],!t))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new E,this._intPt[1]=new E,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return q.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+q.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var a=Math.abs(t.x-e.x),A=Math.abs(t.y-e.y);0!==(o=r>i?a:A)||t.equals(e)||(o=Math.max(a,A))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new J(this._inputLines[0][0],this._inputLines[0][1]),n=new J(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,J.intersects(n,r,e)&&0===At.orientationIndex(n,r,e)&&0===At.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=W.intersection(t,n,r,i)}catch(a){if(!(a instanceof Z))throw a;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new E(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=M.intersection(t,e,n,r),a=this.isInSegmentEnvelopes(o);P.out.println("DD in env = "+a+"  --------------------- "+o),i.distance(o)>1e-4&&P.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new E(t),o=new E(e),a=new E(n),A=new E(r),s=new E;this.normalizeToEnvCentre(i,o,a,A,s);var c=this.safeHCoordinateIntersection(i,o,a,A);return c.x+=s.x,c.y+=s.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=J.intersects(e,n,r),a=J.intersects(e,n,i),A=J.intersects(r,i,e),s=J.intersects(r,i,n);return o&&a?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):A&&s?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&A?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||a||A?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&A?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||A?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,a=t.y<e.y?t.y:e.y,A=t.x>e.x?t.x:e.x,s=t.y>e.y?t.y:e.y,c=n.x<r.x?n.x:r.x,u=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,g=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(A<l?A:l))/2,h=((a>u?a:u)+(s<g?s:g))/2;i.x=f,i.y=h,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!J.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=At.orientationIndex(e,n,r),a=At.orientationIndex(e,n,i);if(o>0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var A=At.orientationIndex(r,i,e),s=At.orientationIndex(r,i,n);return A>0&&s>0||A<0&&s<0?t.NO_INTERSECTION:0===o&&0===a&&0===A&&0===s?this.computeCollinearIntersection(e,n,r,i):(0===o||0===a||0===A||0===s?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new E(r):0===a?this._intPt[0]=new E(i):0===A?this._intPt[0]=new E(e):0===s&&(this._intPt[0]=new E(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=At.distancePointLine(t,n,r),a=At.distancePointLine(e,n,r);return a<o&&(o=a,i=e),(a=At.distancePointLine(n,t,e))<o&&(o=a,i=n),(a=At.distancePointLine(r,t,e))<o&&(o=a,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return ot.signOfDet2x2(r,i,o,a)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,a=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(a=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=a*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(a=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=a*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,A=e.y-this._p.y,s=ot.signOfDet2x2(i,o,a,A);if(0===s)return this._isPointOnSegment=!0,null;A<o&&(s=-s),s>0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==S.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?S.BOUNDARY:this._crossingCount%2==1?S.INTERIOR:S.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof E&&U(arguments[1],j)){for(var t=arguments[0],e=arguments[1],n=new at(t),r=new E,i=new E,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof E&&arguments[1]instanceof Array){for(var a=arguments[0],A=arguments[1],s=new at(a),c=1;c<A.length;c++){var u=A[c],l=A[c-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var At=function(){},st={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.orientationIndex=function(t,e,n){return M.orientationIndex(t,e,n)},At.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(U(arguments[0],j)){var a=arguments[0],A=a.size();if(A<3)return 0;var s=new E,c=new E,u=new E;a.getCoordinate(0,c),a.getCoordinate(1,u);var l=c.x;u.x-=l;for(var g=0,f=1;f<A-1;f++)s.y=c.y,c.x=u.x,c.y=u.y,a.getCoordinate(f+1,u),u.x-=l,g+=c.x*(s.y-u.y);return g/2}},At.distanceLineLine=function(t,e,n,r){if(t.equals(e))return At.distancePointLine(t,n,r);if(n.equals(r))return At.distancePointLine(r,t,e);var i=!1;if(J.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var a=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),A=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,s=a/o;(s<0||s>1||A<0||A>1)&&(i=!0)}}else i=!0;return i?x.min(At.distancePointLine(t,n,r),At.distancePointLine(e,n,r),At.distancePointLine(n,t,e),At.distancePointLine(r,t,e)):0},At.isPointInRing=function(t,e){return At.locatePointInRing(t,e)!==S.EXTERIOR},At.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new E;t.getCoordinate(0,r);for(var i=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var A=r.x,s=r.y,c=A-i,u=s-o;n+=Math.sqrt(c*c+u*u),i=A,o=s}return n},At.isCCW=function(t){var e=t.length-1;if(e<3)throw new C("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==r);var A=r;do{A=(A+1)%e}while(t[A].equals2D(n)&&A!==r);var s=t[a],c=t[A];if(s.equals2D(n)||c.equals2D(n)||s.equals2D(c))return!1;var u=At.computeOrientation(s,n,c);return 0===u?s.x>c.x:u>0},At.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},At.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},At.computeOrientation=function(t,e,n){return At.orientationIndex(t,e,n)},At.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new C("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=At.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],a=arguments[1],A=arguments[2];if(a.x===A.x&&a.y===A.y)return o.distance(a);var s=(A.x-a.x)*(A.x-a.x)+(A.y-a.y)*(A.y-a.y),c=((o.x-a.x)*(A.x-a.x)+(o.y-a.y)*(A.y-a.y))/s;if(c<=0)return o.distance(a);if(c>=1)return o.distance(A);var u=((a.y-o.y)*(A.x-a.x)-(a.x-o.x)*(A.y-a.y))/s;return Math.abs(u)*Math.sqrt(s)}},At.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},st.CLOCKWISE.get=function(){return-1},st.RIGHT.get=function(){return At.CLOCKWISE},st.COUNTERCLOCKWISE.get=function(){return 1},st.LEFT.get=function(){return At.COUNTERCLOCKWISE},st.COLLINEAR.get=function(){return 0},st.STRAIGHT.get=function(){return At.COLLINEAR},Object.defineProperties(At,st);var ct=function(){};ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var ut=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},lt={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ut.prototype.isGeometryCollection=function(){return this.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION},ut.prototype.getFactory=function(){return this._factory},ut.prototype.getGeometryN=function(t){return this},ut.prototype.getArea=function(){return 0},ut.prototype.isRectangle=function(){return!1},ut.prototype.equals=function(){if(arguments[0]instanceof ut){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ut))return!1;var n=e;return this.equalsExact(n)}},ut.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ut.prototype.geometryChanged=function(){this.apply(ut.geometryChangedFilter)},ut.prototype.geometryChangedAction=function(){this._envelope=null},ut.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ut.prototype.getLength=function(){return 0},ut.prototype.getNumGeometries=function(){return 1},ut.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ut.prototype.getUserData=function(){return this._userData},ut.prototype.getSRID=function(){return this._SRID},ut.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ut.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION)throw new C("This method does not support GeometryCollection arguments")},ut.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ut.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ut.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ut.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new J(this._envelope)},ut.prototype.setSRID=function(t){this._SRID=t},ut.prototype.setUserData=function(t){this._userData=t},ut.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),a=i.compareTo(o);if(0!==a)return a}return n.hasNext()?1:r.hasNext()?-1:0},ut.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ut.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ut.SORTINDEX_MULTIPOINT||this.getSortIndex()===ut.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ut.SORTINDEX_MULTIPOLYGON},ut.prototype.interfaces_=function(){return[m,B,e]},ut.prototype.getClass=function(){return ut},ut.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ut.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},lt.serialVersionUID.get=function(){return 0x799ea46522854c00},lt.SORTINDEX_POINT.get=function(){return 0},lt.SORTINDEX_MULTIPOINT.get=function(){return 1},lt.SORTINDEX_LINESTRING.get=function(){return 2},lt.SORTINDEX_LINEARRING.get=function(){return 3},lt.SORTINDEX_MULTILINESTRING.get=function(){return 4},lt.SORTINDEX_POLYGON.get=function(){return 5},lt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},lt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},lt.geometryChangedFilter.get=function(){return gt},Object.defineProperties(ut,lt);var gt=function(){};gt.interfaces_=function(){return[ct]},gt.filter=function(t){t.geometryChangedAction()};var ft=function(){};ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var ht=function(){},dt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};ht.prototype.isInBoundary=function(t){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},dt.Mod2BoundaryNodeRule.get=function(){return It},dt.EndPointBoundaryNodeRule.get=function(){return pt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return Ct},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return yt},dt.MOD2_BOUNDARY_RULE.get=function(){return new It},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new pt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ct},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return ht.MOD2_BOUNDARY_RULE},Object.defineProperties(ht,dt);var It=function(){};It.prototype.isInBoundary=function(t){return t%2==1},It.prototype.interfaces_=function(){return[ht]},It.prototype.getClass=function(){return It};var pt=function(){};pt.prototype.isInBoundary=function(t){return t>0},pt.prototype.interfaces_=function(){return[ht]},pt.prototype.getClass=function(){return pt};var Ct=function(){};Ct.prototype.isInBoundary=function(t){return t>1},Ct.prototype.interfaces_=function(){return[ht]},Ct.prototype.getClass=function(){return Ct};var yt=function(){};yt.prototype.isInBoundary=function(t){return 1===t},yt.prototype.interfaces_=function(){return[ht]},yt.prototype.getClass=function(){return yt};var vt=function(){};vt.prototype.add=function(){},vt.prototype.addAll=function(){},vt.prototype.isEmpty=function(){},vt.prototype.iterator=function(){},vt.prototype.size=function(){},vt.prototype.toArray=function(){},vt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Bt=function(){};Bt.prototype.hasNext=function(){},Bt.prototype.next=function(){},Bt.prototype.remove=function(){};var mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vt);(r.prototype=new Error).name="NoSuchElementException";var bt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Et(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(mt),Et=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Bt),Qt=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof E&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var A=arguments[0],s=arguments[1];if(arguments[2])for(var c=0;c<A.length;c++)this.add(A[c],s);else for(var u=A.length-1;u>=0;u--)this.add(A[u],s);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof E){var l=arguments[0],g=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(l>0&&this.get(l-1).equals2D(g))return null;if(l<f&&this.get(l).equals2D(g))return null}}t.prototype.add.call(this,l,g)}}else if(4===arguments.length){var h=arguments[0],d=arguments[1],I=arguments[2],p=arguments[3],C=1;I>p&&(C=-1);for(var y=I;y!==p;y+=C)this.add(h[y],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new E(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bt),Ft=function(){},wt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};wt.ForwardComparator.get=function(){return St},wt.BidirectionalComparator.get=function(){return Rt},wt.coordArrayType.get=function(){return new Array(0).fill(null)},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Ft.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Ft.indexOf(r,e)<0)return r}return null},Ft.scroll=function(t,e){var n=Ft.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);P.arraycopy(t,n,r,0,t.length-n),P.arraycopy(t,0,r,t.length-n,n),P.arraycopy(r,0,t,0,t.length)},Ft.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(0!==o.compare(r[a],i[a]))return!1;return!0}},Ft.intersection=function(t,e){for(var n=new Qt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Ft.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Ft.removeRepeatedPoints=function(t){return Ft.hasRepeatedPoints(t)?new Qt(t,!1).toCoordinateArray():t},Ft.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Ft.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Ft.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new E(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],A=arguments[4],s=0;s<A;s++)o[a+s]=new E(r[i+s])},Ft.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Ft.envelope=function(t){for(var e=new J,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Ft.toCoordinateArray=function(t){return t.toArray(Ft.coordArrayType)},Ft.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Ft.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Ft.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Ft.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Ft.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Ft.extract=function(t,e,n){e=x.clamp(e,0,t.length);var r=(n=x.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,a=e;a<=n;a++)i[o++]=t[a];return i},Object.defineProperties(Ft,wt);var St=function(){};St.prototype.compare=function(t,e){return Ft.compare(t,e)},St.prototype.interfaces_=function(){return[b]},St.prototype.getClass=function(){return St};var Rt=function(){};Rt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Ft.compare(n,r);return Ft.isEqualReversed(n,r)?0:i},Rt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Ft.increasingDirection(n),o=Ft.increasingDirection(r),a=i>0?0:n.length-1,A=o>0?0:n.length-1,s=0;s<n.length;s++){var c=n[a].compareTo(r[A]);if(0!==c)return c;a+=i,A+=o}return 0},Rt.prototype.interfaces_=function(){return[b]},Rt.prototype.getClass=function(){return Rt};var Ut=function(){};Ut.prototype.get=function(){},Ut.prototype.put=function(){},Ut.prototype.size=function(){},Ut.prototype.values=function(){},Ut.prototype.entrySet=function(){};var xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ut);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new vt).contains=function(){};var kt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Ot(this)},e}(o),Ot=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(Bt),Nt=0;(l.prototype=new xt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},l.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:n,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},l.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(A(t)===c(A(A(t)))){var e=u(A(A(t)));1===a(e)?(s(A(t),Nt),s(e,Nt),s(A(A(t)),1),t=A(A(t))):(t===u(A(t))&&(t=A(t),this.rotateLeft(t)),s(A(t),Nt),s(A(A(t)),1),this.rotateRight(A(A(t))))}else{var n=c(A(A(t)));1===a(n)?(s(A(t),Nt),s(n,Nt),s(A(A(t)),1),t=A(A(t))):(t===c(A(t))&&(t=A(t),this.rotateRight(t)),s(A(t),Nt),s(A(A(t)),1),this.rotateLeft(A(A(t))))}this.root_.color=Nt},l.prototype.values=function(){var t=new bt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=l.successor(e));)t.add(e.value);return t},l.prototype.entrySet=function(){var t=new kt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=l.successor(e));)t.add(e);return t},l.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},l.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},l.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},l.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},l.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},g.prototype=new o,(f.prototype=new g).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},f.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new i},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new Gt(this)};var Gt=function(t){this.treeSet_=t,this.position_=0};Gt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Gt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Gt.prototype.remove=function(){throw new i};var _t=function(){};_t.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},_t.asList=function(t){for(var e=new bt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Mt=function(){},Tt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Tt.P.get=function(){return 0},Tt.L.get=function(){return 1},Tt.A.get=function(){return 2},Tt.FALSE.get=function(){return-1},Tt.TRUE.get=function(){return-2},Tt.DONTCARE.get=function(){return-3},Tt.SYM_FALSE.get=function(){return"F"},Tt.SYM_TRUE.get=function(){return"T"},Tt.SYM_DONTCARE.get=function(){return"*"},Tt.SYM_P.get=function(){return"0"},Tt.SYM_L.get=function(){return"1"},Tt.SYM_A.get=function(){return"2"},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.toDimensionSymbol=function(t){switch(t){case Mt.FALSE:return Mt.SYM_FALSE;case Mt.TRUE:return Mt.SYM_TRUE;case Mt.DONTCARE:return Mt.SYM_DONTCARE;case Mt.P:return Mt.SYM_P;case Mt.L:return Mt.SYM_L;case Mt.A:return Mt.SYM_A}throw new C("Unknown dimension value: "+t)},Mt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case Mt.SYM_FALSE:return Mt.FALSE;case Mt.SYM_TRUE:return Mt.TRUE;case Mt.SYM_DONTCARE:return Mt.DONTCARE;case Mt.SYM_P:return Mt.P;case Mt.SYM_L:return Mt.L;case Mt.SYM_A:return Mt.A}throw new C("Unknown dimension symbol: "+t)},Object.defineProperties(Mt,Tt);var jt=function(){};jt.prototype.filter=function(t){},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt};var Lt=function(){};Lt.prototype.filter=function(t,e){},Lt.prototype.isDone=function(){},Lt.prototype.isGeometryChanged=function(){},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt};var Vt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new C("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new J,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();_t.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new f(_t.asList(this._geometries)),n=new f(_t.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,a=this.getNumGeometries(),A=o.getNumGeometries(),s=0;s<a&&s<A;){var c=this.getGeometryN(s),u=o.getGeometryN(s),l=c.compareToSameClass(u,i);if(0!==l)return l;s++}return s<a?1:s<A?-1:0}},e.prototype.apply=function(){if(U(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(U(arguments[0],Lt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(U(arguments[0],jt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(U(arguments[0],ct)){var a=arguments[0];a.filter(this);for(var A=0;A<this._geometries.length;A++)this._geometries[A].apply(a)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ut),Zt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Pt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Vt),Pt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=ht.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Pt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Pt.prototype.getBoundary=function(){return this._geom instanceof Xt?this.boundaryLineString(this._geom):this._geom instanceof Zt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Pt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Pt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Pt.prototype.computeBoundaryCoordinates=function(t){var e=new bt;this._endpointMap=new l;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),a=o.getValue().count;this._bnRule.isInBoundary(a)&&e.add(o.getKey())}return Ft.toCoordinateArray(e)},Pt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Wt,this._endpointMap.put(t,e)),e.count++},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new Pt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Pt(e,n).getBoundary()}};var Wt=function(){this.count=null};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var Jt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt},Jt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Jt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",a=new function(){}(new function(){}(Jt.getStackTrace(r))),A=0;A<i;A++)try{o+=a.readLine()+Jt.NEWLINE}catch(t){if(!(t instanceof h))throw t;et.shouldNeverReachHere()}return o}},Jt.split=function(t,e){for(var n=e.length,r=new bt,i=""+t,o=i.indexOf(e);o>=0;){var a=i.substring(0,o);r.add(a),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var A=new Array(r.size()).fill(null),s=0;s<A.length;s++)A[s]=r.get(s);return A},Jt.toString=function(){if(1===arguments.length){var t=arguments[0];return Jt.SIMPLE_ORDINATE_FORMAT.format(t)}},Jt.spaces=function(t){return Jt.chars(" ",t)},Ht.NEWLINE.get=function(){return P.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Jt,Ht);var Yt=function(){};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Yt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,j.X)===t.getOrdinate(e-1,j.X)&&t.getOrdinate(0,j.Y)===t.getOrdinate(e-1,j.Y)},Yt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var a=t.getOrdinate(i,o),A=e.getOrdinate(i,o);if(t.getOrdinate(i,o)!==e.getOrdinate(i,o)&&(!y.isNaN(a)||!y.isNaN(A)))return!1}return!0},Yt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Yt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Yt.copy(e,i-1,r,o,1);return r},Yt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Yt.swap(t,r,e-r)},Yt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Yt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Yt.copyCoord(t,e+o,n,r+o)},Yt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Jt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Yt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Yt.createClosedRing(t,e,4):e.getOrdinate(0,j.X)===e.getOrdinate(n-1,j.X)&&e.getOrdinate(0,j.Y)===e.getOrdinate(n-1,j.Y)?e:Yt.createClosedRing(t,e,n+1)},Yt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Yt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Yt.copy(e,0,r,o,1);return r};var Xt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new J:this._points.expandEnvelope(new J)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Yt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return At.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Yt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(U(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(U(arguments[0],Lt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(U(arguments[0],jt)||U(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Pt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new C("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ut),zt=function(){};zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new J;var t=new J;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(U(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(U(arguments[0],Lt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(U(arguments[0],jt)||U(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ut),qt=function(){};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var $t=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new C("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new C("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),a=0;a<o.length;a++)t[++e]=o[a];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(At.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(At.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),a=t.getY(0),A=1;A<=4;A++){var s=t.getX(A),c=t.getY(A);if(s!==o===(c!==a))return!1;o=s,a=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(r._holes[a],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);_t.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);P.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Ft.minCoordinate(e.getCoordinates());Ft.scroll(r,i),P.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],At.isCCW(e.getCoordinates())===n&&Ft.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[0],i=arguments[1],o=r,a=this._shell,A=o._shell,s=a.compareToSameClass(A,i);if(0!==s)return s;for(var c=this.getNumInteriorRing(),u=o.getNumInteriorRing(),l=0;l<c&&l<u;){var g=this.getInteriorRingN(l),f=o.getInteriorRingN(l),h=g.compareToSameClass(f,i);if(0!==h)return h;l++}return l<c?1:l<u?-1:0}},e.prototype.apply=function(t){if(U(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(U(t,Lt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(U(t,jt))t.filter(this);else if(U(t,ct)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ut),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Vt),ee=function(t){function e(e,n){e instanceof E&&n instanceof pe&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ut.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Yt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new C("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new C("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Xt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bt,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Vt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Vt?this.editGeometryCollection(t,e):t instanceof $t?this.editPolygon(t,e):t instanceof Kt||t instanceof Xt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bt,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Zt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new bt,o=0;o<n.getNumInteriorRing();o++){var a=this.edit(n.getInteriorRingN(o),e);null===a||a.isEmpty()||i.add(a)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return ae},ie.CoordinateSequenceOperation.get=function(){return Ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var ae=function(){};ae.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Xt?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var Ae=function(){};Ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Xt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},Ae.prototype.getClass=function(){return Ae};var se=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new E}else if(U(arguments[0],j)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],A=arguments[1];this._coordinates=new Array(a).fill(null),this._dimension=A;for(var s=0;s<a;s++)this._coordinates[s]=new E}},ce={serialVersionUID:{configurable:!0}};se.prototype.setOrdinate=function(t,e,n){switch(e){case j.X:this._coordinates[t].x=n;break;case j.Y:this._coordinates[t].y=n;break;case j.Z:this._coordinates[t].z=n;break;default:throw new C("invalid ordinateIndex")}},se.prototype.size=function(){return this._coordinates.length},se.prototype.getOrdinate=function(t,e){switch(e){case j.X:return this._coordinates[t].x;case j.Y:return this._coordinates[t].y;case j.Z:return this._coordinates[t].z}return y.NaN},se.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},se.prototype.getCoordinateCopy=function(t){return new E(this._coordinates[t])},se.prototype.getDimension=function(){return this._dimension},se.prototype.getX=function(t){return this._coordinates[t].x},se.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new se(t,this._dimension)},se.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},se.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new se(t,this._dimension)},se.prototype.toString=function(){if(this._coordinates.length>0){var t=new O(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},se.prototype.getY=function(t){return this._coordinates[t].y},se.prototype.toCoordinateArray=function(){return this._coordinates},se.prototype.interfaces_=function(){return[j,e]},se.prototype.getClass=function(){return se},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(se,ce);var ue=function(){},le={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ue.prototype.readResolve=function(){return ue.instance()},ue.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new se(t)}if(U(arguments[0],j)){var e=arguments[0];return new se(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new se(n):new se(n,r)}},ue.prototype.interfaces_=function(){return[w,e]},ue.prototype.getClass=function(){return ue},ue.instance=function(){return ue.instanceObject},le.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},le.instanceObject.get=function(){return new ue},Object.defineProperties(ue,le);var ge=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new kt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Ut),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},he={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new N(n).compareTo(new N(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return y.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof E){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,B]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},he.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},he.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,he);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},Ie={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},Ie.serialVersionUID.get=function(){return-552860263173159e4},Ie.nameToTypeMap.get=function(){return new ge},Object.defineProperties(de,Ie),fe.Type=de,fe.FIXED=new de("FIXED"),fe.FLOATING=new de("FLOATING"),fe.FLOATING_SINGLE=new de("FLOATING SINGLE");var pe=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?U(arguments[0],w)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Ce={serialVersionUID:{configurable:!0}};pe.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new E(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new E(t.getMinX(),t.getMinY()),new E(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new E(t.getMinX(),t.getMinY()),new E(t.getMinX(),t.getMaxY()),new E(t.getMaxX(),t.getMaxY()),new E(t.getMaxX(),t.getMinY()),new E(t.getMinX(),t.getMinY())]),null)},pe.prototype.createLineString=function(t){return t?t instanceof Array?new Xt(this.getCoordinateSequenceFactory().create(t),this):U(t,j)?new Xt(t,this):void 0:new Xt(this.getCoordinateSequenceFactory().create([]),this)},pe.prototype.createMultiLineString=function(){if(0===arguments.length)return new Zt(null,this);if(1===arguments.length){var t=arguments[0];return new Zt(t,this)}},pe.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(pe.toGeometryArray(t));var A=t.iterator().next();if(t.size()>1){if(A instanceof $t)return this.createMultiPolygon(pe.toPolygonArray(t));if(A instanceof Xt)return this.createMultiLineString(pe.toLineStringArray(t));if(A instanceof Kt)return this.createMultiPoint(pe.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+A.getClass().getName())}return A},pe.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},pe.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(U(arguments[0],j)){var e=arguments[0];return new Kt(e,this)}}},pe.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},pe.prototype.createPolygon=function(){if(0===arguments.length)return new $t(null,null,this);if(1===arguments.length){if(U(arguments[0],j)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new $t(r,i,this)}},pe.prototype.getSRID=function(){return this._SRID},pe.prototype.createGeometryCollection=function(){if(0===arguments.length)return new Vt(null,this);if(1===arguments.length){var t=arguments[0];return new Vt(t,this)}},pe.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},pe.prototype.getPrecisionModel=function(){return this._precisionModel},pe.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(U(arguments[0],j)){var e=arguments[0];return new ee(e,this)}}},pe.prototype.createMultiPolygon=function(){if(0===arguments.length)return new ne(null,this);if(1===arguments.length){var t=arguments[0];return new ne(t,this)}},pe.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new te(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(U(arguments[0],j)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Yt.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},pe.prototype.interfaces_=function(){return[e]},pe.prototype.getClass=function(){return pe},pe.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.getDefaultCoordinateSequenceFactory=function(){return ue.instance()},pe.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},pe.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Ce.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(pe,Ce);var ye=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ve=function(t){this.geometryFactory=t||new pe};ve.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Be[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ye.indexOf(n)?Be[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Be[n].apply(this,[e.geometries]):Be[n].apply(this,[e])},ve.prototype.write=function(t){var e=t.getGeometryType();if(!me[e])throw new Error("Geometry is not supported");return me[e].apply(this,[t])};var Be={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Be[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Be.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new E(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new E(t[0],t[1]),new E(t[2],t[1]),new E(t[2],t[3]),new E(t[0],t[3]),new E(t[0],t[1])])},Point:function(t){var e=new E(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Be.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Be.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Be.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Be.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],a=Be.coordinates.apply(this,[o]),A=this.geometryFactory.createLinearRing(a);r.push(A)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Be.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},me={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:me.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=me.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(me.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=me.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=me.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=me.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=me.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(me[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},be=function(t){this.geometryFactory=t||new pe,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ve(this.geometryFactory)};be.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},be.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ee=function(){this.parser=new ve(this.geometryFactory)};Ee.prototype.write=function(t){return this.parser.write(t)};var Qe=function(){},Fe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe},Qe.opposite=function(t){return t===Qe.LEFT?Qe.RIGHT:t===Qe.RIGHT?Qe.LEFT:t},Fe.ON.get=function(){return 0},Fe.LEFT.get=function(){return 1},Fe.RIGHT.get=function(){return 2},Object.defineProperties(Qe,Fe),(d.prototype=new Error).name="EmptyStackException",(I.prototype=new mt).add=function(t){return this.array_.push(t),!0},I.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},I.prototype.push=function(t){return this.array_.push(t),t},I.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},I.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},I.prototype.empty=function(){return 0===this.array_.length},I.prototype.isEmpty=function(){return this.empty()},I.prototype.search=function(t){return this.array_.indexOf(t)},I.prototype.size=function(){return this.array_.length},I.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var we=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};we.prototype.getCoordinate=function(){return this._minCoord},we.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},we.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=At.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===At.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===At.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},we.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Qe.LEFT;return n[e].y<n[e+1].y&&(r=Qe.RIGHT),r},we.prototype.getEdge=function(){return this._orientedDe},we.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},we.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},we.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Qe.LEFT&&(this._orientedDe=this._minDe.getSym())},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we};var Se=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new E(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}($),Re=function(){this.array_=[]};Re.prototype.addLast=function(t){this.array_.push(t)},Re.prototype.removeFirst=function(){return this.array_.shift()},Re.prototype.isEmpty=function(){return 0===this.array_.length};var Ue=function(){this._finder=null,this._dirEdgeList=new bt,this._nodes=new bt,this._rightMostCoord=null,this._env=null,this._finder=new we};Ue.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ue.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ue.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Se("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ue.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Qe.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ue.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ue.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Qe.RIGHT)>=1&&e.getDepth(Qe.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ue.prototype.computeDepths=function(t){var e=new kt,n=new Re,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var A=a.getNode();e.contains(A)||(n.addLast(A),e.add(A))}}}},Ue.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ue.prototype.getEnvelope=function(){if(null===this._env){for(var t=new J,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Ue.prototype.addReachable=function(t){var e=new I;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Ue.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Qe.LEFT,t.getDepth(Qe.RIGHT)),e.setDepth(Qe.RIGHT,t.getDepth(Qe.LEFT))},Ue.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Ue.prototype.getNodes=function(){return this._nodes},Ue.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ue.prototype.interfaces_=function(){return[B]},Ue.prototype.getClass=function(){return Ue};var xe=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Qe.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],a=arguments[1],A=arguments[2];this.init(3),this.location[Qe.ON]=o,this.location[Qe.LEFT]=a,this.location[Qe.RIGHT]=A}};xe.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},xe.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==S.NONE)return!1;return!0},xe.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===S.NONE&&(this.location[e]=t)},xe.prototype.isLine=function(){return 1===this.location.length},xe.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Qe.ON]=this.location[Qe.ON],e[Qe.LEFT]=S.NONE,e[Qe.RIGHT]=S.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===S.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},xe.prototype.getLocations=function(){return this.location},xe.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Qe.LEFT];this.location[Qe.LEFT]=this.location[Qe.RIGHT],this.location[Qe.RIGHT]=t},xe.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(S.toLocationSymbol(this.location[Qe.LEFT])),t.append(S.toLocationSymbol(this.location[Qe.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[Qe.RIGHT])),t.toString()},xe.prototype.setLocations=function(t,e,n){this.location[Qe.ON]=t,this.location[Qe.LEFT]=e,this.location[Qe.RIGHT]=n},xe.prototype.get=function(t){return t<this.location.length?this.location[t]:S.NONE},xe.prototype.isArea=function(){return this.location.length>1},xe.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===S.NONE)return!0;return!1},xe.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Qe.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},xe.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(S.NONE)},xe.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},xe.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe};var ke=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new xe(e),this.elt[1]=new xe(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new xe(n.elt[0]),this.elt[1]=new xe(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new xe(S.NONE),this.elt[1]=new xe(S.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],a=arguments[1],A=arguments[2];this.elt[0]=new xe(o,a,A),this.elt[1]=new xe(o,a,A)}else if(4===arguments.length){var s=arguments[0],c=arguments[1],u=arguments[2],l=arguments[3];this.elt[0]=new xe(S.NONE,S.NONE,S.NONE),this.elt[1]=new xe(S.NONE,S.NONE,S.NONE),this.elt[s].setLocations(c,u,l)}};ke.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ke.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ke.prototype.isNull=function(t){return this.elt[t].isNull()},ke.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},ke.prototype.isLine=function(t){return this.elt[t].isLine()},ke.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new xe(t.elt[e]):this.elt[e].merge(t.elt[e])},ke.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ke.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Qe.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},ke.prototype.toString=function(){var t=new O;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},ke.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},ke.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ke.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Qe.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},ke.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ke.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ke.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new xe(this.elt[t].location[0]))},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.toLineLabel=function(t){for(var e=new ke(S.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Oe=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bt,this._pts=new bt,this._label=new ke(S.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Oe.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=At.isCCW(this._ring.getCoordinates())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Se("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Se("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Oe.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var a=r.length-2;n&&(a=r.length-1);for(var A=a;A>=0;A--)this._pts.add(r[A])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!At.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=e.getLocation(n,Qe.RIGHT);if(r===S.NONE)return null;if(this._label.getLocation(n)===S.NONE)return this._label.setLocation(n,r),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Ne=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),De=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ne(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Ge=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};Ge.prototype.setVisited=function(t){this._isVisited=t},Ge.prototype.setInResult=function(t){this._isInResult=t},Ge.prototype.isCovered=function(){return this._isCovered},Ge.prototype.isCoveredSet=function(){return this._isCoveredSet},Ge.prototype.setLabel=function(t){this._label=t},Ge.prototype.getLabel=function(){return this._label},Ge.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ge.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ge.prototype.isInResult=function(){return this._isInResult},Ge.prototype.isVisited=function(){return this._isVisited},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge};var _e=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new ke(0,S.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=S.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==S.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new ke(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof ke)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===S.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=S.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:default:n=S.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ge),Me=function(){this.nodeMap=new l,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Me.prototype.find=function(t){return this.nodeMap.get(t)},Me.prototype.addNode=function(){if(arguments[0]instanceof E){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof _e){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Me.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Me.prototype.iterator=function(){return this.nodeMap.values().iterator()},Me.prototype.values=function(){return this.nodeMap.values()},Me.prototype.getBoundaryNodes=function(t){for(var e=new bt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===S.BOUNDARY&&e.add(r)}return e},Me.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me};var Te=function(){},je={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.isNorthern=function(t){return t===Te.NE||t===Te.NW},Te.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Te.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Te.isInHalfPlane=function(t,e){return e===Te.SE?t===Te.SE||t===Te.SW:t===e||t===e+1},Te.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new C("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Te.NE:Te.SE:e>=0?Te.NW:Te.SW}if(arguments[0]instanceof E&&arguments[1]instanceof E){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new C("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Te.NE:Te.SE:r.y>=n.y?Te.NW:Te.SW}},je.NE.get=function(){return 0},je.NW.get=function(){return 1},je.SW.get=function(){return 2},je.SE.get=function(){return 3},Object.defineProperties(Te,je);var Le=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],A=arguments[3];this._edge=i,this.init(o,a),this._label=A}};Le.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:At.computeOrientation(t._p0,t._p1,this._p1)},Le.prototype.getDy=function(){return this._dy},Le.prototype.getCoordinate=function(){return this._p0},Le.prototype.setNode=function(t){this._node=t},Le.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print("  "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label)},Le.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Le.prototype.getDirectedCoordinate=function(){return this._p1},Le.prototype.getDx=function(){return this._dx},Le.prototype.getLabel=function(){return this._label},Le.prototype.getEdge=function(){return this._edge},Le.prototype.getQuadrant=function(){return this._quadrant},Le.prototype.getNode=function(){return this._node},Le.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return"  "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+"   "+this._label},Le.prototype.computeLabel=function(t){},Le.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Te.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Le.prototype.interfaces_=function(){return[B]},Le.prototype.getClass=function(){return Le};var Ve=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new ke(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Se("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Qe.LEFT)===S.INTERIOR&&this._label.getLocation(e,Qe.RIGHT)===S.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Qe.LEFT]+"/"+this._depth[Qe.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,S.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,S.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Qe.LEFT&&(r=-1);var i=Qe.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===S.EXTERIOR&&e===S.INTERIOR?1:t===S.INTERIOR&&e===S.EXTERIOR?-1:0},e}(Le),Ze=function(){};Ze.prototype.createNode=function(t){return new _e(t,null)},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Pe=function(){if(this._edges=new bt,this._nodes=null,this._edgeEndList=new bt,0===arguments.length)this._nodes=new Me(new Ze);else if(1===arguments.length){var t=arguments[0];this._nodes=new Me(t)}};Pe.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Pe.prototype.find=function(t){return this._nodes.find(t)},Pe.prototype.addNode=function(){if(arguments[0]instanceof _e){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof E){var e=arguments[0];return this._nodes.addNode(e)}},Pe.prototype.getNodeIterator=function(){return this._nodes.iterator()},Pe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Pe.prototype.debugPrintln=function(t){P.out.println(t)},Pe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===S.BOUNDARY},Pe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Pe.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&At.computeOrientation(t,e,r)===At.COLLINEAR&&Te.quadrant(t,e)===Te.quadrant(n,r)},Pe.prototype.getEdgeEnds=function(){return this._edgeEndList},Pe.prototype.debugPrint=function(t){P.out.print(t)},Pe.prototype.getEdgeIterator=function(){return this._edges.iterator()},Pe.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Pe.prototype.insertEdge=function(t){this._edges.add(t)},Pe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Pe.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ve(n,!0),i=new Ve(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Pe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Pe.prototype.getNodes=function(){return this._nodes.values()},Pe.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var We=function(){this._geometryFactory=null,this._shellList=new bt;var t=arguments[0];this._geometryFactory=t};We.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},We.prototype.computePolygons=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},We.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Se("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},We.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bt,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),A=this.findShell(a);null!==A?(this.placePolygonHoles(A,a),e.add(A)):n.addAll(a)}else r.add(o)}return r},We.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},We.prototype.buildMaximalEdgeRings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new De(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},We.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},We.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},We.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,A=e.iterator();A.hasNext();){var s=A.next(),c=s.getLinearRing(),u=c.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var l=!1;u.contains(r)&&At.isPointInRing(i,c.getCoordinates())&&(l=!0),l&&(null===o||a.contains(u))&&(o=s)}return o},We.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},We.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Pe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Je=function(){};Je.prototype.getBounds=function(){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Je,e]},He.prototype.getClass=function(){return He};var Ye=function(){this._size=null,this._items=null,this._size=0,this._items=new bt,this._items.add(null)};Ye.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ye.prototype.size=function(){return this._size},Ye.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Ye.prototype.clear=function(){this._size=0,this._items.clear()},Ye.prototype.isEmpty=function(){return 0===this._size},Ye.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var Xe=function(){};Xe.prototype.visitItem=function(t){},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var ze=function(){};ze.prototype.insert=function(t,e){},ze.prototype.remove=function(t,e){},ze.prototype.query=function(){},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze};var Ke=function(){if(this._childBoundables=new bt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},qe={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[Je,e]},Ke.prototype.getClass=function(){return Ke},qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,qe);var $e=function(){};$e.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var n=t.toArray();e?_t.sort(n,e):_t.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},$e.singletonList=function(t){var e=new bt;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new C("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tn(o,e,this._itemDistance);a.getDistance()<r&&n.add(a)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[B]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof He&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bt:t}if(1===arguments.length){for(var e=arguments[0],n=new bt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ke){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Ke?this.boundablesAtLevel(n,a,i):(et.isTrue(a instanceof He),-1===n&&i.add(a))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(U(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var i=arguments[0],o=arguments[1],a=arguments[2],A=o.getChildBoundables(),s=0;s<A.size();s++){var c=A.get(s);this.getIntersectsOp().intersects(c.getBounds(),i)&&(c instanceof Ke?this.query(i,c,a):c instanceof He?a.visitItem(c.getItem()):et.shouldNeverReachHere())}else if(U(arguments[2],mt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var u=arguments[0],l=arguments[1],g=arguments[2],f=l.getChildBoundables(),h=0;h<f.size();h++){var d=f.get(h);this.getIntersectsOp().intersects(d.getBounds(),u)&&(d instanceof Ke?this.query(u,d,g):d instanceof He?g.add(d.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var a=null,A=r.getChildBoundables().iterator();A.hasNext();){var s=A.next();if(this.getIntersectsOp().intersects(s.getBounds(),n)&&s instanceof Ke&&(o=this.remove(n,s,i))){a=s;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new bt;n.add(this.createNode(e));var r=new bt(t);$e.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var an=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new bt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new An(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new bt;for(var a=0;i.hasNext()&&a<n;){var A=i.next();r[o].add(A),a++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(U(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var i=arguments[0],o=arguments[1],a=arguments[2];t.prototype.query.call(this,i,o,a)}else if(U(arguments[2],mt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var A=arguments[0],s=arguments[1],c=arguments[2];t.prototype.query.call(this,A,s,c)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new bt(t);$e.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(U(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,y.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&U(arguments[1],on)){var i=arguments[0],o=arguments[1],a=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(a)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var A=arguments[0],s=arguments[1],c=null,u=new Ye;for(u.add(A);!u.isEmpty()&&s>0;){var l=u.poll(),g=l.getDistance();if(g>=s)break;l.isLeaves()?(s=g,c=l):l.expandToQueue(u,s)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],h=arguments[1],d=arguments[2],I=new He(f,h),p=new tn(this.getRoot(),I,d);return this.nearestNeighbour(p)[0]}},n.prototype.interfaces_=function(){return[ze,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return An},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),An=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new J(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),sn=function(){};sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.relativeSign=function(t,e){return t<e?-1:t>e?1:0},sn.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=sn.relativeSign(e.x,n.x),i=sn.relativeSign(e.y,n.y);switch(t){case 0:return sn.compareValue(r,i);case 1:return sn.compareValue(i,r);case 2:return sn.compareValue(i,-r);case 3:return sn.compareValue(-r,i);case 4:return sn.compareValue(-r,-i);case 5:return sn.compareValue(-i,-r);case 6:return sn.compareValue(-i,r);case 7:return sn.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},sn.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new E(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:sn.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[B]},cn.prototype.getClass=function(){return cn};var un=function(){this._nodeMap=new l,this._edge=null;var t=arguments[0];this._edge=t};un.prototype.getSplitCoordinates=function(){var t=new Qt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},un.prototype.addCollapsedNodes=function(){var t=new bt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},un.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},un.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new N(e+1))}},un.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new E(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new E(e.coord))},un.prototype.iterator=function(){return this._nodeMap.values().iterator()},un.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},un.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},un.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new N(e[0])),r=i}},un.prototype.getEdge=function(){return this._edge},un.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},un.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new E(t.coord);for(var A=t.segmentIndex+1;A<=e.segmentIndex;A++)o[a++]=this._edge.getCoordinate(A);return i&&(o[a]=new E(e.coord)),new hn(o,this._edge.getData())},un.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},un.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new $("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new $("bad split edge end point at "+i)},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un};var ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new C("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof E&&arguments[1]instanceof E){var i=arguments[0],o=arguments[1],a=o.x-i.x,A=o.y-i.y;if(0===a&&0===A)throw new C("Cannot compute the octant for two identical points "+i);return ln.octant(a,A)}};var gn=function(){};gn.prototype.getCoordinates=function(){},gn.prototype.size=function(){},gn.prototype.getCoordinate=function(t){},gn.prototype.isClosed=function(){},gn.prototype.setData=function(t){},gn.prototype.getData=function(){},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[gn]},fn.prototype.getClass=function(){return fn};var hn=function(){this._nodeList=new un(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};hn.prototype.getCoordinates=function(){return this._pts},hn.prototype.size=function(){return this._pts.length},hn.prototype.getCoordinate=function(t){return this._pts[t]},hn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},hn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},hn.prototype.setData=function(t){this._data=t},hn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ln.octant(t,e)},hn.prototype.getData=function(){return this._data},hn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new E(n.getIntersection(i));this.addIntersection(o,r)}},hn.prototype.toString=function(){return q.toLineString(new se(this._pts))},hn.prototype.getNodeList=function(){return this._nodeList},hn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},hn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn},hn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return hn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new E,this.p1=new E;else if(1===arguments.length){var t=arguments[0];this.p0=new E(t.p0),this.p1=new E(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new E(e,n),this.p1=new E(r,i)}},In={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=At.orientationIndex(this.p0,this.p1,t.p0),n=At.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof E){var r=arguments[0];return At.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof E){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new E(t);var e=this.projectionFactor(t),n=new E;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof dn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(r.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var A=this.project(r.p1);return o<0&&(A=this.p0),o>1&&(A=this.p1),new dn(a,A)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return At.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?y.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=y.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))<r&&(r=i,n[0]=a,n[1]=t.p1);var A=t.closestPoint(this.p0);(i=A.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=A);var s=t.closestPoint(this.p1);return(i=s.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=s),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},dn.prototype.lineIntersection=function(t){try{return W.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof Z))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(i*i+o*o),A=0,s=0;if(0!==e){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");A=e*i/a,s=e*o/a}return new E(n-s,r+A)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||y.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return At.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof E){var e=arguments[0];return At.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new E;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},dn.prototype.hashCode=function(){var t=y.doubleToLongBits(this.p0.x);t^=31*y.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=y.doubleToLongBits(this.p1.x);return n^=31*y.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[B,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new E((t.x+e.x)/2,(t.y+e.y)/2)},In.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,In);var pn=function(){this.tempEnv1=new J,this.tempEnv2=new J,this._overlapSeg1=new dn,this._overlapSeg2=new dn};pn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var Cn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Cn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Cn.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,r),a<n&&this.computeSelect(t,a,n,r)},Cn.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},Cn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Cn.prototype.setId=function(t){this._id=t},Cn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Cn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new J(t,e)}return this._env},Cn.prototype.getEndIndex=function(){return this._end},Cn.prototype.getStartIndex=function(){return this._start},Cn.prototype.getContext=function(){return this._context},Cn.prototype.getId=function(){return this._id},Cn.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var a=this._pts[t],A=this._pts[e],s=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(a,A),o.tempEnv2.init(s,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var u=Math.trunc((t+e)/2),l=Math.trunc((r+i)/2);t<u&&(r<l&&this.computeOverlapsInternal(t,u,n,r,l,o),l<i&&this.computeOverlapsInternal(t,u,n,l,i,o)),u<e&&(r<l&&this.computeOverlapsInternal(u,e,n,r,l,o),l<i&&this.computeOverlapsInternal(u,e,n,l,i,o))},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn};var yn=function(){};yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn},yn.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new N(e));do{var r=yn.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return yn.toIntArray(n)},yn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Te.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Te.quadrant(t[i-1],t[i])===r);)i++;return i-1},yn.getChains=function(){if(1===arguments.length){var t=arguments[0];return yn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bt,i=yn.getChainStartIndices(e),o=0;o<i.length-1;o++){var a=new Cn(e,i[o],i[o+1],n);r.add(a)}return r}},yn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var vn=function(){};vn.prototype.computeNodes=function(t){},vn.prototype.getNodedSubstrings=function(){},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var Bn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};Bn.prototype.setSegmentIntersector=function(t){this._segInt=t},Bn.prototype.interfaces_=function(){return[vn]},Bn.prototype.getClass=function(){return Bn};var mn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bt,this._index=new an,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return hn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=yn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new bn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return bn},Object.defineProperties(e,n),e}(Bn),bn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),a=r.getContext();this._si.processIntersections(o,n,a,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pn),En=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],A=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(A)}},Qn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};En.prototype.getEndCapStyle=function(){return this._endCapStyle},En.prototype.isSingleSided=function(){return this._isSingleSided},En.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=En.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=En.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==En.JOIN_ROUND&&(this._quadrantSegments=En.DEFAULT_QUADRANT_SEGMENTS)},En.prototype.getJoinStyle=function(){return this._joinStyle},En.prototype.setJoinStyle=function(t){this._joinStyle=t},En.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},En.prototype.getSimplifyFactor=function(){return this._simplifyFactor},En.prototype.getQuadrantSegments=function(){return this._quadrantSegments},En.prototype.setEndCapStyle=function(t){this._endCapStyle=t},En.prototype.getMitreLimit=function(){return this._mitreLimit},En.prototype.setMitreLimit=function(t){this._mitreLimit=t},En.prototype.setSingleSided=function(t){this._isSingleSided=t},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},En.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Qn.CAP_ROUND.get=function(){return 1},Qn.CAP_FLAT.get=function(){return 2},Qn.CAP_SQUARE.get=function(){return 3},Qn.JOIN_ROUND.get=function(){return 1},Qn.JOIN_MITRE.get=function(){return 2},Qn.JOIN_BEVEL.get=function(){return 3},Qn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Qn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Qn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(En,Qn);var Fn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=At.COUNTERCLOCKWISE,this._inputLine=t||null},wn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Fn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,t,n,r)},Fn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Fn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Fn.prototype.isShallowConcavity=function(t,e,n,r){return At.computeOrientation(t,e,n)===this._angleOrientation&&At.distancePointLine(e,t,n)<r},Fn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Fn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var a=n;a<r;a+=o)if(!this.isShallow(t,e,this._inputLine[a],i))return!1;return!0},Fn.prototype.isConcave=function(t,e,n){return At.computeOrientation(t,e,n)===this._angleOrientation},Fn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=At.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Fn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Fn.DELETE;)e++;return e},Fn.prototype.isShallow=function(t,e,n,r){return At.distancePointLine(e,t,n)<r},Fn.prototype.collapseLine=function(){for(var t=new Qt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Fn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.simplify=function(t,e){return new Fn(t).simplify(e)},wn.INIT.get=function(){return 0},wn.DELETE.get=function(){return 1},wn.KEEP.get=function(){return 1},wn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Fn,wn);var Sn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bt},Rn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Sn.prototype.getCoordinates=function(){return this._ptList.toArray(Sn.COORDINATE_ARRAY_TYPE)},Sn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Sn.prototype.addPt=function(t){var e=new E(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Sn.prototype.revere=function(){},Sn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Sn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Sn.prototype.toString=function(){return(new pe).createLineString(this.getCoordinates()).toString()},Sn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new E(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Sn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Rn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Sn,Rn);var Un=function(){},xn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},Un.toDegrees=function(t){return 180*t/Math.PI},Un.normalize=function(t){for(;t>Math.PI;)t-=Un.PI_TIMES_2;for(;t<=-Math.PI;)t+=Un.PI_TIMES_2;return t},Un.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Un.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Un.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Un.interiorAngle=function(t,e,n){var r=Un.angle(e,t),i=Un.angle(e,n);return Math.abs(i-r)},Un.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Un.PI_TIMES_2;t>=Un.PI_TIMES_2&&(t=0)}else{for(;t>=Un.PI_TIMES_2;)t-=Un.PI_TIMES_2;t<0&&(t=0)}return t},Un.angleBetween=function(t,e,n){var r=Un.angle(e,t),i=Un.angle(e,n);return Un.diff(r,i)},Un.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Un.toRadians=function(t){return t*Math.PI/180},Un.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Un.COUNTERCLOCKWISE:n<0?Un.CLOCKWISE:Un.NONE},Un.angleBetweenOriented=function(t,e,n){var r=Un.angle(e,t),i=Un.angle(e,n)-r;return i<=-Math.PI?i+Un.PI_TIMES_2:i>Math.PI?i-Un.PI_TIMES_2:i},xn.PI_TIMES_2.get=function(){return 2*Math.PI},xn.PI_OVER_2.get=function(){return Math.PI/2},xn.PI_OVER_4.get=function(){return Math.PI/4},xn.COUNTERCLOCKWISE.get=function(){return At.COUNTERCLOCKWISE},xn.CLOCKWISE.get=function(){return At.CLOCKWISE},xn.NONE.get=function(){return At.COLLINEAR},Object.defineProperties(Un,xn);var kn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===En.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},On={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};kn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=At.computeOrientation(this._s0,this._s1,this._s2),r=n===At.CLOCKWISE&&this._side===Qe.LEFT||n===At.COUNTERCLOCKWISE&&this._side===Qe.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},kn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Qe.LEFT,this._distance,r);var i=new dn;this.computeOffsetSegment(n,Qe.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,A=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case En.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,A+Math.PI/2,A-Math.PI/2,At.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case En.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case En.CAP_SQUARE:var s=new E;s.x=Math.abs(this._distance)*Math.cos(A),s.y=Math.abs(this._distance)*Math.sin(A);var c=new E(r.p1.x+s.x,r.p1.y+s.y),u=new E(i.p1.x+s.x,i.p1.y+s.y);this._segList.addPt(c),this._segList.addPt(u)}},kn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},kn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=W.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Z))throw t;o=new E(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},kn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,a=e.y-t.y,A=Math.atan2(a,o),s=n.x-t.x,c=n.y-t.y,u=Math.atan2(c,s);r===At.CLOCKWISE?A<=u&&(A+=2*Math.PI):A>=u&&(A-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,A,u,r,i),this._segList.addPt(n)},kn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===En.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===En.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},kn.prototype.createSquare=function(t){this._segList.addPt(new E(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new E(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},kn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},kn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},kn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},kn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},kn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Un.angle(i,this._seg0.p0),a=Un.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,A=Un.normalize(o+a),s=Un.normalize(A+Math.PI),c=r*n,u=n-c*Math.abs(Math.sin(a)),l=i.x+c*Math.cos(s),g=i.y+c*Math.sin(s),f=new E(l,g),h=new dn(i,f),d=h.pointAlongOffset(1,u),I=h.pointAlongOffset(1,-u);this._side===Qe.LEFT?(this._segList.addPt(d),this._segList.addPt(I)):(this._segList.addPt(I),this._segList.addPt(d))},kn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Qe.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,A=Math.sqrt(o*o+a*a),s=i*n*o/A,c=i*n*a/A;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+s,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+s},kn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===At.CLOCKWISE?-1:1,a=Math.abs(e-n),A=Math.trunc(a/this._filletAngleQuantum+.5);if(A<1)return null;for(var s=a/A,c=0,u=new E;c<a;){var l=e+o*c;u.x=t.x+i*Math.cos(l),u.y=t.y+i*Math.sin(l),this._segList.addPt(u),c+=s}},kn.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new E((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new E((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},kn.prototype.createCircle=function(t){var e=new E(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},kn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},kn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*kn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},kn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===En.JOIN_BEVEL||this._bufParams.getJoinStyle()===En.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,At.CLOCKWISE,this._distance))},kn.prototype.closeRing=function(){this._segList.closeRing()},kn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(kn,On);var Nn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Nn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Ft.reverse(o),o},Nn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Fn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Qe.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(t,!1);var A=Fn.simplify(t,r),s=A.length-1;n.initSideSegments(A[0],A[1],Qe.LEFT),n.addFirstSegment();for(var c=2;c<=s;c++)n.addNextSegment(A[c],!0)}n.addLastSegment(),n.closeRing()},Nn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Qe.RIGHT&&(r=-r);var i=Fn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var A=1!==a;n.addNextSegment(i[a],A)}n.closeRing()},Nn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Fn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Qe.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var a=Fn.simplify(t,-n),A=a.length-1;e.initSideSegments(a[A],a[A-1],Qe.LEFT);for(var s=A-2;s>=0;s--)e.addNextSegment(a[s],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Nn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case En.CAP_ROUND:e.createCircle(t);break;case En.CAP_SQUARE:e.createSquare(t)}},Nn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Nn.prototype.getBufferParameters=function(){return this._bufParams},Nn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Nn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Nn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Nn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Fn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Qe.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var A=Fn.simplify(t,r),s=A.length-1;n.initSideSegments(A[0],A[1],Qe.LEFT),n.addFirstSegment();for(var c=2;c<=s;c++)n.addNextSegment(A[c],!0)}n.addLastSegment()},Nn.prototype.getSegGen=function(t){return new kn(this._precisionModel,this._bufParams,t)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new E(t[n]);return e};var Dn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new At;var t=arguments[0];this._subgraphs=t},Gn={DepthSegment:{configurable:!0}};Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bt,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(U(arguments[2],mt)&&arguments[0]instanceof E&&arguments[1]instanceof Ve){for(var o=arguments[0],a=arguments[1],A=arguments[2],s=a.getEdge().getCoordinates(),c=0;c<s.length-1;c++)if(this._seg.p0=s[c],this._seg.p1=s[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x)&&!(this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||At.computeOrientation(this._seg.p0,this._seg.p1,o)===At.RIGHT)){var u=a.getDepth(Qe.LEFT);this._seg.p0.equals(s[c])||(u=a.getDepth(Qe.RIGHT));var l=new _n(this._seg,u);A.add(l)}}else if(U(arguments[2],mt)&&arguments[0]instanceof E&&U(arguments[1],mt))for(var g=arguments[0],f=arguments[1],h=arguments[2],d=f.iterator();d.hasNext();){var I=d.next();I.isForward()&&this.findStabbedSegments(g,I,h)}},Dn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$e.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Gn.DepthSegment.get=function(){return _n},Object.defineProperties(Dn,Gn);var _n=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};_n.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},_n.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},_n.prototype.toString=function(){return this._upwardSeg.toString()},_n.prototype.interfaces_=function(){return[B]},_n.prototype.getClass=function(){return _n};var Mn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Mn.prototype.area=function(){return Mn.area(this.p0,this.p1,this.p2)},Mn.prototype.signedArea=function(){return Mn.signedArea(this.p0,this.p1,this.p2)},Mn.prototype.interpolateZ=function(t){if(null===t)throw new C("Supplied point is null.");return Mn.interpolateZ(t,this.p0,this.p1,this.p2)},Mn.prototype.longestSideLength=function(){return Mn.longestSideLength(this.p0,this.p1,this.p2)},Mn.prototype.isAcute=function(){return Mn.isAcute(this.p0,this.p1,this.p2)},Mn.prototype.circumcentre=function(){return Mn.circumcentre(this.p0,this.p1,this.p2)},Mn.prototype.area3D=function(){return Mn.area3D(this.p0,this.p1,this.p2)},Mn.prototype.centroid=function(){return Mn.centroid(this.p0,this.p1,this.p2)},Mn.prototype.inCentre=function(){return Mn.inCentre(this.p0,this.p1,this.p2)},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Mn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Mn.det=function(t,e,n,r){return t*r-e*n},Mn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,a=n.x-i,A=r.x-i,s=n.y-o,c=r.y-o,u=a*c-A*s,l=t.x-i,g=t.y-o,f=(c*l-A*g)/u,h=(-s*l+a*g)/u;return e.z+f*(n.z-e.z)+h*(r.z-e.z)},Mn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),a=r;return i>a&&(a=i),o>a&&(a=o),a},Mn.isAcute=function(t,e,n){return!!Un.isAcute(t,e,n)&&!!Un.isAcute(e,n,t)&&!!Un.isAcute(n,t,e)},Mn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,a=t.y-i,A=e.x-r,s=e.y-i,c=2*Mn.det(o,a,A,s),u=Mn.det(a,o*o+a*a,s,A*A+s*s),l=Mn.det(o,o*o+a*a,A,A*A+s*s);return new E(r-u/c,i+l/c)},Mn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new W(t.x+n/2,t.y+r/2,1),o=new W(t.x-r+n/2,t.y+n+r/2,1);return new W(i,o)},Mn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,a=n.y-t.y;return new E(t.x+i*o,t.y+i*a)},Mn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=n.x-t.x,A=n.y-t.y,s=n.z-t.z,c=i*s-o*A,u=o*a-r*s,l=r*A-i*a,g=c*c+u*u+l*l;return Math.sqrt(g)/2},Mn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new E(r,i)},Mn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),a=r+i+o,A=(r*t.x+i*e.x+o*n.x)/a,s=(r*t.y+i*e.y+o*n.y)/a;return new E(A,s)};var Tn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Tn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Tn.prototype.addPolygon=function(t){var e=this._distance,n=Qe.LEFT;this._distance<0&&(e=-this._distance,n=Qe.RIGHT);var r=t.getExteriorRing(),i=Ft.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,S.EXTERIOR,S.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var a=t.getInteriorRingN(o),A=Ft.removeRepeatedPoints(a.getCoordinates());this._distance>0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(A,e,Qe.opposite(n),S.INTERIOR,S.EXTERIOR)}},Tn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Mn(t[0],t[1],t[2]),r=n.inCentre();return At.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Tn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Ft.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Tn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new hn(t,new ke(0,S.BOUNDARY,e,n));this._curveList.add(r)},Tn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Tn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,a=i;t.length>=ee.MINIMUM_VALID_SIZE&&At.isCCW(t)&&(o=i,a=r,n=Qe.opposite(n));var A=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(A,o,a)},Tn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $t?this.addPolygon(t):t instanceof Xt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Zt||t instanceof ne||t instanceof Vt)&&this.addCollection(t)},Tn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Tn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var jn=function(){};jn.prototype.locate=function(t){},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var Ln=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Ln.prototype.next=function(){if(this._atStart)return this._atStart=!1,Ln.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Vt?(this._subcollectionIterator=new Ln(t),this._subcollectionIterator.next()):t},Ln.prototype.remove=function(){throw new Error(this.getClass().getName())},Ln.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ln.prototype.interfaces_=function(){return[Bt]},Ln.prototype.getClass=function(){return Ln},Ln.isAtomic=function(t){return!(t instanceof Vt)};var Vn=function(){this._geom=null;var t=arguments[0];this._geom=t};Vn.prototype.locate=function(t){return Vn.locate(t,this._geom)},Vn.prototype.interfaces_=function(){return[jn]},Vn.prototype.getClass=function(){return Vn},Vn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&At.isPointInRing(t,e.getCoordinates())},Vn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Vn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Vn.isPointInRing(t,i))return!1}return!0},Vn.containsPoint=function(t,e){if(e instanceof $t)return Vn.containsPointInPolygon(t,e);if(e instanceof Vt)for(var n=new Ln(e);n.hasNext();){var r=n.next();if(r!==e&&Vn.containsPoint(t,r))return!0}return!1},Vn.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:Vn.containsPoint(t,e)?S.INTERIOR:S.EXTERIOR};var Zn=function(){this._edgeMap=new l,this._edgeList=null,this._ptInAreaLocation=[S.NONE,S.NONE]};Zn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Zn.prototype.propagateSideLabels=function(t){for(var e=S.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Qe.LEFT)!==S.NONE&&(e=r.getLocation(t,Qe.LEFT))}if(e===S.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),A=a.getLabel();if(A.getLocation(t,Qe.ON)===S.NONE&&A.setLocation(t,Qe.ON,i),A.isArea(t)){var s=A.getLocation(t,Qe.LEFT),c=A.getLocation(t,Qe.RIGHT);if(c!==S.NONE){if(c!==i)throw new Se("side location conflict",a.getCoordinate());s===S.NONE&&et.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),i=s}else et.isTrue(A.getLocation(t,Qe.LEFT)===S.NONE,"found single null side"),A.setLocation(t,Qe.RIGHT,i),A.setLocation(t,Qe.LEFT,i)}}},Zn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Zn.prototype.print=function(t){P.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Zn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Qe.LEFT);et.isTrue(r!==S.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var a=o.next().getLabel();et.isTrue(a.isArea(t),"Found non-area edge");var A=a.getLocation(t,Qe.LEFT),s=a.getLocation(t,Qe.RIGHT);if(A===s)return!1;if(s!==i)return!1;i=A}return!0},Zn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Zn.prototype.iterator=function(){return this.getEdges().iterator()},Zn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bt(this._edgeMap.values())),this._edgeList},Zn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===S.NONE&&(this._ptInAreaLocation[t]=Vn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Zn.prototype.toString=function(){var t=new O;t.append("EdgeEndStar:   "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Zn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Zn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===S.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var a=o.next(),A=a.getLabel(),s=0;s<2;s++)if(A.isAnyNull(s)){var c=S.NONE;if(e[s])c=S.EXTERIOR;else{var u=a.getCoordinate();c=this.getLocation(s,u,t)}A.setAllLocationsIfNull(s,c)}},Zn.prototype.getDegree=function(){return this._edgeMap.size()},Zn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var Pn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Se("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Te.isNorthern(i)&&Te.isNorthern(o)?n:Te.isNorthern(i)||Te.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){P.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Qe.LEFT),r=t.getDepth(Qe.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Se("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],a=arguments[1],A=arguments[2],s=o;s<a;s++){var c=this._edgeList.get(s);c.setEdgeDepths(Qe.RIGHT,A),A=c.getDepth(Qe.LEFT)}return A}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(r.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),A=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===S.INTERIOR):(a.isInResult()&&(i=S.EXTERIOR),A.isInResult()&&(i=S.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ke(S.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==S.INTERIOR&&o!==S.BOUNDARY||this._label.setLocation(i,S.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zn),Wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new _e(t,new Pn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ze),Jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Jn.prototype.compareTo=function(t){var e=t;return Jn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Jn.prototype.interfaces_=function(){return[B]},Jn.prototype.getClass=function(){return Jn},Jn.orientation=function(t){return 1===Ft.increasingDirection(t)},Jn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,a=e?t.length:-1,A=r?n.length:-1,s=e?0:t.length-1,c=r?0:n.length-1;;){var u=t[s].compareTo(n[c]);if(0!==u)return u;var l=(s+=i)===a,g=(c+=o)===A;if(l&&!g)return-1;if(!l&&g)return 1;if(l&&g)return 0}};var Hn=function(){this._edges=new bt,this._ocaMap=new l};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(")  ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Jn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Jn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Yn=function(){};Yn.prototype.processIntersections=function(t,e,n,r){},Yn.prototype.isDone=function(){},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var Xn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Xn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Xn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Xn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Xn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Xn.prototype.getLineIntersector=function(){return this._li},Xn.prototype.hasProperIntersection=function(){return this._hasProper},Xn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],A=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,A),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Xn.prototype.hasIntersection=function(){return this._hasIntersection},Xn.prototype.isDone=function(){return!1},Xn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Xn.prototype.interfaces_=function(){return[Yn]},Xn.prototype.getClass=function(){return Xn},Xn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var zn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new E(t),this.segmentIndex=e,this.dist=n};zn.prototype.getSegmentIndex=function(){return this.segmentIndex},zn.prototype.getCoordinate=function(){return this.coord},zn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},zn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},zn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},zn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},zn.prototype.getDistance=function(){return this.dist},zn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},zn.prototype.interfaces_=function(){return[B]},zn.prototype.getClass=function(){return zn};var Kn=function(){this._nodeMap=new l,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Kn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new E(t.coord);for(var A=t.segmentIndex+1;A<=e.segmentIndex;A++)o[a++]=this.edge.pts[A];return i&&(o[a]=e.coord),new nr(o,new ke(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new zn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var qn=function(){};qn.prototype.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new N(e));do{var r=this.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return qn.toIntArray(n)},qn.prototype.findChainEnd=function(t,e){for(var n=Te.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Te.quadrant(t[r-1],t[r])===n;)r++;return r-1},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},qn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var $n=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new J,this.env2=new J;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new qn;this.startIndex=e.getChainStartIndices(this.pts)};$n.prototype.getCoordinates=function(){return this.pts},$n.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},$n.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},$n.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],A=arguments[3],s=arguments[4],c=arguments[5],u=this.pts[i],l=this.pts[o],g=a.pts[A],f=a.pts[s];if(o-i==1&&s-A==1)return c.addIntersections(this.e,i,a.e,A),null;if(this.env1.init(u,l),this.env2.init(g,f),!this.env1.intersects(this.env2))return null;var h=Math.trunc((i+o)/2),d=Math.trunc((A+s)/2);i<h&&(A<d&&this.computeIntersectsForChain(i,h,a,A,d,c),d<s&&this.computeIntersectsForChain(i,h,a,d,s,c)),h<o&&(A<d&&this.computeIntersectsForChain(h,o,a,A,d,c),d<s&&this.computeIntersectsForChain(h,o,a,d,s,c))}},$n.prototype.getStartIndexes=function(){return this.startIndex},$n.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Qe.RIGHT]-this._depth[t][Qe.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==S.EXTERIOR&&r!==S.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===S.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,ke.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,a=0;a<this.pts.length;a++)if(this.pts[a].equals2D(n.pts[a])||(r=!1),this.pts[a].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(")  "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new $n(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new J;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new E(t.getIntersection(r)),o=e,a=t.getEdgeDistance(n,r),A=o+1;if(A<this.pts.length){var s=this.pts[A];i.equals2D(s)&&(o=A,a=0)}this.eiList.add(i,o,a)},e.prototype.toString=function(){var t=new O;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(")  "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Qe.ON),e.getLocation(1,Qe.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Qe.LEFT),e.getLocation(1,Qe.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Qe.RIGHT),e.getLocation(1,Qe.RIGHT),2))},e}(Ge),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new bt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),a=new Dn(n).getDepth(o);i.computeDepth(a),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new bt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Ue;i.create(r),e.add(i)}}return $e.sort(e,$e.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new mn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Xn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Nn(n,this._bufParams),i=new Tn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Pe(new Wn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),a=new We(this._geomFact);this.buildSubgraphs(o,a);var A=a.getPolygons();return A.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(A)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var a=i.getData(),A=new nr(i.getCoordinates(),new ke(a));this.insertUniqueEdge(A)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Qe.LEFT),n=t.getLocation(0,Qe.RIGHT);return e===S.INTERIOR&&n===S.EXTERIOR?1:e===S.EXTERIOR&&n===S.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new pe,n=new bt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(U(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&P.out.println(n)}},ir.prototype.scale=function(){if(U(arguments[0],vt)){for(var t=arguments[0],e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new hn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),a=0;a<i.length;a++)o[a]=new E(Math.round((i[a].x-this._offsetX)*this._scaleFactor),Math.round((i[a].y-this._offsetY)*this._scaleFactor),i[a].z);return Ft.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[vn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},ar={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new $("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],a=i.getCoordinates(),A=o.getCoordinates(),s=0;s<a.length-1;s++)for(var c=0;c<A.length-1;c++)this.checkInteriorIntersections(i,s,o,c);else if(4===arguments.length){var u=arguments[0],l=arguments[1],g=arguments[2],f=arguments[3];if(u===g&&l===f)return null;var h=u.getCoordinates()[l],d=u.getCoordinates()[l+1],I=g.getCoordinates()[f],p=g.getCoordinates()[f+1];if(this._li.computeIntersection(h,d,I,p),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,h,d)||this.hasInteriorIntersection(this._li,I,p)))throw new $("found non-noded intersection at "+h+"-"+d+" and "+I+"-"+p)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new $("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},ar.fact.get=function(){return new pe},Object.defineProperties(or,ar);var Ar=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new C("Scale factor must be non-zero");1!==e&&(this._pt=new E(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new E,this._p1Scaled=new E),this.initCorners(this._pt)},sr={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(a)return!1;var A=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&A),"Found bad envelope test"),A},Ar.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new E(this._maxx,this._maxy),this._corner[1]=new E(this._minx,this._maxy),this._corner[2]=new E(this._minx,this._miny),this._corner[3]=new E(this._maxx,this._miny)},Ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ar.prototype.getCoordinate=function(){return this._originalPt},Ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new J(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Ar.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!r)||!!t.equals(this._pt)||!!e.equals(this._pt))))},Ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},sr.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Ar,sr);var cr=function(){this.tempEnv1=new J,this.selectedSegment=new dn};cr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var ur=function(){this._index=null;var t=arguments[0];this._index=t},lr={HotPixelSnapAction:{configurable:!0}};ur.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new gr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Xe]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},lr.HotPixelSnapAction.get=function(){return gr},Object.defineProperties(ur,lr);var gr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bt};fr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],A=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,A),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var s=0;s<this._li.getIntersectionNum();s++)this._interiorIntersections.add(this._li.getIntersection(s));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Yn]},fr.prototype.getClass=function(){return fr};var hr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};hr.prototype.checkCorrectness=function(t){var e=hn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof V))throw t;t.printStackTrace()}},hr.prototype.getNodedSubstrings=function(){return hn.getNodedSubstrings(this._nodedSegStrings)},hr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},hr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},hr.prototype.computeVertexSnaps=function(){if(U(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof hn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new Ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},hr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new mn,this._pointSnapper=new ur(this._noder.getIndex()),this.snapRound(t,this._li)},hr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new Ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},hr.prototype.interfaces_=function(){return[vn]},hr.prototype.getClass=function(){return hr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new En,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},Ir={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new ir(new hr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Se))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof $))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new dr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ut&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new dr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof En&&arguments[0]instanceof ut&&"number"==typeof arguments[1]){var a=arguments[0],A=arguments[1],s=arguments[2];return new dr(a,s).getResultGeometry(A)}}else if(4===arguments.length){var c=arguments[0],u=arguments[1],l=arguments[2],g=arguments[3],f=new dr(c);return f.setQuadrantSegments(l),f.setEndCapStyle(g),f.getResultGeometry(u)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=x.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},Ir.CAP_ROUND.get=function(){return En.CAP_ROUND},Ir.CAP_BUTT.get=function(){return En.CAP_FLAT},Ir.CAP_FLAT.get=function(){return En.CAP_FLAT},Ir.CAP_SQUARE.get=function(){return En.CAP_SQUARE},Ir.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,Ir);var pr=function(){this._pt=[new E,new E],this._distance=y.NaN,this._isNull=!0};pr.prototype.getCoordinates=function(){return this._pt},pr.prototype.getCoordinate=function(t){return this._pt[t]},pr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},pr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},pr.prototype.getDistance=function(){return this._distance},pr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var Cr=function(){};Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.computeDistance=function(){if(arguments[2]instanceof pr&&arguments[0]instanceof Xt&&arguments[1]instanceof E)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new dn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof pr&&arguments[0]instanceof $t&&arguments[1]instanceof E){var A=arguments[0],s=arguments[1],c=arguments[2];Cr.computeDistance(A.getExteriorRing(),s,c);for(var u=0;u<A.getNumInteriorRing();u++)Cr.computeDistance(A.getInteriorRingN(u),s,c)}else if(arguments[2]instanceof pr&&arguments[0]instanceof ut&&arguments[1]instanceof E){var l=arguments[0],g=arguments[1],f=arguments[2];if(l instanceof Xt)Cr.computeDistance(l,g,f);else if(l instanceof $t)Cr.computeDistance(l,g,f);else if(l instanceof Vt)for(var h=l,d=0;d<h.getNumGeometries();d++){var I=h.getGeometryN(d);Cr.computeDistance(I,g,f)}else f.setMinimum(l.getCoordinate(),g)}else if(arguments[2]instanceof pr&&arguments[0]instanceof dn&&arguments[1]instanceof E){var p=arguments[0],C=arguments[1],y=arguments[2],v=p.closestPoint(C);y.setMinimum(v,C)}};var yr=function(t){this._maxPtDist=new pr,this._inputGeom=t||null},vr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};yr.prototype.computeMaxMidpointDistance=function(t){var e=new mr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yr.prototype.computeMaxVertexDistance=function(t){var e=new Br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},yr.prototype.getDistancePoints=function(){return this._maxPtDist},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},vr.MaxPointDistanceFilter.get=function(){return Br},vr.MaxMidpointDistanceFilter.get=function(){return mr},Object.defineProperties(yr,vr);var Br=function(t){this._maxPtDist=new pr,this._minPtDist=new pr,this._geom=t||null};Br.prototype.filter=function(t){this._minPtDist.initialize(),Cr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Br.prototype.getMaxPointDistance=function(){return this._maxPtDist},Br.prototype.interfaces_=function(){return[ft]},Br.prototype.getClass=function(){return Br};var mr=function(t){this._maxPtDist=new pr,this._minPtDist=new pr,this._geom=t||null};mr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new E((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Cr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},mr.prototype.isDone=function(){return!1},mr.prototype.isGeometryChanged=function(){return!1},mr.prototype.getMaxPointDistance=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[Lt]},mr.prototype.getClass=function(){return mr};var br=function(t){this._comps=t||null};br.prototype.filter=function(t){t instanceof $t&&this._comps.add(t)},br.prototype.interfaces_=function(){return[jt]},br.prototype.getClass=function(){return br},br.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return br.getPolygons(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $t?n.add(e):e instanceof Vt&&e.apply(new br(n)),n}};var Er=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Er.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Xt&&this._lines.add(t)},Er.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Er.prototype.interfaces_=function(){return[ct]},Er.prototype.getClass=function(){return Er},Er.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Er.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Er.getLines(e,n))}},Er.getLines=function(){if(1===arguments.length){var t=arguments[0];return Er.getLines(t,!1)}if(2===arguments.length){if(U(arguments[0],vt)&&U(arguments[1],vt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Er.getLines(i,n)}return n}if(arguments[0]instanceof ut&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1],A=new bt;return o.apply(new Er(A,a)),A}if(arguments[0]instanceof ut&&U(arguments[1],vt)){var s=arguments[0],c=arguments[1];return s instanceof Xt?c.add(s):s.apply(new Er(c)),c}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&U(arguments[0],vt)&&U(arguments[1],vt)){for(var u=arguments[0],l=arguments[1],g=arguments[2],f=u.iterator();f.hasNext();){var h=f.next();Er.getLines(h,l,g)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ut&&U(arguments[1],vt)){var d=arguments[0],I=arguments[1],p=arguments[2];return d.apply(new Er(I,p)),I}}};var Qr=function(){if(this._boundaryRule=ht.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new C("Rule must be non-null");this._boundaryRule=t}};Qr.prototype.locateInternal=function(){if(arguments[0]instanceof E&&arguments[1]instanceof $t){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===S.EXTERIOR)return S.EXTERIOR;if(r===S.BOUNDARY)return S.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),a=this.locateInPolygonRing(t,o);if(a===S.INTERIOR)return S.EXTERIOR;if(a===S.BOUNDARY)return S.BOUNDARY}return S.INTERIOR}if(arguments[0]instanceof E&&arguments[1]instanceof Xt){var A=arguments[0],s=arguments[1];if(!s.getEnvelopeInternal().intersects(A))return S.EXTERIOR;var c=s.getCoordinates();return s.isClosed()||!A.equals(c[0])&&!A.equals(c[c.length-1])?At.isOnLine(A,c)?S.INTERIOR:S.EXTERIOR:S.BOUNDARY}if(arguments[0]instanceof E&&arguments[1]instanceof Kt){var u=arguments[0];return arguments[1].getCoordinate().equals2D(u)?S.INTERIOR:S.EXTERIOR}},Qr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?At.locatePointInRing(t,e.getCoordinates()):S.EXTERIOR},Qr.prototype.intersects=function(t,e){return this.locate(t,e)!==S.EXTERIOR},Qr.prototype.updateLocationInfo=function(t){t===S.INTERIOR&&(this._isIn=!0),t===S.BOUNDARY&&this._numBoundaries++},Qr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Xt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,a=0;a<o.getNumGeometries();a++){var A=o.getGeometryN(a);this.updateLocationInfo(this.locateInternal(t,A))}else if(e instanceof Vt)for(var s=new Ln(e);s.hasNext();){var c=s.next();c!==e&&this.computeLocation(t,c)}},Qr.prototype.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:e instanceof Xt||e instanceof $t?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?S.BOUNDARY:this._numBoundaries>0||this._isIn?S.INTERIOR:S.EXTERIOR)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var Fr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},wr={INSIDE_AREA:{configurable:!0}};Fr.prototype.isInsideArea=function(){return this._segIndex===Fr.INSIDE_AREA},Fr.prototype.getCoordinate=function(){return this._pt},Fr.prototype.getGeometryComponent=function(){return this._component},Fr.prototype.getSegmentIndex=function(){return this._segIndex},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},wr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Fr,wr);var Sr=function(t){this._pts=t||null};Sr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Sr.prototype.interfaces_=function(){return[jt]},Sr.prototype.getClass=function(){return Sr},Sr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?$e.singletonList(t):Sr.getPoints(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof Vt&&e.apply(new Sr(n)),n}};var Rr=function(){this._locations=null;var t=arguments[0];this._locations=t};Rr.prototype.filter=function(t){(t instanceof Kt||t instanceof Xt||t instanceof $t)&&this._locations.add(new Fr(t,0,t.getCoordinate()))},Rr.prototype.interfaces_=function(){return[jt]},Rr.prototype.getClass=function(){return Rr},Rr.getLocations=function(t){var e=new bt;return t.apply(new Rr(e)),e};var Ur=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Qr,this._minDistanceLocation=null,this._minDistance=y.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Ur.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=br.getPolygons(this._geom[e]);if(i.size()>0){var o=Rr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&U(arguments[0],mt)&&U(arguments[1],mt)){for(var a=arguments[0],A=arguments[1],s=arguments[2],c=0;c<a.size();c++)for(var u=a.get(c),l=0;l<A.size();l++)if(this.computeContainmentDistance(u,A.get(l),s),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Fr&&arguments[1]instanceof $t){var g=arguments[0],f=arguments[1],h=arguments[2],d=g.getCoordinate();if(S.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,h[0]=g,h[1]=new Fr(f,d),null}},Ur.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Ur.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Er.getLines(this._geom[0]),n=Er.getLines(this._geom[1]),r=Sr.getPoints(this._geom[0]),i=Sr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Ur.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ur.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Ur.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Ur.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Xt&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var a=At.distancePointLine(i,r[o],r[o+1]);if(a<this._minDistance){this._minDistance=a;var A=new dn(r[o],r[o+1]).closestPoint(i);n[0]=new Fr(t,o,A),n[1]=new Fr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Xt&&arguments[1]instanceof Xt){var s=arguments[0],c=arguments[1],u=arguments[2];if(s.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var l=s.getCoordinates(),g=c.getCoordinates(),f=0;f<l.length-1;f++)for(var h=0;h<g.length-1;h++){var d=At.distanceLineLine(l[f],l[f+1],g[h],g[h+1]);if(d<this._minDistance){this._minDistance=d;var I=new dn(l[f],l[f+1]),p=new dn(g[h],g[h+1]),C=I.closestPoints(p);u[0]=new Fr(s,f,C[0]),u[1]=new Fr(c,h,C[1])}if(this._minDistance<=this._terminateDistance)return null}}},Ur.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o),A=i.getCoordinate().distance(a.getCoordinate());if(A<this._minDistance&&(this._minDistance=A,n[0]=new Fr(i,0,i.getCoordinate()),n[1]=new Fr(a,0,a.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Ur.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new C("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Ur.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.distance=function(t,e){return new Ur(t,e).distance()},Ur.isWithinDistance=function(t,e,n){return new Ur(t,e,n).distance()<=n},Ur.nearestPoints=function(t,e){return new Ur(t,e).nearestPoints()};var xr=function(){this._pt=[new E,new E],this._distance=y.NaN,this._isNull=!0};xr.prototype.getCoordinates=function(){return this._pt},xr.prototype.getCoordinate=function(t){return this._pt[t]},xr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},xr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},xr.prototype.toString=function(){return q.toLineString(this._pt[0],this._pt[1])},xr.prototype.getDistance=function(){return this._distance},xr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr};var kr=function(){};kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.computeDistance=function(){if(arguments[2]instanceof xr&&arguments[0]instanceof Xt&&arguments[1]instanceof E)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var a=r.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof xr&&arguments[0]instanceof $t&&arguments[1]instanceof E){var A=arguments[0],s=arguments[1],c=arguments[2];kr.computeDistance(A.getExteriorRing(),s,c);for(var u=0;u<A.getNumInteriorRing();u++)kr.computeDistance(A.getInteriorRingN(u),s,c)}else if(arguments[2]instanceof xr&&arguments[0]instanceof ut&&arguments[1]instanceof E){var l=arguments[0],g=arguments[1],f=arguments[2];if(l instanceof Xt)kr.computeDistance(l,g,f);else if(l instanceof $t)kr.computeDistance(l,g,f);else if(l instanceof Vt)for(var h=l,d=0;d<h.getNumGeometries();d++){var I=h.getGeometryN(d);kr.computeDistance(I,g,f)}else f.setMinimum(l.getCoordinate(),g)}else if(arguments[2]instanceof xr&&arguments[0]instanceof dn&&arguments[1]instanceof E){var p=arguments[0],C=arguments[1],y=arguments[2],v=p.closestPoint(C);y.setMinimum(v,C)}};var Or=function(){this._g0=null,this._g1=null,this._ptDist=new xr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Nr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new C("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.prototype.computeOrientedDistance=function(t,e,n){var r=new Dr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Gr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Or(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Or(n,r);return o.setDensifyFraction(i),o.distance()}},Nr.MaxPointDistanceFilter.get=function(){return Dr},Nr.MaxDensifiedByFractionDistanceFilter.get=function(){return Gr},Object.defineProperties(Or,Nr);var Dr=function(){this._maxPtDist=new xr,this._minPtDist=new xr,this._euclideanDist=new kr,this._geom=null;var t=arguments[0];this._geom=t};Dr.prototype.filter=function(t){this._minPtDist.initialize(),kr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dr.prototype.interfaces_=function(){return[ft]},Dr.prototype.getClass=function(){return Dr};var Gr=function(){this._maxPtDist=new xr,this._minPtDist=new xr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Gr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,a=0;a<this._numSubSegs;a++){var A=n.x+a*i,s=n.y+a*o,c=new E(A,s);this._minPtDist.initialize(),kr.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Gr.prototype.isDone=function(){return!1},Gr.prototype.isGeometryChanged=function(){return!1},Gr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Gr.prototype.interfaces_=function(){return[Lt]},Gr.prototype.getClass=function(){return Gr};var _r=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Mr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};_r.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+q.toLineString(i[0],i[1])+")"}},_r.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=_r.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),_r.VERBOSE&&P.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},_r.prototype.checkNegativeValid=function(){if(!(this._input instanceof $t||this._input instanceof ne||this._input instanceof Vt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},_r.prototype.getErrorIndicator=function(){return this._errorIndicator},_r.prototype.checkMinimumDistance=function(t,e,n){var r=new Ur(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+q.toLineString(i[0],i[1])+" )"}},_r.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},_r.prototype.getErrorLocation=function(){return this._errorLocation},_r.prototype.getPolygonLines=function(t){for(var e=new bt,n=new Er(e),r=br.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},_r.prototype.getErrorMessage=function(){return this._errMsg},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},Mr.VERBOSE.get=function(){return!1},Mr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(_r,Mr);var Tr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},jr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Tr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Tr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Tr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new J(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new J(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Tr.prototype.checkDistance=function(){var t=new _r(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Tr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Tr.prototype.checkPolygonal=function(){this._result instanceof $t||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Tr.prototype.getErrorIndicator=function(){return this._errorIndicator},Tr.prototype.getErrorLocation=function(){return this._errorLocation},Tr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Tr.prototype.report=function(t){if(!Tr.VERBOSE)return null;P.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Tr.prototype.getErrorMessage=function(){return this._errorMsg},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.isValidMsg=function(t,e,n){var r=new Tr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Tr.isValid=function(t,e,n){return!!new Tr(t,e,n).isValid()},jr.VERBOSE.get=function(){return!1},jr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Tr,jr);var Lr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Lr.prototype.getCoordinates=function(){return this._pts},Lr.prototype.size=function(){return this._pts.length},Lr.prototype.getCoordinate=function(t){return this._pts[t]},Lr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Lr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ln.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Lr.prototype.setData=function(t){this._data=t},Lr.prototype.getData=function(){return this._data},Lr.prototype.toString=function(){return q.toLineString(new se(this._pts))},Lr.prototype.interfaces_=function(){return[gn]},Lr.prototype.getClass=function(){return Lr};var Vr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Vr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Vr.prototype.getIntersectionSegments=function(){return this._intSegments},Vr.prototype.count=function(){return this._intersectionCount},Vr.prototype.getIntersections=function(){return this._intersections},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Vr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],A=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,A),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=A,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Vr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Vr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Vr.prototype.interfaces_=function(){return[Yn]},Vr.prototype.getClass=function(){return Vr},Vr.createAllIntersectionsFinder=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e},Vr.createAnyIntersectionFinder=function(t){return new Vr(t)},Vr.createIntersectionCounter=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Zr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Zr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Zr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Zr.prototype.isValid=function(){return this.execute(),this._isValid},Zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Zr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new mn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Zr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Se(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Zr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+q.toLineString(t[0],t[1])+" and "+q.toLineString(t[2],t[3])},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.computeIntersections=function(t){var e=new Zr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Pr=function t(){this._nv=null;var e=arguments[0];this._nv=new Zr(t.toSegmentStrings(e))};Pr.prototype.checkValid=function(){this._nv.checkValid()},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.toSegmentStrings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Lr(r.getCoordinates(),r))}return e},Pr.checkValid=function(t){new Pr(t).checkValid()};var Wr=function(t){this._mapOp=t};Wr.prototype.map=function(t){for(var e=new bt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(pe.toGeometryArray(e))},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.map=function(t,e){return new Wr(e).map(t)};var Jr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bt,this._resultLineList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Jr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Jr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Jr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Jr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Fi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Jr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Jr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Jr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Jr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Fi.isResultOfOp(r,e)&&e===Fi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!n.isInResult()&&!n.isIncidentEdgeInResult()&&(0===n.getEdges().getDegree()||t===Fi.INTERSECTION)){var r=n.getLabel();Fi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Yr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Yr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Yr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new bt,o=0;o<t.getNumInteriorRing();o++){var a=this.transformLinearRing(t.getInteriorRingN(o),t);null===a||a.isEmpty()||(a instanceof ee||(n=!1),i.add(a))}if(n)return this._factory.createPolygon(r,i.toArray([]));var A=new bt;return null!==r&&A.add(r),A.addAll(i),this._factory.buildGeometry(A)},Yr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Yr.prototype.getInputGeometry=function(){return this._inputGeom},Yr.prototype.transformMultiLineString=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Yr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Yr.prototype.transformMultiPoint=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.transformMultiPolygon=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.copy=function(t){return t.copy()},Yr.prototype.transformGeometryCollection=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(pe.toGeometryArray(n)):this._factory.buildGeometry(n)},Yr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Xt)return this.transformLineString(t,null);if(t instanceof Zt)return this.transformMultiLineString(t,null);if(t instanceof $t)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Vt)return this.transformGeometryCollection(t,null);throw new C("Unknown Geometry subtype: "+t.getClass().getName())},Yr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Xr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Xt&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Xr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new E(o)),0===r&&this._isClosed&&t.set(t.size()-1,new E(o)))}},Xr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Xr.prototype.snapTo=function(t){var e=new Qt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Xr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new E(i),!1)}},Xr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=y.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Xr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var zr=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};zr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new qr(e,n).transform(this._srcGeom)},zr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new qr(t,n,!0).transform(this._srcGeom),i=r;return e&&U(i,qt)&&(i=r.buffer(0)),i},zr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},zr.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},zr.prototype.computeMinimumSegmentLength=function(t){for(var e=y.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new zr(t);r[0]=i.snapTo(e,n);var o=new zr(e);return r[1]=o.snapTo(r[0],n),r},zr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=zr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(zr.computeOverlaySnapTolerance(i),zr.computeOverlaySnapTolerance(o))}},zr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*zr.SNAP_PRECISION_FACTOR},zr.snapToSelf=function(t,e,n){return new zr(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(zr,Kr);var qr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Xr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Yr),$r=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};$r.prototype.getCommon=function(){return y.longBitsToDouble(this._commonBits)},$r.prototype.add=function(t){var e=y.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=$r.signExpBits(this._commonBits),this._isFirst=!1,null):$r.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=$r.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=$r.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},$r.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=y.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+y.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+"  "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.getBit=function(t,e){return 0!=(t&1<<e)?1:0},$r.signExpBits=function(t){return t>>52},$r.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},$r.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if($r.getBit(t,r)!==$r.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new E(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new $r,this._commonBitsY=new $r};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new E(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Lt]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new zr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Fi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||P.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=zr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return zr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Fi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Fi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Fi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Fi.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Fi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof $))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof $?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Fi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Fi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Fi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Fi.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var Ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},si={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ai.prototype.isDelete=function(){return this._eventType===Ai.DELETE},Ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ai.prototype.getObject=function(){return this._obj},Ai.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Ai.prototype.getInsertEvent=function(){return this._insertEvent},Ai.prototype.isInsert=function(){return this._eventType===Ai.INSERT},Ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ai.prototype.interfaces_=function(){return[B]},Ai.prototype.getClass=function(){return Ai},si.INSERT.get=function(){return 1},si.DELETE.get=function(){return 2},Object.defineProperties(Ai,si);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var ui=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ui.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ui.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ui.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ui.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ui.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ui.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ui.prototype.hasProperIntersection=function(){return this._hasProper},ui.prototype.hasIntersection=function(){return this._hasIntersection},ui.prototype.isDone=function(){return this._isDone},ui.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},ui.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ui.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],A=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,A),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var li=function(t){function e(){t.call(this),this.events=new bt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$e.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ui&&U(arguments[0],mt)&&U(arguments[1],mt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&U(arguments[0],mt)&&arguments[1]instanceof ui){var a=arguments[0],A=arguments[1];arguments[2]?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(A)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new ai(n,i),a=new Ai(e,n.getMinX(i),o);this.events.add(a),this.events.add(new Ai(n.getMaxX(i),a))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var a=this.events.get(o);if(a.isInsert()){var A=a.getObject();n.isSameLabel(a)||(i.computeIntersections(A,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),gi=function(){this._min=y.POSITIVE_INFINITY,this._max=y.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};gi.prototype.getMin=function(){return this._min},gi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},gi.prototype.getMax=function(){return this._max},gi.prototype.toString=function(){return q.toLineString(new E(this._min,0),new E(this._max,0))},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},fi.NodeComparator.get=function(){return hi},Object.defineProperties(gi,fi);var hi=function(){};hi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},hi.prototype.interfaces_=function(){return[b]},hi.prototype.getClass=function(){return hi};var di=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gi),Ii=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gi),pi=function(){this._leaves=new bt,this._root=null,this._level=0};pi.prototype.buildTree=function(){$e.sort(this._leaves,new gi.NodeComparator);for(var t=this._leaves,e=null,n=new bt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},pi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new di(t,e,n))},pi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},pi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},pi.prototype.printNode=function(t){P.out.println(q.toLineString(new E(t._min,this._level),new E(t._max,this._level)))},pi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},pi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new Ii(t.get(n),t.get(n+1));e.add(i)}}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var Ci=function(){this._items=new bt};Ci.prototype.visitItem=function(t){this._items.add(t)},Ci.prototype.getItems=function(){return this._items},Ci.prototype.interfaces_=function(){return[Xe]},Ci.prototype.getClass=function(){return Ci};var yi=function(){this._index=null;var t=arguments[0];if(!U(t,qt))throw new C("Argument must be Polygonal");this._index=new mi(t)},vi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};yi.prototype.locate=function(t){var e=new at(t),n=new Bi(e);return this._index.query(t.y,t.y,n),e.getLocation()},yi.prototype.interfaces_=function(){return[jn]},yi.prototype.getClass=function(){return yi},vi.SegmentVisitor.get=function(){return Bi},vi.IntervalIndexedGeometry.get=function(){return mi},Object.defineProperties(yi,vi);var Bi=function(){this._counter=null;var t=arguments[0];this._counter=t};Bi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Bi.prototype.interfaces_=function(){return[Xe]},Bi.prototype.getClass=function(){return Bi};var mi=function(){this._index=new pi;var t=arguments[0];this.init(t)};mi.prototype.init=function(t){for(var e=Er.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},mi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},mi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Ci;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var bi=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new ge,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Qr,2===arguments.length){var e=arguments[0],n=arguments[1],r=ht.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=a,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,Qe.ON)===S.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new ui(n,!0,!1);o.setIsDoneIfProperInt(i);var a=this.createEdgeSetIntersector(),A=this._parentGeom instanceof ee||this._parentGeom instanceof $t||this._parentGeom instanceof ne,s=r||!A;return a.computeIntersections(this._edges,o,s),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ui(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,S.INTERIOR)}else if(arguments[0]instanceof E){var e=arguments[0];this.insertPoint(this._argIndex,e,S.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),S.EXTERIOR,S.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,S.INTERIOR,S.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],S.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],S.BOUNDARY)},e.prototype.addLineString=function(t){var e=Ft.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new ke(this._argIndex,S.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===S.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Ft.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;At.isCCW(r)&&(i=n,o=e);var a=new nr(r,new ke(this._argIndex,S.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,r[0],S.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new ke(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new li},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof $t)this.addPolygon(e);else if(e instanceof Xt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Zt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Vt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return U(this._parentGeom,qt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new yi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e}(Pe),Ei=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bi(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=ht.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bi(0,e,r),this._arg[1]=new bi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bi(0,i,a),this._arg[1]=new bi(1,o,a)}};Ei.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ei.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var Qi=function(){};Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi},Qi.map=function(){if(arguments[0]instanceof ut&&U(arguments[1],Qi.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(U(arguments[0],vt)&&U(arguments[1],Qi.MapOp)){for(var o=arguments[0],a=arguments[1],A=new bt,s=o.iterator();s.hasNext();){var c=s.next(),u=a.map(c);null!==u&&A.add(u)}return A}},Qi.MapOp=function(){};var Fi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Qr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new bt,this._resultLineList=new bt,this._resultPointList=new bt,this._graph=new Pe(new Wn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new bt;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==S.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new bt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Pr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new We(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Jr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Qe.RIGHT),i.getLocation(1,Qe.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Qe.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Qe.LEFT,r.getLocation(i,Qe.LEFT)),et.isTrue(!r.isNull(i,Qe.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Qe.RIGHT,r.getLocation(i,Qe.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ei);Fi.overlayOp=function(t,e,n){return new Fi(t,e).getResultGeometry(n)},Fi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Fi.createEmptyResult(Fi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Wr.map(t,{interfaces_:function(){return[Qi.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Fi.INTERSECTION)},Fi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Fi.createEmptyResult(Fi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Fi.SYMDIFFERENCE)},Fi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Fi.INTERSECTION:o=Math.min(r,i);break;case Fi.UNION:o=Math.max(r,i);break;case Fi.DIFFERENCE:o=r;break;case Fi.SYMDIFFERENCE:o=Math.max(r,i)}return o},Fi.createEmptyResult=function(t,e,n,r){var i=null;switch(Fi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Fi.difference=function(t,e){return t.isEmpty()?Fi.createEmptyResult(Fi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Fi.DIFFERENCE))},Fi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Fi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];switch(i===S.BOUNDARY&&(i=S.INTERIOR),o===S.BOUNDARY&&(o=S.INTERIOR),a){case Fi.INTERSECTION:return i===S.INTERIOR&&o===S.INTERIOR;case Fi.UNION:return i===S.INTERIOR||o===S.INTERIOR;case Fi.DIFFERENCE:return i===S.INTERIOR&&o!==S.INTERIOR;case Fi.SYMDIFFERENCE:return i===S.INTERIOR&&o!==S.INTERIOR||i!==S.INTERIOR&&o===S.INTERIOR}return!1}},Fi.INTERSECTION=1,Fi.UNION=2,Fi.DIFFERENCE=3,Fi.SYMDIFFERENCE=4;var wi=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Qr,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};wi.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},wi.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?S.BOUNDARY:this._ptLocator.locate(t,this._g)},wi.prototype.extractLinework=function(t){var e=new Si;t.apply(e);var n=e.getLinework(),r=pe.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Si=function(){this._linework=null,this._linework=new bt};Si.prototype.getLinework=function(){return this._linework},Si.prototype.filter=function(t){if(t instanceof $t){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Si.prototype.interfaces_=function(){return[jt]},Si.prototype.getClass=function(){return Si};var Ri=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Ri.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Ri.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Ri.prototype.getPoints=function(t){for(var e=new bt,n=Er.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Ri.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=Math.sqrt(i*i+o*o),A=n*i/a,s=n*o/a,c=(e.x+t.x)/2,u=(e.y+t.y)/2;if(this._doLeft){var l=new E(c-s,u+A);r.add(l)}if(this._doRight){var g=new E(c+s,u-A);r.add(g)}},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var Ui=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new wi(this._geom[0],this._boundaryDistanceTolerance),new wi(this._geom[1],this._boundaryDistanceTolerance),new wi(this._geom[2],this._boundaryDistanceTolerance)]},xi={TOLERANCE:{configurable:!0}};Ui.prototype.reportResult=function(t,e,n){P.out.println("Overlay result invalid - A:"+S.toLocationSymbol(e[0])+" B:"+S.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+S.toLocationSymbol(e[2]))},Ui.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Ui.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ui.hasLocation(this._location,S.BOUNDARY)||this.isValidResult(r,this._location)}},Ui.prototype.addTestPts=function(t){var e=new Ri(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ui.prototype.isValidResult=function(t,e){var n=Fi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===S.INTERIOR);return r||this.reportResult(t,e,n),r},Ui.prototype.getInvalidLocation=function(){return this._invalidLocation},Ui.prototype.interfaces_=function(){return[]},Ui.prototype.getClass=function(){return Ui},Ui.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ui.computeBoundaryDistanceTolerance=function(t,e){return Math.min(zr.computeSizeBasedSnapTolerance(t),zr.computeSizeBasedSnapTolerance(e))},Ui.isValid=function(t,e,n,r){return new Ui(t,e,r).isValid(n)},xi.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ui,xi);var ki=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};ki.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},ki.prototype.combine=function(){for(var t=new bt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.combine=function(){if(1===arguments.length){var t=arguments[0];return new ki(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new ki(ki.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new ki(ki.createList(r,i,o)).combine()}},ki.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},ki.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=new bt;return a.add(r),a.add(i),a.add(o),a}};var Oi=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bt)},Ni={STRTREE_NODE_CAPACITY:{configurable:!0}};Oi.prototype.reduceToGeometries=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;U(r,mt)?i=this.unionTree(r):r instanceof ut&&(i=r),e.add(i)}return e},Oi.prototype.extractByEnvelope=function(t,e,n){for(var r=new bt,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Oi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return ki.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Oi.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new an(Oi.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Oi.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Oi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Oi.getGeometry(e,n),Oi.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),a=this.binaryUnion(e,n,o),A=this.binaryUnion(e,o,r);return this.unionSafe(a,A)}},Oi.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Oi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Oi.prototype.unionActual=function(t,e){return Oi.restrictToPolygons(t.union(e))},Oi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Oi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),a=this.unionActual(i,o);return r.add(a),ki.combine(r)},Oi.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.restrictToPolygons=function(t){if(U(t,qt))return t;var e=br.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(pe.toPolygonArray(e))},Oi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Oi.union=function(t){return new Oi(t).union()},Ni.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Oi,Ni);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Fi.createEmptyResult(Fi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Fi.UNION)},t.GeoJSONReader=be,t.GeoJSONWriter=Ee,t.OverlayOp=Fi,t.UnionOp=Di,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t){t.exports=JSON.parse('{"name":"vitessce","version":"1.1.4","description":"Vitessce app and React component library","author":"C McCallum","homepage":"http://vitessce.io/","license":"MIT","repository":"https://github.com/hubmapconsortium/vitessce/","keywords":["react-component"],"files":["dist","src"],"main":"dist/umd/production/index.min.js","module":"dist/es/production/index.min.js","peerDependencies":{"react":"^16.8.6","react-dom":"^16.8.6"},"dependencies":{"@deck.gl/core":"8.4.0-alpha.4","@deck.gl/layers":"8.4.0-alpha.4","@hms-dbmi/viv":"^0.8.3","@loaders.gl/3d-tiles":"^2.3.0","@loaders.gl/core":"^2.3.0","@loaders.gl/images":"^2.3.0","@loaders.gl/loader-utils":"^2.3.0","@luma.gl/constants":"^8.3.1","@luma.gl/core":"^8.3.1","@luma.gl/shadertools":"^8.3.1","@luma.gl/webgl":"^8.3.1","@material-ui/core":"^4.8.3","@material-ui/icons":"^4.9.1","@turf/boolean-contains":"^6.0.1","@turf/boolean-overlap":"^6.0.1","@turf/boolean-point-in-polygon":"^6.0.1","@turf/boolean-within":"^6.0.1","@turf/centroid":"^6.0.2","@turf/concave":"^6.0.5","@turf/helpers":"^6.1.4","ajv":"^6.10.0","bowser":"^2.11.0","classnames":"^2.2.6","clsx":"^1.1.1","d3-array":"^2.4.0","d3-dsv":"^1.1.1","d3-force":"^2.1.1","d3-quadtree":"^1.0.7","d3-scale-chromatic":"^1.3.3","deck.gl":"8.4.0-alpha.4","dynamic-import-polyfill":"^0.1.1","glslify":"^7.0.0","higlass":"1.11.4","higlass-register":"^0.3.0","higlass-zarr-datafetchers":"^0.2.0","json2csv":"^4.5.2","lodash":"^4.17.15","lz-string":"^1.4.4","math.gl":"^3.1.3","mathjs":"^9.2.0","nebula.gl":"^0.21.1","prop-types":"^15.7.2","rc-tooltip":"^4.0.3","rc-tree":"2.1.0","react-color":"^2.18.0","react-grid-layout":"^1.1.1","react-vega":"^7.3.0","react-virtualized":"^9.22.2","short-number":"^1.0.6","store":"^2.0.12","tinycolor2":"^1.4.1","uuid":"^3.3.2","vega":"^5.13.0","vega-lite":"^4.13.0","vega-tooltip":"^0.23.0","whatwg-fetch":"^3.0.0","window-pixi":"5.3.3","zarr":"^0.3.0","zustand":"^3.0.2"},"devDependencies":{"@babel/core":"7.9.0","@svgr/webpack":"5.3.1","@typescript-eslint/eslint-plugin":"^2.10.0","@typescript-eslint/parser":"^2.10.0","babel-eslint":"10.0.3","babel-loader":"8.1.0","babel-plugin-glsl":"^1.0.0","babel-plugin-named-asset-import":"^0.3.6","babel-preset-react-app":"^9.1.2","camelcase":"^5.3.1","case-sensitive-paths-webpack-plugin":"2.3.0","css-loader":"3.4.2","cypress":"^3.6.1","dotenv":"8.2.0","dotenv-expand":"5.1.0","enzyme":"^3.9.0","enzyme-adapter-react-16":"^1.11.2","eslint":"^6.6.0","eslint-config-airbnb":"^17.1.0","eslint-config-react-app":"^5.2.0","eslint-loader":"3.0.3","eslint-plugin-cypress":"^2.2.1","eslint-plugin-flowtype":"4.6.0","eslint-plugin-import":"2.20.0","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-react":"7.18.0","eslint-plugin-react-hooks":"^1.6.1","eslint-plugin-vitessce-rules":"file:eslint","expect":"^24.5.0","file-loader":"4.3.0","fs-extra":"^8.1.0","glsl-colormap":"^1.0.1","html-webpack-plugin":"4.0.0-beta.11","identity-obj-proxy":"3.0.0","js-yaml":"^3.13.1","karma":"4.4.1","karma-chrome-launcher":"3.1.0","karma-mocha":"1.3.0","karma-mocha-reporter":"2.2.5","karma-sourcemap-loader":"0.3.7","karma-webpack":"4.0.2","mini-css-extract-plugin":"0.9.0","mocha":"7.1.0","node-sass":"^5.0.0","object.fromentries":"^2.0.2","optimize-css-assets-webpack-plugin":"5.0.3","pnp-webpack-plugin":"1.6.0","postcss-flexbugs-fixes":"4.1.0","postcss-loader":"3.0.0","postcss-normalize":"8.0.1","postcss-preset-env":"6.7.0","postcss-safe-parser":"4.0.1","react":"^16.8.6","react-app-polyfill":"^1.0.6","react-dev-utils":"^10.2.0","react-dom":"^16.8.6","resolve":"1.15.0","resolve-url-loader":"3.1.1","sass-loader":"^10.0.1","semver":"6.3.0","style-loader":"0.23.1","terser-webpack-plugin":"2.3.4","url-loader":"2.3.0","wait-on":"^3.2.0","webpack":"4.41.5","webpack-dev-server":"3.10.2","webpack-node-externals":"^2.5.2","workbox-webpack-plugin":"4.3.1","worker-loader":"^2.0.0"},"resolutions":{"@turf/difference":"6.0.1"},"scripts":{"build-demo:prod":"node scripts/build-demo.js production","build-lib:prod":"node scripts/build-lib.js production","build-demo:dev":"node scripts/build-demo.js development","build-lib:dev":"node scripts/build-lib.js development","build:prod":"npm run build-demo:prod && npm run build-lib:prod","build:dev":"npm run build-demo:dev && npm run build-lib:dev","prepublishOnly":"npm run build-lib:prod","clean":"rm -r dist-demo dist","start":"node scripts/start-demo.js","test":"karma start scripts/karma.config.js --single-run","test:watch":"karma start scripts/karma.config.js --auto-watch","cypress:open":"cypress open","cypress:run":"cypress run","lint-fix":"eslint -c .eslintrc.yml --ext .js --fix src/"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"babel":{"presets":["react-app"],"plugins":["glsl"]}}')},,,,,,,,,,,,,,,,,,,,function(t,e,n){var r=n(131);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(303),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,A=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,A),n=t[A];try{t[A]=void 0;var r=!0}catch(s){}var i=a.call(t);return r&&(e?t[A]=n:delete t[A]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],A=r[1],s=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,A)),u=0,l=A>0?a-4:a;for(n=0;n<l;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===A&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,s[u++]=255&e);1===A&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,A=n-i;a<A;a+=16383)o.push(u(t,a,a+16383>A?A:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=0,s=a.length;A<s;++A)r[A]=a[A],i[a.charCodeAt(A)]=A;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var i,o,a=[],A=e;A<n;A+=3)i=(t[A]<<16&16711680)+(t[A+1]<<8&65280)+(255&t[A+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){},function(t,e,n){(function(e){var r=n(585).Transform,i=n(101);function o(t){r.call(this,t),this._destroyed=!1}function a(t,e,n){n(null,t)}function A(t){return function(e,n,r){return"function"==typeof e&&(r=n,n=e,e={}),"function"!=typeof n&&(n=a),"function"!=typeof r&&(r=null),t(e,n,r)}}i(o,r),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var n=this;e.nextTick((function(){t&&n.emit("error",t),n.emit("close")}))}},t.exports=A((function(t,e,n){var r=new o(t);return r._transform=e,n&&(r._flush=n),r})),t.exports.ctor=A((function(t,e,n){function r(e){if(!(this instanceof r))return new r(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(r,o),r.prototype._transform=e,n&&(r.prototype._flush=n),r})),t.exports.obj=A((function(t,e,n){var r=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return r._transform=e,n&&(r._flush=n),r}))}).call(this,n(68))},function(t,e,n){(e=t.exports=n(415)).Stream=e,e.Readable=e,e.Writable=n(419),e.Duplex=n(204),e.Transform=n(421),e.PassThrough=n(592),e.finished=n(341),e.pipeline=n(593)},function(t,e){},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=n(96).Buffer,A=n(588).inspect,s=A&&A.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,n,c;return e=t,(n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,n,r,i=a.allocUnsafe(t>>>0),o=this.head,A=0;o;)e=o.data,n=i,r=A,a.prototype.copy.call(e,n,r),A+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?r+=i:r+=i.slice(0,t),0===(t-=o)){o===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:s,value:function(t,e){return A(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,n),c&&o(e,c),t}()},function(t,e){},function(t,e,n){var r=n(96),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,n){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},a.alloc=function(t,e,n){if("number"!==typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"===typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e){var r;function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=n(341),a=Symbol("lastResolve"),A=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),g=Symbol("stream");function f(t,e){return{value:t,done:e}}function h(t){var e=t[a];if(null!==e){var n=t[g].read();null!==n&&(t[u]=null,t[a]=null,t[A]=null,e(f(n,!1)))}}function d(t){e.nextTick(h,t)}var I=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((i(r={get stream(){return this[g]},next:function(){var t=this,n=this[s];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(f(void 0,!0));if(this[g].destroyed)return new Promise((function(n,r){e.nextTick((function(){t[s]?r(t[s]):n(f(void 0,!0))}))}));var r,i=this[u];if(i)r=new Promise(function(t,e){return function(n,r){t.then((function(){e[c]?n(f(void 0,!0)):e[l](n,r)}),r)}}(i,this));else{var o=this[g].read();if(null!==o)return Promise.resolve(f(o,!1));r=new Promise(this[l])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var t=this;return new Promise((function(e,n){t[g].destroy(null,(function(t){t?n(t):e(f(void 0,!0))}))}))})),r),I);t.exports=function(t){var e,n=Object.create(p,(i(e={},g,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,A,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,l,{value:function(t,e){var r=n[g].read();r?(n[u]=null,n[a]=null,n[A]=null,t(f(r,!1))):(n[a]=t,n[A]=e)},writable:!0}),e));return n[u]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[A];return null!==e&&(n[u]=null,n[a]=null,n[A]=null,e(t)),void(n[s]=t)}var r=n[a];null!==r&&(n[u]=null,n[a]=null,n[A]=null,r(f(void 0,!0))),n[c]=!0})),t.on("readable",d.bind(null,n)),n}}).call(this,n(68))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,n){"use strict";t.exports=i;var r=n(421);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(101)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){"use strict";var r;var i=n(203).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function A(t){if(t)throw t}function s(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var A=!1;t.on("close",(function(){A=!0})),void 0===r&&(r=n(341)),r(t,{readable:e,writable:i},(function(t){if(t)return o(t);A=!0,o()}));var s=!1;return function(e){if(!A&&!s)return s=!0,function(t){return t.setHeader&&"function"===typeof t.abort}(t)?t.abort():"function"===typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function c(t){t()}function u(t,e){return t.pipe(e)}function l(t){return t.length?"function"!==typeof t[t.length-1]?A:t.pop():A}t.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=l(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var a=e.map((function(t,n){var o=n<e.length-1;return s(t,o,n>0,(function(t){r||(r=t),t&&a.forEach(c),o||(a.forEach(c),i(r))}))}));return e.reduce(u)}},function(t,e,n){"use strict";var r=n(277),i=n(595),o=n(596),a=n(597),A=n(598);function s(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):-2}function l(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):-2}function g(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,l(t))):-2}function f(t,e){var n,r;return t?(r=new c,t.state=r,r.window=null,0!==(n=g(t,e))&&(t.state=null),n):-2}var h,d,I=!0;function p(t){if(I){var e;for(h=new r.Buf32(512),d=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(A(1,t.lens,0,288,h,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;A(2,t.lens,0,32,d,0,t.work,{bits:5}),I=!1}t.lencode=h,t.lenbits=9,t.distcode=d,t.distbits=5}function C(t,e,n,i){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,e,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,e,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,e,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}e.inflateReset=l,e.inflateReset2=g,e.inflateResetKeep=u,e.inflateInit=function(t){return f(t,15)},e.inflateInit2=f,e.inflate=function(t,e){var n,c,u,l,g,f,h,d,I,y,v,B,m,b,E,Q,F,w,S,R,U,x,k,O,N=0,D=new r.Buf8(4),G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),g=t.next_out,u=t.output,h=t.avail_out,l=t.next_in,c=t.input,f=t.avail_in,d=n.hold,I=n.bits,y=f,v=h,x=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;I<16;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(2&n.wrap&&35615===d){n.check=0,D[0]=255&d,D[1]=d>>>8&255,n.check=o(n.check,D,2,0),d=0,I=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!==(15&d)){t.msg="unknown compression method",n.mode=30;break}if(I-=4,U=8+(15&(d>>>=4)),0===n.wbits)n.wbits=U;else if(U>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<U,t.adler=n.check=1,n.mode=512&d?10:12,d=0,I=0;break;case 2:for(;I<16;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(n.flags=d,8!==(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=d>>8&1),512&n.flags&&(D[0]=255&d,D[1]=d>>>8&255,n.check=o(n.check,D,2,0)),d=0,I=0,n.mode=3;case 3:for(;I<32;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.head&&(n.head.time=d),512&n.flags&&(D[0]=255&d,D[1]=d>>>8&255,D[2]=d>>>16&255,D[3]=d>>>24&255,n.check=o(n.check,D,4,0)),d=0,I=0,n.mode=4;case 4:for(;I<16;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.head&&(n.head.xflags=255&d,n.head.os=d>>8),512&n.flags&&(D[0]=255&d,D[1]=d>>>8&255,n.check=o(n.check,D,2,0)),d=0,I=0,n.mode=5;case 5:if(1024&n.flags){for(;I<16;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&(D[0]=255&d,D[1]=d>>>8&255,n.check=o(n.check,D,2,0)),d=0,I=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((B=n.length)>f&&(B=f),B&&(n.head&&(U=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,c,l,B,U)),512&n.flags&&(n.check=o(n.check,c,B,l)),f-=B,l+=B,n.length-=B),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===f)break t;B=0;do{U=c[l+B++],n.head&&U&&n.length<65536&&(n.head.name+=String.fromCharCode(U))}while(U&&B<f);if(512&n.flags&&(n.check=o(n.check,c,B,l)),f-=B,l+=B,U)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===f)break t;B=0;do{U=c[l+B++],n.head&&U&&n.length<65536&&(n.head.comment+=String.fromCharCode(U))}while(U&&B<f);if(512&n.flags&&(n.check=o(n.check,c,B,l)),f-=B,l+=B,U)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;I<16;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(d!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}d=0,I=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;I<32;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}t.adler=n.check=s(d),d=0,I=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=g,t.avail_out=h,t.next_in=l,t.avail_in=f,n.hold=d,n.bits=I,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){d>>>=7&I,I-=7&I,n.mode=27;break}for(;I<3;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}switch(n.last=1&d,I-=1,3&(d>>>=1)){case 0:n.mode=14;break;case 1:if(p(n),n.mode=20,6===e){d>>>=2,I-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}d>>>=2,I-=2;break;case 14:for(d>>>=7&I,I-=7&I;I<32;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if((65535&d)!==(d>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&d,d=0,I=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(B=n.length){if(B>f&&(B=f),B>h&&(B=h),0===B)break t;r.arraySet(u,c,l,B,g),f-=B,l+=B,h-=B,g+=B,n.length-=B;break}n.mode=12;break;case 17:for(;I<14;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(n.nlen=257+(31&d),d>>>=5,I-=5,n.ndist=1+(31&d),d>>>=5,I-=5,n.ncode=4+(15&d),d>>>=4,I-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;I<3;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.lens[G[n.have++]]=7&d,d>>>=3,I-=3}for(;n.have<19;)n.lens[G[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},x=A(0,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,x){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;Q=(N=n.lencode[d&(1<<n.lenbits)-1])>>>16&255,F=65535&N,!((E=N>>>24)<=I);){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(F<16)d>>>=E,I-=E,n.lens[n.have++]=F;else{if(16===F){for(O=E+2;I<O;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(d>>>=E,I-=E,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}U=n.lens[n.have-1],B=3+(3&d),d>>>=2,I-=2}else if(17===F){for(O=E+3;I<O;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}I-=E,U=0,B=3+(7&(d>>>=E)),d>>>=3,I-=3}else{for(O=E+7;I<O;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}I-=E,U=0,B=11+(127&(d>>>=E)),d>>>=7,I-=7}if(n.have+B>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;B--;)n.lens[n.have++]=U}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,k={bits:n.lenbits},x=A(1,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,x){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},x=A(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,x){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(f>=6&&h>=258){t.next_out=g,t.avail_out=h,t.next_in=l,t.avail_in=f,n.hold=d,n.bits=I,a(t,v),g=t.next_out,u=t.output,h=t.avail_out,l=t.next_in,c=t.input,f=t.avail_in,d=n.hold,I=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;Q=(N=n.lencode[d&(1<<n.lenbits)-1])>>>16&255,F=65535&N,!((E=N>>>24)<=I);){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(Q&&0===(240&Q)){for(w=E,S=Q,R=F;Q=(N=n.lencode[R+((d&(1<<w+S)-1)>>w)])>>>16&255,F=65535&N,!(w+(E=N>>>24)<=I);){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}d>>>=w,I-=w,n.back+=w}if(d>>>=E,I-=E,n.back+=E,n.length=F,0===Q){n.mode=26;break}if(32&Q){n.back=-1,n.mode=12;break}if(64&Q){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&Q,n.mode=22;case 22:if(n.extra){for(O=n.extra;I<O;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,I-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;Q=(N=n.distcode[d&(1<<n.distbits)-1])>>>16&255,F=65535&N,!((E=N>>>24)<=I);){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(0===(240&Q)){for(w=E,S=Q,R=F;Q=(N=n.distcode[R+((d&(1<<w+S)-1)>>w)])>>>16&255,F=65535&N,!(w+(E=N>>>24)<=I);){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}d>>>=w,I-=w,n.back+=w}if(d>>>=E,I-=E,n.back+=E,64&Q){t.msg="invalid distance code",n.mode=30;break}n.offset=F,n.extra=15&Q,n.mode=24;case 24:if(n.extra){for(O=n.extra;I<O;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,I-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===h)break t;if(B=v-h,n.offset>B){if((B=n.offset-B)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}B>n.wnext?(B-=n.wnext,m=n.wsize-B):m=n.wnext-B,B>n.length&&(B=n.length),b=n.window}else b=u,m=g-n.offset,B=n.length;B>h&&(B=h),h-=B,n.length-=B;do{u[g++]=b[m++]}while(--B);0===n.length&&(n.mode=21);break;case 26:if(0===h)break t;u[g++]=n.length,h--,n.mode=21;break;case 27:if(n.wrap){for(;I<32;){if(0===f)break t;f--,d|=c[l++]<<I,I+=8}if(v-=h,t.total_out+=v,n.total+=v,v&&(t.adler=n.check=n.flags?o(n.check,u,v,g-v):i(n.check,u,v,g-v)),v=h,(n.flags?d:s(d))!==n.check){t.msg="incorrect data check",n.mode=30;break}d=0,I=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;I<32;){if(0===f)break t;f--,d+=c[l++]<<I,I+=8}if(d!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}d=0,I=0}n.mode=29;case 29:x=1;break t;case 30:x=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=g,t.avail_out=h,t.next_in=l,t.avail_in=f,n.hold=d,n.bits=I,(n.wsize||v!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&C(t,t.output,t.next_out,v-t.avail_out)?(n.mode=31,-4):(y-=t.avail_in,v-=t.avail_out,t.total_in+=y,t.total_out+=v,n.total+=v,n.wrap&&v&&(t.adler=n.check=n.flags?o(n.check,u,v,t.next_out-v):i(n.check,u,v,t.next_out-v)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===y&&0===v||4===e)&&0===x&&(x=-5),x)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var n;return t&&t.state?0===(2&(n=t.state).wrap)?-2:(n.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var n,r=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,e,r,0)!==n.check?-3:C(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";t.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e,n,i){var o=r,a=i+n;t^=-1;for(var A=i;A<a;A++)t=t>>>8^o[255&(t^e[A])];return-1^t}},function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,a,A,s,c,u,l,g,f,h,d,I,p,C,y,v,B,m,b,E,Q,F;n=t.state,r=t.next_in,Q=t.input,i=r+(t.avail_in-5),o=t.next_out,F=t.output,a=o-(e-t.avail_out),A=o+(t.avail_out-257),s=n.dmax,c=n.wsize,u=n.whave,l=n.wnext,g=n.window,f=n.hold,h=n.bits,d=n.lencode,I=n.distcode,p=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;t:do{h<15&&(f+=Q[r++]<<h,h+=8,f+=Q[r++]<<h,h+=8),y=d[f&p];e:for(;;){if(f>>>=v=y>>>24,h-=v,0===(v=y>>>16&255))F[o++]=65535&y;else{if(!(16&v)){if(0===(64&v)){y=d[(65535&y)+(f&(1<<v)-1)];continue e}if(32&v){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}B=65535&y,(v&=15)&&(h<v&&(f+=Q[r++]<<h,h+=8),B+=f&(1<<v)-1,f>>>=v,h-=v),h<15&&(f+=Q[r++]<<h,h+=8,f+=Q[r++]<<h,h+=8),y=I[f&C];n:for(;;){if(f>>>=v=y>>>24,h-=v,!(16&(v=y>>>16&255))){if(0===(64&v)){y=I[(65535&y)+(f&(1<<v)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(m=65535&y,h<(v&=15)&&(f+=Q[r++]<<h,(h+=8)<v&&(f+=Q[r++]<<h,h+=8)),(m+=f&(1<<v)-1)>s){t.msg="invalid distance too far back",n.mode=30;break t}if(f>>>=v,h-=v,m>(v=o-a)){if((v=m-v)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(b=0,E=g,0===l){if(b+=c-v,v<B){B-=v;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}}else if(l<v){if(b+=c+l-v,(v-=l)<B){B-=v;do{F[o++]=g[b++]}while(--v);if(b=0,l<B){B-=v=l;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}}}else if(b+=l-v,v<B){B-=v;do{F[o++]=g[b++]}while(--v);b=o-m,E=F}for(;B>2;)F[o++]=E[b++],F[o++]=E[b++],F[o++]=E[b++],B-=3;B&&(F[o++]=E[b++],B>1&&(F[o++]=E[b++]))}else{b=o-m;do{F[o++]=F[b++],F[o++]=F[b++],F[o++]=F[b++],B-=3}while(B>2);B&&(F[o++]=F[b++],B>1&&(F[o++]=F[b++]))}break}}break}}while(r<i&&o<A);r-=B=h>>3,f&=(1<<(h-=B<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<A?A-o+257:257-(o-A),n.hold=f,n.bits=h}},function(t,e,n){"use strict";var r=n(277),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],A=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,n,s,c,u,l,g){var f,h,d,I,p,C,y,v,B,m=g.bits,b=0,E=0,Q=0,F=0,w=0,S=0,R=0,U=0,x=0,k=0,O=null,N=0,D=new r.Buf16(16),G=new r.Buf16(16),_=null,M=0;for(b=0;b<=15;b++)D[b]=0;for(E=0;E<s;E++)D[e[n+E]]++;for(w=m,F=15;F>=1&&0===D[F];F--);if(w>F&&(w=F),0===F)return c[u++]=20971520,c[u++]=20971520,g.bits=1,0;for(Q=1;Q<F&&0===D[Q];Q++);for(w<Q&&(w=Q),U=1,b=1;b<=15;b++)if(U<<=1,(U-=D[b])<0)return-1;if(U>0&&(0===t||1!==F))return-1;for(G[1]=0,b=1;b<15;b++)G[b+1]=G[b]+D[b];for(E=0;E<s;E++)0!==e[n+E]&&(l[G[e[n+E]]++]=E);if(0===t?(O=_=l,C=19):1===t?(O=i,N-=257,_=o,M-=257,C=256):(O=a,_=A,C=-1),k=0,E=0,b=Q,p=u,S=w,R=0,d=-1,I=(x=1<<w)-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){y=b-R,l[E]<C?(v=0,B=l[E]):l[E]>C?(v=_[M+l[E]],B=O[N+l[E]]):(v=96,B=0),f=1<<b-R,Q=h=1<<S;do{c[p+(k>>R)+(h-=f)]=y<<24|v<<16|B|0}while(0!==h);for(f=1<<b-1;k&f;)f>>=1;if(0!==f?(k&=f-1,k+=f):k=0,E++,0===--D[b]){if(b===F)break;b=e[n+l[E]]}if(b>w&&(k&I)!==d){for(0===R&&(R=w),p+=Q,U=1<<(S=b-R);S+R<F&&!((U-=D[S+R])<=0);)S++,U<<=1;if(x+=1<<S,1===t&&x>852||2===t&&x>592)return 1;c[d=k&I]=w<<24|S<<16|p-u|0}}return 0!==k&&(c[p+k]=b-R<<24|64<<16|0),g.bits=w,0}},function(t,e,n){"use strict";var r=n(277),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(c){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(c){o=!1}for(var a=new r.Buf8(256),A=0;A<256;A++)a[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;function s(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",a=0;a<e;a++)n+=String.fromCharCode(t[a]);return n}a[254]=a[254]=1,e.string2buf=function(t){var e,n,i,o,a,A=t.length,s=0;for(o=0;o<A;o++)55296===(64512&(n=t.charCodeAt(o)))&&o+1<A&&56320===(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(s),a=0,o=0;a<s;o++)55296===(64512&(n=t.charCodeAt(o)))&&o+1<A&&56320===(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|63&n):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|63&n);return e},e.buf2binstring=function(t){return s(t,t.length)},e.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,r,i,o,A=e||t.length,c=new Array(2*A);for(r=0,n=0;n<A;)if((i=t[n++])<128)c[r++]=i;else if((o=a[i])>4)c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<A;)i=i<<6|63&t[n++],o--;o>1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return s(c,r)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0||0===n?e:n+a[t[n]]>e?n:e}},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,n){var r=n(605);t.exports=function(t){function e(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return i.colors[Math.abs(e)%i.colors.length]}function i(t){var n;function r(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];if(r.enabled){var a=r,A=Number(new Date),s=A-(n||A);a.diff=s,a.prev=n,a.curr=A,n=A,e[0]=i.coerce(e[0]),"string"!==typeof e[0]&&e.unshift("%O");var c=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return t;c++;var r=i.formatters[n];if("function"===typeof r){var o=e[c];t=r.call(a,o),e.splice(c,1),c--}return t})),i.formatArgs.call(a,e);var u=a.log||i.log;u.apply(a,e)}}return r.namespace=t,r.enabled=i.enabled(t),r.useColors=i.useColors(),r.color=e(t),r.destroy=o,r.extend=a,"function"===typeof i.init&&i.init(r),i.instances.push(r),r}function o(){var t=i.instances.indexOf(this);return-1!==t&&(i.instances.splice(t,1),!0)}function a(t,e){var n=i(this.namespace+("undefined"===typeof e?":":e)+t);return n.log=this.log,n}function A(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},i.disable=function(){var t=[].concat(r(i.names.map(A)),r(i.skips.map(A).map((function(t){return"-"+t})))).join(",");return i.enable(""),t},i.enable=function(t){var e;i.save(t),i.names=[],i.skips=[];var n=("string"===typeof t?t:"").split(/[\s,]+/),r=n.length;for(e=0;e<r;e++)n[e]&&("-"===(t=n[e].replace(/\*/g,".*?"))[0]?i.skips.push(new RegExp("^"+t.substr(1)+"$")):i.names.push(new RegExp("^"+t+"$")));for(e=0;e<i.instances.length;e++){var o=i.instances[e];o.enabled=i.enabled(o.namespace)}},i.enabled=function(t){if("*"===t[t.length-1])return!0;var e,n;for(e=0,n=i.skips.length;e<n;e++)if(i.skips[e].test(t))return!1;for(e=0,n=i.names.length;e<n;e++)if(i.names[e].test(t))return!0;return!1},i.humanize=n(609),Object.keys(t).forEach((function(e){i[e]=t[e]})),i.instances=[],i.names=[],i.skips=[],i.formatters={},i.selectColor=e,i.enable(i.load()),i}},function(t,e,n){var r=n(606),i=n(607),o=n(502),a=n(608);t.exports=function(t){return r(t)||i(t)||o(t)||a()}},function(t,e,n){var r=n(422);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){var n=1e3,r=6e4,i=60*r,o=24*i;function a(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,e){e=e||{};var A=typeof t;if("string"===A&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===A&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=o)return a(t,e,o,"day");if(e>=i)return a(t,e,i,"hour");if(e>=r)return a(t,e,r,"minute");if(e>=n)return a(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=o)return Math.round(t/o)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){(function(e,r,i){var o=n(424),a=n(101),A=n(425),s=n(426),c=n(617),u=A.IncomingMessage,l=A.readyStates;var g=t.exports=function(t){var n,r=this;s.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+new e(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){r.setHeader(e,t.headers[e])}));var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)i=!1,n=!0;else if("prefer-streaming"===t.mode)n=!1;else if("allow-wrong-content-type"===t.mode)n=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");n=!0}r._mode=function(t,e){return o.fetch&&e?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&t?"arraybuffer":o.vbArray&&t?"text:vbarray":"text"}(n,i),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};a(g,s.Writable),g.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===f.indexOf(n)&&(this._headers[n]={name:t,value:e})},g.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},g.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},g.prototype._onFinish=function(){var t=this;if(!t._destroyed){var n=t._opts,a=t._headers,A=null;"GET"!==n.method&&"HEAD"!==n.method&&(A=o.arraybuffer?c(e.concat(t._body)):o.blobConstructor?new r.Blob(t._body.map((function(t){return c(t)})),{type:(a["content-type"]||{}).value||""}):e.concat(t._body).toString());var s=[];if(Object.keys(a).forEach((function(t){var e=a[t].name,n=a[t].value;Array.isArray(n)?n.forEach((function(t){s.push([e,t])})):s.push([e,n])})),"fetch"===t._mode){var u=null;if(o.abortController){var g=new AbortController;u=g.signal,t._fetchAbortController=g,"requestTimeout"in n&&0!==n.requestTimeout&&(t._fetchTimer=r.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),n.requestTimeout))}r.fetch(t._opts.url,{method:t._opts.method,headers:s,body:A||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:u}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){r.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)}))}else{var f=t._xhr=new r.XMLHttpRequest;try{f.open(t._opts.method,t._opts.url,!0)}catch(h){return void i.nextTick((function(){t.emit("error",h)}))}"responseType"in f&&(f.responseType=t._mode.split(":")[0]),"withCredentials"in f&&(f.withCredentials=!!n.withCredentials),"text"===t._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(f.timeout=n.requestTimeout,f.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){f.setRequestHeader(t[0],t[1])})),t._response=null,f.onreadystatechange=function(){switch(f.readyState){case l.LOADING:case l.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(f.onprogress=function(){t._onXHRProgress()}),f.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{f.send(A)}catch(h){return void i.nextTick((function(){t.emit("error",h)}))}}}},g.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(n){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},g.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},g.prototype._write=function(t,e,n){this._body.push(t),n()},g.prototype.abort=g.prototype.destroy=function(){this._destroyed=!0,r.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},g.prototype.end=function(t,e,n){"function"===typeof t&&(n=t,t=void 0),s.Writable.prototype.end.call(this,t,e,n)},g.prototype.flushHeaders=function(){},g.prototype.setTimeout=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(96).Buffer,n(56),n(68))},function(t,e){},function(t,e,n){"use strict";var r=n(342).Buffer,i=n(613);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),a=this.head,A=0;a;)e=a.data,n=o,i=A,e.copy(n,i),A+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t){var r="undefined"!==typeof t&&t||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(615),e.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(56))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,o={},a=!1,A=t.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(t);s=s&&s.setTimeout?s:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){u(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"===typeof n.data&&0===n.data.indexOf(e)&&u(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),r=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){u(t.data)},r=function(e){t.port2.postMessage(e)}}():A&&"onreadystatechange"in A.createElement("script")?function(){var t=A.documentElement;r=function(e){var n=A.createElement("script");n.onreadystatechange=function(){u(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():r=function(t){setTimeout(u,0,t)},s.setImmediate=function(t){"function"!==typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var a={callback:t,args:e};return o[i]=a,r(i),i++},s.clearImmediate=c}function c(t){delete o[t]}function u(t){if(a)setTimeout(u,0,t);else{var e=o[t];if(e){a=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{c(t),a=!1}}}}}("undefined"===typeof self?"undefined"===typeof t?this:t:self)}).call(this,n(56),n(68))},function(t,e,n){"use strict";t.exports=o;var r=n(431),i=Object.create(n(237));function o(t){if(!(this instanceof o))return new o(t);r.call(this,t)}i.inherits=n(101),i.inherits(o,r),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){var r=n(96).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"===typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(r.isBuffer(t)){for(var e=new Uint8Array(t.length),n=t.length,i=0;i<n;i++)e[i]=t[i];return e.buffer}throw new Error("Argument must be a Buffer")}},function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t};var n=Object.prototype.hasOwnProperty},function(t,e){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(t,e,n){(function(t,r){var i;!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var A,s=2147483647,c=/^xn--/,u=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,h=String.fromCharCode;function d(t){throw new RangeError(g[t])}function I(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function p(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+I((t=t.replace(l,".")).split("."),e).join(".")}function C(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function y(t){return I(t,(function(t){var e="";return t>65535&&(e+=h((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=h(t)})).join("")}function v(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function B(t,e,n){var r=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;r+=36)t=f(t/35);return f(r+36*t/(t+38))}function m(t){var e,n,r,i,o,a,A,c,u,l,g,h=[],I=t.length,p=0,C=128,v=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&d("not-basic"),h.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<I;){for(o=p,a=1,A=36;i>=I&&d("invalid-input"),((c=(g=t.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:36)>=36||c>f((s-p)/a))&&d("overflow"),p+=c*a,!(c<(u=A<=v?1:A>=v+26?26:A-v));A+=36)a>f(s/(l=36-u))&&d("overflow"),a*=l;v=B(p-o,e=h.length+1,0==o),f(p/e)>s-C&&d("overflow"),C+=f(p/e),p%=e,h.splice(p++,0,C)}return y(h)}function b(t){var e,n,r,i,o,a,A,c,u,l,g,I,p,y,m,b=[];for(I=(t=C(t)).length,e=128,n=0,o=72,a=0;a<I;++a)(g=t[a])<128&&b.push(h(g));for(r=i=b.length,i&&b.push("-");r<I;){for(A=s,a=0;a<I;++a)(g=t[a])>=e&&g<A&&(A=g);for(A-e>f((s-n)/(p=r+1))&&d("overflow"),n+=(A-e)*p,e=A,a=0;a<I;++a)if((g=t[a])<e&&++n>s&&d("overflow"),g==e){for(c=n,u=36;!(c<(l=u<=o?1:u>=o+26?26:u-o));u+=36)m=c-l,y=36-l,b.push(h(v(l+m%y,0))),c=f(m/y);b.push(h(v(c,0))),o=B(n,p,r==i),n=0,++r}++n,++e}return b.join("")}A={version:"1.4.1",ucs2:{decode:C,encode:y},decode:m,encode:b,toASCII:function(t){return p(t,(function(t){return u.test(t)?"xn--"+b(t):t}))},toUnicode:function(t){return p(t,(function(t){return c.test(t)?m(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return A}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(130)(t),n(56))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"===typeof t},isObject:function(t){return"object"===typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";e.decode=e.parse=n(623),e.encode=e.stringify=n(624)},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var a={};if("string"!==typeof t||0===t.length)return a;var A=/\+/g;t=t.split(e);var s=1e3;o&&"number"===typeof o.maxKeys&&(s=o.maxKeys);var c=t.length;s>0&&c>s&&(c=s);for(var u=0;u<c;++u){var l,g,f,h,d=t[u].replace(A,"%20"),I=d.indexOf(n);I>=0?(l=d.substr(0,I),g=d.substr(I+1)):(l=d,g=""),f=decodeURIComponent(l),h=decodeURIComponent(g),r(a,f)?i(a[f])?a[f].push(h):a[f]=[a[f],h]:a[f]=h}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,A){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"===typeof t?o(a(t),(function(a){var A=encodeURIComponent(r(a))+n;return i(t[a])?o(t[a],(function(t){return A+encodeURIComponent(r(t))})).join(e):A+encodeURIComponent(r(t[a]))})).join(e):A?encodeURIComponent(r(A))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var a=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},function(t,e,n){"use strict";var r=n(147);e.convertToJson=function t(e,n){var i={};if(!(e.child&&!r.isEmptyObject(e.child)||e.attrsMap&&!r.isEmptyObject(e.attrsMap)))return r.isExist(e.val)?e.val:"";r.isExist(e.val)&&("string"!==typeof e.val||""!==e.val&&e.val!==n.cdataPositionChar)&&("strict"===n.arrayMode?i[n.textNodeName]=[e.val]:i[n.textNodeName]=e.val),r.merge(i,e.attrsMap,n.arrayMode);for(var o=Object.keys(e.child),a=0;a<o.length;a++){var A=o[a];if(e.child[A]&&e.child[A].length>1)for(var s in i[A]=[],e.child[A])e.child[A].hasOwnProperty(s)&&i[A].push(t(e.child[A][s],n));else if(!0===n.arrayMode){var c=t(e.child[A][0],n);i[A]="object"===typeof c?[c]:c}else"strict"===n.arrayMode?i[A]=[t(e.child[A][0],n)]:i[A]=t(e.child[A][0],n)}return i}},function(t,e,n){"use strict";t.exports=function(t,e,n){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=n,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}}},function(t,e,n){"use strict";var r=n(147),i={allowBooleanAttributes:!1},o=["allowBooleanAttributes"];function a(t,e){for(var n=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var r=t.substr(n,e-n);if(e>5&&"xml"===r)return g("InvalidXml","XML declaration allowed only at the start of the document.",h(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function A(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&0===--n)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=r.buildOptions(e,i,o);var n,c=[],f=!1,d=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var I=0;I<t.length;I++){if("<"!==t[I]){if(" "===t[I]||"\t"===t[I]||"\n"===t[I]||"\r"===t[I])continue;return g("InvalidChar","char '"+t[I]+"' is not expected.",h(t,I))}if("?"===t[++I]){if((I=a(t,++I)).err)return I}else{if("!"===t[I]){I=A(t,I);continue}var p=!1;"/"===t[I]&&(p=!0,I++);for(var C="";I<t.length&&">"!==t[I]&&" "!==t[I]&&"\t"!==t[I]&&"\n"!==t[I]&&"\r"!==t[I];I++)C+=t[I];if("/"===(C=C.trim())[C.length-1]&&(C=C.substring(0,C.length-1),I--),n=C,!r.isName(n)){return g("InvalidTag",0===C.trim().length?"There is an unnecessary space between tag name and backward slash '</ ..'.":"Tag '"+C+"' is an invalid name.",h(t,I))}var y=s(t,I);if(!1===y)return g("InvalidAttr","Attributes for '"+C+"' have open quote.",h(t,I));var v=y.value;if(I=y.index,"/"===v[v.length-1]){var B=u(v=v.substring(0,v.length-1),e);if(!0!==B)return g(B.err.code,B.err.msg,h(t,I-v.length+B.err.line));f=!0}else if(p){if(!y.tagClosed)return g("InvalidTag","Closing tag '"+C+"' doesn't have proper closing.",h(t,I));if(v.trim().length>0)return g("InvalidTag","Closing tag '"+C+"' can't have attributes or invalid starting.",h(t,I));var m=c.pop();if(C!==m)return g("InvalidTag","Closing tag '"+m+"' is expected inplace of '"+C+"'.",h(t,I));0==c.length&&(d=!0)}else{var b=u(v,e);if(!0!==b)return g(b.err.code,b.err.msg,h(t,I-v.length+b.err.line));if(!0===d)return g("InvalidXml","Multiple possible root nodes found.",h(t,I));c.push(C),f=!0}for(I++;I<t.length;I++){if("<"===t[I]){if("!"===t[I+1]){I=A(t,++I);continue}break}if("&"===t[I]){var E=l(t,I);if(-1==E)return g("InvalidChar","char '&' is not expected.",h(t,I));I=E}}"<"===t[I]&&I--}}return f?!(c.length>0)||g("InvalidXml","Invalid '"+JSON.stringify(c,null,4).replace(/\r?\n/g,"")+"' found.",1):g("InvalidXml","Start tag expected.",1)};function s(t,e){for(var n="",r="",i=!1;e<t.length;e++){if('"'===t[e]||"'"===t[e])if(""===r)r=t[e];else{if(r!==t[e])continue;r=""}else if(">"===t[e]&&""===r){i=!0;break}n+=t[e]}return""===r&&{value:n,index:e,tagClosed:i}}var c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function u(t,e){for(var n=r.getAllMatches(t,c),i={},o=0;o<n.length;o++){if(0===n[o][1].length)return g("InvalidAttr","Attribute '"+n[o][2]+"' has no space in starting.",d(t,n[o][0]));if(void 0===n[o][3]&&!e.allowBooleanAttributes)return g("InvalidAttr","boolean attribute '"+n[o][2]+"' is not allowed.",d(t,n[o][0]));var a=n[o][2];if(!f(a))return g("InvalidAttr","Attribute '"+a+"' is an invalid name.",d(t,n[o][0]));if(i.hasOwnProperty(a))return g("InvalidAttr","Attribute '"+a+"' is repeated.",d(t,n[o][0]));i[a]=1}return!0}function l(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);for(var n=0;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function g(t,e,n){return{err:{code:t,msg:e,line:n}}}function f(t){return r.isName(t)}function h(t,e){return t.substring(0,e).split(/\r?\n/).length}function d(t,e){return t.indexOf(e)+e.length}},function(t,e,n){"use strict";var r=function(t){return String.fromCharCode(t)},i={nilChar:r(176),missingChar:r(201),nilPremitive:r(175),missingPremitive:r(200),emptyChar:r(178),emptyValue:r(177),boundryChar:r(179),objStart:r(198),arrStart:r(204),arrayEnd:r(185)},o=[i.nilChar,i.nilPremitive,i.missingChar,i.missingPremitive,i.boundryChar,i.emptyChar,i.emptyValue,i.arrayEnd,i.objStart,i.arrStart],a=function t(e,n,r){if("string"===typeof n)return e&&e[0]&&void 0!==e[0].val?A(e[0].val,n):A(e,n);var o,a=void 0===(o=e)?i.missingChar:null===o?i.nilChar:!(o.child&&0===Object.keys(o.child).length&&(!o.attrsMap||0===Object.keys(o.attrsMap).length))||i.emptyChar;if(!0===a){var c="";if(Array.isArray(n)){c+=i.arrStart;var u=n[0],l=e.length;if("string"===typeof u)for(var g=0;g<l;g++){var f=A(e[g].val,u);c=s(c,f)}else for(var h=0;h<l;h++){var d=t(e[h],u,r);c=s(c,d)}c+=i.arrayEnd}else{c+=i.objStart;var I=Object.keys(n);for(var p in Array.isArray(e)&&(e=e[0]),I){var C=I[p],y=void 0;y=!r.ignoreAttributes&&e.attrsMap&&e.attrsMap[C]?t(e.attrsMap[C],n[C],r):C===r.textNodeName?t(e.val,n[C],r):t(e.child[C],n[C],r),c=s(c,y)}}return c}return a},A=function(t){switch(t){case void 0:return i.missingPremitive;case null:return i.nilPremitive;case"":return i.emptyValue;default:return t}},s=function(t,e){return c(e[0])||c(t[t.length-1])||(t+=i.boundryChar),t+e},c=function(t){return-1!==o.indexOf(t)};var u=n(279),l=n(147).buildOptions;e.convert2nimn=function(t,e,n){return n=l(n,u.defaultOptions,u.props),a(t,e,n)}},function(t,e,n){"use strict";var r=n(147),i=n(147).buildOptions,o=n(279),a=function t(e,n,i){for(var o,a="{",A=Object.keys(e.child),s=0;s<A.length;s++){var c=A[s];if(e.child[c]&&e.child[c].length>1){for(var u in a+='"'+c+'" : [ ',e.child[c])a+=t(e.child[c][u],n)+" , ";a=a.substr(0,a.length-1)+" ] "}else a+='"'+c+'" : '+t(e.child[c][0],n)+" ,"}return r.merge(a,e.attrsMap),r.isEmptyObject(a)?r.isExist(e.val)?e.val:"":(r.isExist(e.val)&&("string"!==typeof e.val||""!==e.val&&e.val!==n.cdataPositionChar)&&(a+='"'+n.textNodeName+'" : '+(!0!==(o=e.val)&&!1!==o&&isNaN(o)?'"'+o+'"':o)),","===a[a.length-1]&&(a=a.substr(0,a.length-2)),a+"}")};e.convertToJsonString=function(t,e){return(e=i(e,o.defaultOptions,o.props)).indentBy=e.indentBy||"",a(t,e,0)}},function(t,e,n){"use strict";var r=n(147).buildOptions,i={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:"  ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},o=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function a(t){this.options=r(t,i,o),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=h),this.options.cdataTagName?this.isCDATA=d:this.isCDATA=function(){return!1},this.replaceCDATAstr=A,this.replaceCDATAarr=s,this.options.format?(this.indentate=f,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=g,this.buildObjNode=u):(this.buildTextNode=l,this.buildObjNode=c),this.buildTextValNode=l,this.buildObjectNode=c}function A(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"<![CDATA["+e+"]]"+this.tagEndChar:t.replace(this.options.cdataPositionChar,"<![CDATA["+e+"]]"+this.tagEndChar)}function s(t,e){if(t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t)return t+"<![CDATA["+e.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(var n in e)t=t.replace(this.options.cdataPositionChar,"<![CDATA["+e[n]+"]]>");return t+this.newLine}function c(t,e,n,r){return n&&!t.includes("<")?this.indentate(r)+"<"+e+n+">"+t+"</"+e+this.tagEndChar:this.indentate(r)+"<"+e+n+this.tagEndChar+t+this.indentate(r)+"</"+e+this.tagEndChar}function u(t,e,n,r){return""!==t?this.buildObjectNode(t,e,n,r):this.indentate(r)+"<"+e+n+"/"+this.tagEndChar}function l(t,e,n,r){return this.indentate(r)+"<"+e+n+">"+this.options.tagValueProcessor(t)+"</"+e+this.tagEndChar}function g(t,e,n,r){return""!==t?this.buildTextValNode(t,e,n,r):this.indentate(r)+"<"+e+n+"/"+this.tagEndChar}function f(t){return this.options.indentBy.repeat(t)}function h(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}function d(t){return t===this.options.cdataTagName}a.prototype.parse=function(t){return this.j2x(t,0).val},a.prototype.j2x=function(t,e){for(var n="",r="",i=Object.keys(t),o=i.length,a=0;a<o;a++){var A=i[a];if("undefined"===typeof t[A]);else if(null===t[A])r+=this.indentate(e)+"<"+A+"/"+this.tagEndChar;else if(t[A]instanceof Date)r+=this.buildTextNode(t[A],A,"",e);else if("object"!==typeof t[A]){var s=this.isAttribute(A);s?n+=" "+s+'="'+this.options.attrValueProcessor(""+t[A])+'"':this.isCDATA(A)?t[this.options.textNodeName]?r+=this.replaceCDATAstr(t[this.options.textNodeName],t[A]):r+=this.replaceCDATAstr("",t[A]):A===this.options.textNodeName?t[this.options.cdataTagName]||(r+=this.options.tagValueProcessor(""+t[A])):r+=this.buildTextNode(t[A],A,"",e)}else if(Array.isArray(t[A]))if(this.isCDATA(A))r+=this.indentate(e),t[this.options.textNodeName]?r+=this.replaceCDATAarr(t[this.options.textNodeName],t[A]):r+=this.replaceCDATAarr("",t[A]);else for(var c=t[A].length,u=0;u<c;u++){var l=t[A][u];if("undefined"===typeof l);else if(null===l)r+=this.indentate(e)+"<"+A+"/"+this.tagEndChar;else if("object"===typeof l){var g=this.j2x(l,e+1);r+=this.buildObjNode(g.val,A,g.attrStr,e)}else r+=this.buildTextNode(l,A,"",e)}else if(this.options.attrNodeName&&A===this.options.attrNodeName)for(var f=Object.keys(t[A]),h=f.length,d=0;d<h;d++)n+=" "+f[d]+'="'+this.options.attrValueProcessor(""+t[A][f[d]])+'"';else{var I=this.j2x(t[A],e+1);r+=this.buildObjNode(I.val,A,I.attrStr,e)}}return{attrStr:n,val:r}},t.exports=a},function(t,e,n){"use strict";var r=n(99),i=n(632);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"self",{enumerable:!0,get:function(){return o.self}}),Object.defineProperty(e,"window",{enumerable:!0,get:function(){return o.window}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return o.global}}),Object.defineProperty(e,"document",{enumerable:!0,get:function(){return o.document}}),Object.defineProperty(e,"process",{enumerable:!0,get:function(){return o.process}}),Object.defineProperty(e,"console",{enumerable:!0,get:function(){return o.console}}),Object.defineProperty(e,"isBrowser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"isBrowserMainThread",{enumerable:!0,get:function(){return a.isBrowserMainThread}}),Object.defineProperty(e,"getBrowser",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"isMobile",{enumerable:!0,get:function(){return A.isMobile}}),Object.defineProperty(e,"isElectron",{enumerable:!0,get:function(){return s.default}});var o=n(433),a=i(n(434)),A=i(n(633)),s=r(n(343))},function(t,e,n){var r=n(266);function i(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var A=o?Object.getOwnPropertyDescriptor(t,a):null;A&&(A.get||A.set)?Object.defineProperty(n,a,A):n[a]=t[a]}return n.default=t,e&&e.set(t,n),n}},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return"undefined"!==typeof i.window.orientation},e.default=function(t){if(!t&&!(0,o.default)())return"Node";if((0,a.default)(t))return"Electron";var e="undefined"!==typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var r=-1!==n.indexOf("MSIE "),A=-1!==n.indexOf("Trident/");if(r||A)return"IE";if(i.window.chrome)return"Chrome";if(i.window.safari)return"Safari";if(i.window.mozInnerScreenX)return"Firefox";return"Unknown"};var i=n(433),o=r(n(434)),a=r(n(343))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this,n=function(){var t=4022871197;return function(e){e=String(e);for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)}}();e.next=function(){var t=2091639*e.s0+2.3283064365386963e-10*e.c;return e.s0=e.s1,e.s1=e.s2,e.s2=t-(e.c=0|t)},e.c=1,e.s0=n(" "),e.s1=n(" "),e.s2=n(" "),e.s0-=n(t),e.s0<0&&(e.s0+=1),e.s1-=n(t),e.s1<0&&(e.s1+=1),e.s2-=n(t),e.s2<0&&(e.s2+=1),n=null}function A(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function s(t,e){var n=new a(t),r=e&&e.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.alea=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),e.next()}function A(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function s(t,e){var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.xor128=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),r==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function A(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function s(t,e){var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.xorwow=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this;e.next=function(){var t,n,r=e.x,i=e.i;return t=r[i],n=(t^=t>>>7)^t<<24,n^=(t=r[i+1&7])^t>>>10,n^=(t=r[i+3&7])^t>>>3,n^=(t=r[i+4&7])^t<<7,t=r[i+7&7],n^=(t^=t<<13)^t<<9,r[i]=n,e.i=i+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n<e.length;++n)r[7&n]=r[7&n]<<15^e.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],t.x=r,t.i=0,n=256;n>0;--n)t.next()}(e,t)}function A(t,e){return e.x=t.x.slice(),e.i=t.i,e}function s(t,e){null==t&&(t=+new Date);var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.x&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.xorshift7=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this;e.next=function(){var t,n,r=e.w,i=e.X,o=e.i;return e.w=r=r+1640531527|0,n=i[o+34&127],t=i[o=o+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=i[o]=n^t,e.i=o,n+(r^r>>>16)|0},function(t,e){var n,r,i,o,a,A=[],s=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,s=Math.max(s,e.length)),i=0,o=-32;o<s;++o)e&&(r^=e.charCodeAt((o+32)%e.length)),0===o&&(a=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=A[127&o]^=r+a)?i+1:0);for(i>=128&&(A[127&(e&&e.length||0)]=-1),i=127,o=512;o>0;--o)r=A[i+34&127],n=A[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,A[i]=r^n;t.w=a,t.X=A,t.i=i}(e,t)}function A(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function s(t,e){null==t&&(t=+new Date);var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.X&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.xor4096=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){(function(t){var r;!function(t,i,o){function a(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,i=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r<n.length+20;r++)e.b^=0|n.charCodeAt(r),e.next()}function A(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function s(t,e){var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&A(r,n),i.state=function(){return A(n,{})}),i}i&&i.exports?i.exports=s:n(113)&&n(206)?void 0===(r=function(){return s}.call(e,n,e,i))||(i.exports=r):this.tychei=s}(0,t,n(113))}).call(this,n(130)(t))},function(t,e,n){var r;!function(i,o,a){var A,s=a.pow(256,6),c=a.pow(2,52),u=2*c;function l(t,e,n){var r=[],l=h(function t(e,n){var r,i=[],o=typeof e;if(n&&"object"==o)for(r in e)try{i.push(t(e[r],n-1))}catch(a){}return i.length?i:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,d(o)]:null==t?function(){try{var t;return A&&(t=A.randomBytes)?t=t(256):(t=new Uint8Array(256),(i.crypto||i.msCrypto).getRandomValues(t)),d(t)}catch(r){var e=i.navigator,n=e&&e.plugins;return[+new Date,i,n,i.screen,d(o)]}}():t,3),r),I=new g(r),p=function(){for(var t=I.g(6),e=s,n=0;t<c;)t=256*(t+n),e*=256,n=I.g(1);for(;t>=u;)t/=2,e/=2,n>>>=1;return(t+n)/e};return p.int32=function(){return 0|I.g(4)},p.quick=function(){return I.g(4)/4294967296},p.double=p,h(d(I.S),o),(e.pass||n||function(t,e,n,r){return r&&(r.S&&f(r,I),t.state=function(){return f(I,{})}),n?(a.random=t,e):t})(p,l,"global"in e?e.global:this==a,e.state)}function g(t){var e,n=t.length,r=this,i=0,o=r.i=r.j=0,a=r.S=[];for(n||(t=[n++]);i<256;)a[i]=i++;for(i=0;i<256;i++)a[i]=a[o=255&o+t[i%n]+(e=a[i])],a[o]=e;(r.g=function(t){for(var e,n=0,i=r.i,o=r.j,a=r.S;t--;)e=a[i=255&i+1],n=256*n+a[255&(a[i]=a[o=255&o+e])+(a[o]=e)];return r.i=i,r.j=o,n})(256)}function f(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function h(t,e){for(var n,r=t+"",i=0;i<r.length;)e[255&i]=255&(n^=19*e[255&i])+r.charCodeAt(i++);return d(e)}function d(t){return String.fromCharCode.apply(0,t)}if(h(a.random(),o),t.exports){t.exports=l;try{A=n(641)}catch(I){}}else void 0===(r=function(){return l}.call(e,n,e,t))||(t.exports=r)}("undefined"!==typeof self?self:this,[],Math)},function(t,e){},function(t,e,n){var r=n(492),i=n(453),o=n(672),a=n(674),A=n(495),s=n(200),c=n(386),u=n(408),l="[object Object]",g=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,f,h,d){var I=s(t),p=s(e),C=I?"[object Array]":A(t),y=p?"[object Array]":A(e),v=(C="[object Arguments]"==C?l:C)==l,B=(y="[object Arguments]"==y?l:y)==l,m=C==y;if(m&&c(t)){if(!c(e))return!1;I=!0,v=!1}if(m&&!v)return d||(d=new r),I||u(t)?i(t,e,n,f,h,d):o(t,e,C,n,f,h,d);if(!(1&n)){var b=v&&g.call(t,"__wrapped__"),E=B&&g.call(e,"__wrapped__");if(b||E){var Q=b?t.value():t,F=E?e.value():e;return d||(d=new r),h(Q,F,n,f,d)}}return!!m&&(d||(d=new r),a(t,e,n,f,h,d))}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(281),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(281);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(281);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(281);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(280);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(280),i=n(344),o=n(407);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(406),i=n(654),o=n(192),a=n(452),A=/^\[object .+?Constructor\]$/,s=Function.prototype,c=Object.prototype,u=s.toString,l=c.hasOwnProperty,g=RegExp("^"+u.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?g:A).test(a(t))}},function(t,e,n){var r=n(655),i=function(){var t=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(131)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(658),i=n(280),o=n(344);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(659),i=n(660),o=n(661),a=n(662),A=n(663);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=A,t.exports=s},function(t,e,n){var r=n(282);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(282),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(282),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(282);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(283);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(283);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(283);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(283);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(303),i=n(529),o=n(329),a=n(453),A=n(673),s=n(506),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,l,g){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var f=A;case"[object Set]":var h=1&r;if(f||(f=s),t.size!=e.size&&!h)return!1;var d=g.get(t);if(d)return d==e;r|=2,g.set(t,e);var I=a(f(t),f(e),r,c,l,g);return g.delete(t),I;case"[object Symbol]":if(u)return u.call(t)==u.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(530),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,A){var s=1&n,c=r(t),u=c.length;if(u!=r(e).length&&!s)return!1;for(var l=u;l--;){var g=c[l];if(!(s?g in e:i.call(e,g)))return!1}var f=A.get(t);if(f&&A.get(e))return f==e;var h=!0;A.set(t,e),A.set(e,t);for(var d=s;++l<u;){var I=t[g=c[l]],p=e[g];if(o)var C=s?o(p,I,g,e,t,A):o(I,p,g,t,e,A);if(!(void 0===C?I===p||a(I,p,n,o,A):C)){h=!1;break}d||(d="constructor"==g)}if(h&&!d){var y=t.constructor,v=e.constructor;y==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(h=!1)}return A.delete(t),A.delete(e),h}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(229),i=n(193);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(229),i=n(409),o=n(193),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(510),i=n(681),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(534)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(194)(n(131),"DataView");t.exports=r},function(t,e,n){var r=n(194)(n(131),"Promise");t.exports=r},function(t,e,n){var r=n(194)(n(131),"WeakMap");t.exports=r},function(t,e,n){"use strict";function r(t,e,n){var r=n?" !== ":" === ",i=n?" || ":" && ",o=n?"!":"",a=n?"":"!";switch(t){case"null":return e+r+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+e+i+"typeof "+e+r+'"object"'+i+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+r+'"number"'+i+a+"("+e+" % 1)"+i+e+r+e+")";default:return"typeof "+e+r+'"'+t+'"'}}t.exports={copy:function(t,e){for(var n in e=e||{},t)e[n]=t[n];return e},checkDataType:r,checkDataTypes:function(t,e){switch(t.length){case 1:return r(t[0],e,!0);default:var n="",i=o(t);for(var a in i.array&&i.object&&(n=i.null?"(":"(!"+e+" || ",n+="typeof "+e+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer,i)n+=(n?" && ":"")+r(a,e,!0);return n}},coerceToTypes:function(t,e){if(Array.isArray(e)){for(var n=[],r=0;r<e.length;r++){var o=e[r];(i[o]||"array"===t&&"array"===o)&&(n[n.length]=o)}if(n.length)return n}else{if(i[e])return[e];if("array"===t&&"array"===e)return["array"]}},toHash:o,getProperty:s,escapeQuotes:c,equal:n(538),ucs2length:n(1140),varOccurences:function(t,e){e+="[^0-9]";var n=t.match(new RegExp(e,"g"));return n?n.length:0},varReplace:function(t,e,n){return e+="([^0-9])",n=n.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),n+"$1")},cleanUpCode:function(t){return t.replace(u,"").replace(l,"").replace(g,"if (!($1))")},finalCleanUpCode:function(t,e){var n=t.match(f);n&&2==n.length&&(t=e?t.replace(d,"").replace(I,"return data;"):t.replace(h,"").replace("return errors === 0;","validate.errors = null; return true;"));return(n=t.match(p))&&3===n.length?t.replace(C,""):t},schemaHasRules:function(t,e){if("boolean"==typeof t)return!t;for(var n in t)if(e[n])return!0},schemaHasRulesExcept:function(t,e,n){if("boolean"==typeof t)return!t&&"not"!=n;for(var r in t)if(r!=n&&e[r])return!0},schemaUnknownRules:function(t,e){if("boolean"==typeof t)return;for(var n in t)if(!e[n])return n},toQuotedString:y,getPathExpr:function(t,e,n,r){return m(t,n?"'/' + "+e+(r?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):r?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'")},getPath:function(t,e,n){var r=y(n?"/"+b(e):s(e));return m(t,r)},getData:function(t,e,n){var r,i,o,a;if(""===t)return"rootData";if("/"==t[0]){if(!v.test(t))throw new Error("Invalid JSON-pointer: "+t);i=t,o="rootData"}else{if(!(a=t.match(B)))throw new Error("Invalid JSON-pointer: "+t);if(r=+a[1],"#"==(i=a[2])){if(r>=e)throw new Error("Cannot access property/index "+r+" levels up, current level is "+e);return n[e-r]}if(r>e)throw new Error("Cannot access data "+r+" levels up, current level is "+e);if(o="data"+(e-r||""),!i)return o}for(var A=o,c=i.split("/"),u=0;u<c.length;u++){var l=c[u];l&&(o+=s(E(l)),A+=" && "+o)}return A},unescapeFragment:function(t){return E(decodeURIComponent(t))},unescapeJsonPointer:E,escapeFragment:function(t){return encodeURIComponent(b(t))},escapeJsonPointer:b};var i=o(["string","number","integer","boolean","null"]);function o(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return e}var a=/^[a-z$_][a-z$_0-9]*$/i,A=/'|\\/g;function s(t){return"number"==typeof t?"["+t+"]":a.test(t)?"."+t:"['"+c(t)+"']"}function c(t){return t.replace(A,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var u=/else\s*{\s*}/g,l=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,g=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var f=/[^v.]errors/g,h=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,d=/var errors = 0;|var vErrors = null;/g,I=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,p=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,C=/if \(rootData === undefined\) rootData = data;/;function y(t){return"'"+c(t)+"'"}var v=/^\/(?:[^~]|~0|~1)*$/,B=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function m(t,e){return'""'==t?e:(t+" + "+e).replace(/' \+ '/g,"")}function b(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function E(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}},function(t,e,n){var r=n(513),i=n(514),o=n(1049),a=n(687),A=n(537),s=function t(e,n,s){var c,u,l,g=e&t.F,f=e&t.G,h=e&t.S,d=e&t.P,I=e&t.B,p=e&t.W,C=f?i:i[n]||(i[n]={}),y=C.prototype,v=f?r:h?r[n]:(r[n]||{}).prototype;for(c in f&&(s=n),s)(u=!g&&v&&void 0!==v[c])&&A(C,c)||(l=u?v[c]:s[c],C[c]=f&&"function"!=typeof v[c]?s[c]:I&&u?o(l,r):p&&v[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):d&&"function"==typeof l?o(Function.call,l):l,d&&((C.virtual||(C.virtual={}))[c]=l,e&t.R&&y&&!y[c]&&a(y,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(536),i=n(768);t.exports=n(515)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,e,n){var r=n(1053),i=n(874);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(877)("wks"),i=n(771),o=n(513).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(775).MAX_SAFE_COMPONENT_LENGTH,i=n(776),o=(e=t.exports={}).re=[],a=e.src=[],A=e.t={},s=0,c=function(t,e,n){var r=s++;i(r,e),A[t]=r,a[r]=e,o[r]=new RegExp(e,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION","(".concat(a[A.NUMERICIDENTIFIER],")\\.")+"(".concat(a[A.NUMERICIDENTIFIER],")\\.")+"(".concat(a[A.NUMERICIDENTIFIER],")")),c("MAINVERSIONLOOSE","(".concat(a[A.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[A.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[A.NUMERICIDENTIFIERLOOSE],")")),c("PRERELEASEIDENTIFIER","(?:".concat(a[A.NUMERICIDENTIFIER],"|").concat(a[A.NONNUMERICIDENTIFIER],")")),c("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[A.NUMERICIDENTIFIERLOOSE],"|").concat(a[A.NONNUMERICIDENTIFIER],")")),c("PRERELEASE","(?:-(".concat(a[A.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[A.PRERELEASEIDENTIFIER],")*))")),c("PRERELEASELOOSE","(?:-?(".concat(a[A.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[A.PRERELEASEIDENTIFIERLOOSE],")*))")),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD","(?:\\+(".concat(a[A.BUILDIDENTIFIER],"(?:\\.").concat(a[A.BUILDIDENTIFIER],")*))")),c("FULLPLAIN","v?".concat(a[A.MAINVERSION]).concat(a[A.PRERELEASE],"?").concat(a[A.BUILD],"?")),c("FULL","^".concat(a[A.FULLPLAIN],"$")),c("LOOSEPLAIN","[v=\\s]*".concat(a[A.MAINVERSIONLOOSE]).concat(a[A.PRERELEASELOOSE],"?").concat(a[A.BUILD],"?")),c("LOOSE","^".concat(a[A.LOOSEPLAIN],"$")),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[A.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[A.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[A.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[A.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[A.XRANGEIDENTIFIER],")")+"(?:".concat(a[A.PRERELEASE],")?").concat(a[A.BUILD],"?")+")?)?"),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[A.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[A.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[A.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(a[A.PRERELEASELOOSE],")?").concat(a[A.BUILD],"?")+")?)?"),c("XRANGE","^".concat(a[A.GTLT],"\\s*").concat(a[A.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[A.GTLT],"\\s*").concat(a[A.XRANGEPLAINLOOSE],"$")),c("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),c("COERCERTL",a[A.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[A.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",c("TILDE","^".concat(a[A.LONETILDE]).concat(a[A.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[A.LONETILDE]).concat(a[A.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[A.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",c("CARET","^".concat(a[A.LONECARET]).concat(a[A.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[A.LONECARET]).concat(a[A.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[A.GTLT],"\\s*(").concat(a[A.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[A.GTLT],"\\s*(").concat(a[A.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[A.GTLT],"\\s*(").concat(a[A.LOOSEPLAIN],"|").concat(a[A.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[A.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(a[A.XRANGEPLAIN],")")+"\\s*$"),c("HYPHENRANGELOOSE","^\\s*(".concat(a[A.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(a[A.XRANGEPLAINLOOSE],")")+"\\s*$"),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},function(t,e,n){var r=n(775).MAX_LENGTH,i=n(691),o=i.re,a=i.t,A=n(316);t.exports=function(t,e){if(e&&"object"===typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof A)return t;if("string"!==typeof t)return null;if(t.length>r)return null;if(!(e.loose?o[a.LOOSE]:o[a.FULL]).test(t))return null;try{return new A(t,e)}catch(n){return null}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(11),i=n(14),o=n(24),a=n(25),A=n(40),s=n(360),c=n(336),u=n(70),l=function(t){Object(o.a)(n,t);var e=Object(a.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"_renderAxisTopLayers",value:function(){var t=this.props,e=t.axisTopLabelData,n=t.matrixLeft,r=t.width,i=t.matrixWidth,o=t.viewWidth,a=t.theme,s=t.targetX,l=t.targetY,g=t.axisTopTitle,f=t.cellWidth,h=t.axisOffsetTop,d=t.scaleFactor,I=f>=u.b,p=l+(h-u.c)/2/d;return[new c.a({id:"axisTopLabels",coordinateSystem:A.a.CARTESIAN,data:e,getText:function(t){return t[1]},getPosition:function(t){return[n+(t[0]+.5)/r*i,p]},getTextAnchor:"start",getColor:function(){return u.k[a]},getSize:I?u.b:0,getAngle:75,fontFamily:u.a,updateTriggers:{getPosition:[p,n,i,o],getSize:[I],getColor:[a]}}),new c.a({id:"axisTopTitle",coordinateSystem:A.a.CARTESIAN,data:[{title:g}],getText:function(t){return t.title},getPosition:[s,l],getTextAnchor:"middle",getColor:function(){return u.k[a]},getSize:I?0:u.f,getAngle:0,fontFamily:u.a,updateTriggers:{getSize:[I],getColor:[a]}})]}},{key:"_renderAxisLeftLayers",value:function(){var t=this.props,e=t.axisLeftLabelData,n=t.matrixTop,r=t.height,i=t.matrixHeight,o=t.viewHeight,a=t.theme,s=t.axisLeftTitle,l=t.targetX,g=t.targetY,f=t.cellHeight,h=t.axisOffsetLeft,d=t.scaleFactor,I=f>=u.b,p=l+(h-u.c)/2/d;return[new c.a({id:"axisLeftLabels",coordinateSystem:A.a.CARTESIAN,data:e,getText:function(t){return t[1]},getPosition:function(t){return[p,n+(t[0]+.5)/r*i]},getTextAnchor:"end",getColor:function(){return u.k[a]},getSize:I?u.b:0,getAngle:0,fontFamily:u.a,updateTriggers:{getPosition:[p,n,i,o],getSize:[I],getColor:[a]}}),new c.a({id:"axisLeftTitle",coordinateSystem:A.a.CARTESIAN,data:[{title:s}],getText:function(t){return t.title},getPosition:[l,g],getTextAnchor:"middle",getColor:function(){return u.k[a]},getSize:I?0:u.f,getAngle:90,fontFamily:u.a,updateTriggers:{getSize:[I],getColor:[a]}})]}},{key:"renderLayers",value:function(){return[this._renderAxisTopLayers(),this._renderAxisLeftLayers()]}}]),n}(s.a);l.layerName="HeatmapCompositeTextLayer"},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(11),i=n(14),o=n(24),a=n(25),A=n(26),s=n(480),c=n(360),u=n(70),l=Object(A.a)({},s.a.defaultProps,{image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}}),g=function(t){Object(o.a)(n,t);var e=Object(a.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"renderLayers",value:function(){var t=this.props.image;return new s.a(this.props,{id:"".concat(this.props.id,"-wrapped"),image:t,textureParameters:u.j})}}]),n}(c.a);g.layerName="PixelatedBitmapLayer",g.defaultProps=l},function(t,e,n){"use strict";var r=n(11),i=n(14),o=n(74),a=n(90),A=n(24),s=n(25),c=n(46),u=n(364),l=n(435),g=n(436),f=n(480),h=n(218),d=n(70);n.d(e,"a",(function(){return I}));var I=function(t){Object(A.a)(n,t);var e=Object(s.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"_getShaders",value:function(t){var e=this;return this.props.extensions.forEach((function(n){t=Object(u.a)(t,n.getShaders.call(e,n))})),t}},{key:"updateState",value:function(t){Object(a.a)(Object(o.a)(n.prototype),"updateState",this).call(this,t),this.loadTexture(this.props.image)}},{key:"getShaders",value:function(){var t=this.props.colormap;return this._getShaders({vs:"\n#define SHADER_NAME heatmap-bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n  geometry.worldPosition = positions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = pickingColor;\n\n  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTexCoord = texCoords;\n\n  vec4 color = vec4(0.0);\n  DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:"\n#define SHADER_NAME heatmap-bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision mediump float;\n#endif\n\nvec4 rdbu (float x_354677415) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0.0196078431372549,0.0392156862745098,0.6745098039215687,1);\n  const float e1 = 0.35;\n  const vec4 v1 = vec4(0.41568627450980394,0.5372549019607843,0.9686274509803922,1);\n  const float e2 = 0.5;\n  const vec4 v2 = vec4(0.7450980392156863,0.7450980392156863,0.7450980392156863,1);\n  const float e3 = 0.6;\n  const vec4 v3 = vec4(0.8627450980392157,0.6666666666666666,0.5176470588235295,1);\n  const float e4 = 0.7;\n  const vec4 v4 = vec4(0.9019607843137255,0.5686274509803921,0.35294117647058826,1);\n  const float e5 = 1.0;\n  const vec4 v5 = vec4(0.6980392156862745,0.0392156862745098,0.10980392156862745,1);\n  float a0 = smoothstep(e0,e1,x_354677415);\n  float a1 = smoothstep(e1,e2,x_354677415);\n  float a2 = smoothstep(e2,e3,x_354677415);\n  float a3 = smoothstep(e3,e4,x_354677415);\n  float a4 = smoothstep(e4,e5,x_354677415);\n  return max(mix(v0,v1,a0)*step(e0,x_354677415)*step(x_354677415,e1),\n    max(mix(v1,v2,a1)*step(e1,x_354677415)*step(x_354677415,e2),\n    max(mix(v2,v3,a2)*step(e2,x_354677415)*step(x_354677415,e3),\n    max(mix(v3,v4,a3)*step(e3,x_354677415)*step(x_354677415,e4),mix(v4,v5,a4)*step(e4,x_354677415)*step(x_354677415,e5)\n  ))));\n}\n\nvec4 jet (float x_3419531890) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0,0,0.5137254901960784,1);\n  const float e1 = 0.125;\n  const vec4 v1 = vec4(0,0.23529411764705882,0.6666666666666666,1);\n  const float e2 = 0.375;\n  const vec4 v2 = vec4(0.0196078431372549,1,1,1);\n  const float e3 = 0.625;\n  const vec4 v3 = vec4(1,1,0,1);\n  const float e4 = 0.875;\n  const vec4 v4 = vec4(0.9803921568627451,0,0,1);\n  const float e5 = 1.0;\n  const vec4 v5 = vec4(0.5019607843137255,0,0,1);\n  float a0 = smoothstep(e0,e1,x_3419531890);\n  float a1 = smoothstep(e1,e2,x_3419531890);\n  float a2 = smoothstep(e2,e3,x_3419531890);\n  float a3 = smoothstep(e3,e4,x_3419531890);\n  float a4 = smoothstep(e4,e5,x_3419531890);\n  return max(mix(v0,v1,a0)*step(e0,x_3419531890)*step(x_3419531890,e1),\n    max(mix(v1,v2,a1)*step(e1,x_3419531890)*step(x_3419531890,e2),\n    max(mix(v2,v3,a2)*step(e2,x_3419531890)*step(x_3419531890,e3),\n    max(mix(v3,v4,a3)*step(e3,x_3419531890)*step(x_3419531890,e4),mix(v4,v5,a4)*step(e4,x_3419531890)*step(x_3419531890,e5)\n  ))));\n}\n\nvec4 viridis (float x_98747489) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0.26666666666666666,0.00392156862745098,0.32941176470588235,1);\n  const float e1 = 0.13;\n  const vec4 v1 = vec4(0.2784313725490196,0.17254901960784313,0.47843137254901963,1);\n  const float e2 = 0.25;\n  const vec4 v2 = vec4(0.23137254901960785,0.3176470588235294,0.5450980392156862,1);\n  const float e3 = 0.38;\n  const vec4 v3 = vec4(0.17254901960784313,0.44313725490196076,0.5568627450980392,1);\n  const float e4 = 0.5;\n  const vec4 v4 = vec4(0.12941176470588237,0.5647058823529412,0.5529411764705883,1);\n  const float e5 = 0.63;\n  const vec4 v5 = vec4(0.15294117647058825,0.6784313725490196,0.5058823529411764,1);\n  const float e6 = 0.75;\n  const vec4 v6 = vec4(0.3607843137254902,0.7843137254901961,0.38823529411764707,1);\n  const float e7 = 0.88;\n  const vec4 v7 = vec4(0.6666666666666666,0.8627450980392157,0.19607843137254902,1);\n  const float e8 = 1.0;\n  const vec4 v8 = vec4(0.9921568627450981,0.9058823529411765,0.1450980392156863,1);\n  float a0 = smoothstep(e0,e1,x_98747489);\n  float a1 = smoothstep(e1,e2,x_98747489);\n  float a2 = smoothstep(e2,e3,x_98747489);\n  float a3 = smoothstep(e3,e4,x_98747489);\n  float a4 = smoothstep(e4,e5,x_98747489);\n  float a5 = smoothstep(e5,e6,x_98747489);\n  float a6 = smoothstep(e6,e7,x_98747489);\n  float a7 = smoothstep(e7,e8,x_98747489);\n  return max(mix(v0,v1,a0)*step(e0,x_98747489)*step(x_98747489,e1),\n    max(mix(v1,v2,a1)*step(e1,x_98747489)*step(x_98747489,e2),\n    max(mix(v2,v3,a2)*step(e2,x_98747489)*step(x_98747489,e3),\n    max(mix(v3,v4,a3)*step(e3,x_98747489)*step(x_98747489,e4),\n    max(mix(v4,v5,a4)*step(e4,x_98747489)*step(x_98747489,e5),\n    max(mix(v5,v6,a5)*step(e5,x_98747489)*step(x_98747489,e6),\n    max(mix(v6,v7,a6)*step(e6,x_98747489)*step(x_98747489,e7),mix(v7,v8,a7)*step(e7,x_98747489)*step(x_98747489,e8)\n  )))))));\n}\n\nvec4 inferno (float x_2396186301) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0,0,0.01568627450980392,1);\n  const float e1 = 0.13;\n  const vec4 v1 = vec4(0.12156862745098039,0.047058823529411764,0.2823529411764706,1);\n  const float e2 = 0.25;\n  const vec4 v2 = vec4(0.3333333333333333,0.058823529411764705,0.42745098039215684,1);\n  const float e3 = 0.38;\n  const vec4 v3 = vec4(0.5333333333333333,0.13333333333333333,0.41568627450980394,1);\n  const float e4 = 0.5;\n  const vec4 v4 = vec4(0.7294117647058823,0.21176470588235294,0.3333333333333333,1);\n  const float e5 = 0.63;\n  const vec4 v5 = vec4(0.8901960784313725,0.34901960784313724,0.2,1);\n  const float e6 = 0.75;\n  const vec4 v6 = vec4(0.9764705882352941,0.5490196078431373,0.0392156862745098,1);\n  const float e7 = 0.88;\n  const vec4 v7 = vec4(0.9764705882352941,0.788235294117647,0.19607843137254902,1);\n  const float e8 = 1.0;\n  const vec4 v8 = vec4(0.9882352941176471,1,0.6431372549019608,1);\n  float a0 = smoothstep(e0,e1,x_2396186301);\n  float a1 = smoothstep(e1,e2,x_2396186301);\n  float a2 = smoothstep(e2,e3,x_2396186301);\n  float a3 = smoothstep(e3,e4,x_2396186301);\n  float a4 = smoothstep(e4,e5,x_2396186301);\n  float a5 = smoothstep(e5,e6,x_2396186301);\n  float a6 = smoothstep(e6,e7,x_2396186301);\n  float a7 = smoothstep(e7,e8,x_2396186301);\n  return max(mix(v0,v1,a0)*step(e0,x_2396186301)*step(x_2396186301,e1),\n    max(mix(v1,v2,a1)*step(e1,x_2396186301)*step(x_2396186301,e2),\n    max(mix(v2,v3,a2)*step(e2,x_2396186301)*step(x_2396186301,e3),\n    max(mix(v3,v4,a3)*step(e3,x_2396186301)*step(x_2396186301,e4),\n    max(mix(v4,v5,a4)*step(e4,x_2396186301)*step(x_2396186301,e5),\n    max(mix(v5,v6,a5)*step(e5,x_2396186301)*step(x_2396186301,e6),\n    max(mix(v6,v7,a6)*step(e6,x_2396186301)*step(x_2396186301,e7),mix(v7,v8,a7)*step(e7,x_2396186301)*step(x_2396186301,e8)\n  )))))));\n}\n\nvec4 magma (float x_4140671788) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0,0,0.01568627450980392,1);\n  const float e1 = 0.13;\n  const vec4 v1 = vec4(0.10980392156862745,0.06274509803921569,0.26666666666666666,1);\n  const float e2 = 0.25;\n  const vec4 v2 = vec4(0.30980392156862746,0.07058823529411765,0.4823529411764706,1);\n  const float e3 = 0.38;\n  const vec4 v3 = vec4(0.5058823529411764,0.1450980392156863,0.5058823529411764,1);\n  const float e4 = 0.5;\n  const vec4 v4 = vec4(0.7098039215686275,0.21176470588235294,0.47843137254901963,1);\n  const float e5 = 0.63;\n  const vec4 v5 = vec4(0.8980392156862745,0.3137254901960784,0.39215686274509803,1);\n  const float e6 = 0.75;\n  const vec4 v6 = vec4(0.984313725490196,0.5294117647058824,0.3803921568627451,1);\n  const float e7 = 0.88;\n  const vec4 v7 = vec4(0.996078431372549,0.7607843137254902,0.5294117647058824,1);\n  const float e8 = 1.0;\n  const vec4 v8 = vec4(0.9882352941176471,0.9921568627450981,0.7490196078431373,1);\n  float a0 = smoothstep(e0,e1,x_4140671788);\n  float a1 = smoothstep(e1,e2,x_4140671788);\n  float a2 = smoothstep(e2,e3,x_4140671788);\n  float a3 = smoothstep(e3,e4,x_4140671788);\n  float a4 = smoothstep(e4,e5,x_4140671788);\n  float a5 = smoothstep(e5,e6,x_4140671788);\n  float a6 = smoothstep(e6,e7,x_4140671788);\n  float a7 = smoothstep(e7,e8,x_4140671788);\n  return max(mix(v0,v1,a0)*step(e0,x_4140671788)*step(x_4140671788,e1),\n    max(mix(v1,v2,a1)*step(e1,x_4140671788)*step(x_4140671788,e2),\n    max(mix(v2,v3,a2)*step(e2,x_4140671788)*step(x_4140671788,e3),\n    max(mix(v3,v4,a3)*step(e3,x_4140671788)*step(x_4140671788,e4),\n    max(mix(v4,v5,a4)*step(e4,x_4140671788)*step(x_4140671788,e5),\n    max(mix(v5,v6,a5)*step(e5,x_4140671788)*step(x_4140671788,e6),\n    max(mix(v6,v7,a6)*step(e6,x_4140671788)*step(x_4140671788,e7),mix(v7,v8,a7)*step(e7,x_4140671788)*step(x_4140671788,e8)\n  )))))));\n}\n\nvec4 plasma (float x_1580529385) {\n  const float e0 = 0.0;\n  const vec4 v0 = vec4(0.050980392156862744,0.03137254901960784,0.5294117647058824,1);\n  const float e1 = 0.13;\n  const vec4 v1 = vec4(0.29411764705882354,0.011764705882352941,0.6313725490196078,1);\n  const float e2 = 0.25;\n  const vec4 v2 = vec4(0.49019607843137253,0.011764705882352941,0.6588235294117647,1);\n  const float e3 = 0.38;\n  const vec4 v3 = vec4(0.6588235294117647,0.13333333333333333,0.5882352941176471,1);\n  const float e4 = 0.5;\n  const vec4 v4 = vec4(0.796078431372549,0.27450980392156865,0.4745098039215686,1);\n  const float e5 = 0.63;\n  const vec4 v5 = vec4(0.8980392156862745,0.4196078431372549,0.36470588235294116,1);\n  const float e6 = 0.75;\n  const vec4 v6 = vec4(0.9725490196078431,0.5803921568627451,0.2549019607843137,1);\n  const float e7 = 0.88;\n  const vec4 v7 = vec4(0.9921568627450981,0.7647058823529411,0.1568627450980392,1);\n  const float e8 = 1.0;\n  const vec4 v8 = vec4(0.9411764705882353,0.9764705882352941,0.12941176470588237,1);\n  float a0 = smoothstep(e0,e1,x_1580529385);\n  float a1 = smoothstep(e1,e2,x_1580529385);\n  float a2 = smoothstep(e2,e3,x_1580529385);\n  float a3 = smoothstep(e3,e4,x_1580529385);\n  float a4 = smoothstep(e4,e5,x_1580529385);\n  float a5 = smoothstep(e5,e6,x_1580529385);\n  float a6 = smoothstep(e6,e7,x_1580529385);\n  float a7 = smoothstep(e7,e8,x_1580529385);\n  return max(mix(v0,v1,a0)*step(e0,x_1580529385)*step(x_1580529385,e1),\n    max(mix(v1,v2,a1)*step(e1,x_1580529385)*step(x_1580529385,e2),\n    max(mix(v2,v3,a2)*step(e2,x_1580529385)*step(x_1580529385,e3),\n    max(mix(v3,v4,a3)*step(e3,x_1580529385)*step(x_1580529385,e4),\n    max(mix(v4,v5,a4)*step(e4,x_1580529385)*step(x_1580529385,e5),\n    max(mix(v5,v6,a5)*step(e5,x_1580529385)*step(x_1580529385,e6),\n    max(mix(v6,v7,a6)*step(e6,x_1580529385)*step(x_1580529385,e7),mix(v7,v8,a7)*step(e7,x_1580529385)*step(x_1580529385,e8)\n  )))))));\n}\n\n// The texture (GL.LUMINANCE & Uint8Array).\nuniform sampler2D uBitmapTexture;\n\n// What are the dimensions of the texture (width, height)?\nuniform vec2 uTextureSize;\n\n// How many consecutive pixels should be aggregated together along each axis?\nuniform vec2 uAggSize;\n\n// What are the values of the color scale sliders?\nuniform vec2 uColorScaleRange;\n\n// The texture coordinate, varying (interpolated between values set by the vertex shader).\nvarying vec2 vTexCoord;\n\nvoid main(void) {\n  // Compute 1 pixel in texture coordinates\n  vec2 onePixel = vec2(1.0, 1.0) / uTextureSize;\n  \n  vec2 viewCoord = vec2(floor(vTexCoord.x * uTextureSize.x), floor(vTexCoord.y * uTextureSize.y));\n\n  // Compute (x % aggSizeX, y % aggSizeY).\n  // These values will be the number of values to the left / above the current position to consider.\n  vec2 modAggSize = vec2(-1.0 * mod(viewCoord.x, uAggSize.x), -1.0 * mod(viewCoord.y, uAggSize.y));\n\n  // Take the sum of values along each axis.\n  float intensitySum = 0.0;\n  vec2 offsetPixels = vec2(0.0, 0.0);\n\n  for(int i = 0; i < 16; i++) {\n    // Check to break outer loop early.\n    // Uniforms cannot be used as conditions in GLSL for loops.\n    if(float(i) >= uAggSize.y) {\n      // Done in the y direction.\n      break;\n    }\n\n    offsetPixels = vec2(offsetPixels.x, (modAggSize.y + float(i)) * onePixel.y);\n\n    for(int j = 0; j < 16; j++) {\n      // Check to break inner loop early.\n      // Uniforms cannot be used as conditions in GLSL for loops.\n      if(float(j) >= uAggSize.x) {\n        // Done in the x direction.\n        break;\n      }\n\n      offsetPixels = vec2((modAggSize.x + float(j)) * onePixel.x, offsetPixels.y);\n      intensitySum += texture2D(uBitmapTexture, vTexCoord + offsetPixels).r;\n    }\n  }\n  \n  // Compute the mean value.\n  float intensityMean = intensitySum / (uAggSize.x * uAggSize.y);\n  \n  // Re-scale using the color scale slider values.\n  float scaledIntensityMean = (intensityMean - uColorScaleRange[0]) / max(0.005, (uColorScaleRange[1] - uColorScaleRange[0]));\n\n  gl_FragColor = __colormap(clamp(scaledIntensityMean, 0.0, 1.0));\n\n  geometry.uv = vTexCoord;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n".replace("__colormap",t),modules:[l.a,g.a]})}},{key:"draw",value:function(t){var e=t.uniforms,n=this.state,r=n.bitmapTexture,i=n.model,o=this.props,a=o.aggSizeX,A=o.aggSizeY,s=o.colorScaleLo,c=o.colorScaleHi;r&&i&&i.setUniforms(Object.assign({},e,{uBitmapTexture:r,uTextureSize:[d.l,d.l],uAggSize:[a,A],uColorScaleRange:[s,c]})).draw()}},{key:"loadTexture",value:function(t){var e=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),t instanceof h.a?this.setState({bitmapTexture:t}):t&&this.setState({bitmapTexture:new h.a(e,{data:t,mipmaps:!1,parameters:d.j,format:c.default.LUMINANCE,dataFormat:c.default.LUMINANCE,type:c.default.UNSIGNED_BYTE,width:d.l,height:d.l})})}}]),n}(f.a);I.layerName="HeatmapBitmapLayer",I.defaultProps={image:{type:"object",value:null,async:!0},colormap:{type:"string",value:"plasma",compare:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},aggSizeX:{type:"number",value:8,compare:!0},aggSizeY:{type:"number",value:8,compare:!0},colorScaleLo:{type:"number",value:0,compare:!0},colorScaleHi:{type:"number",value:1,compare:!0}}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(1055),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(1056),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"===typeof e?"undefined":(0,o.default)(e))&&"function"!==typeof e?t:e}},function(t,e,n){"use strict";e.__esModule=!0;var r=a(n(1220)),i=a(n(1224)),o=a(n(1056));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof e?"undefined":(0,o.default)(e)));t.prototype=(0,i.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r.default?(0,r.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";var r={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};e.a={name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n  return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n  return\n    picking_uSelectedColorValid &&\n    !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n  if (picking_uActive) {\n    picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n    if (!picking_uAttribute) {\n      picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n    }\n  } else {\n    picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n  }\n}\n\nvoid picking_setPickingAttribute(float value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.r = value;\n  }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.rg = value;\n  }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.rgb = value;\n  }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n  if (picking_uActive) {\n    return color;\n  }\n  bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n  if (selected) {\n    float highLightAlpha = picking_uHighlightColor.a;\n    float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n    float highLightRatio = highLightAlpha / blendedAlpha;\n\n    vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n    return vec4(blendedRGB, blendedAlpha);\n  } else {\n    return color;\n  }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n  if (picking_uActive) {\n    if (picking_vRGBcolor_Avalid.a == 0.0) {\n      discard;\n    }\n    return picking_vRGBcolor_Avalid;\n  }\n  return color;\n}\nvec4 picking_filterColor(vec4 color) {\n  vec4 highightColor = picking_filterHighlightColor(color);\n  return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){var n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){var i=Array.from(t.pickingHighlightColor,(function(t){return t/255}));Number.isFinite(i[3])||(i[3]=1),e.picking_uHighlightColor=i}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(19);function i(t,e,n,i){var o="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);i.forEach((function(t){a.methodName||(a[t]=function(){throw r.h.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return A})),n.d(e,"a",(function(){return s}));var r=n(353),i=n(19),o=n(47);function a(t,e){return A(t,e)}function A(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return c(t,e)}))}function s(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},r.b)void 0===t.luma.caps[e]&&(t.luma.caps[e]=c(t,e));return t.luma.caps}function c(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){var n,a=r.b[e];Object(o.a)(a,e);var A=Object(i.g)(t)&&a[1]||a[0];if("function"===typeof A)n=A(t);else if(Array.isArray(A)){n=!0;var s=!0,c=!1,u=void 0;try{for(var l,g=A[Symbol.iterator]();!(s=(l=g.next()).done);s=!0){var f=l.value;n=n&&Boolean(t.getExtension(f))}}catch(h){c=!0,u=h}finally{try{s||null==g.return||g.return()}finally{if(c)throw u}}}else"string"===typeof A?n=Boolean(t.getExtension(A)):"boolean"===typeof A?n=A:Object(o.a)(!1);return n}(t,e)),t.luma.caps[e]||i.h.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},function(t,e,n){"use strict";var r=n(27),i=n(23),o=n(1),a=n(3),A=n(2),s=n(286),c="undefined"!==typeof __VERSION__?__VERSION__:"untranspiled source",u=Object(s.a)();function l(t){try{var e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(r){return null}}var g=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(a.a)(this,t),this.storage=l(r),this.id=e,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(A.a)(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function f(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>r&&(n=Math.min(n,r/t.width));var o=t.width*n,a=t.height*n,A=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),A]}var h={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function d(t){return"string"===typeof t?h[t.toUpperCase()]||h.WHITE:t}function I(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"===typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function C(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),o=I(i);try{var a=function(){var r=e.value;"function"===typeof t[r]&&(n.find((function(t){return r===t}))||(t[r]=t[r].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(A){o.e(A)}finally{o.f()}}function y(t,e){if(!t)throw new Error(e||"Assertion failed")}var v=n(114);function B(){var t;if(u&&v.b.performance)t=v.b.performance.now();else if(v.a.hrtime){var e=v.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}n.d(e,"a",(function(){return S}));var m={debug:u&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},b={enabled:!0,level:0};function E(){}var Q={},F={once:!0};function w(t){for(var e in t)for(var n in t[e])return n||"untitled";return"empty"}var S=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id;Object(a.a)(this,t),this.id=n,this.VERSION=c,this._startTs=B(),this._deltaTs=B(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new g("__probe-".concat(this.id,"__"),b),this.userData={},this.timeStamp("".concat(this.id," started")),C(this),Object.seal(this)}return Object(A.a)(t,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((B()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((B()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){y(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,m.warn,arguments,F)}},{key:"error",value:function(t){return this._getLogFunction(0,t,m.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,m.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,m.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,m.debug||m.info,arguments,F)}},{key:"table",value:function(t,e,n){return e?this._getLogFunction(t,e,console.table||E,n&&[n],{tag:w(e)}):E}},{key:"image",value:function(t){var e=t.logLevel,r=t.priority,o=t.image,a=t.message,A=void 0===a?"":a,s=t.scale,c=void 0===s?1:s;return this._shouldLog(e||r)?u?function(t){var e=t.image,n=t.message,r=void 0===n?"":n,o=t.scale,a=void 0===o?1:o;if("string"===typeof e){var A=new Image;return A.onload=function(){var t,e=f(A,r,a);(t=console).log.apply(t,Object(i.a)(e))},A.src=e,E}var s=e.nodeName||"";if("img"===s.toLowerCase()){var c;return(c=console).log.apply(c,Object(i.a)(f(e,r,a))),E}if("canvas"===s.toLowerCase()){var u=new Image;return u.onload=function(){var t;return(t=console).log.apply(t,Object(i.a)(f(u,r,a)))},u.src=e.toDataURL(),E}return E}({image:o,message:A,scale:c}):function(t){var e=t.image,r=(t.message,t.scale),i=void 0===r?1:r,o=null;try{o=n(581)}catch(a){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return E}({image:o,message:A,scale:c}):E}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(Object(o.a)({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||E)}},{key:"group",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},r=n=U({logLevel:t,message:e,opts:n}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||E)}},{key:"withGroup",value:function(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=R(t)}},{key:"_getLogFunction",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var a;o=U({logLevel:t,message:e,args:r,opts:o}),y(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=B();var A=o.tag||o.message;if(o.once){if(Q[A])return E;Q[A]=B()}return e=x(this.id,o.message,o),(a=n).bind.apply(a,[console,e].concat(Object(i.a)(o.args)))}return E}},{key:"level",set:function(t){this.setLevel(t)},get:function(){return this.getLevel()}},{key:"priority",set:function(t){this.level=t},get:function(){return this.level}}]),t}();function R(t){if(!t)return 0;var e;switch(Object(r.a)(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return y(Number.isFinite(e)&&e>=0),e}function U(t){var e=t.logLevel,n=t.message;t.logLevel=R(e);for(var i=t.args?Array.from(t.args):[];i.length&&i.shift()!==n;);switch(t.args=i,Object(r.a)(e)){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"===typeof t.message&&(t.message=t.message());var o=Object(r.a)(t.message);return y("string"===o||"object"===o),Object.assign(t,t.opts)}function x(t,e,n){if("string"===typeof e){var r=n.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}((A=n.total)<10?"".concat(A.toFixed(2),"ms"):A<100?"".concat(A.toFixed(1),"ms"):A<1e3?"".concat(A.toFixed(0),"ms"):"".concat((A/1e3).toFixed(2),"s")):"";e=n.time?"".concat(t,": ").concat(r,"  ").concat(e):"".concat(t,": ").concat(e),i=e,o=n.color,a=n.background,u||"string"!==typeof i||(o&&(o=d(o),i="\x1b[".concat(o,"m").concat(i,"\x1b[39m")),a&&(o=d(a),i="\x1b[".concat(a+10,"m").concat(i,"\x1b[49m"))),e=i}var i,o,a,A;return e}S.VERSION=c},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(107);function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2.3.0";Object(r.a)(t,"no loader provided");var n=t.version;e&&n&&(e=o(e),n=o(n))}function o(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(13),i=n.n(r),o=n(30),a=n(3),A=n(2),s=n(362),c=function(){function t(e){var n=e.maxConcurrency,r=void 0===n?5:n,i=e.onMessage,o=void 0===i?null:i,A=e.onDebug,s=void 0===A?function(){}:A;Object(a.a)(this,t),this.maxConcurrency=r,this.onMessage=o,this.onDebug=s,this.workerPools=new Map}return Object(A.a)(t,null,[{key:"isSupported",value:function(){return"undefined"!==typeof Worker}}]),Object(A.a)(t,[{key:"setProps",value:function(t){"maxConcurrency"in t&&(this.maxConcurrency=t.maxConcurrency),"onDebug"in t&&(this.onDebug=t.onDebug)}},{key:"destroy",value:function(){this.workerPools.forEach((function(t){return t.destroy()}))}},{key:"process",value:function(){var t=Object(o.a)(i.a.mark((function t(e,n,r){var o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=this._getWorkerPool(e,n),t.abrupt("return",o.process(r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}()},{key:"_getWorkerPool",value:function(t,e){var n=this.workerPools.get(e);return n||(n=new s.a({source:t,name:e,onMessage:u.bind(null,this.onMessage),maxConcurrency:this.maxConcurrency,onDebug:this.onDebug}),this.workerPools.set(e,n)),n}}]),t}();function u(t,e){var n=e.worker,r=e.data,i=e.resolve,o=e.reject;if(t)t({worker:n,data:r,resolve:i,reject:o});else switch(r.type){case"done":i(r.result);break;case"error":o(r.message)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(3),i=n(2),o=n(110),a=n(123),A=n(53),s=n(76);function c(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.attributes,i=void 0===n?{}:n;this.typedArrayManager=a.a,this.indexStarts=null,this.vertexStarts=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.opts=e,this.updateGeometry(e),Object.seal(this)}return Object(i.a)(t,[{key:"updateGeometry",value:function(t){Object.assign(this.opts,t);var e=this.opts,n=e.data,r=e.buffers,i=void 0===r?{}:r,o=e.getGeometry,a=e.geometryBuffer,s=e.positionFormat,u=e.dataChanged,l=e.normalize,g=void 0===l||l;if(this.data=n,this.getGeometry=o,this.positionSize=a&&a.size||("XY"===s?2:3),this.buffers=i,this.normalize=g,a&&(Object(A.a)(n.startIndices,"binary data missing startIndices"),this.getGeometry=this.getGeometryFromBuffer(a),g||(i.positions=a)),this.geometryBuffer=i.positions,Array.isArray(u)){var f,h=c(u);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._rebuildGeometry(d)}}catch(I){h.e(I)}finally{h.f()}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(t){var e=t.startRow,n=t.endRow;this._rebuildGeometry({startRow:e,endRow:n})}},{key:"normalizeGeometry",value:function(t){return t}},{key:"updateGeometryAttributes",value:function(t,e,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(t){throw new Error("Not implemented")}},{key:"getGeometryFromBuffer",value:function(t){var e=t.value||t;return Object(A.a)(ArrayBuffer.isView(e),"cannot read geometries"),Object(o.b)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices})}},{key:"_allocate",value:function(t,e){var n=this.attributes,r=this.buffers,i=this._attributeDefs,o=this.typedArrayManager;for(var a in i)if(a in r)o.release(n[a]),n[a]=null;else{var A=i[a];A.copy=e,n[a]=o.allocate(n[a],t,A)}}},{key:"_forEachGeometry",value:function(t,e,n){var r,i=this.data,a=this.getGeometry,A=Object(o.a)(i,e,n),s=A.iterable,u=A.objectInfo,l=c(s);try{for(l.s();!(r=l.n()).done;){var g=r.value;u.index++,t(a(g,u),u.index)}}catch(f){l.e(f)}finally{l.f()}}},{key:"_rebuildGeometry",value:function(t){var e=this;if(this.data&&this.getGeometry){var n=this.indexStarts,r=this.vertexStarts,i=this.instanceCount,o=this.data,a=this.geometryBuffer,A=t||{},c=A.startRow,u=void 0===c?0:c,l=A.endRow,g=void 0===l?1/0:l,f={};if(t||(n=[0],r=[0]),this.normalize||!a)this._forEachGeometry((function(t,n){t=e.normalizeGeometry(t),f[n]=t,r[n+1]=r[n]+e.getGeometrySize(t)}),u,g),i=r[r.length-1];else if(a.buffer instanceof s.a){var h=a.stride||4*this.positionSize;r=o.startIndices,i=r[o.length]||a.buffer.byteLength/h}else{var d=a.value||a,I=a.stride/d.BYTES_PER_ELEMENT||this.positionSize;r=o.startIndices,i=r[o.length]||d.length/I}this._allocate(i,Boolean(t)),this.indexStarts=n,this.vertexStarts=r,this.instanceCount=i;var p={};this._forEachGeometry((function(t,o){t=f[o]||t,p.vertexStart=r[o],p.indexStart=n[o];var a=o<r.length-1?r[o+1]:i;p.geometrySize=a-r[o],p.geometryIndex=o,e.updateGeometryAttributes(t,p)}),u,g),this.vertexCount=n[n.length-1]}}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(1),i=n(3),o=n(2),a=n(309);function A(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?A(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var c={id:"request-scheduler",throttleRequests:!0,maxRequests:6},u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),this.props=s(s({},c),e),this.requestQueue=[],this.activeRequestCount=0,this.requestMap=new Map,this.stats=new a.a({id:e.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever"),this._deferredUpdate=null}return Object(o.a)(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var n={handle:t,getPriority:e},r=new Promise((function(t){return n.resolve=t,n}));return this.requestQueue.push(n),this.requestMap.set(t,r),this._issueNewRequests(),r}},{key:"_issueRequest",value:function(t){var e=this,n=t.handle,r=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(n),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,r?r({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this._deferredUpdate||(this._deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this._deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e)if(this.requestQueue.length>0){var n=this.requestQueue.shift();this._issueRequest(n)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var r=n(2),i=n(3),o=n(7),a=n(8),A=n(6),s=n(173),c=n(98),u=n(37),l=n(366);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var f=(new u.a).lookAt({eye:[0,0,1]});function h(t){var e=t.width,n=t.height,r=t.near,i=t.far;return e=e||1,n=n||1,(new u.a).ortho({left:-e/2,right:e/2,bottom:-n/2,top:n/2,near:r,far:i})}var d=function(t){Object(o.a)(e,t);g(e);function e(t){var n=t.id,r=t.x,o=t.y,A=t.width,s=t.height,u=t.near,l=void 0===u?.1:u,g=t.far,d=void 0===g?1e3:g,I=t.zoom,p=void 0===I?0:I,C=t.target,y=void 0===C?[0,0,0]:C,v=t.flipY,B=void 0===v||v;Object(i.a)(this,e);var m=Math.pow(2,p);return Object(a.a)(void 0,new c.a({id:n,x:r,y:o,width:A,height:s,position:y,viewMatrix:f.clone().scale([m,m*(B?-1:1),m]),projectionMatrix:h({width:A,height:s,near:l,far:d}),zoom:p}))}return e}(c.a),I=function(t){Object(o.a)(n,t);var e=g(n);function n(t){return Object(i.a)(this,n),e.call(this,Object.assign({},t,{type:d}))}return Object(r.a)(n,[{key:"controller",get:function(){return this._getControllerProps({type:l.a})}}]),n}(s.a);I.displayName="OrthographicView"},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"decode",(function(){return EA})),n.d(r,"encode",(function(){return FA}));var i={};n.r(i),n.d(i,"decode",(function(){return NA})),n.d(i,"encode",(function(){return DA}));var o={};n.r(o),n.d(o,"decode",(function(){return MA})),n.d(o,"encode",(function(){return TA}));var a={};n.r(a),n.d(a,"decode",(function(){return VA})),n.d(a,"encode",(function(){return ZA}));var A=n(3),s=n(7),c=n(8),u=n(6);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var g=function(t){Object(s.a)(n,t);var e=l(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return n}(n(828).a);g.layerName="GreatCircleLayer",g.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var f=n(2),h=n(360),d=n(549),I=n(17),p=n(484),C=n.n(p),y=180/Math.PI;function v(t,e,n){var r=1<<e;return[(t[0]+n[0])/r,(t[1]+n[1])/r]}function B(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function m(t){return[B(t[0]),B(t[1])]}function b(t,e){var n=Object(I.a)(e,2),r=n[0],i=n[1];switch(t){case 0:return[1,r,i];case 1:return[-r,1,i];case 2:return[-r,-i,1];case 3:return[-1,-i,-r];case 4:return[i,-1,-r];case 5:return[i,r,-1];default:throw new Error("Invalid face")}}function E(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2],o=Math.atan2(i,Math.sqrt(n*n+r*r));return[Math.atan2(r,n)*y,o*y]}function Q(t,e,n,r){if(0===r){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function F(t){if("string"===typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return C.a.fromString(e,16)}(t)}return function(t){for(var e=C.a.fromString(t,!0,10).toString(2);e.length<64;)e="0"+e;for(var n=e.lastIndexOf("1"),r=e.substring(0,3),i=e.substring(3,n),o=i.length/2,a=C.a.fromString(r,!0,2).toString(10),A=C.a.fromString(i,!0,2).toString(4);A.length<o;)A="0"+A;return"".concat(a,"/").concat(A)}(t.toString())}function w(t){return function(t){for(var e=t.face,n=t.ij,r=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(100*Math.pow(2,-r))),a=new Float64Array(4*o*2+2),A=0,s=0;s<4;s++)for(var c=i[s].slice(0),u=i[s+1],l=(u[0]-c[0])/o,g=(u[1]-c[1])/o,f=0;f<o;f++){c[0]+=l,c[1]+=g;var h=E(b(e,m(v(n,r,c))));a[A++]=h[0],a[A++]=h[1]}return a[A++]=a[0],a[A++]=a[1],a}(function(t){for(var e,n=t.split("/"),r=parseInt(n[0],10),i=n[1],o=i.length,a=[0,0],A=o-1;A>=0;A--){e=o-A;var s=i[A],c=0,u=0;"1"===s?u=1:"2"===s?(c=1,u=1):"3"===s&&(c=1);var l=Math.pow(2,e-1);Q(l,a,c,u),a[0]+=l*c,a[1]+=l*u}if(r%2===1){var g=a[0];a[0]=a[1],a[1]=g}return{face:r,ij:a,level:e}}(F(t)))}function S(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var R=Object.assign({getS2Token:{type:"accessor",value:function(t){return t.token}}},d.a.defaultProps),U=function(t){Object(s.a)(n,t);var e=S(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"renderLayers",value:function(){var t=this.props,e=t.data,n=t.getS2Token,r=this.props,i=r.elevationScale,o=r.extruded,a=r.wireframe,A=r.filled,s=r.stroked,c=r.lineWidthUnits,u=r.lineWidthScale,l=r.lineWidthMinPixels,g=r.lineWidthMaxPixels,f=r.lineJointRounded,h=r.lineMiterLimit,I=r.lineDashJustified,p=r.getElevation,C=r.getFillColor,y=r.getLineColor,v=r.getLineWidth,B=r.getLineDashArray,m=this.props,b=m.updateTriggers,E=m.material;return new(this.getSubLayerClass("cell",d.a))({filled:A,wireframe:a,extruded:o,elevationScale:i,stroked:s,lineWidthUnits:c,lineWidthScale:u,lineWidthMinPixels:l,lineWidthMaxPixels:g,lineJointRounded:f,lineMiterLimit:h,lineDashJustified:I,material:E,getElevation:p,getFillColor:C,getLineColor:y,getLineWidth:v,getLineDashArray:B},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:b.getElevation,getFillColor:b.getFillColor,getLineColor:b.getLineColor,getLineWidth:b.getLineWidth,getLineDashArray:b.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return w(n(t,e))}})}}]),n}(h.a);U.layerName="S2Layer",U.defaultProps=R;var x=n(347),k=n(34);function O(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var N=function(t){Object(s.a)(n,t);var e=O(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"getShaders",value:function(){var t=Object(k.a)(Object(u.a)(n.prototype),"getShaders",this).call(this);return t.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || vTime < currentTime - trailLength) {\n  discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},t}},{key:"initializeState",value:function(t){Object(k.a)(Object(u.a)(n.prototype),"initializeState",this).call(this,t),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(t){var e=this.props,r=e.trailLength,i=e.currentTime;t.uniforms=Object.assign({},t.uniforms,{trailLength:r,currentTime:i}),Object(k.a)(Object(u.a)(n.prototype),"draw",this).call(this,t)}}]),n}(n(226).a);N.layerName="TripsLayer",N.defaultProps={trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var D=n(232),G=n(110);function _(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return M(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function T(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var j=Object.assign({getHexagons:{type:"accessor",value:function(t){return t.hexagons}}},d.a.defaultProps),L=function(t){Object(s.a)(n,t);var e=T(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"updateState",value:function(t){var e=t.props,n=(t.oldProps,t.changeFlags);if(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagons){var r,i=e.data,o=e.getHexagons,a=[],A=Object(G.a)(i),s=A.iterable,c=A.objectInfo,u=_(s);try{for(u.s();!(r=u.n()).done;){var l=r.value;c.index++;var g,f=o(l,c),h=_(Object(D.h3SetToMultiPolygon)(f,!0));try{for(h.s();!(g=h.n()).done;){var d=g.value;a.push(this.getSubLayerRow({polygon:d},l,c.index))}}catch(I){h.e(I)}finally{h.f()}}}catch(I){u.e(I)}finally{u.f()}this.setState({polygons:a})}}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,n=t.extruded,r=t.wireframe,i=t.filled,o=t.stroked,a=t.lineWidthScale,A=t.lineWidthMinPixels,s=t.lineWidthMaxPixels,c=t.lineJointRounded,u=t.lineMiterLimit,l=t.lineDashJustified,g=t.material,f=t.getFillColor,h=t.getLineColor,I=t.getLineWidth,p=t.getLineDashArray,C=t.getElevation,y=t.updateTriggers;return new(this.getSubLayerClass("cluster-region",d.a))({filled:i,wireframe:r,extruded:n,elevationScale:e,stroked:o,lineWidthScale:a,lineWidthMinPixels:A,lineWidthMaxPixels:s,lineJointRounded:c,lineMiterLimit:u,lineDashJustified:l,material:g,getFillColor:this.getSubLayerAccessor(f),getLineColor:this.getSubLayerAccessor(h),getLineWidth:this.getSubLayerAccessor(I),getLineDashArray:this.getSubLayerAccessor(p),getElevation:this.getSubLayerAccessor(C)},this.getSubLayerProps({id:"cluster-region",updateTriggers:y}),{data:this.state.polygons,getPolygon:function(t){return t.polygon}})}}]),n}(h.a);L.defaultProps=j,L.layerName="H3ClusterLayer";var V=n(27),Z=n(181),P=n(550);function W(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}function J(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return H(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Y(t,e){e=void 0===e?t[0][0]:e;var n,r=J(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(a){r.e(a)}finally{r.f()}}function X(t,e,n){var r=Object(D.h3ToGeo)(t),i=Object(I.a)(r,2),o=i[0],a=i[1],A=e.length;Y(e,a);for(var s=e[0]===e[A-1]?A-1:A,c=0;c<s;c++)e[c][0]=Object(Z.c)(a,e[c][0],n),e[c][1]=Object(Z.c)(o,e[c][1],n)}function z(t,e,n){var r=t(e,n),i=Object(D.h3ToGeo)(r),o=Object(I.a)(i,2),a=o[0];return[o[1],a]}function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,r=Object(D.h3ToGeoBoundary)(t,!0);if(1!==e?X(t,r,e):Y(r),n){var i,o=new Float64Array(2*r.length),a=0,A=J(r);try{for(A.s();!(i=A.n()).done;){var s=i.value;o[a++]=s[0],o[a++]=s[1]}}catch(c){A.e(c)}finally{A.f()}return o}return r}var q=Object.assign({},d.a.defaultProps,{highPrecision:!1,coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0});delete q.getLineDashArray;var $=function(t){Object(s.a)(n,t);var e=W(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,n=(t.oldProps,t.changeFlags);if(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagon){var r,i=-1,o=!1,a=!1,A=Object(G.a)(e.data),s=A.iterable,c=A.objectInfo,u=J(s);try{for(u.s();!(r=u.n()).done;){var l=r.value;c.index++;var g=e.getHexagon(l,c),f=Object(D.h3GetResolution)(g);if(i<0)i=f;else if(i!==f){a=!0;break}if(Object(D.h3IsPentagon)(g)){o=!0;break}}}catch(h){u.e(h)}finally{u.f()}this.setState({resolution:i,edgeLengthKM:i>=0?Object(D.edgeLength)(i,D.UNITS.km):0,hasMultipleRes:a,hasPentagon:o})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var t=this.state,e=t.resolution,n=t.hasPentagon,r=t.hasMultipleRes,i=this.context.viewport;return this.props.highPrecision||i.resolution||r||n||e>=0&&e<=5}},{key:"_updateVertices",value:function(t){if(!this._shouldUseHighPrecision()){var e=this.state,n=e.resolution,r=e.edgeLengthKM,i=e.centerHex;if(!(n<0)){var o=this.props.centerHexagon||Object(D.geoToH3)(t.latitude,t.longitude,n);if(i!==o){if(i){var a=Object(D.h3Distance)(i,o);if(a>=0&&a*r<10)return}var A=t.distanceScales.unitsPerMeter,s=K(o),c=Object(D.h3ToGeo)(o),u=Object(I.a)(c,2),l=u[0],g=u[1],f=t.projectFlat([g,l]),h=Object(I.a)(f,2),d=h[0],p=h[1];s=s.map((function(e){var n=t.projectFlat(e);return[(n[0]-d)/A[0],(n[1]-p)/A[1]]})),this.setState({centerHex:o,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var t=this.props,e=t.elevationScale,n=t.material,r=t.coverage,i=t.extruded,o=t.wireframe,a=t.stroked,A=t.filled,s=t.lineWidthUnits,c=t.lineWidthScale,u=t.lineWidthMinPixels,l=t.lineWidthMaxPixels,g=t.getFillColor,f=t.getElevation,h=t.getLineColor,d=t.getLineWidth,I=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:r,wireframe:o,stroked:a,filled:A,lineWidthUnits:s,lineWidthScale:c,lineWidthMinPixels:u,lineWidthMaxPixels:l,material:n,getElevation:f,getFillColor:g,getLineColor:h,getLineWidth:d,updateTriggers:{getFillColor:I.getFillColor,getElevation:I.getElevation,getLineColor:I.getLineColor,getLineWidth:I.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.data,n=t.getHexagon,r=t.updateTriggers,i=t.coverage,o=this.getSubLayerClass("hexagon-cell-hifi",d.a),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return void 0===t||null===t?e:"object"===Object(V.a)(t)?Object.assign({},t,{coverage:e}):{getHexagon:t,coverage:e}}(r.getHexagon,i),new o(a,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return K(n(t,e),i,!0)}})}},{key:"_renderColumnLayer",value:function(){var t=this.props,e=t.data,n=t.getHexagon,r=t.updateTriggers,i=this.getSubLayerClass("hexagon-cell",P.a),o=this._getForwardProps();return o.updateTriggers.getPosition=r.getHexagon,new i(o,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:o.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:z.bind(null,n)})}}]),n}(h.a);$.defaultProps=q,$.layerName="H3HexagonLayer";var tt=n(13),et=n.n(tt),nt=n(1),rt=n(30),it=n(235),ot=n(40),at=n(829),At=n(825),st=n(830),ct=n(44),ut=n(927),lt=(n(79),n(23));function gt(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var ft=1/Math.PI*180,ht=1/180*Math.PI,dt={};function It(t){return Math.round(t/dt.EPSILON)*dt.EPSILON}function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?dt.precision||4:n;return t=It(t),"".concat(parseFloat(t.toPrecision(r)))}function Ct(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function yt(t,e,n){if(Ct(t)){n=n||((i=t).clone?i.clone():new Array(i.length));for(var r=0;r<n.length&&r<t.length;++r)n[r]=e(t[r],r,n);return n}var i;return e(t)}function vt(t){return function(t,e){return yt(t,(function(t){return t*ht}),e)}(t)}function Bt(t,e){return yt(t,(function(t){return t*ft}),e)}function mt(t,e,n){var r=dt.EPSILON;n&&(dt.EPSILON=n);try{if(t===e)return!0;if(Ct(t)&&Ct(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!mt(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=dt.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{dt.EPSILON=r}}function bt(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function Et(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function Qt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(dt.debug&&!bt(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}dt.EPSILON=1e-12,dt.debug=!1,dt.precision=4,dt.printTypes=!1,dt.printDegrees=!1,dt.printRowMajor=!0;var Ft={};function wt(t,e){Ft[t]||(Ft[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}var St=n(105);function Rt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ut=function(t){Object(s.a)(n,t);var e=Rt(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Ct(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(dt)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+pt(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!mt(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(dt.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return gt(!1),0}},{key:"RANK",get:function(){return gt(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(St.a)(Array));function xt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var kt=function(t){Object(s.a)(n,t);var e=xt(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"toString",value:function(){var t="[";if(dt.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Et(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(Ut);function Ot(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}var Nt=n(10),Dt=n(36),Gt=n(22),_t=n(45);function Mt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Tt=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),jt=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Lt=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}),Vt={},Zt=function(t){Object(s.a)(n,t);var e=Mt(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"INDICES",get:function(){return Lt}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return Vt.IDENTITY=Vt.IDENTITY||Object.freeze(new n(Tt)),Vt.IDENTITY}},{key:"ZERO",get:function(){return Vt.ZERO=Vt.ZERO||Object.freeze(new n(jt)),Vt.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(Tt)}},{key:"fromQuaternion",value:function(t){return Nt.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):Nt.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],Nt.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return Nt.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return Nt.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return Nt.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return Nt.q(this,this),this.check()}},{key:"invert",value:function(){return Nt.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Nt.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Nt.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return Nt.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Nt.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Nt.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2];return this.rotateX(n).rotateY(r).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return Nt.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Nt.o(this,this,t):Nt.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return Nt.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(Qt(e=_t.n(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=Dt.j(e||[-0,-0],t,this);break;case 3:e=Gt.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qt(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=Ot(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qt(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return wt("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return wt("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return wt("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(kt);function Pt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Wt=function(t){Object(s.a)(n,t);var e=Pt(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"copy",value:function(t){return gt(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Et(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Et(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return gt(t>=0&&t<this.ELEMENTS,"index is out of range"),Et(this[t])}},{key:"setComponent",value:function(t,e){return gt(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Et(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Et(t)}}]),n}(Ut);function Jt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ht=[0,0,0],Yt={},Xt=function(t){Object(s.a)(n,t);var e=Jt(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&Ct(r)?t.copy(r):(dt.debug&&(Et(r),Et(i),Et(o)),t[0]=r,t[1]=i,t[2]=o),t}return Object(f.a)(n,null,[{key:"ZERO",get:function(){return Yt.ZERO=Yt.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(f.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return dt.debug&&(Et(t.x),Et(t.y),Et(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return Gt.a(this,t)}},{key:"cross",value:function(t){return Gt.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ht:n;return Gt.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ht:n;return Gt.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ht:n;return Gt.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Gt.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Ot(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Gt.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return Gt.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Et(t)}}]),n}(Wt);function zt(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Kt=1/Math.PI*180,qt=1/180*Math.PI,$t={};function te(t){return Math.round(t/$t.EPSILON)*$t.EPSILON}function ee(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?$t.precision||4:n;return t=te(t),"".concat(parseFloat(t.toPrecision(r)))}function ne(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function re(t,e,n){if(ne(t)){n=n||((i=t).clone?i.clone():new Array(i.length));for(var r=0;r<n.length&&r<t.length;++r)n[r]=e(t[r],r,n);return n}var i;return e(t)}function ie(t){return function(t,e){return re(t,(function(t){return t*qt}),e)}(t)}function oe(t){return function(t,e){return re(t,(function(t){return t*Kt}),e)}(t)}function ae(t,e,n){var r=$t.EPSILON;n&&($t.EPSILON=n);try{if(t===e)return!0;if(ne(t)&&ne(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!ae(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=$t.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{$t.EPSILON=r}}function Ae(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}$t.EPSILON=1e-12,$t.debug=!1,$t.precision=4,$t.printTypes=!1,$t.printDegrees=!1,$t.printRowMajor=!0;var se=function(t){Object(s.a)(n,t);var e=Ae(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:ne(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString($t)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+ee(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!ae(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if($t.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return zt(!1),0}},{key:"RANK",get:function(){return zt(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(St.a)(Array));function ce(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function ue(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function le(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if($t.debug&&!ce(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var ge={};function fe(t,e){ge[t]||(ge[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}function he(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var de=function(t){Object(s.a)(n,t);var e=he(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"copy",value:function(t){return zt(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return ue(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return ue(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return zt(t>=0&&t<this.ELEMENTS,"index is out of range"),ue(this[t])}},{key:"setComponent",value:function(t,e){return zt(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=ue(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=ue(t)}}]),n}(se);function Ie(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function pe(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ce=[0,0,0],ye={},ve=function(t){Object(s.a)(n,t);var e=pe(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&ne(r)?t.copy(r):($t.debug&&(ue(r),ue(i),ue(o)),t[0]=r,t[1]=i,t[2]=o),t}return Object(f.a)(n,null,[{key:"ZERO",get:function(){return ye.ZERO=ye.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(f.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return $t.debug&&(ue(t.x),ue(t.y),ue(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return Gt.a(this,t)}},{key:"cross",value:function(t){return Gt.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ce:n;return Gt.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ce:n;return Gt.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Ce:n;return Gt.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Gt.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Ie(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Gt.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return Gt.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=ue(t)}}]),n}(de),Be=.1,me=1e-12,be=1e-15;Math.PI,Math.PI,Math.PI,Math.PI;function Ee(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Qe=function(t){Object(s.a)(n,t);var e=Ee(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"toString",value:function(){var t="[";if($t.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=ue(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(se);function Fe(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var we=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Se=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Re=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}),Ue={},xe=function(t){Object(s.a)(n,t);var e=Fe(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"INDICES",get:function(){return Re}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return Ue.IDENTITY=Ue.IDENTITY||Object.freeze(new n(we)),Ue.IDENTITY}},{key:"ZERO",get:function(){return Ue.ZERO=Ue.ZERO||Object.freeze(new n(Se)),Ue.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(we)}},{key:"fromQuaternion",value:function(t){return Nt.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):Nt.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],Nt.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return Nt.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return Nt.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return Nt.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return Nt.q(this,this),this.check()}},{key:"invert",value:function(){return Nt.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Nt.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Nt.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return Nt.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Nt.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Nt.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2];return this.rotateX(n).rotateY(r).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return Nt.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Nt.o(this,this,t):Nt.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return Nt.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(le(e=_t.n(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=Dt.j(e||[-0,-0],t,this);break;case 3:e=Gt.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return le(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=Ie(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return le(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return fe("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return fe("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return fe("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(Qe),ke=(Math.max(6378137,6378137,6356752.314245179),function(t){return t}),Oe=new ve;function Ne(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ke;return ne(t)?(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=n(t.longitude),e[1]=n(t.latitude),e[2]=t.height):(e[0]=n(t.x),e[1]=n(t.y),e[2]=t.z),e}function De(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Oe;return Ne(t,e,$t._cartographicRadians?ke:ie)}function Ge(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ke;return ne(e)?(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=n(t[0]),e.latitude=n(t[1]),e.height=t[2]):(e.x=n(t[0]),e.y=n(t[1]),e.z=t[2]),e}function _e(t,e){return Ge(t,e,$t._cartographicRadians?ke:oe)}var Me=new ve,Te=new ve,je=new ve;var Le=new ve,Ve={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"}},Ze={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Pe={east:new ve,north:new ve,up:new ve,west:new ve,south:new ve,down:new ve},We=new ve,Je=new ve,He=new ve;function Ye(t,e,n,r,i,o){var a,A,s,c=Ve[e]&&Ve[e][n];zt(c&&(!r||r===c));var u=Le.copy(i);if(ae(u.x,0,1e-14)&&ae(u.y,0,1e-14)){var l=Math.sign(u.z);a=We.fromArray(Ze[e]),"east"!==e&&"west"!==e&&a.scale(l),A=Je.fromArray(Ze[n]),"east"!==n&&"west"!==n&&A.scale(l),s=He.fromArray(Ze[r]),"east"!==r&&"west"!==r&&s.scale(l)}else{var g=Pe.up,f=Pe.east,h=Pe.north;f.set(-u.y,u.x,0).normalize(),t.geodeticSurfaceNormal(u,g),h.copy(g).cross(f);var d=Pe.west,I=Pe.south;Pe.down.copy(g).scale(-1),d.copy(f).scale(-1),I.copy(h).scale(-1),a=Pe[e],A=Pe[n],s=Pe[r]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=A.x,o[5]=A.y,o[6]=A.z,o[7]=0,o[8]=s.x,o[9]=s.y,o[10]=s.z,o[11]=0,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=1,o}var Xe,ze=new ve,Ke=new ve,qe=new ve,$e=new ve,tn=new ve,en=new ve,nn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(A.a)(this,t),zt(e>=0),zt(n>=0),zt(r>=0),this.radii=new ve(e,n,r),this.radiiSquared=new ve(e*e,n*n,r*r),this.radiiToTheFourth=new ve(e*e*e*e,n*n*n*n,r*r*r*r),this.oneOverRadii=new ve(0===e?0:1/e,0===n?0:1/n,0===r?0:1/r),this.oneOverRadiiSquared=new ve(0===e?0:1/(e*e),0===n?0:1/(n*n),0===r?0:1/(r*r)),this.minimumRadius=Math.min(e,n,r),this.maximumRadius=Math.max(e,n,r),this.centerToleranceSquared=Be,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return Object(f.a)(t,null,[{key:"WGS84",get:function(){return Xe=Xe||new t(6378137,6378137,6356752.314245179)}}]),Object(f.a)(t,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=Ke,r=qe,i=Object(I.a)(t,3),o=i[2];this.geodeticSurfaceNormalCartographic(t,n),r.copy(this.radiiSquared).scale(n);var a=Math.sqrt(n.dot(r));return r.scale(1/a),n.scale(o),r.add(n),r.to(e)}},{key:"cartesianToCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];en.from(t);var n=this.scaleToGeodeticSurface(en,$e);if(n){var r=this.geodeticSurfaceNormal(n,Ke),i=tn;i.copy(en).subtract(n);var o=Math.atan2(r.y,r.x),a=Math.asin(r.z),A=Math.sign(Gt.d(i,en))*Gt.g(i);return _e([o,a,A],e)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new xe;return Ye(this,"east","north","up",t,e)}},{key:"localFrameToFixedFrame",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new xe;return Ye(this,t,e,n,r,i)}},{key:"geocentricSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ze.from(t).normalize().to(e)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=De(t),r=n[0],i=n[1],o=Math.cos(i);return ze.set(o*Math.cos(r),o*Math.sin(r),Math.sin(i)).normalize(),ze.to(e)}},{key:"geodeticSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ze.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}},{key:"scaleToGeodeticSurface",value:function(t,e){return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ve,r=e.oneOverRadii,i=e.oneOverRadiiSquared,o=e.centerToleranceSquared;Me.from(t);var a=t.x,A=t.y,s=t.z,c=r.x,u=r.y,l=r.z,g=a*a*c*c,f=A*A*u*u,h=s*s*l*l,d=g+f+h,I=Math.sqrt(1/d);if(Number.isFinite(I)){var p=Te;if(p.copy(t).scale(I),d<o)return p.to(n);var C=i.x,y=i.y,v=i.z,B=je;B.set(p.x*C*2,p.y*y*2,p.z*v*2);var m,b,E,Q,F=(1-I)*t.len()/(.5*B.len()),w=0;do{var S=(m=1/(1+(F-=w)*C))*m,R=(b=1/(1+F*y))*b,U=(E=1/(1+F*v))*E,x=S*m,k=R*b,O=U*E,N=g*x*C+f*k*y+h*O*v,D=-2*N;w=(Q=g*S+f*R+h*U-1)/D}while(Math.abs(Q)>me);return Me.scale([m,b,E]).to(n)}}(t,this,e)}},{key:"scaleToGeocentricSurface",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];$e.from(t);var n=$e.x,r=$e.y,i=$e.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*o.x+r*r*o.y+i*i*o.z);return $e.multiplyScalar(a).to(e)}},{key:"transformPositionToScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return $e.from(t).scale(this.oneOverRadii).to(e)}},{key:"transformPositionFromScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return $e.from(t).scale(this.radii).to(e)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];zt(ae(this.radii.x,this.radii.y,be)),zt(this.radii.z>0),$e.from(t);var r=$e.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-e))return $e.set(0,0,r).to(n)}}]),t}(),rn=n(309),on=n(107),an=n(81),An=n(707),sn=function t(e,n,r){Object(A.a)(this,t),this.item=e,this.previous=n,this.next=r},cn=function(){function t(){Object(A.a)(this,t),this.head=null,this.tail=null,this._length=0}return Object(f.a)(t,[{key:"add",value:function(t){var e=new sn(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}},{key:"remove",value:function(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}},{key:"splice",value:function(t,e){t!==e&&(this.remove(e),this._insert(t,e))}},{key:"_insert",value:function(t,e){var n=t.next;t.next=e,this.tail===t?this.tail=e:n.previous=e,e.next=n,e.previous=t,++this._length}},{key:"length",get:function(){return this._length}}]),t}();function un(t){return void 0!==t&&null!==t}var ln=function(){function t(){Object(A.a)(this,t),this._list=new cn,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return Object(f.a)(t,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var e=t._cacheNode;un(e)&&this._list.splice(this._sentinel,e)}},{key:"add",value:function(t,e,n){un(e._cacheNode)||(e._cacheNode=this._list.add(e),n&&n(t,e))}},{key:"unloadTile",value:function(t,e,n){var r=e._cacheNode;un(r)&&(this._list.remove(r),e._cacheNode=void 0,n&&n(t,e))}},{key:"unloadTiles",value:function(t,e){var n=this._trimTiles;this._trimTiles=!1;for(var r=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel,a=r.head;a!==o&&(t.gpuMemoryUsageInBytes>i||n);){var A=a.item;a=a.next,this.unloadTile(t,A,e)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),t}();var gn=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function fn(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;var hn={};function dn(t){return Math.round(t/hn.EPSILON)*hn.EPSILON}function In(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?hn.precision||4:n;return t=dn(t),"".concat(parseFloat(t.toPrecision(r)))}function pn(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Cn(t,e,n){var r=hn.EPSILON;n&&(hn.EPSILON=n);try{if(t===e)return!0;if(pn(t)&&pn(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Cn(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=hn.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{hn.EPSILON=r}}function yn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}hn.EPSILON=1e-12,hn.debug=!1,hn.precision=4,hn.printTypes=!1,hn.printDegrees=!1,hn.printRowMajor=!0;var vn=function(t){Object(s.a)(n,t);var e=yn(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:pn(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(hn)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+In(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Cn(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(hn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return fn(!1),0}},{key:"RANK",get:function(){return fn(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(St.a)(Array));function Bn(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function mn(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function bn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(hn.debug&&!Bn(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var En={};function Qn(t,e){En[t]||(En[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}function Fn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var wn=function(t){Object(s.a)(n,t);var e=Fn(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"copy",value:function(t){return fn(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return mn(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return mn(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return fn(t>=0&&t<this.ELEMENTS,"index is out of range"),mn(this[t])}},{key:"setComponent",value:function(t,e){return fn(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=mn(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=mn(t)}}]),n}(vn);function Sn(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function Rn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Un=[0,0,0],xn={},kn=function(t){Object(s.a)(n,t);var e=Rn(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&pn(r)?t.copy(r):(hn.debug&&(mn(r),mn(i),mn(o)),t[0]=r,t[1]=i,t[2]=o),t}return Object(f.a)(n,null,[{key:"ZERO",get:function(){return xn.ZERO=xn.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(f.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return hn.debug&&(mn(t.x),mn(t.y),mn(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return Gt.a(this,t)}},{key:"cross",value:function(t){return Gt.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Un:n;return Gt.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Un:n;return Gt.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Un:n;return Gt.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Gt.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Sn(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Gt.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return Gt.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=mn(t)}}]),n}(wn),On=new kn,Nn=new kn,Dn=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object(A.a)(this,t),r=r||On.copy(e).add(n).scale(.5),this.center=new kn(r),this.halfDiagonal=new kn(n).subtract(this.center),this.minimum=new kn(e),this.maximum=new kn(n)}Object(f.a)(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"intersectPlane",value:function(t){var e=this.halfDiagonal,n=Nn.from(t.normal),r=e.x*Math.abs(n.x)+e.y*Math.abs(n.y)+e.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-r>0?gn.INSIDE:i+r<0?gn.OUTSIDE:gn.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e,n=On.from(t).subtract(this.center),r=this.halfDiagonal,i=0;return(e=Math.abs(n.x)-r.x)>0&&(i+=e*e),(e=Math.abs(n.y)-r.y)>0&&(i+=e*e),(e=Math.abs(n.z)-r.z)>0&&(i+=e*e),i}}])}(),new kn),Gn=new kn,_n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(A.a)(this,t),this.radius=-0,this.center=new kn,this.fromCenterRadius(e,n)}return Object(f.a)(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=Dn.from(e),this.center=(new kn).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,n=this.radius,r=t.center,i=t.radius,o=Dn.copy(r).subtract(e),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();var A=.5*(n+a+i);return Gn.copy(o).scale((-n+A)/a).add(e),this.center.copy(Gn),this.radius=A,this}},{key:"expand",value:function(t){var e=(t=Dn.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"intersectPlane",value:function(t){var e=this.center,n=this.radius,r=t.normal.dot(e)+t.distance;return r<-n?gn.OUTSIDE:r<n?gn.INTERSECTING:gn.INSIDE}},{key:"transform",value:function(t){this.center.transform(t);var e=Nt.e(Dn,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){return(t=Dn.from(t)).subtract(this.center).lengthSquared()-this.radius*this.radius}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}}]),t}();function Mn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Tn=function(t){Object(s.a)(n,t);var e=Mn(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"toString",value:function(){var t="[";if(hn.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=mn(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(vn),jn=n(48);function Ln(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Vn=Object.freeze([1,0,0,0,1,0,0,0,1]),Zn=Object.freeze([0,0,0,0,0,0,0,0,0]),Pn=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),Wn={},Jn=function(t){Object(s.a)(n,t);var e=Ln(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Pn}}],[{key:"IDENTITY",get:function(){return Wn.IDENTITY=Wn.IDENTITY||Object.freeze(new n(Vn)),Wn.IDENTITY}},{key:"ZERO",get:function(){return Wn.ZERO=Wn.ZERO||Object.freeze(new n(Zn)),Wn.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=A,this[6]=n,this[7]=o,this[8]=s,this.check()}},{key:"determinant",value:function(){return jn.b(this)}},{key:"identity",value:function(){return this.copy(Vn)}},{key:"fromQuaternion",value:function(t){return jn.c(this,t),this.check()}},{key:"transpose",value:function(){return jn.i(this,this),this.check()}},{key:"invert",value:function(){return jn.d(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return jn.e(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return jn.e(this,this,t),this.check()}},{key:"rotate",value:function(t){return jn.f(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?jn.g(this,this,t):jn.g(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return jn.h(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=Dt.i(e||[-0,-0],t,this);break;case 3:e=Gt.p(e||[-0,-0,-0],t,this);break;case 4:e=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return bn(e,t.length),e}},{key:"transformVector",value:function(t,e){return Qn("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return Qn("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return Qn("Matrix3.transformVector"),this.transform(t,e)}}]),n}(Tn),Hn=n(33);function Yn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Xn=[0,0,0,1],zn=function(t){Object(s.a)(n,t);var e=Yn(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0,-0),Array.isArray(r)&&1===arguments.length?t.copy(r):t.set(r,i,o,a),t}return Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromMatrix3",value:function(t){return Hn.e(this,t),this.check()}},{key:"identity",value:function(){return Hn.f(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return Hn.p(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"len",value:function(){return Hn.h(this)}},{key:"lengthSquared",value:function(){return Hn.r(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return Hn.d(this,t)}},{key:"rotationTo",value:function(t,e){return Hn.n(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return Hn.a(this,this,t),this.check()}},{key:"calculateW",value:function(){return Hn.b(this,this),this.check()}},{key:"conjugate",value:function(){return Hn.c(this,this),this.check()}},{key:"invert",value:function(){return Hn.g(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return Hn.i(this,t,e,n),this.check()}},{key:"multiplyRight",value:function(t,e){return fn(!e),Hn.j(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return fn(!e),Hn.j(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return Hn.k(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Hn.l(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Hn.m(this,this,t),this.check()}},{key:"scale",value:function(t){return Hn.o(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){switch(arguments.length){case 1:var r=arguments[0],i=r.start;t=void 0===i?Xn:i,e=r.target,n=r.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],n=o[1],t=this}return Hn.q(this,t,e,n),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return _t.o(e,t,this),bn(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=mn(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=mn(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=mn(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=mn(t)}}]),n}(vn),Kn=new kn,qn=new kn,$n=new kn,tr=new kn,er=new kn,nr=new kn,rr=new kn,ir=new kn,or=new kn,ar=new kn,Ar=0,sr=1,cr=2,ur=3,lr=4,gr=5,fr=6,hr=7,dr=8,Ir=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Object(A.a)(this,t),this.center=(new kn).from(e),this.halfAxes=new Jn(n)}return Object(f.a)(t,[{key:"fromCenterHalfSizeQuaternion",value:function(t,e,n){var r=new zn(n),i=(new Jn).fromQuaternion(r);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new kn).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _n,e=this.halfAxes,n=e.getColumn(0,ir),r=e.getColumn(1,or),i=e.getColumn(2,ar),o=Kn.copy(n).add(r).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,n=t.normal,r=this.halfAxes,i=n.x,o=n.y,a=n.z,A=Math.abs(i*r[Ar]+o*r[sr]+a*r[cr])+Math.abs(i*r[ur]+o*r[lr]+a*r[gr])+Math.abs(i*r[fr]+o*r[hr]+a*r[dr]),s=n.dot(e)+t.distance;return s<=-A?gn.OUTSIDE:s>=A?gn.INSIDE:gn.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=qn.from(t).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,$n),i=n.getColumn(1,tr),o=n.getColumn(2,er),a=r.magnitude(),A=i.magnitude(),s=o.magnitude();r.normalize(),i.normalize(),o.normalize();var c,u=0;return(c=Math.abs(e.dot(r))-a)>0&&(u+=c*c),(c=Math.abs(e.dot(i))-A)>0&&(u+=c*c),(c=Math.abs(e.dot(o))-s)>0&&(u+=c*c),u}},{key:"computePlaneDistances",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,A=a.getColumn(0,$n),s=a.getColumn(1,tr),c=a.getColumn(2,er),u=nr.copy(A).add(s).add(c).add(o),l=rr.copy(u).subtract(t),g=e.dot(l);return r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).add(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).subtract(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),u.copy(o).add(A).subtract(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).add(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).add(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).subtract(s).add(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),o.copy(u).subtract(A).subtract(s).subtract(c),l.copy(u).subtract(t),g=e.dot(l),r=Math.min(g,r),i=Math.max(g,i),n[0]=r,n[1]=i,n}},{key:"getTransform",value:function(){}},{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new kn(t).len(),new kn(e).len(),new kn(n).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new kn(t).normalize(),i=new kn(e).normalize(),o=new kn(n).normalize();return(new zn).fromMatrix3(new Jn([].concat(Object(lt.a)(r),Object(lt.a)(i),Object(lt.a)(o))))}}]),t}(),pr=new kn,Cr=new kn,yr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(A.a)(this,t),this.normal=new kn,this.distance=-0,this.fromNormalDistance(e,n)}return Object(f.a)(t,[{key:"fromNormalDistance",value:function(t,e){return fn(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=pr.from(t),this.normal.from(e).normalize();var n=-this.normal.dot(t);return this.distance=n,this}},{key:"fromCoefficients",value:function(t,e,n,r){return this.normal.set(t,e,n),fn(Cn(this.normal.len(),1)),this.distance=r,this}},{key:"clone",value:function(e){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return Cn(this.distance,t.distance)&&Cn(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=Cr.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=pr.from(t);var n=this.getPointDistance(t),r=Cr.copy(this.normal).scale(n);return t.subtract(r).to(e)}}]),t}();function vr(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Br(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var mr=[new kn([1,0,0]),new kn([0,1,0]),new kn([0,0,1])],br=new kn,Er=new kn,Qr=(new yr(new kn(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Object(A.a)(this,t),this.planes=e,fn(this.planes.every((function(t){return t instanceof yr})))}return Object(f.a)(t,null,[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),Object(f.a)(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*mr.length;var e,n=t.center,r=t.radius,i=0,o=vr(mr);try{for(o.s();!(e=o.n()).done;){var a=e.value,A=this.planes[i],s=this.planes[i+1];A||(A=this.planes[i]=new yr),s||(s=this.planes[i+1]=new yr);var c=br.copy(a).scale(-r).add(n);a.dot(c);A.fromPointNormal(c,a);var u=br.copy(a).scale(r).add(n),l=Er.copy(a).negate();l.dot(u);s.fromPointNormal(u,l),i+=2}}catch(g){o.e(g)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){fn(t);var e,n=gn.INSIDE,r=vr(this.planes);try{for(r.s();!(e=r.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case gn.OUTSIDE:return gn.OUTSIDE;case gn.INTERSECTING:n=gn.INTERSECTING}}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(e,n){if(fn(e,"boundingVolume is required."),fn(Number.isFinite(n),"parentPlaneMask is required."),n===t.MASK_OUTSIDE||n===t.MASK_INSIDE)return n;for(var r=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0===(n&a))){var A=i[o],s=e.intersectPlane(A);if(s===gn.OUTSIDE)return t.MASK_OUTSIDE;s===gn.INTERSECTING&&(r|=a)}}return r}}]),t}());function Fr(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var wr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Sr=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Rr=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}),Ur={},xr=function(t){Object(s.a)(n,t);var e=Fr(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"INDICES",get:function(){return Rr}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return Ur.IDENTITY=Ur.IDENTITY||Object.freeze(new n(wr)),Ur.IDENTITY}},{key:"ZERO",get:function(){return Ur.ZERO=Ur.ZERO||Object.freeze(new n(Sr)),Ur.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(wr)}},{key:"fromQuaternion",value:function(t){return Nt.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):Nt.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],Nt.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return Nt.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return Nt.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return Nt.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return Nt.q(this,this),this.check()}},{key:"invert",value:function(){return Nt.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Nt.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Nt.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return Nt.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Nt.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Nt.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2];return this.rotateX(n).rotateY(r).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return Nt.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Nt.o(this,this,t):Nt.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return Nt.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(bn(e=_t.n(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=Dt.j(e||[-0,-0],t,this);break;case 3:e=Gt.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return bn(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=Sn(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return bn(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Qn("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Qn("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Qn("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(Tn);function kr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Or(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?kr(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Nr=new kn,Dr=new kn,Gr=new kn,_r=new kn,Mr=new kn,Tr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(A.a)(this,t),e=Or({near:1,far:5e8},e),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near,this._near=this.near,this.far=e.far,this._far=this.far,this._cullingVolume=new Qr([new yr,new yr,new yr,new yr,new yr,new yr]),this._perspectiveMatrix=new xr,this._infinitePerspective=new xr}return Object(f.a)(t,[{key:"clone",value:function(){return new t({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(e){return e&&e instanceof t&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far}},{key:"computeCullingVolume",value:function(t,e,n){fn(t,"position is required."),fn(e,"direction is required."),fn(n,"up is required.");var r=this._cullingVolume.planes;n=Nr.copy(n).normalize();var i=Dr.copy(e).cross(n).normalize(),o=Gr.copy(e).multiplyByScalar(this.near).add(t),a=_r.copy(e).multiplyByScalar(this.far).add(t),A=Mr;return A.copy(i).multiplyByScalar(this.left).add(o).subtract(t).cross(n),r[0].fromPointNormal(t,A),A.copy(i).multiplyByScalar(this.right).add(o).subtract(t).cross(n).negate(),r[1].fromPointNormal(t,A),A.copy(n).multiplyByScalar(this.bottom).add(o).subtract(t).cross(i).negate(),r[2].fromPointNormal(t,A),A.copy(n).multiplyByScalar(this.top).add(o).subtract(t).cross(i),r[3].fromPointNormal(t,A),A=(new kn).copy(e),r[4].fromPointNormal(o,A),A.negate(),r[5].fromPointNormal(a,A),this._cullingVolume}},{key:"getPixelDimensions",value:function(t,e,n,r){jr(this),fn(Number.isFinite(t)&&Number.isFinite(e)),fn(t>0),fn(e>0),fn(n>0),fn(r);var i=1/this.near,o=this.top*i,a=2*n*o/e,A=2*n*(o=this.right*i)/t;return r.x=A,r.y=a,r}},{key:"projectionMatrix",get:function(){return jr(this),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return jr(this),this._infinitePerspective}}]),t}();function jr(t){fn(Number.isFinite(t.right)&&Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.near)&&Number.isFinite(t.far));var e=t.top,n=t.bottom,r=t.right,i=t.left,o=t.near,a=t.far;e===t._top&&n===t._bottom&&i===t._left&&r===t._right&&o===t._near&&a===t._far||(fn(t.near>0&&t.near<t.far,"near must be greater than zero and less than far."),t._left=i,t._right=r,t._top=e,t._bottom=n,t._near=o,t._far=a,t._perspectiveMatrix=(new xr).frustum({left:i,right:r,bottom:n,top:e,near:o,far:a}),t._infinitePerspective=(new xr).frustum({left:i,right:r,bottom:n,top:e,near:o,far:1/0}))}function Lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}!function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(A.a)(this,t),e=Vr({near:1,far:5e8,xOffset:0,yOffset:0},e),this._offCenterFrustum=new Tr,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near,this._near=this.near,this.far=e.far,this._far=this.far,this.xOffset=e.xOffset,this._xOffset=this.xOffset,this.yOffset=e.yOffset,this._yOffset=this.yOffset}Object(f.a)(t,[{key:"clone",value:function(){return new t({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(e){return null!==(n=e)&&"undefined"!==typeof n&&e instanceof t&&(Zr(this),Zr(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum));var n}},{key:"computeCullingVolume",value:function(t,e,n){return Zr(this),this._offCenterFrustum.computeCullingVolume(t,e,n)}},{key:"getPixelDimensions",value:function(t,e,n,r){return Zr(this),this._offCenterFrustum.getPixelDimensions(t,e,n,r)}},{key:"projectionMatrix",get:function(){return Zr(this),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return Zr(this),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return Zr(this),this._fovy}},{key:"sseDenominator",get:function(){return Zr(this),this._sseDenominator}}])}();function Zr(t){fn(Number.isFinite(t.fov)&&Number.isFinite(t.aspectRatio)&&Number.isFinite(t.near)&&Number.isFinite(t.far));var e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(fn(t.fov>=0&&t.fov<Math.PI),fn(t.aspectRatio>0),fn(t.near>=0&&t.near<t.far),t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}new kn,new kn,new kn,new kn,new kn,new kn,new kn,new kn,new kn,new kn,new kn,new kn,Math.PI;Math.PI,Math.PI,Math.PI,Math.PI,new Jn,new Jn,new Jn,new Jn,new Jn;new kn,new kn,new kn,new kn,new kn,new Jn,new Jn,new Jn;var Pr=new Xt,Wr=new Xt,Jr=new Qr([new yr,new yr,new yr,new yr,new yr,new yr]);function Hr(t,e){var n=t.cameraDirection,r=t.cameraUp,i=t.height,o=t.distanceScales.metersPerUnit,a=[t.longitude,t.latitude,0],A=nn.WGS84.cartographicToCartesian(a,new Xt),s=nn.WGS84.eastNorthUpToFixedFrame(A),c=t.unprojectPosition(t.cameraPosition),u=nn.WGS84.cartographicToCartesian(c,new Xt),l=new Xt(s.transformAsVector(new Xt(n).scale(o))).normalize(),g=new Xt(s.transformAsVector(new Xt(r).scale(o))).normalize();return function(t,e){var n=t.getFrustumPlanes(),r=0;for(var i in n){var o=n[i],a=o.normal.dot(t.center);Wr.copy(o.normal).scale(o.distance-a).add(t.center);var A=t.unprojectPosition(Wr),s=nn.WGS84.cartographicToCartesian(A,new Xt);Jr.planes[r++].fromPointNormal(s,Pr.copy(e).subtract(s))}}(t,A),{camera:{position:u,direction:l,up:g},viewport:t,height:i,cullingVolume:Jr,frameNumber:e,sseDenominator:1.15}}var Yr=new Xt;var Xr=0,zr=1,Kr=3,qr=4,$r=5,ti=1,ei=2,ni="empty",ri="scenegraph",ii="pointcloud",oi="mesh",ai="I3S",Ai="TILES3D",si="geometricError",ci=1;function ui(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var li=Object.freeze([1,0,0,0,1,0,0,0,1]),gi=Object.freeze([0,0,0,0,0,0,0,0,0]),fi=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),hi={},di=function(t){Object(s.a)(n,t);var e=ui(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return fi}}],[{key:"IDENTITY",get:function(){return hi.IDENTITY=hi.IDENTITY||Object.freeze(new n(li)),hi.IDENTITY}},{key:"ZERO",get:function(){return hi.ZERO=hi.ZERO||Object.freeze(new n(gi)),hi.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=A,this[6]=n,this[7]=o,this[8]=s,this.check()}},{key:"determinant",value:function(){return jn.b(this)}},{key:"identity",value:function(){return this.copy(li)}},{key:"fromQuaternion",value:function(t){return jn.c(this,t),this.check()}},{key:"transpose",value:function(){return jn.i(this,this),this.check()}},{key:"invert",value:function(){return jn.d(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return jn.e(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return jn.e(this,this,t),this.check()}},{key:"rotate",value:function(t){return jn.f(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?jn.g(this,this,t):jn.g(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return jn.h(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=Dt.i(e||[-0,-0],t,this);break;case 3:e=Gt.p(e||[-0,-0,-0],t,this);break;case 4:e=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qt(e,t.length),e}},{key:"transformVector",value:function(t,e){return wt("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return wt("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return wt("Matrix3.transformVector"),this.transform(t,e)}}]),n}(kt);function Ii(t){return void 0!==t&&null!==t}var pi=new Xt,Ci=new Xt,yi=new Xt;new Zt;function vi(t,e,n){if(Object(on.a)(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,n){var r=new Xt(t[0],t[1],t[2]);e.transform(r,r);var i=e.transformAsVector(t.slice(3,6)),o=e.transformAsVector(t.slice(6,9)),a=e.transformAsVector(t.slice(9,12)),A=new di([i[0],i[1],i[2],o[0],o[1],o[2],a[0],a[1],a[2]]);if(Ii(n))return n.center=r,n.halfAxes=A,n;return new Ir(r,A)}(t.box,e,n);if(t.region){var r=Object(I.a)(t.region,6),i=r[0],o=r[1],a=r[2],A=r[3],s=r[4],c=r[5],u=nn.WGS84.cartographicToCartesian([Bt(i),Bt(A),s],Ci),l=nn.WGS84.cartographicToCartesian([Bt(a),Bt(o),c],yi),g=(new Xt).addVectors(u,l).multiplyScalar(.5),f=(new Xt).subVectors(u,l).len()/2;return Bi([g[0],g[1],g[2],f],new Zt)}if(t.sphere)return Bi(t.sphere,e,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function Bi(t,e,n){var r=new Xt(t[0],t[1],t[2]);e.transform(r,r);var i=e.getScale(pi),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return Ii(n)?(n.center=r,n.radius=a,n):new _n(r,a)}new Xt,new Xt,new Zt,new Xt,new Xt,new Xt;function mi(t,e){if(t.dynamicScreenSpaceError&&t._dynamicScreenSpaceErrorComputedDensity){var n=t._dynamicScreenSpaceErrorComputedDensity,r=t.dynamicScreenSpaceErrorFactor;return function(t,e){var n=t*e;return 1-Math.exp(-n*n)}(e,n)*r}return 0}var bi=Math.PI/2;function Ei(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2],o=vt(n),a=vt(r),A=1+i/6378137,s=A*Math.cos(a);return[n=s*Math.cos(o),r=s*Math.sin(o),i=A*Math.sin(a)]}function Qi(t,e){var n=Object(I.a)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o,A=Object(I.a)(e,3),s=A[0],c=A[1],u=A[2],l=Ei([s,c,void 0===u?0:u]),g=Ei([r,i,a]),f=g[0]-l[0],h=g[1]-l[1],d=g[2]-l[2];return f*f+h*h+d*d}function Fi(t,e){var n=e.viewport,r=t.header.mbs[1],i=[t.header.mbs[0],r,t.header.mbs[2]],o=t.header.mbs[3]/6378137,a=Qi(n.unprojectPosition(n.cameraPosition),i)-o*o;if(a<=0)return 170141175e30;var A=function(t,e){var n=e.viewport,r=n.width,i=n.height,o=n.pixelProjectionMatrix,a=Math.tan(Math.atan(Math.sqrt(1/(o[0]*o[0])+1/(o[5]*o[5]))));return Math.sqrt(i*i+r*r)/a}(0,e);return A*=o/Math.sqrt(a)/n.scale}function wi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Si(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wi(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ri=new Xt;var Ui=function(){function t(e,n,r){Object(A.a)(this,t),Object(on.a)("object"===Object(V.a)(n)),this.header=n,this.tileset=e,this.id=n.id,this.url=n.url,this.parent=r,this.refine=this._getRefine(n.refine),this.type=n.type,this.contentUrl=n.contentUrl,this.lodMetricType=null,this.lodMetricValue=null,this.boundingVolume=null,this.content=null,this.contentState=Xr,this.gpuMemoryUsageInBytes=0,this.children=[],this.depth=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this._initializeLodMetric(n),this._initializeTransforms(n),this._initializeBoundingVolumes(n),this._initializeContent(n),this._initializeRenderingState(n),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,this._getPriority=this._getPriority.bind(this),Object.seal(this)}return Object(f.a)(t,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"getScreenSpaceError",value:function(t,e){switch(this.tileset.type){case ai:return Fi(this,t);case Ai:return function(t,e,n){var r=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=n?i:t.lodMetricValue;if(0===o)return 0;var a=Math.max(t._distanceToCamera,1e-7),A=o*e.height/(a*e.sseDenominator);return A-=mi(r,a)}(this,t,e);default:return console.error("Unsupported tileset type"),null}}},{key:"_getPriority",value:function(){return this.isVisible?this.contentState===Xr?-1:Math.max(1e7-this._priority,0)||0:-1}},{key:"loadContent",value:function(){var t=Object(rt.a)(et.a.mark((function t(){var e,n,r,i,o;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.hasEmptyContent){t.next=2;break}return t.abrupt("return",!1);case 2:if(!this.content){t.next=4;break}return t.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=zr,t.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority);case 9:if(e=t.sent){t.next=13;break}return this.contentState=Xr,t.abrupt("return",!1);case 13:return t.prev=13,n=this.tileset.getTileUrl(this.contentUrl),r=this.tileset.fetchOptions,i=this.tileset.loader,o=Si(Si({},r),{},Object(nt.a)({},i.id,{tile:this.header,tileset:this.tileset.tileset,isTileset:"auto",isTileHeader:!1})),t.next=20,Object(ut.a)(n,i,o);case 20:return this.content=t.sent,this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this,an.a.dirname(this.contentUrl)),this.contentState=Kr,this._onContentLoaded(),t.abrupt("return",!0);case 27:throw t.prev=27,t.t0=t.catch(13),this.contentState=$r,t.t0;case 31:return t.prev=31,e.done(),t.finish(31);case 34:case"end":return t.stop()}}),t,this,[[13,27,31,34]])})));return function(){return t.apply(this,arguments)}}()},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.contentState=Xr,!0}},{key:"updateVisibility",value:function(t){if(this._frameNumber!==t.frameNumber){var e=this.parent,n=e?e.computedTransform:this.tileset.modelMatrix,r=e?e._visibilityPlaneMask:Qr.MASK_INDETERMINATE;this._updateTransform(n),this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,r),this._visible=this._visibilityPlaneMask!==Qr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._priority=this.lodMetricValue,this._frameNumber=t.frameNumber}}},{key:"visibility",value:function(t,e){var n=t.cullingVolume,r=this.boundingVolume;return n.computeVisibilityWithPlaneMask(r,e)}},{key:"contentVisibility",value:function(t){return!0}},{key:"distanceToTile",value:function(t){var e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var e=t.camera,n=this.boundingVolume;return Ri.subVectors(n.center,e.position),e.direction.dot(Ri)}},{key:"insideViewerRequestVolume",value:function(t){var e=this._viewerRequestVolume;return!e||0===e.distanceToCamera(t)}},{key:"_initializeLodMetric",value:function(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new Zt(t.transform):new Zt;var e=this.parent,n=this.tileset,r=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new Zt(r).multiplyRight(this.transform);var i=e&&e._initialTransform?e._initialTransform.clone():new Zt;this._initialTransform=new Zt(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Xr,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(t){this.depth=t.level,this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Qr.MASK_INDETERMINATE,this._visible=!1,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||ei}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset.traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=vi(t.boundingVolume,this.computedTransform,this.boundingVolume);var e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=vi(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=vi(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Zt,e=t.clone().multiplyRight(this.transform),n=!e.equals(this.computedTransform);n&&(this.computedTransform=e,this._updateBoundingVolume(this.header))}},{key:"updateExpiration",value:function(){if(void 0!==(e=this._expireDate)&&null!==e&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=qr,this._expiredContent=this.content)}var e}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===Kr||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===Xr}},{key:"contentExpired",get:function(){return this.contentState===qr}},{key:"contentFailed",get:function(){return this.contentState===$r}},{key:"extras",get:function(){return this.header.extras}}]),t}(),xi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Object(A.a)(this,t),this._array=new Array(e),this._map=new Map,this._length=e}return Object(f.a)(t,[{key:"get",value:function(t){return Object(on.a)(t<this._array.length),this._array[t]}},{key:"set",value:function(t,e){Object(on.a)(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}},{key:"delete",value:function(t){var e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(t){if(!this._map.has(t)){var e=this.length++;this._array[e]=t,this._map.set(t,e)}}},{key:"pop",value:function(){var t=this._array[--this.length];return this._map.delete(t),t}},{key:"reserve",value:function(t){Object(on.a)(t>=0),t>this._array.length&&(this._array.length=t)}},{key:"resize",value:function(t){Object(on.a)(t>=0),this.length=t}},{key:"trim",value:function(t){null!==t&&void 0!==t||(t=this.length),this._array.length=t}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(t){return this._map.has(t)}},{key:"length",get:function(){return this._length},set:function(t){this._length=t,t>this._array.length&&(this._array.length=t)}},{key:"values",get:function(){return this._array}}]),t}();function ki(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Oi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oi(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ni(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Di(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ni(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Gi={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2},_i=function(){function t(e){Object(A.a)(this,t),this.options=Di(Di({},Gi),e),this._traversalStack=new xi,this._emptyTraversalStack=new xi,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return Object(f.a)(t,[{key:"traverse",value:function(t,e,n){this.root=t,this.options=Di(Di({},this.options),n),this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,e){var n=this._traversalStack;for(n.push(t);n.length>0;){var r=n.pop(),i=!1;this.canTraverse(r,e)&&(this.updateChildTiles(r,e),i=this.updateAndPushChildren(r,e,n));var o=r.parent,a=Boolean(!o||o._shouldRefine),A=!i;r.hasRenderContent?r.refine===ti?(this.loadTile(r,e),this.selectTile(r,e)):r.refine===ei&&(this.loadTile(r,e),A&&this.selectTile(r,e)):(this.emptyTiles[r.id]=r,this.loadTile(r,e),A&&this.selectTile(r,e)),this.touchTile(r,e),r._shouldRefine=i&&a}this.options.onTraversalEnd&&this.options.onTraversalEnd(e)}},{key:"updateChildTiles",value:function(t,e){var n,r=ki(t.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.updateTile(i,e)}}catch(o){r.e(o)}finally{r.f()}return!0}},{key:"updateAndPushChildren",value:function(t,e,n){var r=this.options,i=r.loadSiblings,o=r.skipLevelOfDetail,a=t.children;a.sort(this.compareDistanceToCamera);var A,s=!o&&t.refine===ei&&t.hasRenderContent,c=!1,u=ki(a);try{for(u.s();!(A=u.n()).done;){var l=A.value;if(l.isVisibleAndInRequestVolume?(n.find(l)&&n.delete(l),n.push(l),c=!0):(s||i)&&(this.loadTile(l,e),this.touchTile(l,e)),s){var g=void 0;if(!(g=!!l._inRequestVolume&&(l.hasRenderContent?l.contentAvailable:this.executeEmptyTraversal(l,e))))return g}}}catch(f){u.e(f)}finally{u.f()}return c}},{key:"updateTile",value:function(t,e){this.updateTileVisibility(t,e)}},{key:"selectTile",value:function(t,e){this.shouldSelectTile(t,e)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,e){this.shouldLoadTile(t,e)&&(t._requestedFrame=e.frameNumber,t._priority=this.getPriority(t),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}},{key:"canTraverse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!(!r&&!t.isVisibleAndInRequestVolume)&&(!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:this.shouldRefine(t,e,n)))}},{key:"shouldLoadTile",value:function(t,e){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t,e){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,e,n){var r=t._screenSpaceError;return n&&(r=t.getScreenSpaceError(e,!0)),r>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,e){t.updateVisibility(e)}},{key:"compareDistanceToCamera",value:function(t,e){return t._distanceToCamera-e._distanceToCamera}},{key:"getPriority",value:function(t){var e=this.options;switch(t.refine){case ti:return t._distanceToCamera;case ei:var n=t.parent,r=n&&(!e.skipLevelOfDetail||0===t._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:t._screenSpaceError;return this.root._screenSpaceError-r;default:return Object(on.a)(!1)}}},{key:"anyChildrenVisible",value:function(t,e){var n,r=!1,i=ki(t.children);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.updateVisibility(e),r=r||o.isVisibleAndInRequestVolume}}catch(a){i.e(a)}finally{i.f()}return r}},{key:"executeEmptyTraversal",value:function(t,e){for(var n=!0,r=this._emptyTraversalStack;r.length>0;){var i=r.pop();this.updateTile(i,e),i.isVisibleAndInRequestVolume||(this.loadTile(i,e),this.touchTile(i,e));var o=!i.hasRenderContent&&this.canTraverse(i,e,!1,!0);if(o||i.contentAvailable||(n=!1),o){var a,A=ki(i.children.filter((function(t){return t})));try{for(A.s();!(a=A.n()).done;){var s=a.value;r.find(s)&&r.delete(s),r.push(s)}}catch(c){A.e(c)}finally{A.f()}}}return n}}]),t}();function Mi(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ti=function(t){Object(s.a)(n,t);var e=Mi(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"compareDistanceToCamera",value:function(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}},{key:"updateTileVisibility",value:function(t,e){if(t.updateVisibility(e),t.isVisibleAndInRequestVolume){var n=t.children.length>0;if(t.hasTilesetContent&&n){var r=t.children[0];return this.updateTileVisibility(r,e),void(t._visible=r._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))t._visible=!1;else{var i=t.refine===ei,o=t._optimChildrenWithinParent===ci;i&&o&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(t,e){var n=t.parent;return!(!n||n.hasTilesetContent||n.refine!==ti)&&!this.shouldRefine(t,e,!0)}}]),n}(_i),ji="REQUESTED",Li="COMPLETED",Vi="ERROR",Zi=function(){function t(){Object(A.a)(this,t),this._statusMap={}}return Object(f.a)(t,[{key:"add",value:function(t,e,n,r){var i=this;this._statusMap[e]||(this._statusMap[e]={request:t,callback:n,key:e,frameState:r,status:ji},t().then((function(t){i._statusMap[e].status=Li,i._statusMap[e].callback(t,r)})).catch((function(t){i._statusMap[e].status=Vi,n(t)})))}},{key:"update",value:function(t,e){this._statusMap[t]&&(this._statusMap[t].frameState=e)}},{key:"find",value:function(t){return this._statusMap[t]}}]),t}();function Pi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pi(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ji(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Hi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hi(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Hi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yi(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Xi=function(t){Object(s.a)(n,t);var e=Yi(n);function n(t){var r;return Object(A.a)(this,n),(r=e.call(this,t))._tileManager=new Zi,r}return Object(f.a)(n,[{key:"shouldRefine",value:function(t,e){return t._lodJudge=function(t,e){var n=e.viewport,r=n.metersPerPixel,i=t.header.mbs[1],o=t.header.mbs[0],a=t.header.mbs[2],A=t.header.mbs[3],s=n.height,c=n.width,u=n.latitude,l=n.longitude,g=[l,u],f=[o,i,a],h=[l,i],d=[o,u],I=Math.sqrt(s*s+c*c)*r[0],p=.5*s+A/6378137,C=.5*c+A/6378137;if(Qi(g,f)>I+A/6378137)return"OUT";if(Qi(g,h)>p)return"OUT";if(Qi(g,d)>C)return"OUT";if(0===t.lodMetricValue)return"DIG";var y=Fi(t,e);return(y*=bi)<.5?"OUT":!t.header.children||y<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}},{key:"updateChildTiles",value:function(t,e){var n,r=this,i=t.header.children||[],o=t.children,a=t.tileset,A=Ji(i);try{var s=function(){var i=n.value,A=o&&o.find((function(t){return t.id===i.id}));if(A)A&&r.updateTile(A,e);else{var s=function(){return r._loadTile(i.id,a)};r._tileManager.find(i.id)?r._tileManager.update(i.id,e):(a.tileset.nodePages&&(s=function(){return a.tileset.nodePagesTile.formTileFromNodePages(i.id)}),r._tileManager.add(s,i.id,(function(e){return r._onTileLoad(e,t)}),e))}};for(A.s();!(n=A.n()).done;)s()}catch(c){A.e(c)}finally{A.f()}}},{key:"_loadTile",value:function(){var t=Object(rt.a)(et.a.mark((function t(e,n){var r,i,o;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.loader,i=n.getTileUrl("".concat(n.url,"/nodes/").concat(e)),o={i3s:Wi(Wi({},n.fetchOptions),{},{isTileHeader:!0,loadContent:!1})},t.next=5,Object(ut.a)(i,r,o);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_onTileLoad",value:function(t,e){var n=this.options.basePath,r=new Ui(e.tileset,t,e,n);e.children.push(r);var i=this._tileManager.find(r.id).frameState;this.updateTile(r,i),this._frameNumber===i.frameNumber&&this.executeTraversal(r,i)}}]),n}(_i);function zi(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Ki(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ki(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Ki(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qi(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var to={ellipsoid:nn.WGS84,modelMatrix:new Zt,throttleRequests:!1,maximumMemoryUsage:32,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(t,e,n){},maximumScreenSpaceError:8},eo=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,t),Object(on.a)(e),this.options=$i($i({},to),n),this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||an.a.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.fetchOptions=this.options.fetchOptions||{},this.options.headers&&(this.fetchOptions.headers=this.options.headers),this.options.token&&(this.fetchOptions.token=this.options.token),this.root=null,this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this._traverser=this._initializeTraverser(),this._cache=new ln,this._requestScheduler=new An.a({throttleRequests:this.options.throttleRequests}),this._frameNumber=0,this._updateFrameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._queryParams={},this._queryParamsString=null,this.maximumMemoryUsage=this.options.maximumMemoryUsage,this.gpuMemoryUsageInBytes=0,this.stats=new rn.a({id:this.url}),this._initializeStats(),this._hasMixedContent=!1,this._maximumScreenSpaceError=this.options.maximumScreenSpaceError,this._properties=void 0,this._extensionsUsed=void 0,this._gltfUpAxis=void 0,this._dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description,this._defaultGeometrySchema=[],this._initializeTileSet(e,this.options)}return Object(f.a)(t,[{key:"isLoaded",value:function(){return 0===this._pendingCount}},{key:"destroy",value:function(){this._destroy()}},{key:"getTileUrl",value:function(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}},{key:"update",value:function(t){this._cache.reset(),this._frameNumber++,this._frameState=Hr(t,this._frameNumber),this._traverser.traverse(this.root,this._frameState,this.options)}},{key:"_onTraversalEnd",value:function(){var t=Object.values(this._traverser.selectedTiles);this._tilesChanged(this.selectedTiles,t)&&this._updateFrameNumber++,this.selectedTiles=t;var e,n=zi(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var r=e.value;this._tiles[r.id]=r}}catch(i){n.e(i)}finally{n.f()}return this._requestedTiles=Object.values(this._traverser.requestedTiles),this._emptyTiles=Object.values(this._traverser.emptyTiles),this._loadTiles(this._frameState),this._unloadTiles(),this._updateStats(),this._updateFrameNumber}},{key:"_tilesChanged",value:function(t,e){if(t.length!==e.length)return!0;var n=new Set(t.map((function(t){return t.id}))),r=new Set(e.map((function(t){return t.id}))),i=t.filter((function(t){return!r.has(t.id)})).length>0;return i=i||e.filter((function(t){return!n.has(t.id)})).length>0}},{key:"_loadTiles",value:function(t){var e,n=zi(this._requestedTiles);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r,t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(t,e){return t._unloadTile(e)}))}},{key:"_updateStats",value:function(){var t,e=0,n=0,r=zi(this.selectedTiles);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.contentAvailable&&(e++,i.content.pointCount&&(n+=i.content.pointCount))}}catch(o){r.e(o)}finally{r.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points").count=n}},{key:"_initializeTileSet",value:function(t){this.root=this._initializeTileHeaders(t,null,this.basePath),this.type===Ai&&this._initializeCesiumTileset(t),this.type===ai&&this._initializeI3STileset(t),this._calculateViewProps()}},{key:"_calculateViewProps",value:function(){var t=this.root,e=t.boundingVolume.center;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Xt,void(this.zoom=1);this.cartographicCenter=nn.WGS84.cartesianToCartographic(e,new Xt),this.cartesianCenter=e,this.zoom=function(t){var e=t.halfAxes,n=t.radius,r=t.width,i=t.height;if(e){e.getColumn(0,Yr);var o=Yr.len();e.getColumn(1,Yr);var a=Yr.len();e.getColumn(2,Yr);var A=o/2,s=a/2,c=Yr.len()/2;return(Math.log2(6378137/A)+Math.log2(6378137/s)+Math.log2(6356752.314245179/c))/3}return n?Math.log2(6356752.314245179/n):i&&r?(Math.log2(6378137/r)+Math.log2(6378137/i))/2:1}(t.boundingVolume)}},{key:"_initializeStats",value:function(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(t,e,n){var r=new Ui(this,t.root,e,n);if(e&&(e.children.push(r),r.depth=e.depth+1),this.type===Ai){var i=[];for(i.push(r);i.length>0;){var o=i.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();var a,A=zi(o.header.children||[]);try{for(A.s();!(a=A.n()).done;){var s=a.value,c=new Ui(this,s,o,n);o.children.push(c),c.depth=o.depth+1,i.push(c)}}catch(u){A.e(u)}finally{A.f()}}}return r}},{key:"_initializeTraverser",value:function(){var t;switch(this.type){case Ai:t=Ti;break;case ai:t=Xi;break;default:t=_i}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(t){this._destroySubtree(t)}},{key:"_loadTile",value:function(){var t=Object(rt.a)(et.a.mark((function t(e,n){var r;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this._onStartTileLoading(),t.next=4,e.loadContent(n);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),this._onTileLoadError(e,t.t0);case 10:return t.prev=10,this._onEndTileLoading(),this._onTileLoad(e,r),t.finish(10);case 14:case"end":return t.stop()}}),t,this,[[0,7,10,14]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_onTileLoadError",value:function(t,e){this.stats.get("Failed Tile Loads").incrementCount();var n=e.message||e.toString(),r=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(n)),this.options.onTileError(t,n,r)}},{key:"_onTileLoad",value:function(t,e){e&&(t&&t.content&&function(t,e){Object(on.a)(t),Object(on.a)(e);var n=e.rtcCenter,r=e.rotateYtoZ,i=t.computedTransform,o=t.boundingVolume.center,a=new Zt(i);if(n&&a.translate(n),r){var A=(new Zt).rotateX(Math.PI/2);a=a.multiplyRight(A)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);var s=new Xt(o);e.cartesianModelMatrix=a,e.cartesianOrigin=s;var c=nn.WGS84.cartesianToCartographic(s,new Xt),u=nn.WGS84.eastNorthUpToFixedFrame(s).invert();e.cartographicModelMatrix=u.multiplyRight(a),e.cartographicOrigin=c,e.modelMatrix=e.cartographicModelMatrix}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t))}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(t){this._cache.add(this,t,(function(e){return e._updateCacheStats(t)}))}},{key:"_updateCacheStats",value:function(t){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(t){this.gpuMemoryUsageInBytes-=t.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}},{key:"_destroy",value:function(){var t=[];for(this.root&&t.push(this.root);t.length>0;){var e,n=t.pop(),r=zi(n.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.push(i)}}catch(o){r.e(o)}finally{r.f()}this._destroyTile(n)}this.root=null}},{key:"_destroySubtree",value:function(t){var e=t,n=[];for(n.push(e);n.length>0;){var r,i=zi((t=n.pop()).children);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o)}}catch(a){i.e(a)}finally{i.f()}t!==e&&this._destroyTile(t)}e.children=[]}},{key:"_destroyTile",value:function(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}},{key:"_initializeCesiumTileset",value:function(t){if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description,this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed,this.extras=t.extras}},{key:"_initializeI3STileset",value:function(t){"token"in this.options&&(this._queryParams.token=this.options.token),this._defaultGeometrySchema=t.store.defaultGeometrySchema}},{key:"hasExtension",value:function(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];e.push("".concat(i,"=").concat(t[i]))}switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}}]),t}(),no={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect"};Object.keys(no);function ro(t,e,n){Object(on.a)(t instanceof ArrayBuffer);var r=new TextDecoder("utf8"),i=new Uint8Array(t,e,n);return r.decode(i)}function io(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t);return"".concat(String.fromCharCode(n.getUint8(e+0))).concat(String.fromCharCode(n.getUint8(e+1))).concat(String.fromCharCode(n.getUint8(e+2))).concat(String.fromCharCode(n.getUint8(e+3)))}var oo,ao=n(743),Ao=n(190);function so(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function co(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?so(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):so(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function uo(t){return lo.apply(this,arguments)}function lo(){return(lo=Object(rt.a)(et.a.mark((function t(e){var n;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.modules||{},oo=n.draco3d?oo||new Promise((function(t){var e=n.draco3d.createDecoderModule({onModuleLoaded:function(){t({draco:e})}})})):oo||go(e),t.next=4,oo;case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function go(t){return fo.apply(this,arguments)}function fo(){return(fo=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,Object(ao.a)("draco_decoder.js","draco",e);case 5:return n=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,Object(ao.a)("draco_wasm_wrapper.js","draco",e);case 10:return t.t2=t.sent,t.next=13,Object(ao.a)("draco_decoder.wasm","draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:i=t.sent,o=Object(I.a)(i,2),n=o[0],r=o[1];case 21:return n=n||Ao.a.DracoDecoderModule,t.next=24,ho(n,r);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ho(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t(co(co({},n),{},{onModuleLoaded:function(t){return e({draco:t})}}))}))}var Io=n(744),po=0,Co=1,yo={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vo={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Bo=function(){function t(e){Object(A.a)(this,t),this.draco=e,this.drawMode="TRIANGLE",this.metadataQuerier={}}return Object(f.a)(t,[{key:"destroy",value:function(){}},{key:"destroyGeometry",value:function(t){t&&this.draco.destroy(t.dracoGeometry)}},{key:"parseSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.metadataQuerier=new this.draco.MetadataQuerier;var n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength);var r,i,o,a=new this.draco.Decoder,A={};try{var s=a.GetEncodedGeometryType(n);switch(s){case this.draco.TRIANGULAR_MESH:i=new this.draco.Mesh,r=a.DecodeBufferToMesh(n,i),o={type:po,faceCount:i.num_faces(),attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;case this.draco.POINT_CLOUD:i=new this.draco.PointCloud,r=a.DecodeBufferToPointCloud(n,i),o={type:Co,attributeCount:i.num_attributes(),vertexCount:i.num_points()};break;default:throw new Error("Unknown DRACO geometry type.")}if(!r.ok()||!i.ptr){var c="DRACO decompression failed: ".concat(r.error_msg());throw i&&this.draco.destroy(i),new Error(c)}A.loaderData={header:o},this._extractDRACOGeometry(a,i,s,A,e);var u=this._getGeometryMetadata(a,i);A.header={vertexCount:o.vertexCount,boundingBox:Object(Io.a)(A.attributes),metadata:u}}finally{this.draco.destroy(a),this.draco.destroy(n),this.draco.destroy(i),this.draco.destroy(this.metadataQuerier)}return A}},{key:"_extractDRACOGeometry",value:function(t,e,n,r,i){var o=this._getAttributes(t,e,i);if(!o.POSITION)throw new Error("DRACO decompressor: No position attribute found.");return n===this.draco.TRIANGULAR_MESH?(o.indices="TRIANGLE_STRIP"===this.drawMode?this._getMeshStripIndices(t,e):this._getMeshFaceIndices(t,e),r.mode="TRIANGLE_STRIP"===this.drawMode?5:4):r.mode=0,o.indices&&(r.indices={value:o.indices,size:1},delete o.indices),r.attributes=o,r}},{key:"getPositionAttributeMetadata",value:function(t){this.metadata=this.metadata||{},this.metadata.attributes=this.metadata.attributes||{};var e=new this.draco.AttributeQuantizationTransform;if(e.InitFromAttribute(t)){this.metadata.attributes.position.isQuantized=!0,this.metadata.attributes.position.maxRange=e.range(),this.metadata.attributes.position.numQuantizationBits=e.quantization_bits(),this.metadata.attributes.position.minValues=new Float32Array(3);for(var n=0;n<3;++n)this.metadata.attributes.position.minValues[n]=e.min_value(n)}this.draco.destroy(e)}},{key:"_getAttributes",value:function(t,e,n){for(var r={},i=e.num_points(),o=0;o<e.num_attributes();o++){var a=t.GetAttribute(e,o),A=this._getAttributeMetadata(t,e,o),s={uniqueId:a.unique_id(),attributeType:a.attribute_type(),dataType:vo[a.data_type()],size:a.size(),numComponents:a.num_components(),byteOffset:a.byte_offset(),byteStride:a.byte_stride(),normalized:a.normalized(),metadata:A},c=this._deduceAttributeName(s,n),u=this._getAttributeTypedArray(t,e,a,c).typedArray;r[c]={value:u,size:u.length/i,metadata:A}}return r}},{key:"_getMeshFaceIndices",value:function(t,e){for(var n=e.num_faces(),r=new Uint32Array(3*n),i=new this.draco.DracoInt32Array,o=0;o<n;++o){t.GetFaceFromMesh(e,o,i);var a=3*o;r[a]=i.GetValue(0),r[a+1]=i.GetValue(1),r[a+2]=i.GetValue(2)}return this.draco.destroy(i),r}},{key:"_getMeshStripIndices",value:function(t,e){var n=new this.draco.DracoInt32Array;t.GetTriangleStripsFromMesh(e,n);for(var r=new Uint32Array(n.size()),i=0;i<n.size();++i)r[i]=n.GetValue(i);return this.draco.destroy(n),r}},{key:"_getAttributeTypedArray",value:function(t,e,n,r){if(0===n.ptr){var i="DRACO decode bad attribute ".concat(r);throw new Error(i)}var o,a,A=vo[n.data_type()],s=n.num_components(),c=e.num_points()*s;switch(A){case Float32Array:o=new this.draco.DracoFloat32Array,t.GetAttributeFloatForAllPoints(e,n,o),a=new Float32Array(c);break;case Int8Array:o=new this.draco.DracoInt8Array,t.GetAttributeInt8ForAllPoints(e,n,o),a=new Int8Array(c);break;case Int16Array:o=new this.draco.DracoInt16Array,t.GetAttributeInt16ForAllPoints(e,n,o),a=new Int16Array(c);break;case Int32Array:o=new this.draco.DracoInt32Array,t.GetAttributeInt32ForAllPoints(e,n,o),a=new Int32Array(c);break;case Uint8Array:o=new this.draco.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(e,n,o),a=new Uint8Array(c);break;case Uint16Array:o=new this.draco.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(e,n,o),a=new Uint16Array(c);break;case Uint32Array:o=new this.draco.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(e,n,o),a=new Uint32Array(c);break;default:throw new Error("DRACO decoder: unexpected attribute type.")}for(var u=0;u<c;u++)a[u]=o.GetValue(u);return this.draco.destroy(o),{typedArray:a,components:s}}},{key:"_deduceAttributeName",value:function(t,e){var n=e.extraAttributes,r=void 0===n?{}:n;if(r&&"object"===Object(V.a)(r))for(var i=0,o=Object.entries(r);i<o.length;i++){var a=Object(I.a)(o[i],2),A=a[0];if(a[1]===t.uniqueId)return A}for(var s in yo){var c=this.draco[s];if(t.attributeType===c)return yo[s]}if(t.metadata){var u=e.attributeNameEntry||"name";if(t.metadata[u])return t.metadata[u].string}return"CUSTOM_ATTRIBUTE_".concat(t.uniqueId)}},{key:"_getGeometryMetadata",value:function(t,e){var n=t.GetMetadata(e);return this._queryDracoMetadata(n)}},{key:"_getAttributeMetadata",value:function(t,e,n){var r=t.GetAttributeMetadata(e,n);return this._queryDracoMetadata(r)}},{key:"_queryDracoMetadata",value:function(t){if(!t||!t.ptr)return{};for(var e={},n=this.metadataQuerier.NumEntries(t),r=0;r<n;r++){var i=this.metadataQuerier.GetEntryName(t,r);e[i]={int:this.metadataQuerier.GetIntEntry(t,i),string:this.metadataQuerier.GetStringEntry(t,i),double:this.metadataQuerier.GetDoubleEntry(t,i),intArray:this.metadataQuerier.GetIntEntryArray(t,i)}}return e}},{key:"decode",value:function(t,e){return this.parseSync(t,e)}}]),t}();function mo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mo(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Eo=bo(bo({},{id:"draco",name:"Draco",version:"2.3.0",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"===typeof WebAssembly?"undefined":Object(V.a)(WebAssembly))?"wasm":"js",libraryPath:"libs/",workerUrl:"https://unpkg.com/@loaders.gl/draco@".concat("2.3.0","/dist/draco-loader.worker.js"),localWorkerUrl:"modules/draco/dist/draco-loader.worker.dev.js",extraAttributes:{}}}}),{},{parse:function(t,e,n,r){return Qo.apply(this,arguments)}});function Qo(){return(Qo=Object(rt.a)(et.a.mark((function t(e,n,r,i){var o,a,A;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,uo(n);case 2:return o=t.sent,a=o.draco,A=new Bo(a),t.prev=5,t.abrupt("return",A.parseSync(e,bo({extraAttributes:n.draco&&n.draco.extraAttributes||null},n.parseOptions||{})));case 7:return t.prev=7,A.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}function Fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fo(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var So={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ro=wo(wo({},{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6}),So);function Uo(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;var xo={};function ko(t){return Math.round(t/xo.EPSILON)*xo.EPSILON}function Oo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?xo.precision||4:n;return t=ko(t),"".concat(parseFloat(t.toPrecision(r)))}function No(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Do(t,e,n){var r=xo.EPSILON;n&&(xo.EPSILON=n);try{if(t===e)return!0;if(No(t)&&No(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Do(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=xo.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{xo.EPSILON=r}}function Go(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}xo.EPSILON=1e-12,xo.debug=!1,xo.precision=4,xo.printTypes=!1,xo.printDegrees=!1,xo.printRowMajor=!0;var _o=function(t){Object(s.a)(n,t);var e=Go(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:No(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xo)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Oo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Do(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(xo.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Uo(!1),0}},{key:"RANK",get:function(){return Uo(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(St.a)(Array));function Mo(t,e){if(t.length!==e)return!1;for(var n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function To(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function jo(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(xo.debug&&!Mo(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}var Lo={};function Vo(t,e){Lo[t]||(Lo[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}function Zo(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Po=function(t){Object(s.a)(n,t);var e=Zo(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"copy",value:function(t){return Uo(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return To(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return To(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Uo(t>=0&&t<this.ELEMENTS,"index is out of range"),To(this[t])}},{key:"setComponent",value:function(t,e){return Uo(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=To(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=To(t)}}]),n}(_o);function Wo(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function Jo(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ho,Yo=[0,0,0],Xo={},zo=function(t){Object(s.a)(n,t);var e=Jo(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&No(r)?t.copy(r):(xo.debug&&(To(r),To(i),To(o)),t[0]=r,t[1]=i,t[2]=o),t}return Object(f.a)(n,null,[{key:"ZERO",get:function(){return Xo.ZERO=Xo.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(f.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return xo.debug&&(To(t.x),To(t.y),To(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return Gt.a(this,t)}},{key:"cross",value:function(t){return Gt.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Yo:n;return Gt.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Yo:n;return Gt.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Yo:n;return Gt.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Gt.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Wo(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Gt.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return Gt.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=To(t)}}]),n}(Po),Ko=(Ho={},Object(nt.a)(Ho,So.DOUBLE,Float64Array),Object(nt.a)(Ho,So.FLOAT,Float32Array),Object(nt.a)(Ho,So.UNSIGNED_SHORT,Uint16Array),Object(nt.a)(Ho,So.UNSIGNED_INT,Uint32Array),Object(nt.a)(Ho,So.UNSIGNED_BYTE,Uint8Array),Object(nt.a)(Ho,So.BYTE,Int8Array),Object(nt.a)(Ho,So.SHORT,Int16Array),Object(nt.a)(Ho,So.INT,Int32Array),Ho),qo={DOUBLE:So.DOUBLE,FLOAT:So.FLOAT,UNSIGNED_SHORT:So.UNSIGNED_SHORT,UNSIGNED_INT:So.UNSIGNED_INT,UNSIGNED_BYTE:So.UNSIGNED_BYTE,BYTE:So.BYTE,SHORT:So.SHORT,INT:So.INT},$o=function(){function t(){Object(A.a)(this,t)}return Object(f.a)(t,null,[{key:"fromTypedArray",value:function(t){for(var e in t=ArrayBuffer.isView(t)?t.constructor:t,Ko){if(Ko[e]===t)return e}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(t){var e=qo[t];if(!e)throw new Error("Failed to convert GL type");return e}},{key:"getArrayType",value:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(t){case So.UNSIGNED_SHORT_5_6_5:case So.UNSIGNED_SHORT_4_4_4_4:case So.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:var e=Ko[t];if(!e)throw new Error("Failed to convert GL type");return e}}},{key:"getByteSize",value:function(e){return t.getArrayType(e).BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(t.getArrayType(e))}},{key:"createTypedArray",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(n.byteLength-r)/t.getByteSize(e));var o=t.getArrayType(e);return new o(n,r,i)}}]),t}(),ta=function(){function t(e,n){Object(A.a)(this,t),this.json=e,this.buffer=n,this.featuresLength=0,this._cachedTypedArrays={}}return Object(f.a)(t,[{key:"getExtension",value:function(t){return this.json.extensions&&this.json.extensions[t]}},{key:"hasProperty",value:function(t){return Boolean(this.json[t])}},{key:"getGlobalProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ro.UNSIGNED_INT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.json[t];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(t,e,n,1,r.byteOffset):r}},{key:"getPropertyArray",value:function(t,e,n){var r=this.json[t];return r&&Number.isFinite(r.byteOffset)?("componentType"in r&&(e=$o.fromName(r.componentType)),this._getTypedArrayFromBinary(t,e,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(t,e,r)}},{key:"getProperty",value:function(t,e,n,r,i){var o=this.json[t];if(!o)return o;var a=this.getPropertyArray(t,e,n);if(1===n)return a[r];for(var A=0;A<n;++A)i[A]=a[n*r+A];return i}},{key:"_getTypedArrayFromBinary",value:function(t,e,n,r,i){var o=this._cachedTypedArrays,a=o[t];return a||(a=$o.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,r*n),o[t]=a),a}},{key:"_getTypedArrayFromArray",value:function(t,e,n){var r=this._cachedTypedArrays,i=r[t];return i||(i=$o.createTypedArray(e,n),r[t]=i),i}}]),t}(),ea={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},na={SCALAR:function(t,e){return t[e]},VEC2:function(t,e){return[t[2*e+0],t[2*e+1]]},VEC3:function(t,e){return[t[3*e+0],t[3*e+1],t[3*e+2]]},VEC4:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT2:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT3:function(t,e){return[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]]},MAT4:function(t,e){return[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]}},ra={SCALAR:function(t,e,n){e[n]=t},VEC2:function(t,e,n){e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:function(t,e,n){e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:function(t,e,n){e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT2:function(t,e,n){e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT3:function(t,e,n){e[9*n+0]=t[0],e[9*n+1]=t[1],e[9*n+2]=t[2],e[9*n+3]=t[3],e[9*n+4]=t[4],e[9*n+5]=t[5],e[9*n+6]=t[6],e[9*n+7]=t[7],e[9*n+8]=t[8],e[9*n+9]=t[9]},MAT4:function(t,e,n){e[16*n+0]=t[0],e[16*n+1]=t[1],e[16*n+2]=t[2],e[16*n+3]=t[3],e[16*n+4]=t[4],e[16*n+5]=t[5],e[16*n+6]=t[6],e[16*n+7]=t[7],e[16*n+8]=t[8],e[16*n+9]=t[9],e[16*n+10]=t[10],e[16*n+11]=t[11],e[16*n+12]=t[12],e[16*n+13]=t[13],e[16*n+14]=t[14],e[16*n+15]=t[15]}};function ia(t){throw new Error('"'+t+'" is read-only')}var oa=function(t){return void 0!==t};function aa(t,e,n){if(!e)return null;var r=t.getExtension("3DTILES_batch_table_hierarchy"),i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,r=i),r?function(t,e){var n,r,i,o,a=t.instancesLength,A=t.classes,s=t.classIds,c=t.parentCounts,u=t.parentIds,l=a;oa(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),ia("classIds"),s=i.createArrayBufferView(e.buffer,e.byteOffset+s.byteOffset,a));if(oa(c))for(oa(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),ia("parentCounts"),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,a)),o=new Uint16Array(a),ia("parentIdsLength"),l=0,n=0;n<a;++n)o[n]=l,l+=(ia("parentIdsLength"),c[n]);oa(u)&&oa(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),ia("parentIds"),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,l));var g=A.length;for(n=0;n<g;++n){var f=A[n].length,h=A[n].instances,d=getBinaryProperties(f,h,e);A[n].instances=combine(d,h)}var I=new Array(g).fill(0),p=new Uint16Array(a);for(n=0;n<a;++n)r=s[n],p[n]=I[r],++I[r];var C={classes:A,classIds:s,classIndexes:p,parentCounts:c,parentIndexes:o,parentIds:u};return function(t){for(var e=t.classIds.length,n=0;n<e;++n)sa(t,n,stack)}(C),C}(r,n):null}function Aa(t,e,n){if(t){var r=t.parentCounts;return t.parentIds?n(t,e):r>0?function(t,e,n){var r=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,A=r.length,s=scratchVisited;s.length=Math.max(s.length,A);var c=++marker,u=scratchStack;u.length=0,u.push(e);for(;u.length>0;)if(e=u.pop(),s[e]!==c){s[e]=c;var l=n(t,e);if(oa(l))return l;for(var g=i[e],f=a[e],h=0;h<g;++h){var d=o[f+h];d!==e&&u.push(d)}}return null}(t,e,n):function(t,e,n){var r=!0;for(;r;){var i=n(t,e);if(oa(i))return i;var o=t.parentIds[e];r=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,n)}}function sa(t,e,n){var r=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(oa(i)){assert(e<a,"Parent index ".concat(e," exceeds the total number of instances: ").concat(a)),assert(-1===n.indexOf(e),"Circular dependency detected in the batch table hierarchy."),n.push(e);for(var A=oa(r)?r[e]:1,s=oa(r)?o[e]:e,c=0;c<A;++c){var u=i[s+c];u!==e&&sa(t,u,n)}n.pop(e)}}function ca(t){return void 0!==t&&null!==t}var ua=function(t,e){return t},la={HIERARCHY:!0,extensions:!0,extras:!0},ga=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in Object(A.a)(this,t),Object(on.a)(r>=0),this.json=e||{},this.binary=n,this.featureCount=r,this._extensions=this.json&&this.json.extensions||{},this._properties={},this.json)la[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=aa(this,this.json,this.binary))}return Object(f.a)(t,[{key:"getExtension",value:function(t){return this.json&&this.json.extensions&&this.json.extensions[t]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(t,e){return this._checkBatchId(t),Object(on.a)("string"===typeof e,e),!!this._hierarchy&&ca(Aa(this._hierarchy,t,(function(t,n){var r=t.classIds[n];return t.classes[r].name===e})))}},{key:"isExactClass",value:function(t,e){return Object(on.a)("string"===typeof e,e),this.getExactClassName(t)===e}},{key:"getExactClassName",value:function(t){if(this._checkBatchId(t),this._hierarchy){var e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}},{key:"hasProperty",value:function(t,e){return this._checkBatchId(t),Object(on.a)("string"===typeof e,e),ca(this._properties[e])||this._hasPropertyInHierarchy(t,e)}},{key:"getPropertyNames",value:function(t,e){var n;this._checkBatchId(t),(e=ca(e)?e:[]).length=0;var r=Object.keys(this._properties);return(n=e).push.apply(n,Object(lt.a)(r)),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}},{key:"getProperty",value:function(t,e){if(this._checkBatchId(t),Object(on.a)("string"===typeof e,e),this._binaryProperties){var n=this._binaryProperties[e];if(ca(n))return this._getBinaryProperty(n,t)}var r=this._properties[e];if(ca(r))return ua(r[t]);if(this._hierarchy){var i=this._getHierarchyProperty(t,e);if(ca(i))return i}}},{key:"setProperty",value:function(t,e,n){var r=this.featureCount;if(this._checkBatchId(t),Object(on.a)("string"===typeof e,e),this._binaryProperties){var i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,n)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,e,n)){var o=this._properties[e];ca(o)||(this._properties[e]=new Array(r),o=this._properties[e]),o[t]=ua(n)}}},{key:"_checkBatchId",value:function(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(t,e){return t.unpack(t.typedArray,e)}},{key:"_setBinaryProperty",value:function(t,e,n){t.pack(n,t.typedArray,e)}},{key:"_initializeBinaryProperties",value:function(){var t=null;for(var e in this._properties){var n=this._properties[e],r=this._initializeBinaryProperty(e,n);r&&((t=t||{})[e]=r)}return t}},{key:"_initializeBinaryProperty",value:function(t,e){if("byteOffset"in e){var n=e;Object(on.a)(this.binary,"Property ".concat(t," requires a batch table binary.")),Object(on.a)(n.type,"Property ".concat(t," requires a type."));var r=function(t,e,n,r){var i=t.componentType;Object(on.a)(t.componentType);var o="string"===typeof i?$o.fromName(i):i,a=ea[t.type],A=na[t.type],s=ra[t.type];return n+=t.byteOffset,{values:$o.createTypedArray(o,e,n,a*r),type:o,size:a,unpacker:A,packer:s}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:r.values,componentCount:r.size,unpack:r.unpacker,pack:r.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(t,e){if(!this._hierarchy)return!1;var n=Aa(this._hierarchy,t,(function(t,n){var r=t.classIds[n];return ca(t.classes[r].instances[e])}));return ca(n)}},{key:"_getPropertyNamesInHierarchy",value:function(t,e){Aa(this._hierarchy,t,(function(t,n){var r=t.classIds[n],i=t.classes[r].instances;for(var o in i)i.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}},{key:"_getHierarchyProperty",value:function(t,e){var n=this;return Aa(this._hierarchy,t,(function(t,r){var i=t.classIds[r],o=t.classes[i],a=t.classIndexes[r],A=o.instances[e];return ca(A)?ca(A.typedArray)?n._getBinaryProperty(A,a):ua(A[a]):null}))}},{key:"_setHierarchyProperty",value:function(t,e,n,r){var i=this,o=Aa(this._hierarchy,e,(function(t,o){var a=t.classIds[o],A=t.classes[a],s=t.classIndexes[o],c=A.instances[n];return!!ca(c)&&(Object(on.a)(o===e,'Inherited property "'.concat(n,'" is read-only.')),ca(c.typedArray)?i._setBinaryProperty(c,s,r):c[s]=ua(r),!0)}));return ca(o)}}]),t}();function fa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new DataView(e);if(t.magic=r.getUint32(n,!0),n+=4,t.version=r.getUint32(n,!0),n+=4,t.byteLength=r.getUint32(n,!0),n+=4,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return n}function ha(t,e,n){var r=new DataView(e);return t.header=t.header||{},t.header.featureTableJsonByteLength=r.getUint32(n,!0),n+=4,t.header.featureTableBinaryByteLength=r.getUint32(n,!0),n+=4,t.header.batchTableJsonByteLength=r.getUint32(n,!0),n+=4,t.header.batchTableBinaryByteLength=r.getUint32(n,!0),n+=4}function da(t,e,n,r){return n=function(t,e,n,r){var i=t.header,o=i.featureTableJsonByteLength,a=i.featureTableBinaryByteLength;if(t.featureTableJson={BATCH_LENGTH:0},o>0){var A=ro(e,n,o);t.featureTableJson=JSON.parse(A)}return n+=o,t.featureTableBinary=new Uint8Array(e,n,a),n+=a}(t,e,n),n=function(t,e,n,r){var i=t.header,o=i.batchTableJsonByteLength,a=i.batchTableBinaryByteLength;if(o>0){var A=ro(e,n,o);t.batchTableJson=JSON.parse(A),n+=o,a>0&&(t.batchTableBinary=new Uint8Array(e,n,a),t.batchTableBinary=new Uint8Array(t.batchTableBinary),n+=a)}return n}(t,e,n)}function Ia(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=t>>11&31,r=t>>5&63,i=31&t;return e[0]=n<<3,e[1]=r<<2,e[2]=i<<3,e}function pa(t,e,n){if(!e&&(!t||!t.batchIds||!n))return null;var r=t.batchIds,i=t.isRGB565,o=t.pointCount;if(r&&n){for(var a=new Uint8ClampedArray(3*o),A=0;A<o;A++){var s=r[A],c=n.getProperty(s,"dimensions").map((function(t){return 255*t}));a[3*A]=c[0],a[3*A+1]=c[1],a[3*A+2]=c[2]}return{type:Ro.UNSIGNED_BYTE,value:a,size:3,normalized:!0}}if(i){for(var u=new Uint8ClampedArray(3*o),l=0;l<o;l++){var g=Ia(e[l]);u[3*l]=g[0],u[3*l+1]=g[1],u[3*l+2]=g[2]}return{type:Ro.UNSIGNED_BYTE,value:u,size:3,normalized:!0}}return e&&e.length===3*o?{type:Ro.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Ro.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}function Ca(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;var ya={};function va(t){return Math.round(t/ya.EPSILON)*ya.EPSILON}function Ba(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=void 0===n?ya.precision||4:n;return t=va(t),"".concat(parseFloat(t.toPrecision(r)))}function ma(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ba(t,e,n){if(ma(t)){n=n||((i=t).clone?i.clone():new Array(i.length));for(var r=0;r<n.length&&r<t.length;++r)n[r]=e(t[r],r,n);return n}var i;return e(t)}function Ea(t,e,n){return ba(t,(function(t){return Math.max(e,Math.min(n,t))}))}function Qa(t,e,n){var r=ya.EPSILON;n&&(ya.EPSILON=n);try{if(t===e)return!0;if(ma(t)&&ma(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Qa(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=ya.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{ya.EPSILON=r}}function Fa(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}ya.EPSILON=1e-12,ya.debug=!1,ya.precision=4,ya.printTypes=!1,ya.printDegrees=!1,ya.printRowMajor=!0;var wa=function(t){Object(s.a)(n,t);var e=Fa(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:ma(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(ya)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Ba(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Qa(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(ya.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Ca(!1),0}},{key:"RANK",get:function(){return Ca(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(St.a)(Array));function Sa(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function Ra(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ua=function(t){Object(s.a)(n,t);var e=Ra(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"copy",value:function(t){return Ca(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Sa(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Sa(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Ca(t>=0&&t<this.ELEMENTS,"index is out of range"),Sa(this[t])}},{key:"setComponent",value:function(t,e){return Ca(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Sa(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Sa(t)}}]),n}(wa);function xa(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ka=function(t){Object(s.a)(n,t);var e=xa(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(A.a)(this,n),t=e.call(this,2),ma(r)&&1===arguments.length?t.copy(r):(ya.debug&&(Sa(r),Sa(i)),t[0]=r,t[1]=i),t}return Object(f.a)(n,[{key:"set",value:function(t,e){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return ya.debug&&(Sa(t.x),Sa(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Dt.j(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o}(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Dt.i(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return Dt.h(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Dt.g(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 2}}]),n}(Ua);function Oa(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Na=[0,0,0],Da={},Ga=function(t){Object(s.a)(n,t);var e=Oa(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&ma(r)?t.copy(r):(ya.debug&&(Sa(r),Sa(i),Sa(o)),t[0]=r,t[1]=i,t[2]=o),t}return Object(f.a)(n,null,[{key:"ZERO",get:function(){return Da.ZERO=Da.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(f.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return ya.debug&&(Sa(t.x),Sa(t.y),Sa(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return Gt.a(this,t)}},{key:"cross",value:function(t){return Gt.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Na:n;return Gt.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Na:n;return Gt.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?Na:n;return Gt.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Gt.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a}(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Gt.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return Gt.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Sa(t)}}]),n}(Ua);Math.PI,Math.PI,Math.PI,Math.PI;function _a(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}new ka,new Ga,new ka,new ka,new Uint8Array(1);function Ma(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return Ea(t,0,e)/e*2-1}function Ta(t){return t<0?-1:1}function ja(t,e,n,r){if(_a(r),t<0||t>n||e<0||e>n)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(n));if(r.x=Ma(t,n),r.y=Ma(e,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*Ta(i),r.y=(1-Math.abs(i))*Ta(r.y)}return r.normalize()}function La(t,e,n){return ja(t,e,255,n)}var Va=new zo;function Za(t,e,n){return t.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){for(var n=new zo,r=new Float32Array(3*t.pointCount),i=0;i<t.pointCount;i++)n.set(e[3*i],e[3*i+1],e[3*i+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(r,3*i);return r}(t,e)):{type:Ro.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function Pa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pa(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ja(t,e,n,r,i){return Ha.apply(this,arguments)}function Ha(){return(Ha=Object(rt.a)(et.a.mark((function t(e,n,r,i,o){var a,A,s;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=fa(e,n,r),r=ha(e,n,r),r=da(e,n,r),Ya(e),a=Xa(e),A=a.featureTable,s=a.batchTable,t.next=7,$a(e,A,s,i,o);case 7:return za(e,A,i),Ka(e,A,s),qa(e,A),t.abrupt("return",r);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ya(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Xa(t){var e=new ta(t.featureTableJson,t.featureTableBinary),n=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=n,t.featuresLength=n,t.pointsLength=n,t.pointCount=n,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",Ro.FLOAT,3);var r=function(t,e){var n=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",Ro.UNSIGNED_SHORT,1),t.batchIds)){var r=e.getGlobalProperty("BATCH_LENGTH");if(!r)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=t.batchTableJson,o=t.batchTableBinary;n=new ga(i,o,r)}return n}(t,e);return{featureTable:e,batchTable:r}}function za(t,e,n){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",Ro.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){var r=e.getPropertyArray("POSITION_QUANTIZED",Ro.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ro.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ro.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Za(t,r,n)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Ka(t,e,n){if(!t.attributes.colors){var r=null;e.hasProperty("RGBA")?(r=e.getPropertyArray("RGBA",Ro.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?r=e.getPropertyArray("RGB",Ro.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(r=e.getPropertyArray("RGB565",Ro.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=pa(t,r,n)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Ro.UNSIGNED_BYTE,4))}function qa(t,e){if(!t.attributes.normals){var n=null;e.hasProperty("NORMAL")?n=e.getPropertyArray("NORMAL",Ro.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(n=e.getPropertyArray("NORMAL_OCT16P",Ro.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){for(var n=new Float32Array(3*t.pointsLength),r=0;r<t.pointsLength;r++)La(e[2*r],e[2*r+1],Va),Va.toArray(n,3*r);return{type:Ro.FLOAT,size:2,value:n}}return{type:Ro.FLOAT,size:2,value:e}}(t,n)}}function $a(t,e,n,r,i){return tA.apply(this,arguments)}function tA(){return(tA=Object(rt.a)(et.a.mark((function t(e,n,r,i,o){var a,A,s,c,u,l,g,f;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(s=c.properties),!(u=n.getExtension("3DTILES_draco_point_compression"))){t.next=15;break}if(A=u.properties,l=u.byteOffset,g=u.byteLength,A&&Number.isFinite(l)&&g){t.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:a=e.featureTableBinary.slice(l,l+g),e.hasPositions=Number.isFinite(A.POSITION),e.hasColors=Number.isFinite(A.RGB)||Number.isFinite(A.RGBA),e.hasNormals=Number.isFinite(A.NORMAL),e.hasBatchIds=Number.isFinite(A.BATCH_ID),e.isTranslucent=Number.isFinite(A.RGBA);case 15:if(a){t.next=17;break}return t.abrupt("return",!0);case 17:return f={buffer:a,properties:Wa(Wa({},A),s),featureTableProperties:A,batchTableProperties:s,dequantizeInShader:!1},t.next=20,eA(e,f,i,o);case 20:return t.abrupt("return",t.sent);case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function eA(t,e,n,r){return nA.apply(this,arguments)}function nA(){return(nA=Object(rt.a)(et.a.mark((function t(e,n,r,i){var o,a,A,s,c,u,l,g,f,h,d,I,p,C;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.parse,t.next=3,o(n.buffer,Eo,{draco:{extraAttributes:n.batchTableProperties||{}}});case 3:if(a=t.sent,A=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,c=a.attributes.NORMAL&&a.attributes.NORMAL.value,u=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=A&&a.attributes.POSITION.value.quantization,g=c&&a.attributes.NORMAL.value.quantization,l&&(f=a.POSITION.data.quantization,h=f.range,e.quantizedVolumeScale=new zo(h,h,h),e.quantizedVolumeOffset=new zo(f.minValues),e.quantizedRange=(1<<f.quantizationBits)-1,e.isQuantizedDraco=!0),g&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0),d={},n.batchTableProperties)for(I=0,p=Object.keys(n.batchTableProperties);I<p.length;I++)C=p[I],a.attributes[C]&&a.attributes[C].value&&(d[C.toLowerCase()]=a.attributes[C].value);e.attributes=Wa({positions:A,colors:pa(e,s),normals:c,batchIds:u},d);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var rA=n(928),iA=n(816),oA=n(456);function aA(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function AA(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;var n=e.baseUri||e.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function sA(t,e,n){var r=t.bufferViews[n];aA(r);var i=e[r.buffer];aA(i);var o=(r.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,r.byteLength)}var cA=n(228);var uA=["SCALAR","VEC2","VEC3","VEC4"],lA=new Map([[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126]]),gA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},fA={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},hA={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function dA(t){return uA[t-1]||uA[0]}function IA(t){var e=lA.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function pA(t,e){var n=hA[t.componentType],r=gA[t.type],i=fA[t.componentType],o=t.count*r,a=t.count*r*i;return aA(a>=0&&a<=e.byteLength),{ArrayType:n,length:o,byteLength:a}}var CA=function(){function t(e){if(Object(A.a)(this,t),e instanceof t)return e;e||(e={json:{asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},buffers:[]}),this.byteLength=0,this.gltf=e,aA(this.gltf.json)}return Object(f.a)(t,[{key:"getApplicationData",value:function(t){return this.json[t]}},{key:"getExtraData",value:function(t){return(this.json.extras||{})[t]}},{key:"getExtension",value:function(t){var e=this.getUsedExtensions().find((function(e){return e===t})),n=this.json.extensions||{};return e?n[t]||!0:null}},{key:"getRequiredExtension",value:function(t){return this.getRequiredExtensions().find((function(e){return e===t}))?this.getExtension(t):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(t,e){return(t.extensions||{})[e]}},{key:"getScene",value:function(t){return this.getObject("scenes",t)}},{key:"getNode",value:function(t){return this.getObject("nodes",t)}},{key:"getSkin",value:function(t){return this.getObject("skins",t)}},{key:"getMesh",value:function(t){return this.getObject("meshes",t)}},{key:"getMaterial",value:function(t){return this.getObject("materials",t)}},{key:"getAccessor",value:function(t){return this.getObject("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this.getObject("textures",t)}},{key:"getSampler",value:function(t){return this.getObject("samplers",t)}},{key:"getImage",value:function(t){return this.getObject("images",t)}},{key:"getBufferView",value:function(t){return this.getObject("bufferViews",t)}},{key:"getBuffer",value:function(t){return this.getObject("buffers",t)}},{key:"getObject",value:function(t,e){if("object"===Object(V.a)(e))return e;var n=this.json[t]&&this.json[t][e];if(!n)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return n}},{key:"getTypedArrayForBufferView",value:function(t){var e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];aA(n);var r=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,t.byteLength)}},{key:"getTypedArrayForAccessor",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=pA(t,e),i=r.ArrayType,o=r.length;return new i(n,e.byteOffset+t.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=e.byteOffset||0;return new Uint8Array(n,r,e.byteLength)}},{key:"addApplicationData",value:function(t,e){return this.json[t]=e,this}},{key:"addExtraData",value:function(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}},{key:"addObjectExtension",value:function(t,e,n){return aA(n),t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}},{key:"setObjectExtension",value:function(t,e,n){(t.extensions||{})[e]=n}},{key:"removeObjectExtension",value:function(t,e){var n=t.extensions||{},r=n[e];return delete n[e],r}},{key:"addExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return aA(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}},{key:"addRequiredExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return aA(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}},{key:"registerUsedExtension",value:function(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(e){return e===t}))||this.json.extensionsUsed.push(t)}},{key:"registerRequiredExtension",value:function(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(e){return e===t}))||this.json.extensionsRequired.push(t)}},{key:"removeExtension",value:function(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}},{key:"addMesh",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=this._addAttributes(t),i={primitives:[{attributes:r,indices:e,mode:n}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}},{key:"addPointCloud",value:function(t){var e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}},{key:"addImage",value:function(t,e){e=e||function(t){var e=Object(cA.a)(t);return e?e.mimeType:null}(t);var n={bufferView:this.addBufferView(t),mimeType:e};return this.json.images=this.json.images||[],this.json.images.push(n),this.json.images.length-1}},{key:"addBufferView",value:function(t){var e=t.byteLength;aA(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);var n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=Object(oA.c)(e),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(t,e){var n={bufferView:t,type:dA(e.size),componentType:e.componentType,count:e.count};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},n=this.addBufferView(t),r={size:e.size,componentType:IA(t),count:Math.round(t.length/e.size)};return this.addAccessor(n,Object.assign(r,e))}},{key:"createBinaryChunk",value:function(){if(!this.arrayBuffer){for(var t=this.byteLength,e=new ArrayBuffer(t),n=new Uint8Array(e),r=0,i=0;i<this.sourceBuffers.length;i++){var o=this.sourceBuffers[i];r=Object(oA.a)(o,n,r)}this.json.buffers[0].byteLength=t,this.arrayBuffer=e,this.sourceBuffers=[]}}},{key:"_removeStringFromArray",value:function(t,e){for(var n=!0;n;){var r=t.indexOf(e);r>-1?t.splice(r,1):n=!1}}},{key:"json",get:function(){return this.gltf.json}}]),t}();function yA(t){var e={};for(var n in t){var r=t[n];if("indices"!==n){var i=vA(r);e[n]=i}}return e}function vA(t,e){var n=function(t,e){var n=t,r=1,i=0;t&&t.value&&(n=t.value,r=t.size||1);n&&(ArrayBuffer.isView(n)||(n=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(n&&!(t instanceof e))return new e(t);return t}(n,Float32Array)),i=n.length/r);return{buffer:n,size:r,count:i}}(t),r=n.buffer,i=n.size;return{value:r,size:i,bufferView:null,byteOffset:0,count:n.count,type:dA(i),componentType:IA(r)}}var BA=et.a.mark(xA);function mA(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return bA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bA(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function bA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function EA(t,e,n){return QA.apply(this,arguments)}function QA(){return(QA=Object(rt.a)(et.a.mark((function t(e,n,r){var i,o,a,A,s;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.gltf.decompressMeshes){t.next=2;break}return t.abrupt("return");case 2:i=new CA(e),o=[],a=mA(xA(i));try{for(a.s();!(A=a.n()).done;)s=A.value,i.getObjectExtension(s,"KHR_draco_mesh_compression")&&o.push(wA(s,i,n,r))}catch(c){a.e(c)}finally{a.f()}return t.next=8,Promise.all(o);case 8:i.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function FA(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new CA(t),i=mA(r.json.meshes||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value;RA(o,n),r.addRequiredExtension("KHR_draco_mesh_compression")}}catch(a){i.e(a)}finally{i.f()}}function wA(t,e,n,r){return SA.apply(this,arguments)}function SA(){return(SA=Object(rt.a)(et.a.mark((function t(e,n,r,i){var o,a,A,s,c;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.getObjectExtension(e,"KHR_draco_mesh_compression"),a=n.getTypedArrayForBufferView(o.bufferView),A=Object(oA.b)(a.buffer,a.byteOffset),s=i.parse,t.next=6,s(A,Eo,r,i);case 6:c=t.sent,e.attributes=yA(c.attributes),c.indices&&(e.indices=vA(c.indices)),UA(e);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function RA(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter||!r.DracoLoader)throw new Error("DracoWriter/DracoLoader not available");var o=r.DracoWriter.encodeSync({attributes:t}),a=i.parseSync,A=a({attributes:t}),s=r._addFauxAttributes(A.attributes),c=r.addBufferView(o),u={primitives:[{attributes:s,mode:n,extensions:Object(nt.a)({},"KHR_draco_mesh_compression",{bufferView:c,attributes:s})}]};return u}function UA(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("Empty glTF primitive detected: Draco decompression failure?")}function xA(t){var e,n,r,i,o,a;return et.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:e=mA(t.json.meshes||[]),A.prev=1,e.s();case 3:if((n=e.n()).done){A.next=24;break}r=n.value,i=mA(r.primitives),A.prev=6,i.s();case 8:if((o=i.n()).done){A.next=14;break}return a=o.value,A.next=12,a;case 12:A.next=8;break;case 14:A.next=19;break;case 16:A.prev=16,A.t0=A.catch(6),i.e(A.t0);case 19:return A.prev=19,i.f(),A.finish(19);case 22:A.next=3;break;case 24:A.next=29;break;case 26:A.prev=26,A.t1=A.catch(1),e.e(A.t1);case 29:return A.prev=29,e.f(),A.finish(29);case 32:case"end":return A.stop()}}),BA,null,[[1,26,29,32],[6,16,19,22]])}function kA(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return OA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OA(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function OA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function NA(t,e){var n=new CA(t),r=n.json,i=n.getExtension("KHR_lights_punctual");i&&(n.json.lights=i.lights,n.removeExtension("KHR_lights_punctual"));var o,a=kA(r.nodes||[]);try{for(a.s();!(o=a.n()).done;){var A=o.value,s=n.getObjectExtension(A,"KHR_lights_punctual");s&&(A.light=s.light),n.removeObjectExtension(A,"KHR_lights_punctual")}}catch(c){a.e(c)}finally{a.f()}}function DA(t,e){var n=new CA(t),r=n.json;if(r.lights){var i=n.addExtension("KHR_lights_punctual");aA(!i.lights),i.lights=r.lights,delete r.lights}if(n.json.lights){var o,a=kA(n.json.lights);try{for(a.s();!(o=a.n()).done;){var A=o.value,s=A.node;n.addObjectExtension(s,"KHR_lights_punctual",A)}}catch(c){a.e(c)}finally{a.f()}delete n.json.lights}}function GA(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return _A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _A(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function _A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function MA(t,e){var n=new CA(t),r=n.json;n.removeExtension("KHR_materials_unlit");var i,o=GA(r.materials||[]);try{for(o.s();!(i=o.n()).done;){var a=i.value;a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),n.removeObjectExtension(a,"KHR_materials_unlit")}}catch(A){o.e(A)}finally{o.f()}}function TA(t,e){var n=new CA(t),r=n.json;if(n.materials){var i,o=GA(r.materials);try{for(o.s();!(i=o.n()).done;){var a=i.value;a.unlit&&(delete a.unlit,n.addObjectExtension(a,"KHR_materials_unlit",{}),n.addExtension("KHR_materials_unlit"))}}catch(A){o.e(A)}finally{o.f()}}}function jA(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return LA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LA(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function LA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function VA(t,e){var n=new CA(t),r=n.json,i=n.getExtension("KHR_techniques_webgl");if(i){var o,a=function(t,e){var n=t.programs,r=void 0===n?[]:n,i=t.shaders,o=void 0===i?[]:i,a=t.techniques,A=void 0===a?[]:a,s=new TextDecoder;return o.forEach((function(t){if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=s.decode(e.getTypedArrayForBufferView(t.bufferView))})),r.forEach((function(t){t.fragmentShader=o[t.fragmentShader],t.vertexShader=o[t.vertexShader]})),A.forEach((function(t){t.program=r[t.program]})),A}(i,n),A=jA(r.materials||[]);try{for(A.s();!(o=A.n()).done;){var s=o.value,c=n.getObjectExtension(s,"KHR_techniques_webgl");c&&(s.technique=Object.assign({},c,a[c.technique]),s.technique.values=PA(s.technique,n)),n.removeObjectExtension(s,"KHR_techniques_webgl")}}catch(u){A.e(u)}finally{A.f()}n.removeExtension("KHR_techniques_webgl")}}function ZA(t,e){}function PA(t,e){var n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((function(e){t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((function(t){"object"===Object(V.a)(n[t])&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}var WA={KHR_draco_mesh_compression:r,KHR_lights_punctual:i,KHR_materials_unlit:o,KHR_techniques_webgl:a};function JA(t){return HA.apply(this,arguments)}function HA(){return(HA=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o,a,A=arguments;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=A.length>1&&void 0!==A[1]?A[1]:{},r=A.length>2?A[2]:void 0,n.gltf=n.gltf||{},t.t0=et.a.keys(WA);case 4:if((t.t1=t.t0()).done){t.next=14;break}if(i=t.t1.value,o=n.gltf.excludeExtensions||{},i in o&&!o[i]){t.next=12;break}return a=WA[i],t.next=12,a.decode(e,n,r);case 12:t.next=4;break;case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function YA(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}function XA(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new DataView(t),i=n.magic,o=void 0===i?1735152710:i,a=r.getUint32(e,!1);return a===o||1735152710===a}function zA(t,e,n,r){Object(on.a)(t.header.byteLength>20);var i=e.getUint32(n+0,!0),o=e.getUint32(n+4,!0);return n+=8,Object(on.a)(0===o),qA(t,e,n,i,r),n+=i,n+=$A(t,e,n,t.header.byteLength,r)}function KA(t,e,n,r){return Object(on.a)(t.header.byteLength>20),function(t,e,n,r){for(;n+8<=t.header.byteLength;){var i=e.getUint32(n+0,!0),o=e.getUint32(n+4,!0);switch(n+=8,o){case 1313821514:qA(t,e,n,i,r);break;case 5130562:$A(t,e,n,i,r);break;case 0:r.glb.strict||qA(t,e,n,i,r);break;case 1:r.glb.strict||$A(t,e,n,i,r)}n+=Object(oA.c)(i)}}(t,e,n,r),n+t.header.byteLength}function qA(t,e,n,r,i){var o=new Uint8Array(e.buffer,n,r),a=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(a),Object(oA.c)(r)}function $A(t,e,n,r,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:e.buffer}),Object(oA.c)(r)}function ts(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return es(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function es(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ns(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return rs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rs(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function rs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var is,os={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},as={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},As=function(){function t(e){Object(A.a)(this,t),this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}return Object(f.a)(t,[{key:"normalize",value:function(t,e){this.json=t.json;var n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t,e){var n,r=new CA(t),i=r.json,o=ts(i.images||[]);try{for(o.s();!(n=o.n()).done;){var a=n.value,A=r.removeObjectExtension(a,"KHR_binary_glTF");A&&Object.assign(a,A)}}catch(s){o.e(s)}finally{o.f()}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var e in os)this._convertTopLevelObjectToArray(t,e)}},{key:"_convertTopLevelObjectToArray",value:function(t,e){var n=t[e];if(n&&!Array.isArray(n))for(var r in t[e]=[],n){var i=n[r];i.id=i.id||r;var o=t[e].length;t[e].push(i),this.idToIndexMap[e][r]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var e in os)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var n,r=ns(t.textures);try{for(r.s();!(n=r.n()).done;){var i=n.value;this._convertTextureIds(i)}}catch(h){r.e(h)}finally{r.f()}var o,a=ns(t.meshes);try{for(a.s();!(o=a.n()).done;){var A=o.value;this._convertMeshIds(A)}}catch(h){a.e(h)}finally{a.f()}var s,c=ns(t.nodes);try{for(c.s();!(s=c.n()).done;){var u=s.value;this._convertNodeIds(u)}}catch(h){c.e(h)}finally{c.f()}var l,g=ns(t.scenes);try{for(g.s();!(l=g.n()).done;){var f=l.value;this._convertSceneIds(f)}}catch(h){g.e(h)}finally{g.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var e,n=ns(t.primitives);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.attributes,o=r.indices,a=r.material;for(var A in i)i[A]=this._convertIdToIndex(i[A],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}catch(s){n.e(s)}finally{n.f()}}},{key:"_convertNodeIds",value:function(t){var e=this;t.children&&(t.children=t.children.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertSceneIds",value:function(t){var e=this;t.nodes&&(t.nodes=t.nodes.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertIdsToIndices",value:function(t,e){var n,r=ns(t[e]);try{for(r.s();!(n=r.n()).done;){var i=n.value;for(var o in i){var a=i[o],A=this._convertIdToIndex(a,o);i[o]=A}}}catch(s){r.e(s)}finally{r.f()}}},{key:"_convertIdToIndex",value:function(t,e){var n=as[e];if(n in this.idToIndexMap){var r=this.idToIndexMap[n][t];if(!Number.isFinite(r))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return r}return t}},{key:"_updateObjects",value:function(t){var e,n=ns(this.json.buffers);try{for(n.s();!(e=n.n()).done;){delete e.value.type}}catch(r){n.e(r)}finally{n.f()}}}]),t}();function ss(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new As).normalize(t,e)}function cs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function us(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cs(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ls={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},fs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},hs={magFilter:fs.TEXTURE_MAG_FILTER,minFilter:fs.TEXTURE_MIN_FILTER,wrapS:fs.TEXTURE_WRAP_S,wrapT:fs.TEXTURE_WRAP_T},ds=(is={},Object(nt.a)(is,fs.TEXTURE_MAG_FILTER,fs.LINEAR),Object(nt.a)(is,fs.TEXTURE_MIN_FILTER,fs.NEAREST_MIPMAP_LINEAR),Object(nt.a)(is,fs.TEXTURE_WRAP_S,fs.REPEAT),Object(nt.a)(is,fs.TEXTURE_WRAP_,fs.REPEAT),is);var Is=function(){function t(){Object(A.a)(this,t)}return Object(f.a)(t,[{key:"postProcess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.json,r=t.buffers,i=void 0===r?[]:r,o=t.images,a=void 0===o?[]:o,A=t.baseUri,s=void 0===A?"":A;return aA(n),this.baseUri=s,this.json=n,this.buffers=i,this.images=a,this._resolveTree(this.json,e),this.json}},{key:"_resolveTree",value:function(t){var e=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.bufferViews&&(t.bufferViews=t.bufferViews.map((function(t,n){return e._resolveBufferView(t,n)}))),t.images&&(t.images=t.images.map((function(t,n){return e._resolveImage(t,n)}))),t.samplers&&(t.samplers=t.samplers.map((function(t,n){return e._resolveSampler(t,n)}))),t.textures&&(t.textures=t.textures.map((function(t,n){return e._resolveTexture(t,n)}))),t.accessors&&(t.accessors=t.accessors.map((function(t,n){return e._resolveAccessor(t,n)}))),t.materials&&(t.materials=t.materials.map((function(t,n){return e._resolveMaterial(t,n)}))),t.meshes&&(t.meshes=t.meshes.map((function(t,n){return e._resolveMesh(t,n)}))),t.nodes&&(t.nodes=t.nodes.map((function(t,n){return e._resolveNode(t,n)}))),t.skins&&(t.skins=t.skins.map((function(t,n){return e._resolveSkin(t,n)}))),t.scenes&&(t.scenes=t.scenes.map((function(t,n){return e._resolveScene(t,n)}))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,e){if("object"===Object(V.a)(e))return e;var n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}},{key:"_resolveScene",value:function(t,e){var n=this;return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((function(t){return n.getNode(t)})),t}},{key:"_resolveNode",value:function(t,e){var n=this;return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((function(t){return n.getNode(t)}))),void 0!==t.mesh&&(t.mesh=this.getMesh(t.mesh)),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,e){var n=this;return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((function(t){var e=(t=us({},t)).attributes;for(var r in t.attributes={},e)t.attributes[r]=n.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=n.getAccessor(t.indices)),void 0!==t.material&&(t.material=n.getMaterial(t.material)),t}))),t}},{key:"_resolveMaterial",value:function(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture=us({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=us({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=us({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.pbrMetallicRoughness){t.pbrMetallicRoughness=us({},t.pbrMetallicRoughness);var n=t.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=us({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=us({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,e){var n,r;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,gs[n]),t.components=(r=t.type,ls[r]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,o=pA(t,t.bufferView),a=o.ArrayType,A=o.length,s=(t.bufferView.byteOffset||0)+i.byteOffset;t.value=new a(i.arrayBuffer,s,A)}return t}},{key:"_resolveTexture",value:function(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):ds,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,e){for(var n in t.id=t.id||"sampler-".concat(e),t.parameters={},t){var r=this._enumSamplerParameter(n);void 0!==r&&(t.parameters[r]=t[n])}return t}},{key:"_enumSamplerParameter",value:function(t){return hs[t]}},{key:"_resolveImage",value:function(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));var n=this.images[e];return n&&(t.image=n),t}},{key:"_resolveBufferView",value:function(t,e){t.id=t.id||"bufferView-".concat(e);var n=t.buffer;t.buffer=this.buffers[n];var r=this.buffers[n].arrayBuffer,i=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(r,i,t.byteLength),t}},{key:"_resolveCamera",value:function(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}]),t}();function ps(t,e){return(new Is).postProcess(t,e)}function Cs(t,e){return ys.apply(this,arguments)}function ys(){return(ys=Object(rt.a)(et.a.mark((function t(e,n){var r,i,o,a,A,s,c=arguments;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=c.length>2&&void 0!==c[2]?c[2]:0,i=c.length>3?c[3]:void 0,o=c.length>4?c[4]:void 0,vs(e,n,r,i),ss(e,{normalize:i.gltf.normalize}),a=[],i.gltf.loadImages&&(A=bs(e,i,o),a.push(A)),!i.gltf.loadBuffers){t.next=10;break}return t.next=10,Bs(e,i,o);case 10:return s=JA(e,i,o),a.push(s),t.next=14,Promise.all(a);case 14:return t.abrupt("return",i.gltf.postProcess?ps(e,i):e);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function vs(t,e,n,r){(r.uri&&(t.baseUri=r.uri),e instanceof ArrayBuffer&&!XA(e,n,r))&&(e=(new TextDecoder).decode(e));if("string"===typeof e)t.json=Object(iA.a)(e);else if(e instanceof ArrayBuffer){var i={};n=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(e));t.type=YA(r,n+0),t.version=r.getUint32(n+4,!0);var i=r.getUint32(n+8,!0);switch(t.header={byteOffset:n,byteLength:i},t.json={},t.binChunks=[],n+=12,t.version){case 1:return zA(t,r,n,{});case 2:return KA(t,r,n,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}(i,e,n,r),aA("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else aA(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var a=t._glb.binChunks;t.buffers[0]={arrayBuffer:a[0].arrayBuffer,byteOffset:a[0].byteOffset,byteLength:a[0].byteLength}}var A=t.json.images||[];t.images=new Array(A.length).fill({})}function Bs(t,e,n){return ms.apply(this,arguments)}function ms(){return(ms=Object(rt.a)(et.a.mark((function t(e,n,r){var i,o,a,A,s,c;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<e.json.buffers.length)){t.next=18;break}if(!(o=e.json.buffers[i]).uri){t.next=15;break}return aA(a=r.fetch),A=AA(o.uri,n),t.next=9,a(A);case 9:return s=t.sent,t.next=12,s.arrayBuffer();case 12:c=t.sent,e.buffers[i]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete o.uri;case 15:++i,t.next=1;break;case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function bs(t,e,n){return Es.apply(this,arguments)}function Es(){return(Es=Object(rt.a)(et.a.mark((function t(e,n,r){var i,o,a;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.json.images||[],o=[],a=0;a<i.length;++a)o.push(Qs(e,i[a],a,n,r));return t.next=5,Promise.all(o);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qs(t,e,n,r,i){return Fs.apply(this,arguments)}function Fs(){return(Fs=Object(rt.a)(et.a.mark((function t(e,n,r,i,o){var a,A,s,c,u,l,g;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.fetch,A=o.parse,!n.uri){t.next=9;break}return c=AA(n.uri,i),t.next=5,a(c);case 5:return u=t.sent,t.next=8,u.arrayBuffer();case 8:s=t.sent;case 9:return Number.isFinite(n.bufferView)&&(l=sA(e.json,e.buffers,n.bufferView),s=Object(oA.b)(l.buffer,l.byteOffset,l.byteLength)),aA(s,"glTF image has no data"),t.next=13,A(s,rA.a,{},o);case 13:g=t.sent,e.images[r]=g;case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ws(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ss(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ws(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Rs={id:"gltf",name:"glTF",version:"2.3.0",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(t){return xs.apply(this,arguments)},options:{gltf:{normalize:!1,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},uri:"",log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}},Us=Rs;function xs(){return(xs=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o,a,A=arguments;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=A.length>1&&void 0!==A[1]?A[1]:{},r=A.length>2?A[2]:void 0,(n=Ss(Ss({},Rs.options),n)).gltf=Ss(Ss({},Rs.options.gltf),n.gltf),ks(n),i=n.byteOffset,o=void 0===i?0:i,a={},t.next=9,Cs(a,e,o,n,r);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ks(t){"fetchImages"in t&&(t.gltf.loadImages=t.fetchImages),"createImages"in t&&(t.gltf.loadImages=t.createImages),"fetchLinkedResources"in t&&(t.gltf.fetchBuffers=t.fetchLinkedResources),"decompress"in t&&(t.gltf.decompressMeshes=t.decompress),"decompress"in t.gltf&&(t.gltf.decompressMeshes=t.gltf.decompress),"postProcess"in t&&(t.gltf.postProcess=t.postProcess)}var Os=0,Ns=1;function Ds(t,e,n){t.rotateYtoZ=!0;var r=t.byteOffset+t.byteLength-n;if(0===r)throw new Error("glTF byte length must be greater than 0.");return t.gltfArrayBuffer=Object(oA.b)(e,n,r),t.gltfByteOffset=0,t.gltfByteLength=r,n%4===0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}function Gs(t,e,n,r){return _s.apply(this,arguments)}function _s(){return(_s=Object(rt.a)(et.a.mark((function t(e,n,r,i){var o,a,A;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=r["3d-tiles"]||{},Ms(e,n,r),!o.loadGLTF){t.next=16;break}if(a=i.parse,A=i.fetch,!e.gltfUrl){t.next=9;break}return t.next=7,A(e.gltfUrl,r);case 7:e.gltfArrayBuffer=t.sent,e.gltfByteOffset=0;case 9:if(!e.gltfArrayBuffer){t.next=16;break}return t.next=12,a(e.gltfArrayBuffer,Us,r,i);case 12:e.gltf=t.sent,delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ms(t,e,n){switch(e){case Os:var r=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(r);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case Ns:break;default:throw new Error("b3dm: Illegal glTF format field")}}function Ts(t,e,n,r,i){return js.apply(this,arguments)}function js(){return(js=Object(rt.a)(et.a.mark((function t(e,n,r,i,o){var a,A;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Ls(e,n,r,i,o),t.next=3,Gs(e,Ns,i,o);case 3:return a=e.gltf||{},(A=a.extensions)&&A.CESIUM_RTC&&(e.rtcCenter=A.CESIUM_RTC.center),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ls(t,e,n,r,i){n=Ds(t,e,n=da(t,e,n=ha(t,e,n=fa(t,e,n))));var o=new ta(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ro.FLOAT,3),n}function Vs(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Zs=function(t){Object(s.a)(n,t);var e=Vs(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"toString",value:function(){var t="[";if(xo.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=To(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(_o);function Ps(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ws=Object.freeze([1,0,0,0,1,0,0,0,1]),Js=Object.freeze([0,0,0,0,0,0,0,0,0]),Hs=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),Ys={},Xs=function(t){Object(s.a)(n,t);var e=Ps(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Hs}}],[{key:"IDENTITY",get:function(){return Ys.IDENTITY=Ys.IDENTITY||Object.freeze(new n(Ws)),Ys.IDENTITY}},{key:"ZERO",get:function(){return Ys.ZERO=Ys.ZERO||Object.freeze(new n(Js)),Ys.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=A,this[6]=n,this[7]=o,this[8]=s,this.check()}},{key:"determinant",value:function(){return jn.b(this)}},{key:"identity",value:function(){return this.copy(Ws)}},{key:"fromQuaternion",value:function(t){return jn.c(this,t),this.check()}},{key:"transpose",value:function(){return jn.i(this,this),this.check()}},{key:"invert",value:function(){return jn.d(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return jn.e(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return jn.e(this,this,t),this.check()}},{key:"rotate",value:function(t){return jn.f(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?jn.g(this,this,t):jn.g(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return jn.h(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=Dt.i(e||[-0,-0],t,this);break;case 3:e=Gt.p(e||[-0,-0,-0],t,this);break;case 4:e=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return jo(e,t.length),e}},{key:"transformVector",value:function(t,e){return Vo("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return Vo("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return Vo("Matrix3.transformVector"),this.transform(t,e)}}]),n}(Zs);function zs(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ks=[0,0,0,1],qs=function(t){Object(s.a)(n,t);var e=zs(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(A.a)(this,n),t=e.call(this,-0,-0,-0,-0),Array.isArray(r)&&1===arguments.length?t.copy(r):t.set(r,i,o,a),t}return Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromMatrix3",value:function(t){return Hn.e(this,t),this.check()}},{key:"identity",value:function(){return Hn.f(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return Hn.p(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"len",value:function(){return Hn.h(this)}},{key:"lengthSquared",value:function(){return Hn.r(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return Hn.d(this,t)}},{key:"rotationTo",value:function(t,e){return Hn.n(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return Hn.a(this,this,t),this.check()}},{key:"calculateW",value:function(){return Hn.b(this,this),this.check()}},{key:"conjugate",value:function(){return Hn.c(this,this),this.check()}},{key:"invert",value:function(){return Hn.g(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return Hn.i(this,t,e,n),this.check()}},{key:"multiplyRight",value:function(t,e){return Uo(!e),Hn.j(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Uo(!e),Hn.j(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return Hn.k(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Hn.l(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Hn.m(this,this,t),this.check()}},{key:"scale",value:function(t){return Hn.o(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){switch(arguments.length){case 1:var r=arguments[0],i=r.start;t=void 0===i?Ks:i,e=r.target,n=r.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],n=o[1],t=this}return Hn.q(this,t,e,n),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return _t.o(e,t,this),jo(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=To(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=To(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=To(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=To(t)}}]),n}(_o);function $s(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var tc=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ec=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),nc=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}),rc={},ic=function(t){Object(s.a)(n,t);var e=$s(n);function n(t){var r;return Object(A.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(f.a)(n,[{key:"INDICES",get:function(){return nc}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return rc.IDENTITY=rc.IDENTITY||Object.freeze(new n(tc)),rc.IDENTITY}},{key:"ZERO",get:function(){return rc.ZERO=rc.ZERO||Object.freeze(new n(ec)),rc.ZERO}}]),Object(f.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(tc)}},{key:"fromQuaternion",value:function(t){return Nt.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):Nt.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],Nt.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return Nt.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return Nt.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return Nt.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return Nt.q(this,this),this.check()}},{key:"invert",value:function(){return Nt.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Nt.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Nt.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return Nt.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Nt.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Nt.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(I.a)(t,3),n=e[0],r=e[1],i=e[2];return this.rotateX(n).rotateY(r).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return Nt.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Nt.o(this,this,t):Nt.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return Nt.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(jo(e=_t.n(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=Dt.j(e||[-0,-0],t,this);break;case 3:e=Gt.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return jo(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=Wo(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return jo(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Vo("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Vo("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Vo("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(Zs);function oc(t,e,n,r,i){return ac.apply(this,arguments)}function ac(){return(ac=Object(rt.a)(et.a.mark((function t(e,n,r,i,o){return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Ac(e,n,r,i,o),t.next=3,Gs(e,e.gltfFormat,i,o);case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ac(t,e,n,r,i){if(n=fa(t,e,n),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));n=ha(t,e,n);var o=new DataView(e);if(t.gltfFormat=o.getUint32(n,!0),n=Ds(t,e,n=da(t,e,n+=4)),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var a=new ta(t.featureTableJson,t.featureTableBinary),A=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=A,!Number.isFinite(A))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ro.FLOAT,3);new ga(t.batchTableJson,t.batchTableBinary,A);return function(t,e,n,r){for(var i=[new Array(r),t._batchTable][0],o=new zo,a=(new zo,new zo,new zo,new Xs),A=new qs,s=new zo,c={},u=new ic,l=[],g=[],f=new zo,h=new zo,d=0;d<r;d++){var I=void 0;if(e.hasProperty("POSITION"))I=e.getProperty("POSITION",Ro.FLOAT,3,d,o);else if(e.hasProperty("POSITION_QUANTIZED")){I=e.getProperty("POSITION_QUANTIZED",Ro.UNSIGNED_SHORT,3,d,o);var p=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ro.FLOAT,3,f);if(!p)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var C=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ro.FLOAT,3,h);if(!C)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var y=0;y<3;y++)I[y]=I[y]/65535*C[y]+p[y]}if(!I)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(I),c.translation=o,t.normalUp=e.getProperty("NORMAL_UP",Ro.FLOAT,3,d,l),t.normalRight=e.getProperty("NORMAL_RIGHT",Ro.FLOAT,3,d,g);if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",Ro.UNSIGNED_SHORT,2,l),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Ro.UNSIGNED_SHORT,2,g),t.octNormalUp){if(!t.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}t.eastNorthUp?(nn.WGS84.eastNorthUpToFixedFrame(o,u),u.getRotationMatrix3(a)):a.identity()}!1,A.fromMatrix3(a),c.rotation=A,s.set(1,1,1);var v=e.getProperty("SCALE",Ro.FLOAT,1,d);Number.isFinite(v)&&s.multiplyByScalar(v);var B=e.getProperty("SCALE_NON_UNIFORM",Ro.FLOAT,3,d,l);B&&s.scale(B),c.scale=s;var m=e.getProperty("BATCH_ID",Ro.UNSIGNED_SHORT,1,d);void 0===m&&(m=d);var b=(new ic).fromQuaternion(c.rotation);u.identity(),u.translate(c.translation),u.multiplyRight(b),u.scale(c.scale);var E=u.clone();i[d]={modelMatrix:E,batchId:m}}t.instances=i}(t,a,0,A),n}function sc(t,e,n,r,i,o){return cc.apply(this,arguments)}function cc(){return(cc=Object(rt.a)(et.a.mark((function t(e,n,r,i,o,a){var A,s;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=fa(e,n,r),A=new DataView(n),e.tilesLength=A.getUint32(r,!0),r+=4,e.tiles=[];case 5:if(!(e.tiles.length<e.tilesLength&&e.byteLength-r>12)){t.next=13;break}return s={},e.tiles.push(s),t.next=10,a(n,r,i,o,s);case 10:r=t.sent,t.next=5;break;case 13:return t.abrupt("return",r);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function uc(t){return lc.apply(this,arguments)}function lc(){return(lc=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o,a=arguments;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:0,r=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,(o=a.length>4&&void 0!==a[4]?a[4]:{}).byteOffset=n,o.type=io(e,n),t.t0=o.type,t.next=t.t0===no.COMPOSITE?9:t.t0===no.BATCHED_3D_MODEL?12:t.t0===no.INSTANCED_3D_MODEL?15:t.t0===no.POINT_CLOUD?18:21;break;case 9:return t.next=11,sc(o,e,n,r,i,uc);case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,Ts(o,e,n,r,i);case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,oc(o,e,n,r,i);case 17:return t.abrupt("return",t.sent);case 18:return t.next=20,Ja(o,e,n,r,i);case 20:return t.abrupt("return",t.sent);case 21:throw new Error("3DTileLoader: unknown type ".concat(o.type));case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gc(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return fc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fc(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hc(t,e){if(t.content){var n=t.content.uri||t.content.url;t.contentUrl="".concat(e.basePath,"/").concat(n)}return t.id=t.contentUrl,t.lodMetricType=si,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=function(t){if(!t.contentUrl)return ni;var e=t.contentUrl.split(".").pop();switch(e){case"pnts":return ii;case"i3dm":case"b3dm":return ri;default:return e}}(t),t.refine=function(t){switch(t){case"REPLACE":case"replace":return ei;case"ADD":case"add":return ti;default:return t}}(t.refine),t}function dc(t){var e=t.basePath,n=hc(t.root,t),r=[];for(r.push(n);r.length>0;){var i,o=gc(r.pop().children||[]);try{for(o.s();!(i=o.n()).done;){var a=i.value;hc(a,{basePath:e}),r.push(a)}}catch(A){o.e(A)}finally{o.f()}}return n}function Ic(t){return an.a.dirname(t.url)}function pc(t,e,n){return Cc.apply(this,arguments)}function Cc(){return(Cc=Object(rt.a)(et.a.mark((function t(e,n,r){var i;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i={}).content=i.content||{},0,t.next=5,uc(e,0,n,r,i.content);case 5:return t.abrupt("return",i.content);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function yc(t,e,n){return vc.apply(this,arguments)}function vc(){return(vc=Object(rt.a)(et.a.mark((function t(e,n,r){var i;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=JSON.parse((new TextDecoder).decode(e))).loader=n.loader||mc,i.url=r.url,i.basePath=Ic(i),i.root=dc(i),i.type=Ai,i.lodMetricType=si,i.lodMetricValue=i.root.lodMetricValue,t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bc(){return(Bc=Object(rt.a)(et.a.mark((function t(e,n,r,i){var o;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n["3d-tiles"]||{},!("auto"===o.isTileset?r.url&&-1!==r.url.indexOf(".json"):o.isTileset)){t.next=8;break}return t.next=5,yc(e,n,r);case 5:e=t.sent,t.next=11;break;case 8:return t.next=10,pc(e,n,r);case 10:e=t.sent;case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var mc={id:"3d-tiles",name:"3D Tiles",version:"2.3.0",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(t,e,n,r){return Bc.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",tile:null,tileset:null}}},bc=mc;function Ec(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ec(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ec(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Fc(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var wc=new Z.b,Sc={getPointColor:[0,0,0],pointSize:1,data:null,loadOptions:{},loader:bc,onTilesetLoad:function(t){},onTileLoad:function(t){},onTileUnload:function(t){},onTileError:function(t,e,n){}},Rc=function(t){Object(s.a)(n,t);var e=Fc(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&ct.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null}}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags;if(e.data&&e.data!==n.data&&this._loadTileset(e.data),r.viewportChanged){var i=this.state.tileset3d;this._updateTileset(i)}}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.sourceLayer,r=this.state.layerMap,i=n&&n.id;if(i){var o=i.substring(this.id.length+1),a=o.substring(o.indexOf("-")+1);e.object=r[a]&&r[a].tile}return e}},{key:"_loadTileset",value:function(){var t=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o,a,A,s;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.props,r=n.loader,i=n.loadOptions,o=Qc({},i),!r.preload){t.next=7;break}return t.next=5,r.preload(e,i);case 5:a=t.sent,Object.assign(o,a);case 7:return t.next=9,Object(ut.a)(e,r,o);case 9:A=t.sent,s=new eo(A,Qc({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError},o)),this.setState({tileset3d:s,layerMap:{}}),this._updateTileset(s),this.props.onTilesetLoad(s);case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_onTileLoad",value:function(t){this.props.onTileLoad(t),this._updateTileset(this.state.tileset3d),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}},{key:"_updateTileset",value:function(t){var e=this.context,n=e.timeline,r=e.viewport;if(n&&r&&t){var i=t.update(r);this.state.frameNumber!==i&&this.setState({frameNumber:i})}}},{key:"_create3DTileLayer",value:function(t){if(!t.content)return null;switch(t.type){case ii:return this._createPointCloudTileLayer(t);case ri:return this._create3DModelTileLayer(t);case oi:return this._createSimpleMeshLayer(t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}},{key:"_createPointCloudTileLayer",value:function(t){var e=t.content,n=e.attributes,r=e.pointCount,i=e.constantRGBA,o=e.cartographicOrigin,a=e.modelMatrix,A=n.positions,s=n.normals,c=n.colors;if(!A)return null;var u=this.props,l=u.pointSize,g=u.getPointColor;return new(this.getSubLayerClass("pointcloud",at.a))({pointSize:l},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),data:{header:{vertexCount:r},attributes:{POSITION:A,NORMAL:s,COLOR_0:c}},coordinateSystem:ot.a.METER_OFFSETS,coordinateOrigin:o,modelMatrix:a,getColor:i||g})}},{key:"_create3DModelTileLayer",value:function(t){var e=t.content,n=e.gltf,r=e.instances,i=e.cartographicOrigin,o=e.modelMatrix;return new(this.getSubLayerClass("scenegraph",At.a))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),data:r||[{}],scenegraph:n,coordinateSystem:ot.a.METER_OFFSETS,coordinateOrigin:i,modelMatrix:o,getTransformMatrix:function(t){return t.modelMatrix},getPosition:function(t){return[0,0,0]}})}},{key:"_createSimpleMeshLayer",value:function(t){for(var e=t.content,n=e.attributes,r=e.modelMatrix,i=e.cartographicOrigin,o=e.texture,a=n.normals,A=n.texCoords,s=new Float32Array(n.positions.value.length),c=0;c<s.length;c+=3)wc.copy(n.positions.value.subarray(c,c+3)),s.set(wc,c);var u=new it.a({drawMode:4,attributes:{positions:s,normals:a,texCoords:A}});return new(this.getSubLayerClass("mesh",st.a))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),mesh:u,data:[{}],getPosition:[0,0,0],getColor:[255,255,255],texture:o,modelMatrix:r,coordinateOrigin:i,coordinateSystem:ot.a.METER_OFFSETS})}},{key:"renderLayers",value:function(){var t=this,e=this.state,n=e.tileset3d,r=e.layerMap;return n?n.tiles.map((function(e){var n=r[e.id]&&r[e.id].layer;return e.selected?(n||(n=t._create3DTileLayer(e),r[e.id]={layer:n,tile:e}),n&&n.props&&!n.props.visible&&(n=n.clone({visible:!0}),r[e.id].layer=n),n):(n&&n.props&&n.props.visible&&(n=n.clone({visible:!1}),r[e.id].layer=n),n)})).filter(Boolean):null}}]),n}(h.a);Rc.layerName="Tile3DLayer",Rc.defaultProps=Sc;var Uc=n(251),xc=n(11),kc=n(14),Oc=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:257;Object(xc.a)(this,t),this.gridSize=e;var n=e-1;if(n&n-1)throw new Error("Expected grid size to be 2^n+1, got ".concat(e,"."));this.numTriangles=n*n*2-2,this.numParentTriangles=this.numTriangles-n*n,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(var r=0;r<this.numTriangles;r++){var i=r+2,o=0,a=0,A=0,s=0,c=0,u=0;for(1&i?A=s=c=n:o=a=u=n;(i>>=1)>1;){var l=o+A>>1,g=a+s>>1;1&i?(A=o,s=a,o=c,a=u):(o=A,a=s,A=c,s=u),c=l,u=g}var f=4*r;this.coords[f+0]=o,this.coords[f+1]=a,this.coords[f+2]=A,this.coords[f+3]=s}}return Object(kc.a)(t,[{key:"createTile",value:function(t){return new Nc(t,this)}}]),t}(),Nc=function(){function t(e,n){Object(xc.a)(this,t);var r=n.gridSize;if(e.length!==r*r)throw new Error("Expected terrain data of length ".concat(r*r," (").concat(r," x ").concat(r,"), got ").concat(e.length,"."));this.terrain=e,this.martini=n,this.errors=new Float32Array(e.length),this.update()}return Object(kc.a)(t,[{key:"update",value:function(){for(var t=this.martini,e=t.numTriangles,n=t.numParentTriangles,r=t.coords,i=t.gridSize,o=this.terrain,a=this.errors,A=e-1;A>=0;A--){var s=4*A,c=r[s+0],u=r[s+1],l=r[s+2],g=r[s+3],f=c+l>>1,h=u+g>>1,d=f+h-u,I=h+c-f,p=(o[u*i+c]+o[g*i+l])/2,C=h*i+f,y=Math.abs(p-o[C]);if(a[C]=Math.max(a[C],y),A<n){var v=(u+I>>1)*i+(c+d>>1),B=(g+I>>1)*i+(l+d>>1);a[C]=Math.max(a[C],a[v],a[B])}}}},{key:"getMesh",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.martini,n=e.gridSize,r=e.indices,i=this.errors,o=0,a=0,A=n-1;function s(e,A,c,u,l,g){var f=e+c>>1,h=A+u>>1;Math.abs(e-l)+Math.abs(A-g)>1&&i[h*n+f]>t?(s(l,g,e,A,f,h),s(c,u,l,g,f,h)):(r[A*n+e]=r[A*n+e]||++o,r[u*n+c]=r[u*n+c]||++o,r[g*n+l]=r[g*n+l]||++o,a++)}r.fill(0),s(0,0,A,A,A,0),s(A,A,0,0,0,A);var c=new Uint16Array(2*o),u=new Uint32Array(3*a),l=0;function g(e,o,a,A,s,f){var h=e+a>>1,d=o+A>>1;if(Math.abs(e-s)+Math.abs(o-f)>1&&i[d*n+h]>t)g(s,f,e,o,h,d),g(a,A,s,f,h,d);else{var I=r[o*n+e]-1,p=r[A*n+a]-1,C=r[f*n+s]-1;c[2*I]=e,c[2*I+1]=o,c[2*p]=a,c[2*p+1]=A,c[2*C]=s,c[2*C+1]=f,u[l++]=I,u[l++]=p,u[l++]=C}}return g(0,0,A,A,A,0),g(A,A,0,0,0,A),{vertices:c,triangles:u}}}]),t}();function Dc(t){if(!t||!t.POSITION)return null;var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,A=t.POSITION.value,s=A&&A.length;if(!s)return null;for(var c=0;c<s;c+=3){var u=A[c],l=A[c+1],g=A[c+2];e=u<e?u:e,n=l<n?l:n,r=g<r?g:r,i=u>i?u:i,o=l>o?l:o,a=g>a?g:a}return[[e,n,r],[i,o,a]]}function Gc(t,e){if(null===t)return null;var n=e.meshMaxError,r=e.bounds,i=e.elevationDecoder,o=t.data,a=t.width,A=a+1,s=function(t,e,n){for(var r=n.rScaler,i=n.bScaler,o=n.gScaler,a=n.offset,A=e+1,s=new Float32Array(A*A),c=0,u=0;u<e;u++)for(var l=0;l<e;l++,c++){var g=4*c,f=t[g+0],h=t[g+1],d=t[g+2];s[c+u]=f*r+h*o+d*i+a}for(var I=A*(A-1),p=0;p<A-1;p++,I++)s[I]=s[I-A];for(var C=A-1,y=0;y<A;y++,C+=A)s[C]=s[C-1];return s}(o,a,i),c=new Oc(A).createTile(s).getMesh(n),u=c.vertices,l=c.triangles,g=function(t,e,n,r){for(var i=n+1,o=t.length/2,a=new Float32Array(3*o),A=new Float32Array(2*o),s=r||[0,0,n,n],c=Object(I.a)(s,4),u=c[0],l=c[1],g=c[2],f=c[3],h=(g-u)/n,d=(f-l)/n,p=0;p<o;p++){var C=t[2*p],y=t[2*p+1],v=y*i+C;a[3*p+0]=C*h+u,a[3*p+1]=-y*d+f,a[3*p+2]=e[v],A[2*p+0]=C/n,A[2*p+1]=y/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:A,size:2}}}(u,s,a,r);return{loaderData:{header:{}},header:{vertexCount:l.length,boundingBox:Dc(g)},mode:4,indices:{value:l,size:1},attributes:g}}function _c(){return(_c=Object(rt.a)(et.a.mark((function t(e,n,r){var i;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.image=n.image||{},n.image.type="data",t.next=4,r.parse(e,n,n.baseUri);case 4:return i=t.sent,t.abrupt("return",Gc(i,n.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mc(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var jc=Tc(Tc({},{id:"terrain",name:"Terrain",version:"2.3.7",extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("2.3.7","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}}),{},{parse:function(t,e,n){return _c.apply(this,arguments)}}),Lc=n(143);function Vc(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}function Zc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zc(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Wc=[1],Jc=Pc(Pc({},x.a.defaultProps),{},{elevationData:Lc.f,texture:Lc.f,meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0});function Hc(t){return Array.isArray(t)?t.join(";"):t}var Yc=function(t){Object(s.a)(n,t);var e=Vc(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=e.elevationData!==n.elevationData;if(r){var i=e.elevationData,o=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:o})}var a=r||e.meshMaxError!==n.meshMaxError||e.elevationDecoder!==n.elevationDecoder||e.bounds!==n.bounds;if(!this.state.isTiled&&a){var A=this.loadTerrain(e);this.setState({terrain:A})}}},{key:"loadTerrain",value:function(t){var e=t.elevationData,n=t.bounds,r=t.elevationDecoder,i=t.meshMaxError,o=t.workerUrl;if(!e)return null;var a={terrain:{bounds:n,meshMaxError:i,elevationDecoder:r}};return null!==o&&(a.terrain.workerUrl=o),Object(ut.a)(e,jc,a)}},{key:"getTiledTerrainData",value:function(t){var e=this.props,n=e.elevationData,r=e.texture,i=e.elevationDecoder,o=e.meshMaxError,a=e.workerUrl,A=Object(Lc.b)(n,t),s=Object(Lc.b)(r,t),c=t.bbox,u=t.z,l=new Uc.a({longitude:(c.west+c.east)/2,latitude:(c.north+c.south)/2,zoom:u}),g=l.projectFlat([c.west,c.south]),f=l.projectFlat([c.east,c.north]),h=[g[0],g[1],f[0],f[1]],d=this.loadTerrain({elevationData:A,bounds:h,elevationDecoder:i,meshMaxError:o,workerUrl:a}),I=s?Object(ut.a)(s).catch((function(t){return null})):Promise.resolve(null);return Promise.all([d,I])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",st.a),n=t.data,r=t.color;if(!n)return null;var i=Object(I.a)(n,2),o=i[0],a=i[1];return new e(t,{data:Wc,mesh:o,texture:a,coordinateSystem:ot.a.CARTESIAN,getPosition:function(t){return[0,0,0]},getColor:r})}},{key:"onViewportLoad",value:function(t){if(t&&0!==t.length&&!t.every((function(t){return!t}))){var e=this.state.zRange,n=t.filter(Boolean).map((function(t){return t[0].header.boundingBox.map((function(t){return t[2]}))})),r=Math.min.apply(Math,Object(lt.a)(n.map((function(t){return t[0]})))),i=Math.max.apply(Math,Object(lt.a)(n.map((function(t){return t[1]}))));(!e||r<e[0]||i>e[1])&&this.setState({zRange:[r,i]})}}},{key:"renderLayers",value:function(){var t=this.props,e=t.color,n=t.material,r=t.elevationData,i=t.texture,o=t.wireframe,a=t.meshMaxError,A=t.elevationDecoder,s=t.tileSize,c=t.maxZoom,u=t.minZoom,l=t.extent,g=t.maxRequests;return this.state.isTiled?new x.a(this.getSubLayerProps({id:"tiles"}),{wireframe:o,color:e,material:n,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Hc(r),texture:Hc(i),meshMaxError:a,elevationDecoder:A}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:c,minZoom:u,extent:l,maxRequests:g}):new(this.getSubLayerClass("mesh",st.a))(this.getSubLayerProps({id:"mesh"}),{data:Wc,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:n,wireframe:o})}}]),n}(h.a);Yc.layerName="TerrainLayer",Yc.defaultProps=Jc;var Xc=n(838),zc=n.n(Xc),Kc=function(){function t(e,n,r,i,o){Object(A.a)(this,t),this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields($c,this,n)}return Object(f.a)(t,null,[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),Object(f.a)(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,a=0,A=[];t.pos<n;){if(i<=0){var s=t.readVarint();r=7&s,i=s>>3}if(i--,1===r||2===r)o+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&A.push(e),e=[]),e.push(new zc.a(o,a));else{if(7!==r)throw new Error("unknown command ".concat(r));e&&e.push(e[0].clone())}}return e&&A.push(e),A}},{key:"bbox",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,A=-1/0,s=1/0,c=-1/0;t.pos<e;){if(r<=0){var u=t.readVarint();n=7&u,r=u>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>A&&(A=i),(o+=t.readSVarint())<s&&(s=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command ".concat(n))}return[a,s,A,c]}},{key:"toGeoJSON",value:function(e,n,r){var i,o,a=this.extent*Math.pow(2,r),A=this.extent*e,s=this.extent*n,c=this.loadGeometry(),u=t.types[this.type];function l(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+s)/a;t[e]=[360*(n.x+A)/a-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var g=[];for(i=0;i<c.length;i++)g[i]=c[i][0];l(c=g);break;case 2:for(i=0;i<c.length;i++)l(c[i]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=qc(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(c),i=0;i<c.length;i++)for(o=0;o<c[i].length;o++)l(c[i][o])}return 1===c.length?c=c[0]:u="Multi".concat(u),{type:"Feature",geometry:{type:u,coordinates:c},properties:this.properties}}}]),t}();function qc(t){for(var e,n,r=0,i=0,o=t.length-1;i<t.length;o=i++)e=t[i],r+=((n=t[o]).x-e.x)*(e.y+n.y);return r}function $c(t,e,n){1===t?e.id=n.readVarint():2===t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos)}var tu=function(){function t(e,n){Object(A.a)(this,t),this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(eu,this,n),this.length=this._features.length}return Object(f.a)(t,[{key:"feature",value:function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Kc(this._pbf,e,this.extent,this._keys,this._values)}}]),t}();function eu(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}var nu=function t(e,n){Object(A.a)(this,t),this.layers=e.readFields(ru,{},n)};function ru(t,e,n){if(3===t){var r=new tu(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}function iu(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return ou(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ou(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function au(t){var e,n,r=0,i=0,o=0,a=0,A=0,s=0,c=0,u=0,l=0,g=new Set,f={},h=iu(t);try{for(h.s();!(e=h.n()).done;){var d=e.value,I=d.geometry;switch(I.type){case"Point":i++,r++,g.add(I.coordinates.length);break;case"MultiPoint":i++,r+=I.coordinates.length;var p,C=iu(I.coordinates);try{for(C.s();!(p=C.n()).done;){var y=p.value;g.add(y.length)}}catch(j){C.e(j)}finally{C.f()}break;case"LineString":A++,o+=I.coordinates.length,a++;var v,B=iu(I.coordinates);try{for(B.s();!(v=B.n()).done;){var m=v.value;g.add(m.length)}}catch(j){B.e(j)}finally{B.f()}break;case"MultiLineString":A++;var b,E=iu(I.coordinates);try{for(E.s();!(b=E.n()).done;){var Q=b.value;o+=Q.length,a++;var F,w=iu(Q);try{for(w.s();!(F=w.n()).done;){var S=F.value;g.add(S.length)}}catch(j){w.e(j)}finally{w.f()}}}catch(j){E.e(j)}finally{E.f()}break;case"Polygon":l++,c++,u+=I.coordinates.length,s+=Cu(I.coordinates).length;var R,U=iu(Cu(I.coordinates));try{for(U.s();!(R=U.n()).done;){var x=R.value;g.add(x.length)}}catch(j){U.e(j)}finally{U.f()}break;case"MultiPolygon":l++;var k,O=iu(I.coordinates);try{for(O.s();!(k=O.n()).done;){var N=k.value;c++,u+=N.length,s+=Cu(N).length;var D,G=iu(Cu(N));try{for(G.s();!(D=G.n()).done;){var _=D.value;g.add(_.length)}}catch(j){G.e(j)}finally{G.f()}}}catch(j){O.e(j)}finally{O.f()}break;default:throw new Error("Unsupported geometry type: ".concat(I.type))}if(d.properties)for(var M in d.properties){var T=d.properties[M];f[M]=f[M]||void 0===f[M]?(n=T,Number.isFinite(n)):f[M]}}}catch(j){h.e(j)}finally{h.f()}return{pointPositionsCount:r,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:a,lineFeaturesCount:A,coordLength:Math.max.apply(Math,Object(lt.a)(g)),polygonPositionsCount:s,polygonObjectsCount:c,polygonRingsCount:u,polygonFeaturesCount:l,numericPropKeys:Object.keys(f).filter((function(t){return f[t]}))}}function Au(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.pointPositionsCount,i=e.pointFeaturesCount,o=e.linePositionsCount,a=e.linePathsCount,A=e.lineFeaturesCount,s=e.polygonPositionsCount,c=e.polygonObjectsCount,u=e.polygonRingsCount,l=e.polygonFeaturesCount,g=n.coordLength,f=n.numericPropKeys,h=n.PositionDataType,d=void 0===h?Float32Array:h,I=t.length>65535?Uint32Array:Uint16Array,p={positions:new d(r*g),globalFeatureIds:new I(r),featureIds:i>65535?new Uint32Array(r):new Uint16Array(r),numericProps:{},properties:[]},C={pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new d(o*g),globalFeatureIds:new I(o),featureIds:A>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[]},y={polygonIndices:s>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:s>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new d(s*g),globalFeatureIds:new I(s),featureIds:l>65535?new Uint32Array(s):new Uint16Array(s),numericProps:{},properties:[]},v=0,B=[p,C,y];v<B.length;v++){var m,b=B[v],E=iu(f);try{for(E.s();!(m=E.n()).done;){var Q=m.value;b.numericProps[Q]=new Float32Array(b.positions.length/g)}}catch(k){E.e(k)}finally{E.f()}}C.pathIndices[a]=o,y.polygonIndices[c]=s,y.primitivePolygonIndices[u]=s;var F,w={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},S=iu(t);try{for(S.s();!(F=S.n()).done;){var R=F.value,U=R.geometry,x=R.properties;switch(U.type){case"Point":su(U.coordinates,p,w,g,x),p.properties.push(Iu(x,f)),w.pointFeature++;break;case"MultiPoint":cu(U.coordinates,p,w,g,x),p.properties.push(Iu(x,f)),w.pointFeature++;break;case"LineString":uu(U.coordinates,C,w,g,x),C.properties.push(Iu(x,f)),w.lineFeature++;break;case"MultiLineString":lu(U.coordinates,C,w,g,x),C.properties.push(Iu(x,f)),w.lineFeature++;break;case"Polygon":gu(U.coordinates,y,w,g,x),y.properties.push(Iu(x,f)),w.polygonFeature++;break;case"MultiPolygon":fu(U.coordinates,y,w,g,x),y.properties.push(Iu(x,f)),w.polygonFeature++;break;default:throw new Error("Invalid geometry type")}w.feature++}}catch(k){S.e(k)}finally{S.f()}return hu(p,C,y,g)}function su(t,e,n,r,i){e.positions.set(t,n.pointPosition*r),e.globalFeatureIds[n.pointPosition]=n.feature,e.featureIds[n.pointPosition]=n.pointFeature,du(e,i,n.pointPosition,1),n.pointPosition++}function cu(t,e,n,r,i){var o,a=iu(t);try{for(a.s();!(o=a.n()).done;){su(o.value,e,n,r,i)}}catch(A){a.e(A)}finally{a.f()}}function uu(t,e,n,r,i){e.pathIndices[n.linePath]=n.linePosition,n.linePath++,pu(e.positions,t,n.linePosition,r);var o=t.length;du(e,i,n.linePosition,o),e.globalFeatureIds.set(new Uint32Array(o).fill(n.feature),n.linePosition),e.featureIds.set(new Uint32Array(o).fill(n.lineFeature),n.linePosition),n.linePosition+=o}function lu(t,e,n,r,i){var o,a=iu(t);try{for(a.s();!(o=a.n()).done;){uu(o.value,e,n,r,i)}}catch(A){a.e(A)}finally{a.f()}}function gu(t,e,n,r,i){e.polygonIndices[n.polygonObject]=n.polygonPosition,n.polygonObject++;var o,a=iu(t);try{for(a.s();!(o=a.n()).done;){var A=o.value;e.primitivePolygonIndices[n.polygonRing]=n.polygonPosition,n.polygonRing++,pu(e.positions,A,n.polygonPosition,r);var s=A.length;du(e,i,n.polygonPosition,s),e.globalFeatureIds.set(new Uint32Array(s).fill(n.feature),n.polygonPosition),e.featureIds.set(new Uint32Array(s).fill(n.polygonFeature),n.polygonPosition),n.polygonPosition+=s}}catch(c){a.e(c)}finally{a.f()}}function fu(t,e,n,r,i){var o,a=iu(t);try{for(a.s();!(o=a.n()).done;){gu(o.value,e,n,r,i)}}catch(A){a.e(A)}finally{a.f()}}function hu(t,e,n,r){var i={points:{positions:{value:t.positions,size:r},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:t.numericProps,properties:t.properties},lines:{pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:r},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:e.numericProps,properties:e.properties},polygons:{polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},positions:{value:n.positions,size:r},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:n.numericProps,properties:n.properties}};for(var o in i)for(var a in i[o].numericProps)i[o].numericProps[a]={value:i[o].numericProps[a],size:1};return i}function du(t,e,n,r){for(var i in t.numericProps)i in e&&t.numericProps[i].set(new Array(r).fill(e[i]),n)}function Iu(t,e){for(var n in t)e.includes(n)&&delete t[n];return t}function pu(t,e,n,r){var i,o=n*r,a=iu(e);try{for(a.s();!(i=a.n()).done;){var A=i.value;t.set(A,o),o+=r}}catch(s){a.e(s)}finally{a.f()}}function Cu(t){var e;return(e=[]).concat.apply(e,Object(lt.a)(t))}var yu=n(837),vu=n.n(yu),Bu=["Unknown","Point","LineString","Polygon"];function mu(t,e){for(var n=0;n<t.length;n++){var r=t[n];t[n]=[r.x/e.extent,r.y/e.extent]}}function bu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return t},n=Bu[t.type],r=t.loadGeometry();switch(t.type){case 1:for(var i=[],o=0;o<r.length;o++)i[o]=r[o][0];e(r=i,t);break;case 2:for(var a=0;a<r.length;a++)e(r[a],t);break;case 3:r=Qu(r);for(var A=0;A<r.length;A++)for(var s=0;s<r[A].length;s++)e(r[A][s],t)}return Eu(n,t,r)}function Eu(t,e,n){var r=t;1===n.length?n=n[0]:r="Multi".concat(t);var i={type:"Feature",geometry:{type:r,coordinates:n},properties:e.properties||{}};return"id"in e&&(i.id=e.id),i}function Qu(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=Fu(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&i.push(n),i}function Fu(t){for(var e,n,r=t.length,i=0,o=0,a=r-1;o<r;a=o++)e=t[o],i+=((n=t[a]).x-e.x)*(e.y+n.y);return i}function wu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Su(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wu(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ru(t,e){if((e=e||{}).mvt=e.mvt||{},e.gis=e.gis||{},0===t.byteLength)return[];var n=new nu(new vu.a(t)),r=e.mvt,i=[];if((Array.isArray(r.layers)?r.layers:Object.keys(n.layers)).forEach((function(t){var e=n.layers[t],o=Su(Su({},r),{},{layerName:t});if(e)for(var a=0;a<e.length;a++){var A=Uu(e.feature(a),o);i.push(A)}})),"binary"===e.gis.format){var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=au(t);return Au(t,n,{coordLength:e.coordLength||n.coordLength,numericPropKeys:e.numericPropKeys||n.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}(i);return o.byteLength=t.byteLength,o}return i}function Uu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="wgs84"===e.coordinates,r=e.tileIndex&&Number.isFinite(e.tileIndex.x)&&Number.isFinite(e.tileIndex.y)&&Number.isFinite(e.tileIndex.z);if(n&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.");var i=n&&r?t.toGeoJSON(e.tileIndex.x,e.tileIndex.y,e.tileIndex.z):bu(t,mu);return e.layerProperty&&(i.properties[e.layerProperty]=e.layerName),i}function xu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ku(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xu(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ou=ku(ku({},{id:"mvt",name:"Mapbox Vector Tile",version:"2.3.7",extensions:["mvt"],mimeTypes:["application/x-protobuf"],category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null,_format:"geojson",workerUrl:"https://unpkg.com/@loaders.gl/mvt@".concat("2.3.7","/dist/mvt-loader.worker.js")}}}),{},{parse:function(){var t=Object(rt.a)(et.a.mark((function t(e,n){return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ru(e,n));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),parseSync:Ru,binary:!0}),Nu=n(815);function Du(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Gu={clipBounds:[0,0,1,1]},_u="\nuniform vec4 clip_bounds;\n\nbool clip_isInBounds(vec2 position) {\n  return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];\n}\n",Mu={name:"clip-vs",vs:_u},Tu={"vs:#decl":"\nvarying float clip_isVisible;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));\n","fs:#decl":"\nvarying float clip_isVisible;\n","fs:DECKGL_FILTER_COLOR":"\n  if (clip_isVisible < 0.5) discard;\n"},ju={name:"clip-fs",fs:_u},Lu={"vs:#decl":"\nvarying vec2 clip_commonPosition;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_commonPosition = geometry.position.xy;\n","fs:#decl":"\nvarying vec2 clip_commonPosition;\n","fs:DECKGL_FILTER_COLOR":"\n  if (!clip_isInBounds(clip_commonPosition)) discard;\n"},Vu=function(t){Object(s.a)(n,t);var e=Du(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"getShaders",value:function(){var t="instancePositions"in this.getAttributeManager().attributes;return"clipByInstance"in this.props&&(t=this.props.clipByInstance),this.state.clipByInstance=t,t?{modules:[Mu],inject:Tu}:{modules:[ju],inject:Lu}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props.clipBounds,r=void 0===n?Gu.clipBounds:n;if(this.state.clipByInstance)e.clip_bounds=r;else{var i=this.projectPosition([r[0],r[1],0]),o=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],o[0]),Math.min(i[1],o[1]),Math.max(i[0],o[0]),Math.max(i[1],o[1])]}}}]),n}(Nu.a);function Zu(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Pu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pu(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Pu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ju(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wu(Object(n),!0).forEach((function(e){Object(nt.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hu(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(u.a)(t);if(e){var i=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}Vu.extensionName="ClipExtension",Vu.defaultProps=Gu;function Yu(t){return Xu.apply(this,arguments)}function Xu(){return(Xu=Object(rt.a)(et.a.mark((function t(e){return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(ut.a)(e);case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),new Error("An error occurred fetching TileJSON: ".concat(t.t0));case 9:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}var zu=function(t){Object(s.a)(n,t);var e=Hu(n);function n(){return Object(A.a)(this,n),e.apply(this,arguments)}return Object(f.a)(n,[{key:"initializeState",value:function(){Object(k.a)(Object(u.a)(n.prototype),"initializeState",this).call(this),this.setState({data:null,tileJSON:null})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.context,o=t.changeFlags;if(o.dataChanged&&this._updateTileData({props:e}),this.state.data){Object(k.a)(Object(u.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,context:i,changeFlags:o});var a=this.state.tileset;o.viewportChanged&&a.isLoaded&&this._onViewportChange()}}},{key:"_updateTileData",value:function(){var t=Object(rt.a)(et.a.mark((function t(e){var n,r,i,o,a,A;return et.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.props,r=this.props.onDataLoad,i=n.data,o=null,a=n.minZoom,A=n.maxZoom,"string"!==typeof i||Object(Lc.c)(i)){t.next=13;break}return this.setState({data:null,tileJSON:null}),t.next=9,Yu(i);case 9:o=t.sent,r&&r(o),t.next=14;break;case 13:i.tilejson&&(o=i);case 14:o&&(i=o.tiles,Number.isFinite(o.minzoom)&&o.minzoom>a&&(a=o.minzoom),Number.isFinite(o.maxzoom)&&(!Number.isFinite(A)||o.maxzoom<A)&&(A=o.maxzoom)),this.setState({data:i,tileJSON:o,minZoom:a,maxZoom:A});case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"renderLayers",value:function(){return this.state.data?Object(k.a)(Object(u.a)(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(t){var e=Object(Lc.b)(this.state.data,t);if(!e)return Promise.reject("Invalid URL");var n=this.getLoadOptions();return n=Ju(Ju({},n),{},{mvt:Ju(Ju({},n&&n.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:t.x,y:t.y,z:t.z}})}),Object(ut.a)(e,Ou,n)}},{key:"renderSubLayers",value:function(t){var e=t.tile,r=Math.pow(2,e.z),i=512/r,o=-i,a=512*e.x/r,A=512*(1-e.y/r),s=(new Z.a).scale([i,o,1]);return t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=s,t.coordinateOrigin=[a,A,0],t.coordinateSystem=ot.a.CARTESIAN,t.extensions=[].concat(Object(lt.a)(t.extensions||[]),[new Vu])),Object(k.a)(Object(u.a)(n.prototype),"renderSubLayers",this).call(this,t)}},{key:"onHover",value:function(t,e){var r=this.props,i=r.uniqueIdProperty;if(r.autoHighlight){var o,a=this.state.hoveredFeatureId,A=t.object;A&&(o=Ku(A,i)),a!==o&&this.setState({hoveredFeatureId:o})}return Object(k.a)(Object(u.a)(n.prototype),"onHover",this).call(this,t,e)}},{key:"getHighlightedObjectIndex",value:function(t){var e=this.state.hoveredFeatureId,n=this.props,r=n.uniqueIdProperty,i=n.highlightedFeatureId,o=t.data;if(!(qu(e)||qu(i))||!Array.isArray(o))return-1;var a=qu(i)?i:e;return o.findIndex((function(t){return Ku(t,r)===a}))}},{key:"_pickObjects",value:function(t){var e=this.context,n=e.deck,r=e.viewport,i=r.width,o=r.height,a=r.x,A=r.y,s=[this.id];return n.pickObjects({x:a,y:A,width:i,height:o,layerIds:s,maxObjects:t})}},{key:"getRenderedFeatures",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this._pickObjects(e),r=new Set,i=[],o=Zu(n);try{for(o.s();!(t=o.n()).done;){var a=t.value,A=Ku(a.object,this.props.uniqueIdProperty);-1===A?i.push(a.object):r.has(A)||(r.add(A),i.push(a.object))}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"_onViewportChange",value:function(){var t=this.props.onViewportChange;if(t){var e=this.context.viewport;t({getRenderedFeatures:this.getRenderedFeatures.bind(this),viewport:e})}}},{key:"_onViewportLoad",value:function(){Object(k.a)(Object(u.a)(n.prototype),"_onViewportLoad",this).call(this),this._onViewportChange()}},{key:"isLoaded",get:function(){return this.state.data&&this.state.tileset&&Object(k.a)(Object(u.a)(n.prototype),"isLoaded",this)}}]),n}(x.a);function Ku(t,e){return e?t.properties[e]:"id"in t?t.id:-1}function qu(t){return void 0!==t&&null!==t&&""!==t}zu.layerName="MVTLayer",zu.defaultProps={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,onViewportChange:{type:"function",optional:!0,value:null,compare:!1}},n.d(e,"GreatCircleLayer",(function(){return g})),n.d(e,"S2Layer",(function(){return U})),n.d(e,"TileLayer",(function(){return x.a})),n.d(e,"TripsLayer",(function(){return N})),n.d(e,"H3ClusterLayer",(function(){return L})),n.d(e,"H3HexagonLayer",(function(){return $})),n.d(e,"Tile3DLayer",(function(){return Rc})),n.d(e,"TerrainLayer",(function(){return Yc})),n.d(e,"MVTLayer",(function(){return zu}))},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(2),a=n(371),A=n(53),s=n(153),c=n(44),u=n(144);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractiveStateChange:e.onInteractiveStateChange},Object.seal(this),this.setProps(e)}return Object(o.a)(t,[{key:"finalize",value:function(){for(var t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}},{key:"updateViewStates",value:function(){for(var t in this.controllers){var e=this.controllers[t];e&&e.updateTransition()}}},{key:"getViewports",value:function(t){return t?this._viewports.filter((function(e){return e.containsPixel(t)})):this._viewports}},{key:"getViews",value:function(){var t={};return this.views.forEach((function(e){t[e.id]=e})),t}},{key:"getView",value:function(t){return"string"===typeof t?this.views.find((function(e){return e.id===t})):t}},{key:"getViewState",value:function(t){var e=this.getView(t),n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}},{key:"getViewport",value:function(t){return this._viewportMap[t]}},{key:"unproject",value:function(t,e){for(var n=this.getViewports(),r={x:t[0],y:t[1]},i=n.length-1;i>=0;--i){var o=n[i];if(o.containsPixel(r)){var a=t.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,e)}}return null}},{key:"setProps",value:function(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}},{key:"_update",value:function(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}},{key:"_setSize",value:function(t,e){Object(A.a)(Number.isFinite(t)&&Number.isFinite(e)),t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(t){t=Object(u.b)(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}},{key:"_setViewState",value:function(t){t?(!Object(s.a)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):c.a.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange(e)}},{key:"_createController",value:function(t,e){return new(0,e.type)(g({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange,makeViewport:t._getViewport.bind(t)},e))}},{key:"_updateController",value:function(t,e,n,r){var i=t.controller;return i?(i=g(g(g(g({},e),t.props),i),{},{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height}),r?r.setProps(i):r=this._createController(t,i),r):null}},{key:"_rebuildViewports",value:function(){var t=this.width,e=this.height,n=this.views,r=this.controllers;this._viewports=[],this.controllers={};for(var i=n.length;i--;){var o=n[i],a=this.getViewState(o),A=o.makeViewport({width:t,height:e,viewState:a});this.controllers[o.id]=this._updateController(o,a,A,r[o.id]),this._viewports.unshift(A)}for(var s in r)r[s]&&!this.controllers[s]&&r[s].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var t=this;this._viewportMap={},this._viewports.forEach((function(e){e.id&&(t._viewportMap[e.id]=t._viewportMap[e.id]||e)}))}},{key:"_diffViews",value:function(t,e){return t.length!==e.length||t.some((function(n,r){return!t[r].equals(e[r])}))}}]),t}(),h=n(367),d=n(305);function I(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var C=new d.a,y=function(){function t(){Object(i.a)(this,t),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return Object(o.a)(t,[{key:"setProps",value:function(t){"effects"in t&&(t.effects.length===this.effects.length&&Object(s.a)(t.effects,this.effects)||(this.setEffects(t.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=t,this._createInternalEffects()}},{key:"cleanup",value:function(){var t,e=I(this.effects);try{for(e.s();!(t=e.n()).done;){t.value.cleanup()}}catch(i){e.e(i)}finally{e.f()}var n,r=I(this._internalEffects);try{for(r.s();!(n=r.n()).done;){n.value.cleanup()}}catch(i){r.e(i)}finally{r.f()}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some((function(t){return t instanceof d.a}))||this._internalEffects.push(C)}}]),t}(),v=n(227),B=n(374),m=n(133),b=n(218),E=n(19),Q=n(358),F=n(296),w={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function S(t){var e=t.pickedColors,n=t.layers,r=t.deviceX,i=t.deviceY,o=t.deviceRadius,a=t.deviceRect;if(e){for(var A=a.x,s=a.y,u=a.width,l=a.height,g=o*o,f=-1,h=0,d=0;d<l;d++){var I=d+s-i,p=I*I;if(p>g)h+=4*u;else for(var C=0;C<u;C++){if(e[h+3]-1>=0){var y=C+A-r,v=y*y+p;v<=g&&(g=v,f=h)}h+=4}}if(f>=0){var B=e[f+3]-1,m=e.slice(f,f+4),b=n[B];if(b){var E=b.decodePickingColor(m),Q=Math.floor(f/4/u);return{pickedColor:m,pickedLayer:b,pickedObjectIndex:E,pickedX:A+(f/4-Q*u),pickedY:s+Q}}c.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return w}function R(t){var e=t.pickInfo,n=t.viewports,r=t.pixelRatio,i=t.x,o=t.y,a=t.z,A={viewports:n}.viewports[0],s=A&&A.unproject([i-A.x,o-A.y],{targetZ:a});return{color:null,layer:null,index:-1,picked:!1,x:i,y:o,pixel:[i,o],coordinate:s,lngLat:s,devicePixel:e&&[e.pickedX,e.pickedY],pixelRatio:r}}function U(t){var e=t.pickInfo,n=t.lastPickedInfo,r=t.mode,i=t.layers,o=e.pickedColor,a=e.pickedLayer,A=e.pickedObjectIndex,s=a?[a]:[];if("hover"===r){var c=n.index,u=n.layerId,l=a&&a.props.id;if(l!==u||A!==c){if(l!==u){var g=i.find((function(t){return t.props.id===u}));g&&s.unshift(g)}n.layerId=l,n.index=A,n.info=null}}var f=R(t),h=new Map;return h.set(null,f),s.forEach((function(t){var e=Object.assign({},f);if(t===a&&(e.color=o,e.index=A,e.picked=!0),e=x({layer:t,info:e,mode:r}),t===a&&"hover"===r&&(n.info=e),e&&h.set(e.layer.id,e),"hover"===r&&t.props.autoHighlight){var i={pickingSelectedColor:a===t?o:null},s=t.props.highlightColor;a===t&&"function"===typeof s&&(i.pickingHighlightColor=s(e)),t.setModuleParameters(i),t.setNeedsRedraw()}})),h}function x(t){for(var e=t.layer,n=t.info,r=t.mode;e&&n;){var i=n.layer||e;n.layer=e,n=e.getPickingInfo({info:n,mode:r,sourceLayer:i}),e=e.parent}return n}function k(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var N=function(){function t(e){Object(i.a)(this,t),this.gl=e,this.pickingFBO=null,this.pickLayersPass=new F.a(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null},this._onError=null}return Object(o.a)(t,[{key:"setProps",value:function(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"onError"in t&&(this._onError=t.onError),"_pickable"in t&&(this._pickable=t._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}},{key:"pickObject",value:function(t){return this._pickClosestObject(t)}},{key:"pickObjects",value:function(t){return this._pickVisibleObjects(t)}},{key:"getLastPickedObject",value:function(t){var e=t.x,n=t.y,r=t.layers,i=t.viewports,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,a=o&&o.layer&&o.layer.id,A=a?r.find((function(t){return t.id===a})):null,s=i[0]&&i[0].unproject([e,n]),c={x:e,y:n,coordinate:s,lngLat:s,layer:A};return A?Object.assign({},o,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"_resizeBuffer",value:function(){var t=this.gl;return this.pickingFBO||(this.pickingFBO=new m.a(t),m.a.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new m.a(t),this.depthFBO.attach(Object(r.a)({},36064,new b.a(t,{format:Object(E.g)(t)?34836:6408,type:5126}))))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}},{key:"_getPickable",value:function(t){if(!1===this._pickable)return null;var e=t.filter((function(t){return t.isPickable()&&!t.isComposite}));return e.length>255?(c.a.warn("Too many pickable layers, only picking the first 255")(),e.slice(0,255)):e.length?e:null}},{key:"_pickClosestObject",value:function(t){var e=t.layers,n=t.views,r=t.viewports,i=t.x,o=t.y,a=t.radius,A=void 0===a?0:a,s=t.depth,c=void 0===s?1:s,u=t.mode,l=void 0===u?"query":u,g=t.unproject3D,f=t.onViewportActive;if(!(e=this._getPickable(e)))return{result:[],emptyInfo:R({viewports:r,x:i,y:o})};this._resizeBuffer();for(var h,d=Object(E.c)(this.gl),I=Object(E.b)(this.gl,[i,o],!0),p=[I.x+Math.floor(I.width/2),I.y+Math.floor(I.height/2)],C=Math.round(A*d),y=this.pickingFBO,v=y.width,B=y.height,m=this._getPickingRect({deviceX:p[0],deviceY:p[1],deviceRadius:C,deviceWidth:v,deviceHeight:B}),b=[],Q={},F=0;F<c;F++){var w=S({pickedColors:m&&this._drawAndSample({layers:e,views:n,viewports:r,onViewportActive:f,deviceRect:m,pass:"picking:".concat(l),redrawReason:l}),layers:e,deviceX:p[0],deviceY:p[1],deviceRadius:C,deviceRect:m}),x=void 0;if(w.pickedLayer&&g&&this.depthFBO)x=this._drawAndSample({layers:[w.pickedLayer],views:n,viewports:r,onViewportActive:f,deviceRect:{x:w.pickedX,y:w.pickedY,width:1,height:1},pass:"picking:".concat(l),redrawReason:"pick-z",pickZ:!0})[0]*r[0].distanceScales.metersPerUnit[2]+r[0].position[2];if(w.pickedColor&&F+1<c){var O=w.pickedColor[3]-1;Q[O]=!0,e[O].clearPickingColor(w.pickedColor)}var N,D=k((h=U({pickInfo:w,lastPickedInfo:this.lastPickedInfo,mode:l,layers:e,viewports:r,x:i,y:o,z:x,pixelRatio:d})).values());try{for(D.s();!(N=D.n()).done;){var G=N.value;G.layer&&b.push(G)}}catch(M){D.e(M)}finally{D.f()}if(!w.pickedColor)break}for(var _ in Q)e[_].restorePickingColors();return{result:b,emptyInfo:h&&h.get(null)}}},{key:"_pickVisibleObjects",value:function(t){var e=t.layers,n=t.views,r=t.viewports,i=t.x,o=t.y,a=t.width,A=void 0===a?1:a,s=t.height,u=void 0===s?1:s,l=t.mode,g=void 0===l?"query":l,f=t.maxObjects,h=void 0===f?null:f,d=t.onViewportActive;if(!(e=this._getPickable(e)))return[];this._resizeBuffer();for(var I=Object(E.c)(this.gl),p=Object(E.b)(this.gl,[i,o],!0),C=p.x,y=p.y+p.height,v=Object(E.b)(this.gl,[i+A,o+u],!0),B=v.x+v.width,m=v.y,b={x:C,y:m,width:B-C,height:y-m},Q=function(t){var e=t.pickedColors,n=t.layers,r=new Map;if(e)for(var i=0;i<e.length;i+=4){var o=e[i+3]-1;if(o>=0){var a=e.slice(i,i+4),A=a.join(",");if(!r.has(A)){var s=n[o];s?r.set(A,{pickedColor:a,pickedLayer:s,pickedObjectIndex:s.decodePickingColor(a)}):c.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(r.values())}({pickedColors:this._drawAndSample({layers:e,views:n,viewports:r,onViewportActive:d,deviceRect:b,pass:"picking:".concat(g),redrawReason:g}),layers:e}),F=new Map,w=Number.isFinite(h),S=0;S<Q.length&&!(w&&F.size>=h);S++){var R=Q[S],U={color:R.pickedColor,layer:null,index:R.pickedObjectIndex,picked:!0,x:i,y:o,width:A,height:u,pixelRatio:I};U=x({layer:R.pickedLayer,info:U,mode:g}),F.has(U.object)||F.set(U.object,U)}return Array.from(F.values())}},{key:"_drawAndSample",value:function(t){var e=t.layers,n=t.views,r=t.viewports,i=t.onViewportActive,o=t.deviceRect,a=t.pass,s=t.redrawReason,c=t.pickZ;if(Object(A.a)(o.width>0&&o.height>0),e.length<1)return null;var u=c?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,onError:this._onError,views:n,viewports:r,onViewportActive:i,pickingFBO:u,deviceRect:o,pass:a,redrawReason:s,pickZ:c});var l=o.x,g=o.y,f=o.width,h=o.height,d=new(c?Float32Array:Uint8Array)(f*h*4);return Object(Q.c)(u,{sourceX:l,sourceY:g,sourceWidth:f,sourceHeight:h,target:d}),d}},{key:"_getPickingRect",value:function(t){var e=t.deviceX,n=t.deviceY,r=t.deviceRadius,i=t.deviceWidth,o=t.deviceHeight,a=Math.max(0,e-r),A=Math.max(0,n-r),s=Math.min(i,e+r+1)-a,c=Math.min(o,n+r+1)-A;return s<=0||c<=0?null:{x:a,y:A,width:s,height:c}}}]),t}(),D={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},G=function(){function t(e){Object(i.a)(this,t);var n=e.parentElement;n&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,D),n.appendChild(this.el))}return Object(o.a)(t,[{key:"setTooltip",value:function(t,e,n){var r=this.el;if("string"===typeof t)r.innerText=t;else{if(!t)return void(r.style.display="none");"text"in t&&(r.innerText=t.text),"html"in t&&(r.innerHTML=t.html),"className"in t&&(r.className=t.className),Object.assign(r.style,t.style)}r.style.display="block",r.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"remove",value:function(){this.el&&this.el.remove()}}]),t}(),_=n(123),M=n(395),T=n(58),j=n(932),L=n(925),V=n(247),Z=n(309),P=n(17),W=n(248),J=n.n(W),H={mousedown:1,mousemove:2,mouseup:4};!function(t){var e=t.prototype.handler;t.prototype.handler=function(t){var n=this.store;t.button>0&&(function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(n,(function(e){return e.pointerId===t.pointerId}))||n.push(t)),e.call(this,t)}}(J.a.PointerEventInput),J.a.MouseInput.prototype.handler=function(t){var e=H[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};var Y=J.a.Manager,X=J.a,z=X?[[X.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[X.Rotate,{enable:!1}],[X.Pinch,{enable:!1}],[X.Swipe,{enable:!1}],[X.Pan,{threshold:0,enable:!1}],[X.Press,{enable:!1}],[X.Tap,{event:"doubletap",taps:2,enable:!1}],[X.Tap,{event:"anytap",enable:!1}],[X.Tap,{enable:!1}]]:null,K={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},q={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},tt=["keydown","keyup"],et=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],nt=["wheel","mousewheel","DOMMouseScroll"],rt={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},it={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ot=n(187),at=-1!==ot.b.indexOf("firefox"),At=nt,st=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},o),this.events=At.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent,!!ot.a&&{passive:!1})}))}return Object(o.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){var e=t.deltaY;ot.c.WheelEvent&&(at&&t.deltaMode===ot.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=ot.c.devicePixelRatio),t.deltaMode===ot.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625===0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}},{key:"_onWheel",value:function(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),ct=et,ut=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},o),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ct.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(o.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:"pointerover",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:"pointerout",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleMoveEvent",value:function(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),lt=tt,gt=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},o),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=lt.concat(o.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=o.tabIndex||0,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(o.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),ft=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},r),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return Object(o.a)(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){"contextmenu"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),ht=n(27),dt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var It={srcElement:"root",priority:0},pt=function(){function t(e){Object(i.a)(this,t),this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return Object(o.a)(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;n&&("object"!==Object(ht.a)(n)||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},It,n):It;var A=a.get(n.srcElement);A||(A=[],a.set(n.srcElement,A));var s={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};r&&(s.once=!0),i&&(s.passive=!0),o.push(s),this._active=this._active||!s.passive;for(var c=A.length-1;c>=0&&!(A[c].priority>=s.priority);)c--;A.splice(c+1,0,s)}},{key:"remove",value:function(t,e){for(var n=this.handlers,r=this.handlersByElement,i=n.length-1;i>=0;i--){var o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);var a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=n.some((function(t){return!t.passive}))}},{key:"handleEvent",value:function(t){if(!this.isEmpty()){for(var e=this._normalizeEvent(t),n=t.srcEvent.target;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}}},{key:"_emit",value:function(t,e){var n=this.handlersByElement.get(e);if(n){for(var r=!1,i=function(){t.handled=!0},o=function(){t.handled=!0,r=!0},a=[],A=0;A<n.length;A++){var s=n[A],c=s.type,u=s.handler,l=s.once;if(u(Object.assign({},t,{type:c,stopPropagation:i,stopImmediatePropagation:o})),l&&a.push(n[A]),r)break}for(var g=0;g<a.length;g++){var f=a[g],h=f.type,d=f.handler;this.remove(h,d)}}}},{key:"_normalizeEvent",value:function(t){var e=this.eventManager.element;return Object.assign({},t,function(t){var e=dt[t.srcEvent.type];if(!e)return null;var n=t.srcEvent,r=n.buttons,i=n.button,o=n.which,a=!1,A=!1,s=!1;return 4===e||2===e&&!Number.isFinite(r)?(a=1===o,A=2===o,s=3===o):2===e?(a=Boolean(1&r),A=Boolean(4&r),s=Boolean(2&r)):1===e&&(a=0===i,A=1===i,s=2===i),{leftButton:a,middleButton:A,rightButton:s}}(t),function(t,e){var n=t.srcEvent;if(!t.center&&!Number.isFinite(n.clientX))return null;var r=t.center||{x:n.clientX,y:n.clientY},i=e.getBoundingClientRect(),o=i.width/e.offsetWidth,a=i.height/e.offsetHeight;return{center:r,offsetCenter:{x:(r.x-i.left-e.clientLeft)/o,y:(r.y-i.top-e.clientTop)/a}}}(t,e),{handled:!1,rootElement:e})}}]),t}();function Ct(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return yt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var vt={events:null,recognizers:null,recognizerOptions:{},Manager:Y,touchAction:"none",tabIndex:0},Bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),this.options=Object.assign({},vt,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var r=n.events;r&&this.on(r)}return Object(o.a)(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,r=n.Manager;for(var i in this.manager=new r(t,{touchAction:n.touchAction,recognizers:n.recognizers||z}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(K).forEach((function(t){var n=e.manager.get(t);n&&K[t].forEach((function(t){n.recognizeWith(t)}))})),n.recognizerOptions){var o=this.manager.get(i);if(o){var a=n.recognizerOptions[i];delete a.enable,o.set(a)}}this.wheelInput=new st(t,this._onOtherEvent,{enable:!1}),this.moveInput=new ut(t,this._onOtherEvent,{enable:!1}),this.keyInput=new gt(t,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new ft(t,this._onOtherEvent,{enable:!1});var A,s=Ct(this.events);try{for(s.s();!(A=s.n()).done;){var c=Object(P.a)(A.value,2),u=c[0],l=c[1];l.isEmpty()||(this._toggleRecognizer(l.recognizerName,!0),this.manager.on(u,l.handleEvent))}}catch(g){s.e(g)}finally{s.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,n){this._addEventHandler(t,e,n,!1)}},{key:"once",value:function(t,e,n){this._addEventHandler(t,e,n,!0)}},{key:"watch",value:function(t,e,n){this._addEventHandler(t,e,n,!1,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});var i=q[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=n.get(i);e?(o.requireFailure(t),r.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,n,r,i){if("string"===typeof t){var o=this.manager,a=this.events,A=it[t]||t,s=a.get(A);s||(s=new pt(this),a.set(A,s),s.recognizerName=rt[A]||A,o&&o.on(A,s.handleEvent)),s.add(t,e,n,r,i),s.isEmpty()||this._toggleRecognizer(s.recognizerName,!0)}else for(var c in n=e,t)this._addEventHandler(c,t[c],n,r,i)}},{key:"_removeEventHandler",value:function(t,e){if("string"===typeof t){var n=this.events,r=it[t]||t,i=n.get(r);if(i&&(i.remove(t,e),i.isEmpty())){var o,a=i.recognizerName,A=!1,s=Ct(n.values());try{for(s.s();!(o=s.n()).done;){var c=o.value;if(c.recognizerName===a&&!c.isEmpty()){A=!0;break}}}catch(l){s.e(l)}finally{s.f()}A||this._toggleRecognizer(a,!1)}}else for(var u in t)this._removeEventHandler(u,t[u])}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,n=$[e.type];n&&this.manager.emit(n,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}(),mt=n(40);function bt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?bt(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Ft(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ft(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wt(){}n.d(e,"a",(function(){return Rt}));var St={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:wt,onResize:wt,onViewStateChange:wt,onBeforeRender:wt,onAfterRender:wt,onLoad:wt,onError:null,_onMetrics:null,getCursor:function(t){return t.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Rt=function(){function t(e){Object(i.a)(this,t),e=Object.assign({},St,e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),e.viewState&&e.initialViewState&&c.a.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Object(T.getBrowser)()&&c.a.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!==typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new Z.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&_.a.setProps(e._typedArrayManagerProps),this.animationLoop.start()}return Object(o.a)(t,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&c.a.removed("onLayerHover","onHover")(),"onLayerClick"in t&&c.a.removed("onLayerClick","onClick")(),t.initialViewState&&!Object(s.a)(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);var e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(t),r=this.layerManager.needsRedraw(t),i=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||n||r||i||o}},{key:"redraw",value:function(t){if(this.layerManager){var e=t||this.needsRedraw({clearRedrawFlags:!0});e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(t){return this.viewManager.getViewports(t)}},{key:"pickObject",value:function(t){var e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}},{key:"pickMultipleObjects",value:function(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}},{key:"pickObjects",value:function(t){return this._pick("pickObjects","pickObjects Time",t)}},{key:"_addResources",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}},{key:"_removeResources",value:function(t){var e,n=Qt(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.layerManager.resourceManager.remove(r)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_pick",value:function(t,e,n){var r=this.stats;r.get("Pick Count").incrementCount(),r.get(e).timeStart();var i=this.deckPicker[t](Object.assign({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport},n));return r.get(e).timeEnd(),i}},{key:"_createCanvas",value:function(t){var e=t.canvas;("string"===typeof e&&(e=document.getElementById(e),Object(A.a)(e)),e)||(e=document.createElement("canvas"),(t.parent||document.body).appendChild(e));var n=t.id,r=t.style;return e.id=n,Object.assign(e.style,r),e}},{key:"_setCanvasSize",value:function(t){if(this.canvas){var e=t.width,n=t.height;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var t=this.width,e=this.height;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var t=this.canvas;if(!t)return!1;var e=t.clientWidth||t.width,n=t.clientHeight||t.height;return(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(t){var e=this,n=t.width,r=t.height,i=t.gl,o=t.glOptions,a=t.debug,A=t.useDevicePixels,s=t.autoResizeDrawingBuffer;return new j.a({width:n,height:r,useDevicePixels:A,autoResizeDrawingBuffer:s,autoResizeViewport:!1,gl:i,onCreateContext:function(t){return Object(E.a)(Object.assign({},o,t,{canvas:e.canvas,debug:a}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:t.onBeforeRender,onAfterRender:t.onAfterRender,onError:t.onError})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var t=this.props.views||[new h.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}},{key:"_onPointerMove",value:function(t){var e=this._pickRequest;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;var n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}},{key:"_pickAndCallback",value:function(){var t=this._pickRequest;if(t.event){var e,n=this._pick("pickObject","pickObject Time",t),r=n.result,i=n.emptyInfo,o=!1,a=Qt(r);try{for(a.s();!(e=a.n()).done;){var A=e.value;i=A,o=A.layer.onHover(A,t.event)}}catch(c){a.e(c)}finally{a.f()}if(!o&&this.props.onHover&&this.props.onHover(i,t.event),this.props.getTooltip){var s=this.props.getTooltip(i);this.tooltip.setTooltip(s,i.x,i.y)}t.event=null}}},{key:"_updateCursor",value:function(){var t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_setGLContext",value:function(t){if(!this.layerManager){this.canvas||(this.canvas=t.canvas,Object(E.e)(t,{enable:!0,copyState:!0})),this.tooltip=new G(this.canvas),Object(E.k)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);var e=new L.a;for(var n in e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new Bt(this.props.parent||t.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),mt.b)this.eventManager.on(n,this._onEvent);this.viewManager=new f({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});var r=this.viewManager.getViewports()[0];this.layerManager=new a.a(t,{deck:this,stats:this.stats,viewport:r,timeline:e}),this.effectManager=new y,this.deckRenderer=new B.a(t),this.deckPicker=new N(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(t,e){var n=this.layerManager.context.gl;Object(E.k)(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(Object.assign({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(t){var e=t.gl;this._setGLContext(e)}},{key:"_onRenderFrame",value:function(t){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),c.a.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(t){var e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=Et(Et({},this.viewState),{},Object(r.a)({},t.viewId,e)),this.props.viewState||this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractiveStateChange",value:function(t){var e=t.isDragging,n=void 0!==e&&e;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(t){var e=mt.b[t.type],n=t.offsetCenter;if(e&&n){var r=this.layerManager.getLayers(),i=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:r,viewports:this.getViewports(n)},this._lastPointerDownInfo),o=i.layer,a=o&&(o[e.handler]||o.props[e.handler]),A=this.props[e.handler],s=!1;a&&(s=a.call(o,i,t)),!s&&A&&A(i,t)}}},{key:"_onPointerDown",value:function(t){var e=t.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:e.x,y:e.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var t=this.stats;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();var e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var t=this.metrics,e=this.stats;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();var n=V.a.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}]),t}();Rt.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(v.a)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},Rt.defaultProps=St,Rt.VERSION=M.a.VERSION},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(436),l=n(252),g=n(379),f=n(235);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return I}));var d={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},I=function(t){Object(a.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvec3 splitLine(vec3 a, vec3 b, float x) {\n  float t = (x - a.x) / (b.x - a.x);\n  return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  vec3 source_world = instanceSourcePositions;\n  vec3 target_world = instanceTargetPositions;\n  vec3 source_world_64low = instanceSourcePositions64Low;\n  vec3 target_world_64low = instanceTargetPositions64Low;\n\n  if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n    source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n    target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n    float deltaLng = target_world.x - source_world.x;\n\n    if (deltaLng * useShortestPath > 180.) {\n      source_world.x += 360. * useShortestPath;\n      source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      source_world_64low = vec3(0.0);\n    } else if (deltaLng * useShortestPath < -180.) {\n      target_world.x += 360. * useShortestPath;\n      target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      target_world_64low = vec3(0.0);\n    } else if (useShortestPath < 0.) {\n      gl_Position = vec4(0.);\n      return;\n    }\n  }\n  vec4 source_commonspace;\n  vec4 target_commonspace;\n  vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n  vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale),\n    widthMinPixels, widthMaxPixels\n  );\n  float segmentIndex = positions.x;\n  vec4 p = mix(source, target, segmentIndex);\n  geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n  uv = positions.xy;\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n  vec3 offset = vec3(\n    getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;if(Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i}),i.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.widthUnits,o=r.widthScale,a=r.widthMinPixels,A=r.widthMaxPixels,s=r.wrapLongitude,c="pixels"===i?n.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({widthScale:o*c,widthMinPixels:a,widthMaxPixels:A,useShortestPath:s?1:0}).draw(),s&&this.state.model.setUniforms({useShortestPath:-1}).draw()}},{key:"_getModel",value:function(t){return new g.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new f.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0}))}},{key:"wrapLongitude",get:function(){return!1}}]),n}(l.a);I.layerName="LineLayer",I.defaultProps=d},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(44),c=n(360),u=n(334),l=n(226),g=n(253),f=n(295);function h(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},i=n.startRow,o=void 0===i?0:i,a=n.endRow,A=void 0===a?t.length:a,c=o;c<A;c++){var u=t[c];s.a.assert(u&&u.geometry,"GeoJSON does not have geometry");var l=u.geometry;if("GeometryCollection"===l.type){s.a.assert(Array.isArray(l.geometries),"GeoJSON does not have geometries array");for(var g=l.geometries,f=0;f<g.length;f++){var h=g[f];d(h,r,e,u,c)}}else d(l,r,e,u,c)}return r}function d(t,e,n,r,i){var o=t.type,a=t.coordinates,A=e.pointFeatures,c=e.lineFeatures,u=e.polygonFeatures,l=e.polygonOutlineFeatures;if(function(t,e){var n=I[t];s.a.assert(n,"Unknown GeoJSON type ".concat(t));for(;e&&--n>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,a))switch(o){case"Point":A.push(n({geometry:t},r,i));break;case"MultiPoint":a.forEach((function(t){A.push(n({geometry:{type:"Point",coordinates:t}},r,i))}));break;case"LineString":c.push(n({geometry:t},r,i));break;case"MultiLineString":a.forEach((function(t){c.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}));break;case"Polygon":u.push(n({geometry:t},r,i)),a.forEach((function(t){l.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}));break;case"MultiPolygon":a.forEach((function(t){u.push(n({geometry:{type:"Polygon",coordinates:t}},r,i)),t.forEach((function(t){l.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}))}))}else s.a.warn("".concat(o," coordinates are malformed"))()}var I={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function p(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}n.d(e,"a",(function(){return b}));var v=[0,0,0,255],B={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusUnits:"meters",pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,getLineColor:{type:"accessor",value:v},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};function m(t){return t.geometry.coordinates}var b=function(t){Object(o.a)(n,t);var e=y(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"initializeState",value:function(){this.state={features:{}},this.props.getLineDashArray&&s.a.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=t.props,n=t.changeFlags;if(n.dataChanged){var r=function(t){if(Array.isArray(t))return t;switch(s.a.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return s.a.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),i=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var o=this.state.features,a={},A={};for(var c in o)a[c]=o[c].slice(),A[c]=[];var u,l=p(n.dataChanged);try{for(l.s();!(u=l.n()).done;){var g=u.value,d=h(r,i,g);for(var I in o)A[I].push(Object(f.a)({data:a[I],getIndex:function(t){return t.__source.index},dataRange:g,replace:d[I]}))}}catch(C){l.e(C)}finally{l.f()}this.setState({features:a,featuresDiff:A})}else this.setState({features:h(r,i),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var t=this.state,e=t.features,n=t.featuresDiff,r=e.pointFeatures,i=e.lineFeatures,o=e.polygonFeatures,a=e.polygonOutlineFeatures,A=this.props,s=A.stroked,c=A.filled,f=A.extruded,h=A.wireframe,d=A.material,I=A.transitions,p=this.props,C=p.lineWidthUnits,y=p.lineWidthScale,B=p.lineWidthMinPixels,b=p.lineWidthMaxPixels,E=p.lineJointRounded,Q=p.lineMiterLimit,F=p.pointRadiusUnits,w=p.pointRadiusScale,S=p.pointRadiusMinPixels,R=p.pointRadiusMaxPixels,U=p.elevationScale,x=p.lineDashJustified,k=this.props,O=k.getLineColor,N=k.getFillColor,D=k.getRadius,G=k.getLineWidth,_=k.getLineDashArray,M=k.getElevation,T=k.updateTriggers,j=this.getSubLayerClass("polygons-fill",g.a),L=this.getSubLayerClass("polygons-stroke",l.a),V=this.getSubLayerClass("line-strings",l.a),Z=this.getSubLayerClass("points",u.a),P=this.shouldRenderSubLayer("polygons-fill",o)&&new j({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:f,elevationScale:U,filled:c,wireframe:h,material:d,getElevation:this.getSubLayerAccessor(M),getFillColor:this.getSubLayerAccessor(N),getLineColor:this.getSubLayerAccessor(f&&h?O:v),transitions:I&&{getPolygon:I.geometry,getElevation:I.getElevation,getFillColor:I.getFillColor,getLineColor:I.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:T.getElevation,getFillColor:T.getFillColor,lineColors:f&&h,getLineColor:T.getLineColor}}),{data:o,getPolygon:m});return[!f&&P,!f&&s&&this.shouldRenderSubLayer("polygons-stroke",a)&&new L({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:C,widthScale:y,widthMinPixels:B,widthMaxPixels:b,rounded:E,miterLimit:Q,dashJustified:x,getColor:this.getSubLayerAccessor(O),getWidth:this.getSubLayerAccessor(G),getDashArray:this.getSubLayerAccessor(_),transitions:I&&{getPath:I.geometry,getColor:I.getLineColor,getWidth:I.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:T.getLineColor,getWidth:T.getLineWidth,getDashArray:T.getLineDashArray}}),{data:a,getPath:m}),this.shouldRenderSubLayer("linestrings",i)&&new V({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:C,widthScale:y,widthMinPixels:B,widthMaxPixels:b,rounded:E,miterLimit:Q,dashJustified:x,getColor:this.getSubLayerAccessor(O),getWidth:this.getSubLayerAccessor(G),getDashArray:this.getSubLayerAccessor(_),transitions:I&&{getPath:I.geometry,getColor:I.getLineColor,getWidth:I.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:T.getLineColor,getWidth:T.getLineWidth,getDashArray:T.getLineDashArray}}),{data:i,getPath:m}),this.shouldRenderSubLayer("points",r)&&new Z({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:s,filled:c,radiusUnits:F,radiusScale:w,radiusMinPixels:S,radiusMaxPixels:R,lineWidthUnits:C,lineWidthScale:y,lineWidthMinPixels:B,lineWidthMaxPixels:b,getFillColor:this.getSubLayerAccessor(N),getLineColor:this.getSubLayerAccessor(O),getRadius:this.getSubLayerAccessor(D),getLineWidth:this.getSubLayerAccessor(G),transitions:I&&{getPosition:I.geometry,getFillColor:I.getFillColor,getLineColor:I.getLineColor,getRadius:I.getRadius,getLineWidth:I.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:T.getFillColor,getLineColor:T.getLineColor,getRadius:T.getRadius,getLineWidth:T.getLineWidth}}),{data:r,getPosition:m,highlightedObjectIndex:this._getHighlightedIndex(r)}),f&&P]}},{key:"_getHighlightedIndex",value:function(t){var e=this.props.highlightedObjectIndex;return Number.isFinite(e)?t.findIndex((function(t){return t.__source.index===e})):null}}]),n}(c.a);b.layerName="GeoJsonLayer",b.defaultProps=B},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(381);function a(){return i.a.useContext(o.a)}},,,,,,,,,,,,,,,function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,i=n;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}},function(t,e,n){var r=n(329),i=n(345),o=n(454),a=n(192);t.exports=function(t,e,n){if(!a(n))return!1;var A=typeof e;return!!("number"==A?i(n)&&o(e,n.length):"string"==A&&e in n)&&r(n[e],t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(109);function i(t,e,n,r){var i=n[0],o=n[1],a=t[0],A=t[1],s=e[0],c=e[1],u=s-a,l=c-A;return 0===(n[0]-a)*l-(n[1]-A)*u&&(r?"start"===r?Math.abs(u)>=Math.abs(l)?u>0?a<i&&i<=s:s<=i&&i<a:l>0?A<o&&o<=c:c<=o&&o<A:"end"===r?Math.abs(u)>=Math.abs(l)?u>0?a<=i&&i<s:s<i&&i<=a:l>0?A<=o&&o<c:c<o&&o<=A:"both"===r&&(Math.abs(u)>=Math.abs(l)?u>0?a<i&&i<s:s<i&&i<a:l>0?A<o&&o<c:c<o&&o<A):Math.abs(u)>=Math.abs(l)?u>0?a<=i&&i<=s:s<=i&&i<=a:l>0?A<=o&&o<=c:c<=o&&o<=A)}e.default=function(t,e,n){void 0===n&&(n={});for(var o=r.getCoord(t),a=r.getCoords(e),A=0;A<a.length-1;A++){var s=!1;if(n.ignoreEndVertices&&(0===A&&(s="start"),A===a.length-2&&(s="end"),0===A&&A+1===a.length-1&&(s="both")),i(a[A],a[A+1],o,s))return!0}return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(268),i=n(207),o=n(455),a=n(546),A=n(137),s=n(69),c=n(109);e.default=function(t,e,n){void 0===n&&(n={});var u=s.point([1/0,1/0],{dist:1/0}),l=0;return A.flattenEach(t,(function(t){for(var A=c.getCoords(t),g=0;g<A.length-1;g++){var f=s.point(A[g]);f.properties.dist=i.default(e,f,n);var h=s.point(A[g+1]);h.properties.dist=i.default(e,h,n);var d=i.default(f,h,n),I=Math.max(f.properties.dist,h.properties.dist),p=r.default(f,h),C=o.default(e,I,p+90,n),y=o.default(e,I,p-90,n),v=a.default(s.lineString([C.geometry.coordinates,y.geometry.coordinates]),s.lineString([f.geometry.coordinates,h.geometry.coordinates])),B=null;v.features.length>0&&((B=v.features[0]).properties.dist=i.default(e,B,n),B.properties.location=l+i.default(f,B,n)),f.properties.dist<u.properties.dist&&((u=f).properties.index=g,u.properties.location=l),h.properties.dist<u.properties.dist&&((u=h).properties.index=g+1,u.properties.location=l+d),B&&B.properties.dist<u.properties.dist&&((u=B).properties.index=g),l+=d}})),u}},function(t,e,n){"use strict";var r=n(978);t.exports=Function.prototype.bind||r},function(t,e,n){"use strict";var r=n(799),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,A=Object.defineProperty,s=A&&function(){var t={};try{for(var e in A(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(n){return!1}}(),c=function(t,e,n,r){var i;(!(e in t)||"function"===typeof(i=r)&&"[object Function]"===o.call(i)&&r())&&(s?A(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},o=r(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var A=0;A<o.length;A+=1)c(t,o[A],e[o[A]],n[o[A]])};u.supportsDescriptors=!!s,t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ArrowStyles",{enumerable:!0,get:function(){return r.ArrowStyles}}),Object.defineProperty(e,"DEFAULT_ARROWS",{enumerable:!0,get:function(){return r.DEFAULT_ARROWS}}),Object.defineProperty(e,"MAX_ARROWS",{enumerable:!0,get:function(){return r.MAX_ARROWS}}),Object.defineProperty(e,"EditableGeoJsonLayer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"EditableH3ClusterLayer",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"SelectionLayer",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"ElevatedEditHandleLayer",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"PathOutlineLayer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"PathMarkerLayer",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"JunctionScatterplotLayer",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"toDeckColor",{enumerable:!0,get:function(){return l.toDeckColor}});var r=n(990),i=g(n(737)),o=g(n(1017)),a=g(n(1018)),A=g(n(1020)),s=g(n(819)),c=g(n(1022)),u=g(n(1026)),l=n(1027);function g(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(142),o=n(376),a=(r=n(814))&&r.__esModule?r:{default:r};function A(t){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return(u="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function l(t,e){return!e||"object"!==A(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=[0,0,0,153],p=[0,0,0,144],C=[0,0,0,255],y=[0,0,144,144],v=[144,144,144,255],B=[144,144,144,144],m=[192,0,0,255],b=[0,0,0,128],E=[124,0,192,255],Q=[255,255,255,255],F=o.DrawPolygonMode;function w(t){return t&&"function"===typeof t?function(e){return t(function(t){if(t.__source)return t.__source.object;if(t.sourceFeature)return t.sourceFeature.feature;return t}(e))}:t}function S(t){switch(t.properties.editHandleType){case"existing":return m;case"snap-source":return E;case"intermediate":default:return b}}var R={mode:F,onEdit:function(){},pickable:!0,pickingRadius:10,pickingDepth:5,fp64:!1,filled:!0,stroked:!0,lineWidthScale:1,lineWidthMinPixels:1,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineWidthUnits:"pixels",lineJointRounded:!1,lineMiterLimit:4,pointRadiusScale:1,pointRadiusMinPixels:2,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,getLineColor:function(t,e,n){return e?C:I},getFillColor:function(t,e,n){return e?y:p},getRadius:function(t){return t&&t.properties&&t.properties.radius||t&&t.properties&&t.properties.size||1},getLineWidth:function(t){return t&&t.properties&&t.properties.lineWidth||3},getTentativeLineColor:function(t){return v},getTentativeFillColor:function(t){return B},getTentativeLineWidth:function(t){return t&&t.properties&&t.properties.lineWidth||3},editHandleType:"point",editHandlePointRadiusScale:1,editHandlePointOutline:!0,editHandlePointStrokeWidth:2,editHandlePointRadiusMinPixels:4,editHandlePointRadiusMaxPixels:8,getEditHandlePointColor:S,getEditHandlePointOutlineColor:function(t){return Q},getEditHandlePointRadius:function(t){switch(t.properties.editHandleType){case"existing":return 5;case"snap":return 7;case"intermediate":default:return 3}},editHandleIconAtlas:null,editHandleIconMapping:null,editHandleIconSizeScale:1,getEditHandleIcon:function(t){return t.properties.editHandleType},getEditHandleIconSize:10,getEditHandleIconColor:S,getEditHandleIconAngle:0,billboard:!0},U={view:o.ViewMode,modify:o.ModifyMode,translate:new o.SnappableMode(new o.TranslateMode),transform:new o.SnappableMode(new o.TransformMode),scale:o.ScaleMode,rotate:o.RotateMode,duplicate:o.DuplicateMode,split:o.SplitPolygonMode,extrude:o.ExtrudeMode,elevation:o.ElevationMode,drawPoint:o.DrawPointMode,drawLineString:o.DrawLineStringMode,drawPolygon:o.DrawPolygonMode,drawRectangle:o.DrawRectangleMode,drawCircleFromCenter:o.DrawCircleFromCenterMode,drawCircleByBoundingBox:o.DrawCircleByDiameterMode,drawEllipseByBoundingBox:o.DrawEllipseByBoundingBoxMode,drawRectangleUsing3Points:o.DrawRectangleUsingThreePointsMode,drawEllipseUsing3Points:o.DrawEllipseUsingThreePointsMode,draw90DegreePolygon:o.Draw90DegreePolygonMode,drawPolygonByDragging:o.DrawPolygonByDraggingMode},x=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(A,t);var e,n,r,o,a=(e=A,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return l(this,t)});function A(){return s(this,A),a.apply(this,arguments)}return n=A,(r=[{key:"renderLayers",value:function(){var t=this.getSubLayerProps({id:"geojson",data:this.props.data,fp64:this.props.fp64,filled:this.props.filled,stroked:this.props.stroked,lineWidthScale:this.props.lineWidthScale,lineWidthMinPixels:this.props.lineWidthMinPixels,lineWidthMaxPixels:this.props.lineWidthMaxPixels,lineWidthUnits:this.props.lineWidthUnits,lineJointRounded:this.props.lineJointRounded,lineMiterLimit:this.props.lineMiterLimit,pointRadiusScale:this.props.pointRadiusScale,pointRadiusMinPixels:this.props.pointRadiusMinPixels,pointRadiusMaxPixels:this.props.pointRadiusMaxPixels,getLineColor:this.selectionAwareAccessor(this.props.getLineColor),getFillColor:this.selectionAwareAccessor(this.props.getFillColor),getRadius:this.selectionAwareAccessor(this.props.getRadius),getLineWidth:this.selectionAwareAccessor(this.props.getLineWidth),_subLayerProps:{"line-strings":{billboard:this.props.billboard},"polygons-stroke":{billboard:this.props.billboard}},updateTriggers:{getLineColor:[this.props.selectedFeatureIndexes,this.props.mode],getFillColor:[this.props.selectedFeatureIndexes,this.props.mode],getRadius:[this.props.selectedFeatureIndexes,this.props.mode],getLineWidth:[this.props.selectedFeatureIndexes,this.props.mode]}}),e=[new i.GeoJsonLayer(t)];return e=e.concat(this.createGuidesLayers(),this.createTooltipsLayers())}},{key:"initializeState",value:function(){u(f(A.prototype),"initializeState",this).call(this),this.setState({selectedFeatures:[],editHandles:[]})}},{key:"shouldUpdateState",value:function(t){return u(f(A.prototype),"shouldUpdateState",this).call(this,t)||t.changeFlags.stateChanged}},{key:"updateState",value:function(t){var e,n=t.props,r=t.oldProps,i=t.changeFlags;(u(f(A.prototype),"updateState",this).call(this,{oldProps:r,props:n,changeFlags:i}),!i.propsOrDataChanged||0!==Object.keys(r).length&&n.mode===r.mode)||("function"===typeof n.mode?e=new(0,n.mode):"string"===typeof n.mode?(e=U[n.mode],console.warn("Deprecated use of passing `mode` as a string. Pass the mode's class constructor instead.")):e=n.mode,e||(console.warn("No mode configured for ".concat(String(n.mode))),e=new F),e!==this.state.mode&&this.setState({mode:e,cursor:null}));var o=[];Array.isArray(n.selectedFeatureIndexes)&&(o=n.selectedFeatureIndexes.map((function(t){return n.data.features[t]}))),this.setState({selectedFeatures:o})}},{key:"getModeProps",value:function(t){var e=this;return{modeConfig:t.modeConfig,data:t.data,selectedIndexes:t.selectedFeatureIndexes,lastPointerMoveEvent:this.state.lastPointerMoveEvent,cursor:this.state.cursor,onEdit:function(n){e.setNeedsUpdate(),t.onEdit(n)},onUpdateCursor:function(t){e.setState({cursor:t})}}}},{key:"selectionAwareAccessor",value:function(t){var e=this;return"function"!==typeof t?t:function(n){return t(n,e.isFeatureSelected(n),e.props.mode)}}},{key:"isFeatureSelected",value:function(t){if(!this.props.data||!this.props.selectedFeatureIndexes)return!1;if(!this.props.selectedFeatureIndexes.length)return!1;var e=this.props.data.features.indexOf(t);return this.props.selectedFeatureIndexes.includes(e)}},{key:"getPickingInfo",value:function(t){var e=t.info;return t.sourceLayer.id.endsWith("guides")&&(e.isGuide=!0),e}},{key:"createGuidesLayers",value:function(){var t,e=this.getActiveMode().getGuides(this.getModeProps(this.props));return e&&e.features.length?(t="icon"===this.props.editHandleType?{type:i.IconLayer,iconAtlas:this.props.editHandleIconAtlas,iconMapping:this.props.editHandleIconMapping,sizeScale:this.props.editHandleIconSizeScale,getIcon:w(this.props.getEditHandleIcon),getSize:w(this.props.getEditHandleIconSize),getColor:w(this.props.getEditHandleIconColor),getAngle:w(this.props.getEditHandleIconAngle)}:{type:i.ScatterplotLayer,radiusScale:this.props.editHandlePointRadiusScale,stroked:this.props.editHandlePointOutline,getLineWidth:this.props.editHandlePointStrokeWidth,radiusMinPixels:this.props.editHandlePointRadiusMinPixels,radiusMaxPixels:this.props.editHandlePointRadiusMaxPixels,getRadius:w(this.props.getEditHandlePointRadius),getFillColor:w(this.props.getEditHandlePointColor),getLineColor:w(this.props.getEditHandlePointOutlineColor)},[new i.GeoJsonLayer(this.getSubLayerProps({id:"guides",data:e,fp64:this.props.fp64,_subLayerProps:{points:t},lineWidthScale:this.props.lineWidthScale,lineWidthMinPixels:this.props.lineWidthMinPixels,lineWidthMaxPixels:this.props.lineWidthMaxPixels,lineWidthUnits:this.props.lineWidthUnits,lineJointRounded:this.props.lineJointRounded,lineMiterLimit:this.props.lineMiterLimit,getLineColor:w(this.props.getTentativeLineColor),getLineWidth:w(this.props.getTentativeLineWidth),getFillColor:w(this.props.getTentativeFillColor)}))]):[]}},{key:"createTooltipsLayers",value:function(){var t=this.getActiveMode().getTooltips(this.getModeProps(this.props));return[new i.TextLayer(this.getSubLayerProps({id:"tooltips",data:t}))]}},{key:"onLayerClick",value:function(t){this.getActiveMode().handleClick(t,this.getModeProps(this.props))}},{key:"onLayerKeyUp",value:function(t){this.getActiveMode().handleKeyUp(t,this.getModeProps(this.props))}},{key:"onStartDragging",value:function(t){this.getActiveMode().handleStartDragging(t,this.getModeProps(this.props))}},{key:"onDragging",value:function(t){this.getActiveMode().handleDragging(t,this.getModeProps(this.props))}},{key:"onStopDragging",value:function(t){this.getActiveMode().handleStopDragging(t,this.getModeProps(this.props))}},{key:"onPointerMove",value:function(t){this.setState({lastPointerMoveEvent:t}),this.getActiveMode().handlePointerMove(t,this.getModeProps(this.props))}},{key:"getCursor",value:function(t){var e=t.isDragging,n=this.state.cursor;return n||(n=e?"grabbing":"grab"),n}},{key:"getActiveMode",value:function(){return this.state.mode}}])&&c(n.prototype,r),o&&c(n,o),A}(a.default);e.default=x,d(x,"layerName","EditableGeoJsonLayer"),d(x,"defaultProps",R)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ModifyMode=void 0;var r,i=(r=n(733))&&r.__esModule?r:{default:r},o=n(69),a=n(230),A=n(155),s=n(330);function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e){return!e||"object"!==c(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function I(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t,e){return(C=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)}(g,t);var e,n,r,A,c=(e=g,function(){var t,n=p(e);if(I()){var r=p(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d(this,t)});function g(){return f(this,g),c.apply(this,arguments)}return n=g,(r=[{key:"getGuides",value:function(t){var e,n=this,r=[],i=t.data,A=t.lastPointerMoveEvent,s=i.features,c=A&&A.picks,g=A&&A.mapCoords,f=function(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=l(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(t.selectedIndexes);try{for(f.s();!(e=f.n()).done;){var h=e.value;if(h<s.length){var d=s[h].geometry;r.push.apply(r,u((0,a.getEditHandlesForGeometry)(d,h)))}else console.warn("selectedFeatureIndexes out of range ".concat(h))}}catch(b){f.e(b)}finally{f.f()}if(c&&c.length&&g){var I=!(0,a.getPickedExistingEditHandle)(c)&&c.find((function(t){return!t.isGuide}));if(I&&!I.object.geometry.type.includes("Point")&&t.selectedIndexes.includes(I.index)){var p=null,C=[],y=(0,o.point)(g);if((0,a.recursivelyTraverseNestedArrays)(I.object.geometry.coordinates,[],(function(e,r){var i=(0,o.lineString)(e),a=n.nearestPointOnLine(i,y,t.modeConfig&&t.modeConfig.viewport);(!p||a.properties.dist<p.properties.dist)&&(p=a,C=r)})),p){var v=p,B=v.geometry.coordinates,m=v.properties.index;r.push({type:"Feature",properties:{guideType:"editHandle",editHandleType:"intermediate",featureIndex:I.index,positionIndexes:[].concat(u(C),[m+1])},geometry:{type:"Point",coordinates:B}})}}}return{type:"FeatureCollection",features:r}}},{key:"nearestPointOnLine",value:function(t,e,n){if(t.geometry.coordinates.some((function(t){return t.length>2}))){if(n)return(0,a.nearestPointOnProjectedLine)(t,e,n);console.log("Editing 3D point but modeConfig.viewport not provided. Falling back to 2D logic.")}return(0,i.default)(t,e)}},{key:"handleClick",value:function(t,e){var n=(0,a.getPickedExistingEditHandle)(t.picks),r=(0,a.getPickedIntermediateEditHandle)(t.picks);if(n){var i,o=n.properties,A=o.featureIndex,c=o.positionIndexes;try{i=new s.ImmutableFeatureCollection(e.data).removePosition(A,c).getObject()}catch(h){}i&&e.onEdit({updatedData:i,editType:"removePosition",editContext:{featureIndexes:[A],positionIndexes:c,position:n.geometry.coordinates}})}else if(r){var u=r.properties,l=u.featureIndex,g=u.positionIndexes,f=new s.ImmutableFeatureCollection(e.data).addPosition(l,g,r.geometry.coordinates).getObject();f&&e.onEdit({updatedData:f,editType:"addPosition",editContext:{featureIndexes:[l],positionIndexes:g,position:r.geometry.coordinates}})}}},{key:"handleDragging",value:function(t,e){var n=(0,a.getPickedEditHandle)(t.pointerDownPicks);if(n){t.cancelPan();var r=n.properties,i=new s.ImmutableFeatureCollection(e.data).replacePosition(r.featureIndex,r.positionIndexes,t.mapCoords).getObject();e.onEdit({updatedData:i,editType:"movePosition",editContext:{featureIndexes:[r.featureIndex],positionIndexes:r.positionIndexes,position:t.mapCoords}})}}},{key:"handlePointerMove",value:function(t,e){var n=this.getCursor(t);e.onUpdateCursor(n)}},{key:"handleStartDragging",value:function(t,e){var n=e.selectedIndexes,r=(0,a.getPickedIntermediateEditHandle)(t.picks);if(n.length&&r){var i=r.properties,o=new s.ImmutableFeatureCollection(e.data).addPosition(i.featureIndex,i.positionIndexes,t.mapCoords).getObject();e.onEdit({updatedData:o,editType:"addPosition",editContext:{featureIndexes:[i.featureIndex],positionIndexes:i.positionIndexes,position:t.mapCoords}})}}},{key:"handleStopDragging",value:function(t,e){var n=e.selectedIndexes,r=(0,a.getPickedEditHandle)(t.picks);if(n.length&&r){var i=r.properties,o=new s.ImmutableFeatureCollection(e.data).replacePosition(i.featureIndex,i.positionIndexes,t.mapCoords).getObject();e.onEdit({updatedData:o,editType:"finishMovePosition",editContext:{featureIndexes:[i.featureIndex],positionIndexes:i.positionIndexes,position:t.mapCoords}})}}},{key:"getCursor",value:function(t){var e=t&&t.picks||[];return(0,a.getPickedEditHandles)(e).length?"cell":null}}])&&h(n.prototype,r),A&&h(n,A),g}(A.GeoJsonEditMode);e.ModifyMode=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TranslateMode=void 0;var r=c(n(268)),i=c(n(207)),o=c(n(1088)),a=n(69),A=n(155),s=n(330);function c(t){return t&&t.__esModule?t:{default:t}}function u(t){return(u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e){return!e||"object"!==u(e)&&"function"!==typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(y,t);var e,n,A,c,u=(e=y,function(){var t,n=I(e);if(d()){var r=I(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return f(this,t)});function y(){var t;l(this,y);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C(h(t=u.call.apply(u,[this].concat(n))),"_geometryBeforeTranslate",void 0),C(h(t),"_isTranslatable",void 0),t}return n=y,(A=[{key:"handleDragging",value:function(t,e){if(this._isTranslatable){if(this._geometryBeforeTranslate){var n=this.getTranslateAction(t.pointerDownMapCoords,t.mapCoords,"translating",e);n&&e.onEdit(n)}t.cancelPan()}}},{key:"handlePointerMove",value:function(t,e){this._isTranslatable=this.isSelectionPicked(t.pointerDownPicks||t.picks,e),this.updateCursor(e)}},{key:"handleStartDragging",value:function(t,e){this._isTranslatable&&(this._geometryBeforeTranslate=this.getSelectedFeaturesAsFeatureCollection(e))}},{key:"handleStopDragging",value:function(t,e){if(this._geometryBeforeTranslate){var n=this.getTranslateAction(t.pointerDownMapCoords,t.mapCoords,"translated",e);n&&e.onEdit(n),this._geometryBeforeTranslate=null}}},{key:"updateCursor",value:function(t){this._isTranslatable?t.onUpdateCursor("move"):t.onUpdateCursor(null)}},{key:"getTranslateAction",value:function(t,e,n,A){if(!this._geometryBeforeTranslate)return null;for(var c=(0,a.point)(t),u=(0,a.point)(e),l=(0,i.default)(c,u),g=(0,r.default)(c,u),f=(0,o.default)(this._geometryBeforeTranslate,l,g),h=new s.ImmutableFeatureCollection(A.data),d=A.selectedIndexes,I=0;I<d.length;I++){var p=d[I],C=f.features[I];h=h.replaceGeometry(p,C.geometry)}return{updatedData:h.getObject(),editType:n,editContext:{featureIndexes:d}}}}])&&g(n.prototype,A),c&&g(n,c),y}(A.GeoJsonEditMode);e.TranslateMode=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69),i=n(109);function o(t,e){void 0===e&&(e={});var n=i.getGeom(t);n.type;return A(n.coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function a(t,e){void 0===e&&(e={});var n=i.getGeom(t),o=(n.type,n.coordinates),a=e.properties?e.properties:"Feature"===t.type?t.properties:{},s=[];return o.forEach((function(t){s.push(A(t,a))})),r.featureCollection(s)}function A(t,e){return t.length>1?r.multiLineString(t,e):r.lineString(t[0],e)}e.default=function(t,e){void 0===e&&(e={});var n=i.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return o(n,e);case"MultiPolygon":return a(n,e);default:throw new Error("invalid poly")}},e.polygonToLine=o,e.multiPolygonToLine=a,e.coordsToLine=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawPolygonMode=void 0;var r=n(230);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return(c="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function u(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var h=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(d,t);var e,n,i,a,h=(e=d,function(){var t,n=g(e);if(l()){var r=g(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function d(){return A(this,d),h.apply(this,arguments)}return n=d,(i=[{key:"createTentativeFeature",value:function(t){var e,n=t.lastPointerMoveEvent,r=this.getClickSequence(),i=n?[n.mapCoords]:[];return 1===r.length||2===r.length?e={type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[].concat(o(r),i)}}:r.length>2&&(e={type:"Feature",properties:{guideType:"tentative"},geometry:{type:"Polygon",coordinates:[[].concat(o(r),i,[r[0]])]}}),e}},{key:"getGuides",value:function(t){var e,n=this.getClickSequence(),r={type:"FeatureCollection",features:[]},i=this.createTentativeFeature(t);i&&r.features.push(i);var a=n.map((function(t,e){return{type:"Feature",properties:{guideType:"editHandle",editHandleType:"existing",featureIndex:-1,positionIndexes:[e]},geometry:{type:"Point",coordinates:t}}}));return(e=r.features).push.apply(e,o(a)),r}},{key:"handleClick",value:function(t,e){var n=t.picks,i=(0,r.getPickedEditHandle)(n),a=!1;i||(this.addClickSequence(t),a=!0);var A=this.getClickSequence();if(A.length>2&&i&&Array.isArray(i.properties.positionIndexes)&&(0===i.properties.positionIndexes[0]||i.properties.positionIndexes[0]===A.length-1)){var s={type:"Polygon",coordinates:[[].concat(o(A),[A[0]])]};this.resetClickSequence();var c=this.getAddFeatureOrBooleanPolygonAction(s,e);c&&e.onEdit(c)}else a&&e.onEdit({updatedData:e.data,editType:"addTentativePosition",editContext:{position:t.mapCoords}})}},{key:"handleKeyUp",value:function(t,e){if("Enter"===t.key){var n=this.getClickSequence();if(n.length>2){var r={type:"Polygon",coordinates:[[].concat(o(n),[n[0]])]};this.resetClickSequence();var i=this.getAddFeatureOrBooleanPolygonAction(r,e);i&&e.onEdit(i)}}}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell"),c(g(d.prototype),"handlePointerMove",this).call(this,t,e)}}])&&s(n.prototype,i),a&&s(n,a),d}(n(155).GeoJsonEditMode);e.DrawPolygonMode=h},function(t,e,n){"use strict";function r(t,e){if(t===e)return!0;if(Array.isArray(t)){var n=t.length;if(!e||e.length!==n)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}return!1}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,n={};return function(i){for(var o in i)if(!r(i[o],n[o])){e=t(i),n=i;break}return e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(13),i=n.n(r),o=n(30),a=n(190),A=n(519),s=n(107),c={};function u(t){return l.apply(this,arguments)}function l(){return(l=Object(o.a)(i.a.mark((function t(e){var n,r,o=arguments;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]?o[2]:{},n&&(e=g(e,n,r)),c[e]=c[e]||f(e),t.next=6,c[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t,e,n){var r=n.modules||{};return r[t]?r[t]:a.b?n.CDN?(Object(s.a)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat("2.3.0","/dist/libs/").concat(t)):a.c?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function f(t){return h.apply(this,arguments)}function h(){return(h=Object(o.a)(i.a.mark((function t(e){var n,r,o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return n=t.sent,t.next=6,n.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(a.b){t.next=9;break}return t.abrupt("return",A.requireFromFile&&A.requireFromFile(e));case 9:if(!a.c){t.next=11;break}return t.abrupt("return",importScripts(e));case 11:return t.next=13,fetch(e);case 13:return r=t.sent,t.next=16,r.text();case 16:return o=t.sent,t.abrupt("return",d(o,e));case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t,e){if(!a.b)return A.requireFromString&&A.requireFromString(t,e);if(a.c)return eval.call(a.a,t),null;var n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(r){n.text=t}return document.body.appendChild(n),null}},function(t,e,n){"use strict";function r(t){if(!t||!t.POSITION)return null;var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,A=t.POSITION.value,s=A&&A.length;if(!s)return null;for(var c=0;c<s;c+=3){var u=A[c],l=A[c+1],g=A[c+2];e=u<e?u:e,n=l<n?l:n,r=g<r?g:r,i=u>i?u:i,o=l>o?l:o,a=g>a?g:a}return[[e,n,r],[i,o,a]]}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.r(e);var r=n(830);n.d(e,"SimpleMeshLayer",(function(){return r.a}));var i=n(825);n.d(e,"ScenegraphLayer",(function(){return i.a}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"objects",void 0),i(this,"originals",void 0),i(this,"updateTrigger",void 0),i(this,"_idToPosition",void 0),i(this,"_getData",void 0),i(this,"_convert",void 0),this.objects=[],this.originals=[],this.updateTrigger=0,this._idToPosition=new Map,this._getData=e,this._convert=n}var e,n,o;return e=t,(n=[{key:"updateAllDeckObjects",value:function(){var t=this;this._getData&&this._convert&&(this.originals.length=0,this.objects.length=0,this._idToPosition.clear(),this._getData().forEach((function(e){t._idToPosition.set(e.id,t.objects.length),t.originals.push(e),t.objects.push(t._convert(e))})),this.triggerUpdate())}},{key:"updateDeckObjectsByIds",value:function(t){var e=this;this._getData&&this._convert&&(t.forEach((function(t){var n=e._idToPosition.get(t);void 0!==n&&(e.objects[n]=e._convert(e.originals[n]))})),this.triggerUpdate())}},{key:"triggerUpdate",value:function(){this.updateTrigger++}},{key:"getDeckObjectById",value:function(t){var e=this._idToPosition.get(t);return void 0!==e?this.objects[e]:null}},{key:"getOriginalById",value:function(t){var e=this._idToPosition.get(t);return void 0!==e?this.originals[e]:null}}])&&r(e.prototype,n),o&&r(e,o),t}();e.default=o},function(t,e,n){var r=n(688);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){var r=n(1071),i=n(889);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var A=-1,s=e.length;++A<s;){var c=e[A],u=o?o(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),a?i(n,c,u):r(n,c,u)}return n}},function(t,e,n){"use strict";n.r(e);var r={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325};function i(t,e,n){if(!u(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&l(r),i&&g(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function o(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!c(t[0])||!c(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function a(t,e){if(!u(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&l(n),r&&g(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function A(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function s(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!==typeof e)throw new Error("units must be a string");var n=r[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function c(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function u(t){return!!t&&t.constructor===Object}function l(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!c(t))throw new Error("bbox must only contain numbers")}))}function g(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function f(t,e,n){if(null!==t)for(var r,i,o,a,A,s,c,u,l=0,g=0,h=t.type,d="FeatureCollection"===h,I="Feature"===h,p=d?t.features.length:1,C=0;C<p;C++){A=(u=!!(c=d?t.features[C].geometry:I?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<A;y++){var v=0,B=0;if(null!==(a=u?c.geometries[y]:c)){s=a.coordinates;var m=a.type;switch(l=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(s,g,C,v,B))return!1;g++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<s.length;r++){if(!1===e(s[r],g,C,v,B))return!1;g++,"MultiPoint"===m&&v++}"LineString"===m&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<s.length;r++){for(i=0;i<s[r].length-l;i++){if(!1===e(s[r][i],g,C,v,B))return!1;g++}"MultiLineString"===m&&v++,"Polygon"===m&&B++}"Polygon"===m&&v++;break;case"MultiPolygon":for(r=0;r<s.length;r++){for("MultiPolygon"===m&&(B=0),i=0;i<s[r].length;i++){for(o=0;o<s[r][i].length-l;o++){if(!1===e(s[r][i][o],g,C,v,B))return!1;g++}B++}v++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===f(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function h(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function d(t,e){var n,r,i,o,a,A,s,c,u,l,g=0,f="FeatureCollection"===t.type,h="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(A=f?t.features[n].geometry:h?t.geometry:t,c=f?t.features[n].properties:h?t.properties:{},u=f?t.features[n].bbox:h?t.bbox:void 0,l=f?t.features[n].id:h?t.id:void 0,a=(s=!!A&&"GeometryCollection"===A.type)?A.geometries.length:1,i=0;i<a;i++)if(null!==(o=s?A.geometries[i]:A))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,g,c,u,l))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],g,c,u,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,g,c,u,l))return!1;g++}}var I=function(t){var e=[1/0,1/0,-1/0,-1/0];return f(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e};var p=function(t,e){if(!u(e=e||{}))throw new Error("options is invalid");var n=e.properties;if(!t)throw new Error("geojson is required");var r=I(t);return o([(r[0]+r[2])/2,(r[1]+r[3])/2],n)},C=n(557);function y(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function v(t){return!!t&&t.constructor===Object}function B(t,e,n){if(null!==t)for(var r,i,o,a,A,s,c,u,l=0,g=0,f=t.type,h="FeatureCollection"===f,d="Feature"===f,I=h?t.features.length:1,p=0;p<I;p++){A=(u=!!(c=h?t.features[p].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var C=0;C<A;C++){var y=0,v=0;if(null!==(a=u?c.geometries[C]:c)){s=a.coordinates;var m=a.type;switch(l=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(s,g,p,y,v))return!1;g++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<s.length;r++){if(!1===e(s[r],g,p,y,v))return!1;g++,"MultiPoint"===m&&y++}"LineString"===m&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<s.length;r++){for(i=0;i<s[r].length-l;i++){if(!1===e(s[r][i],g,p,y,v))return!1;g++}"MultiLineString"===m&&y++,"Polygon"===m&&v++}"Polygon"===m&&y++;break;case"MultiPolygon":for(r=0;r<s.length;r++){for("MultiPolygon"===m&&(v=0),i=0;i<s[r].length;i++){for(o=0;o<s[r][i].length-l;o++){if(!1===e(s[r][i][o],g,p,y,v))return!1;g++}v++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===B(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var m=n(314);function b(t,e,n){if(!v(n=n||{}))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&y(t[0])?t="mercator"===e?E(t):Q(t):(!0!==r&&(t=Object(m.a)(t)),B(t,(function(t){var n="mercator"===e?E(t):Q(t);t[0]=n[0],t[1]=n[1]}))),t}function E(t){var e,n=Math.PI/180,r=6378137,i=20037508.342789244,o=[r*(Math.abs(t[0])<=180?t[0]:t[0]-360*((e=t[0])<0?-1:e>0?1:0))*n,r*Math.log(Math.tan(.25*Math.PI+.5*t[1]*n))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function Q(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var F=function(){return new w};function w(){this.reset()}w.prototype={constructor:w,reset:function(){this.s=this.t=0},add:function(t){R(S,t,this.t),R(this,S.s,this.s),this.s?this.t+=S.t:this.s=S.t},valueOf:function(){return this.s}};var S=new w;function R(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var U=1e-6,x=Math.PI,k=x/2,O=x/4,N=2*x,D=180/x,G=x/180,_=Math.abs,M=Math.atan,T=Math.atan2,j=Math.cos,L=(Math.ceil,Math.exp),V=(Math.floor,Math.log),Z=(Math.pow,Math.sin),P=(Math.sign,Math.sqrt),W=Math.tan;function J(t){return t>1?0:t<-1?x:Math.acos(t)}function H(t){return t>1?k:t<-1?-k:Math.asin(t)}function Y(){}function X(t,e){t&&K.hasOwnProperty(t.type)&&K[t.type](t,e)}var z={Feature:function(t,e){X(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)X(n[r].geometry,e)}},K={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){q(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)q(n[r],e,0)},Polygon:function(t,e){$(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)$(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)X(n[r],e)}};function q(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function $(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)q(t[n],e,1);e.polygonEnd()}var tt=function(t,e){t&&z.hasOwnProperty(t.type)?z[t.type](t,e):X(t,e)};F(),F();function et(t){return[T(t[1],t[0]),H(t[2])]}function nt(t){var e=t[0],n=t[1],r=j(n);return[r*j(e),r*Z(e),Z(n)]}function rt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function it(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ot(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function at(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function At(t){var e=P(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}F();var st=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function ct(t,e){return[t>x?t-N:t<-x?t+N:t,e]}function ut(t,e,n){return(t%=N)?e||n?st(gt(t),ft(e,n)):gt(t):e||n?ft(e,n):ct}function lt(t){return function(e,n){return[(e+=t)>x?e-N:e<-x?e+N:e,n]}}function gt(t){var e=lt(t);return e.invert=lt(-t),e}function ft(t,e){var n=j(t),r=Z(t),i=j(e),o=Z(e);function a(t,e){var a=j(e),A=j(t)*a,s=Z(t)*a,c=Z(e),u=c*n+A*r;return[T(s*i-u*o,A*n-c*r),H(u*i+s*o)]}return a.invert=function(t,e){var a=j(e),A=j(t)*a,s=Z(t)*a,c=Z(e),u=c*i-s*o;return[T(s*i+c*o,A*n+u*r),H(u*n-A*r)]},a}ct.invert=ct;function ht(t,e,n,r,i,o){if(n){var a=j(e),A=Z(e),s=r*n;null==i?(i=e+r*N,o=e-s/2):(i=dt(a,i),o=dt(a,o),(r>0?i<o:i>o)&&(i+=r*N));for(var c,u=i;r>0?u>o:u<o;u-=s)c=et([a,-A*j(u),-A*Z(u)]),t.point(c[0],c[1])}}function dt(t,e){(e=nt(e))[0]-=t,At(e);var n=J(-e[1]);return((-e[2]<0?-n:n)+N-U)%N}var It=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Y,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},pt=function(t,e){return _(t[0]-e[0])<U&&_(t[1]-e[1])<U};function Ct(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var yt=function(t,e,n,r,i){var o,a,A=[],s=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(pt(r,a)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else A.push(n=new Ct(r,t,null,!0)),s.push(n.o=new Ct(r,null,n,!1)),A.push(n=new Ct(a,t,null,!1)),s.push(n.o=new Ct(a,null,n,!0))}})),A.length){for(s.sort(e),vt(A),vt(s),o=0,a=s.length;o<a;++o)s[o].e=n=!n;for(var c,u,l=A[0];;){for(var g=l,f=!0;g.v;)if((g=g.n)===l)return;c=g.z,i.lineStart();do{if(g.v=g.o.v=!0,g.e){if(f)for(o=0,a=c.length;o<a;++o)i.point((u=c[o])[0],u[1]);else r(g.x,g.n.x,1,i);g=g.n}else{if(f)for(c=g.p.z,o=c.length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(g.x,g.p.x,-1,i);g=g.p}c=(g=g.o).z,f=!f}while(!g.v);i.lineEnd()}}};function vt(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}var Bt=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var mt=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Bt(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}(Bt);mt.right,mt.left;var bt=Array.prototype;bt.slice,bt.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var Et=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};function Qt(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,A,c){var u=0,l=0;if(null==i||(u=a(i,A))!==(l=a(o,A))||s(i,o)<0^A>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+A+4)%4)!==l);else c.point(o[0],o[1])}function a(r,i){return _(r[0]-t)<U?i>0?0:3:_(r[0]-n)<U?i>0?2:1:_(r[1]-e)<U?i>0?1:0:i>0?3:2}function A(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,c,u,l,g,f,h,d,I,p,C,y=a,v=It(),B={point:m,lineStart:function(){B.point=b,c&&c.push(u=[]);p=!0,I=!1,h=d=NaN},lineEnd:function(){s&&(b(l,g),f&&I&&v.rejoin(),s.push(v.result()));B.point=m,I&&y.lineEnd()},polygonStart:function(){y=v,s=[],c=[],C=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,a,A=c[n],s=1,u=A.length,l=A[0],g=l[0],f=l[1];s<u;++s)o=g,a=f,l=A[s],g=l[0],f=l[1],a<=r?f>r&&(g-o)*(r-a)>(f-a)*(t-o)&&++e:f<=r&&(g-o)*(r-a)<(f-a)*(t-o)&&--e;return e}(),n=C&&e,i=(s=Et(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&yt(s,A,e,o,a),a.polygonEnd());y=a,s=c=u=null}};function m(t,e){i(t,e)&&y.point(t,e)}function b(o,a){var A=i(o,a);if(c&&u.push([o,a]),p)l=o,g=a,f=A,p=!1,A&&(y.lineStart(),y.point(o,a));else if(A&&I)y.point(o,a);else{var s=[h=Math.max(-1e9,Math.min(1e9,h)),d=Math.max(-1e9,Math.min(1e9,d))],v=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,i,o){var a,A=t[0],s=t[1],c=0,u=1,l=e[0]-A,g=e[1]-s;if(a=n-A,l||!(a>0)){if(a/=l,l<0){if(a<c)return;a<u&&(u=a)}else if(l>0){if(a>u)return;a>c&&(c=a)}if(a=i-A,l||!(a<0)){if(a/=l,l<0){if(a>u)return;a>c&&(c=a)}else if(l>0){if(a<c)return;a<u&&(u=a)}if(a=r-s,g||!(a>0)){if(a/=g,g<0){if(a<c)return;a<u&&(u=a)}else if(g>0){if(a>u)return;a>c&&(c=a)}if(a=o-s,g||!(a<0)){if(a/=g,g<0){if(a>u)return;a>c&&(c=a)}else if(g>0){if(a<c)return;a<u&&(u=a)}return c>0&&(t[0]=A+c*l,t[1]=s+c*g),u<1&&(e[0]=A+u*l,e[1]=s+u*g),!0}}}}}(s,v,t,e,n,r)?A&&(y.lineStart(),y.point(o,a),C=!1):(I||(y.lineStart(),y.point(s[0],s[1])),y.point(v[0],v[1]),A||y.lineEnd(),C=!1)}h=o,d=a,I=A}return B}}var Ft=F(),wt=function(t,e){var n=e[0],r=e[1],i=[Z(n),-j(n),0],o=0,a=0;Ft.reset();for(var A=0,s=t.length;A<s;++A)if(u=(c=t[A]).length)for(var c,u,l=c[u-1],g=l[0],f=l[1]/2+O,h=Z(f),d=j(f),I=0;I<u;++I,g=C,h=v,d=B,l=p){var p=c[I],C=p[0],y=p[1]/2+O,v=Z(y),B=j(y),m=C-g,b=m>=0?1:-1,E=b*m,Q=E>x,F=h*v;if(Ft.add(T(F*b*Z(E),d*B+F*j(E))),o+=Q?m+b*N:m,Q^g>=n^C>=n){var w=it(nt(l),nt(p));At(w);var S=it(i,w);At(S);var R=(Q^m>=0?-1:1)*H(S[2]);(r>R||r===R&&(w[0]||w[1]))&&(a+=Q^m>=0?1:-1)}}return(o<-U||o<U&&Ft<-U)^1&a};F();var St=function(t){return t};F(),F();var Rt=1/0,Ut=Rt,xt=-Rt,kt=xt;var Ot={point:function(t,e){t<Rt&&(Rt=t);t>xt&&(xt=t);e<Ut&&(Ut=e);e>kt&&(kt=e)},lineStart:Y,lineEnd:Y,polygonStart:Y,polygonEnd:Y,result:function(){var t=[[Rt,Ut],[xt,kt]];return xt=kt=-(Ut=Rt=1/0),t}};function Nt(t){this._context=t}Nt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,N)}},result:Y};F();function Dt(){this._string=[]}function Gt(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Dt.prototype={_radius:4.5,_circle:Gt(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Gt(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var _t=function(t,e,n,r){return function(i,o){var a,A,s,c=e(o),u=i.invert(r[0],r[1]),l=It(),g=e(l),f=!1,h={point:d,lineStart:p,lineEnd:C,polygonStart:function(){h.point=y,h.lineStart=v,h.lineEnd=B,A=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=p,h.lineEnd=C,A=Et(A);var t=wt(a,u);A.length?(f||(o.polygonStart(),f=!0),yt(A,Tt,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),A=a=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function I(t,e){var n=i(t,e);c.point(n[0],n[1])}function p(){h.point=I,c.lineStart()}function C(){h.point=d,c.lineEnd()}function y(t,e){s.push([t,e]);var n=i(t,e);g.point(n[0],n[1])}function v(){g.lineStart(),s=[]}function B(){y(s[0][0],s[0][1]),g.lineEnd();var t,e,n,r,i=g.clean(),c=l.result(),u=c.length;if(s.pop(),a.push(s),s=null,u)if(1&i){if((e=(n=c[0]).length-1)>0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else u>1&&2&i&&c.push(c.pop().concat(c.shift())),A.push(c.filter(Mt))}return h}};function Mt(t){return t.length>1}function Tt(t,e){return((t=t.x)[0]<0?t[1]-k-U:k-t[1])-((e=e.x)[0]<0?e[1]-k-U:k-e[1])}var jt=_t((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var A=o>0?x:-x,s=_(o-n);_(s-x)<U?(t.point(n,r=(r+a)/2>0?k:-k),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),t.point(o,r),e=0):i!==A&&s>=x&&(_(n-i)<U&&(n-=i*U),_(o-A)<U&&(o-=A*U),r=function(t,e,n,r){var i,o,a=Z(t-n);return _(a)>U?M((Z(e)*(o=j(r))*Z(n)-Z(r)*(i=j(e))*Z(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(A,r),e=0),t.point(n=o,r=a),i=A},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*k,r.point(-x,i),r.point(0,i),r.point(x,i),r.point(x,0),r.point(x,-i),r.point(0,-i),r.point(-x,-i),r.point(-x,0),r.point(-x,i);else if(_(t[0]-e[0])>U){var o=t[0]<e[0]?x:-x;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-x,-k]);var Lt=function(t,e){var n=j(t),r=n>0,i=_(n)>U;function o(t,e){return j(t)*j(e)>n}function a(t,e,r){var i=[1,0,0],o=it(nt(t),nt(e)),a=rt(o,o),A=o[0],s=a-A*A;if(!s)return!r&&t;var c=n*a/s,u=-n*A/s,l=it(i,o),g=at(i,c);ot(g,at(o,u));var f=l,h=rt(g,f),d=rt(f,f),I=h*h-d*(rt(g,g)-1);if(!(I<0)){var p=P(I),C=at(f,(-h-p)/d);if(ot(C,g),C=et(C),!r)return C;var y,v=t[0],B=e[0],m=t[1],b=e[1];B<v&&(y=v,v=B,B=y);var E=B-v,Q=_(E-x)<U;if(!Q&&b<m&&(y=m,m=b,b=y),Q||E<U?Q?m+b>0^C[1]<(_(C[0]-v)<U?m:b):m<=C[1]&&C[1]<=b:E>x^(v<=C[0]&&C[0]<=B)){var F=at(f,(-h+p)/d);return ot(F,g),[C,et(F)]}}}function A(e,n){var i=r?t:x-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return _t(o,(function(t){var e,n,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(l,g){var f,h=[l,g],d=o(l,g),I=r?d?0:A(l,g):d?A(l+(l<0?x:-x),g):0;if(!e&&(c=s=d)&&t.lineStart(),d!==s&&(!(f=a(e,h))||pt(e,f)||pt(h,f))&&(h[0]+=U,h[1]+=U,d=o(h[0],h[1])),d!==s)u=0,d?(t.lineStart(),f=a(h,e),t.point(f[0],f[1])):(f=a(e,h),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&r^d){var p;I&n||!(p=a(h,e,!0))||(u=0,r?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1])))}!d||e&&pt(e,h)||t.point(h[0],h[1]),e=h,s=d,n=I},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}}),(function(n,r,i,o){ht(o,t,e,i,n,r)}),r?[0,-t]:[-x,t-x])};function Vt(t){return function(e){var n=new Zt;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Zt(){}function Pt(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),tt(n,t.stream(Ot));var a=Ot.result(),A=Math.min(r/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),s=+e[0][0]+(r-A*(a[1][0]+a[0][0]))/2,c=+e[0][1]+(i-A*(a[1][1]+a[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*A).translate([s,c])}function Wt(t,e,n){return Pt(t,[[0,0],e],n)}Zt.prototype={constructor:Zt,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Jt=j(30*G),Ht=function(t,e){return+e?function(t,e){function n(r,i,o,a,A,s,c,u,l,g,f,h,d,I){var p=c-r,C=u-i,y=p*p+C*C;if(y>4*e&&d--){var v=a+g,B=A+f,m=s+h,b=P(v*v+B*B+m*m),E=H(m/=b),Q=_(_(m)-1)<U||_(o-l)<U?(o+l)/2:T(B,v),F=t(Q,E),w=F[0],S=F[1],R=w-r,x=S-i,k=C*R-p*x;(k*k/y>e||_((p*R+C*x)/y-.5)>.3||a*g+A*f+s*h<Jt)&&(n(r,i,o,a,A,s,w,S,Q,v/=b,B/=b,m,d,I),I.point(w,S),n(w,S,Q,v,B,m,c,u,l,g,f,h,d,I))}}return function(e){var r,i,o,a,A,s,c,u,l,g,f,h,d={point:I,lineStart:p,lineEnd:y,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=p}};function I(n,r){n=t(n,r),e.point(n[0],n[1])}function p(){u=NaN,d.point=C,e.lineStart()}function C(r,i){var o=nt([r,i]),a=t(r,i);n(u,l,c,g,f,h,u=a[0],l=a[1],c=r,g=o[0],f=o[1],h=o[2],16,e),e.point(u,l)}function y(){d.point=I,e.lineEnd()}function v(){p(),d.point=B,d.lineEnd=m}function B(t,e){C(r=t,e),i=u,o=l,a=g,A=f,s=h,d.point=C}function m(){n(u,l,c,g,f,h,i,o,r,a,A,s,16,e),d.lineEnd=y,y()}return d}}(t,e):function(t){return Vt({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var Yt=Vt({point:function(t,e){this.stream.point(t*G,e*G)}});function Xt(t){return zt((function(){return t}))()}function zt(t){var e,n,r,i,o,a,A,s,c,u,l=150,g=480,f=250,h=0,d=0,I=0,p=0,C=0,y=null,v=jt,B=null,m=St,b=.5,E=Ht(w,b);function Q(t){return[(t=o(t[0]*G,t[1]*G))[0]*l+n,r-t[1]*l]}function F(t){return(t=o.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*D,t[1]*D]}function w(t,i){return[(t=e(t,i))[0]*l+n,r-t[1]*l]}function S(){o=st(i=ut(I,p,C),e);var t=e(h,d);return n=g-t[0]*l,r=f+t[1]*l,R()}function R(){return c=u=null,Q}return Q.stream=function(t){return c&&u===t?c:c=Yt(v(i,E(m(u=t))))},Q.clipAngle=function(t){return arguments.length?(v=+t?Lt(y=t*G,6*G):(y=null,jt),R()):y*D},Q.clipExtent=function(t){return arguments.length?(m=null==t?(B=a=A=s=null,St):Qt(B=+t[0][0],a=+t[0][1],A=+t[1][0],s=+t[1][1]),R()):null==B?null:[[B,a],[A,s]]},Q.scale=function(t){return arguments.length?(l=+t,S()):l},Q.translate=function(t){return arguments.length?(g=+t[0],f=+t[1],S()):[g,f]},Q.center=function(t){return arguments.length?(h=t[0]%360*G,d=t[1]%360*G,S()):[h*D,d*D]},Q.rotate=function(t){return arguments.length?(I=t[0]%360*G,p=t[1]%360*G,C=t.length>2?t[2]%360*G:0,S()):[I*D,p*D,C*D]},Q.precision=function(t){return arguments.length?(E=Ht(w,b=t*t),R()):P(b)},Q.fitExtent=function(t,e){return Pt(Q,t,e)},Q.fitSize=function(t,e){return Wt(Q,t,e)},function(){return e=t.apply(this,arguments),Q.invert=e.invert&&F,S()}}function Kt(t){return function(e,n){var r=j(e),i=j(n),o=t(r*i);return[o*i*Z(e),o*Z(n)]}}function qt(t){return function(e,n){var r=P(e*e+n*n),i=t(r),o=Z(i),a=j(i);return[T(e*o,r*a),H(r&&n*o/r)]}}var $t=Kt((function(t){return P(2/(1+t))}));$t.invert=qt((function(t){return 2*H(t/2)}));var te=Kt((function(t){return(t=J(t))&&t/Z(t)}));te.invert=qt((function(t){return t}));function ee(t,e){return[t,V(W((k+e)/2))]}ee.invert=function(t,e){return[t,2*M(L(e))-k]};function ne(t){var e,n,r,i=Xt(t),o=i.center,a=i.scale,A=i.translate,s=i.clipExtent,c=null;function u(){var o=x*a(),A=i(function(t){function e(e){return(e=t(e[0]*G,e[1]*G))[0]*=D,e[1]*=D,e}return t=ut(t[0]*G,t[1]*G,t.length>2?t[2]*G:0),e.invert=function(e){return(e=t.invert(e[0]*G,e[1]*G))[0]*=D,e[1]*=D,e},e}(i.rotate()).invert([0,0]));return s(null==c?[[A[0]-o,A[1]-o],[A[0]+o,A[1]+o]]:t===ee?[[Math.max(A[0]-o,c),e],[Math.min(A[0]+o,n),r]]:[[c,Math.max(A[1]-o,e)],[n,Math.min(A[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(A(t),u()):A()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=n=r=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==c?null:[[c,e],[n,r]]},u()}function re(t,e){return[t,e]}re.invert=re;function ie(t,e){var n=j(e),r=j(t)*n;return[n*Z(t)/r,Z(e)/r]}ie.invert=qt(M);function oe(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}oe.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(_(n)>U&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function ae(t,e){return[j(e)*Z(t),Z(e)]}ae.invert=qt(H);function Ae(t,e){var n=j(e),r=1+j(t)*n;return[n*Z(t)/r,Z(e)/r]}Ae.invert=qt((function(t){return 2*M(t)}));function se(t,e){return[V(W((k+e)/2)),-t]}se.invert=function(t,e){return[-e,2*M(L(t))-k]};function ce(t,e,n,r){var o,c=t.properties||{},u="Feature"===t.type?t.geometry:t;if("GeometryCollection"===u.type){var l=[];return d(t,(function(t){var i=ce(t,e,n,r);i&&l.push(i)})),a(l)}var g=I(t),f=g[1]>50&&g[3]>50;o=f?{type:u.type,coordinates:ue(u.coordinates,ge(u))}:function(t,e){return b(t,"mercator",e)}(u);var h,p=(new C.GeoJSONReader).read(o),y=A(s(e,n),"meters"),v=C.BufferOp.bufferOp(p,y);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((v=(new C.GeoJSONWriter).write(v)).coordinates))return(h=f?{type:v.type,coordinates:le(v.coordinates,ge(u))}:function(t,e){return b(t,"wgs84",e)}(v)).geometry?h:i(h,c)}function ue(t,e){return"object"!==typeof t[0]?e(t):t.map((function(t){return ue(t,e)}))}function le(t,e){return"object"!==typeof t[0]?e.invert(t):t.map((function(t){return le(t,e)}))}function ge(t){var e=p(t).geometry.coordinates.reverse(),n=e.map((function(t){return-t}));return function(){var t=ne(se),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}().center(e).rotate(n).scale(6371008.8)}e.default=function(t,e,n){var r=(n=n||{}).units,i=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!==typeof n)throw new Error("options must be an object");if("number"!==typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");i=i||64,r=r||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return d(t,(function(t){var n=ce(t,e,r,i);n&&o.push(n)})),a(o);case"FeatureCollection":return h(t,(function(t){var n=ce(t,e,r,i);n&&h(n,(function(t){t&&o.push(t)}))})),a(o)}return ce(t,e,r,i)}},function(t,e,n){"use strict";n.r(e);function r(t,e,n){if(!a(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&A(r),i&&s(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!o(t[0])||!o(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,n)}function o(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function a(t){return!!t&&t.constructor===Object}function A(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!o(t))throw new Error("bbox must only contain numbers")}))}function s(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function c(t,e,n){if(null!==t)for(var r,i,o,a,A,s,u,l,g=0,f=0,h=t.type,d="FeatureCollection"===h,I="Feature"===h,p=d?t.features.length:1,C=0;C<p;C++){A=(l=!!(u=d?t.features[C].geometry:I?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<A;y++){var v=0,B=0;if(null!==(a=l?u.geometries[y]:u)){s=a.coordinates;var m=a.type;switch(g=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(s,f,C,v,B))return!1;f++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<s.length;r++){if(!1===e(s[r],f,C,v,B))return!1;f++,"MultiPoint"===m&&v++}"LineString"===m&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<s.length;r++){for(i=0;i<s[r].length-g;i++){if(!1===e(s[r][i],f,C,v,B))return!1;f++}"MultiLineString"===m&&v++,"Polygon"===m&&B++}"Polygon"===m&&v++;break;case"MultiPolygon":for(r=0;r<s.length;r++){for("MultiPolygon"===m&&(B=0),i=0;i<s[r].length;i++){for(o=0;o<s[r][i].length-g;o++){if(!1===e(s[r][i][o],f,C,v,B))return!1;f++}B++}v++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===c(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var u=function(t,e){var n=0,r=0,o=0;return c(t,(function(t){n+=t[0],r+=t[1],o++}),!0),i([n/o,r/o],e)},l=n(553),g=n(554),f=n(333),h=n(314);e.default=function(t,e,n){if(!a(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e||(r||(r=u(t)),!1!==i&&void 0!==i||(t=Object(h.a)(t)),c(t,(function(t){var n=Object(l.a)(r,t)+e,i=Object(g.a)(r,t),o=function(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Object(f.a)(r,i,n));t[0]=o[0],t[1]=o[1]}))),t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(387),i=(Object(r.a)((function(t){return{paper:{backgroundColor:t.palette.background.paper},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"},popper:{zIndex:4}}})),Object(r.a)((function(t){return{root:{paddingLeft:t.spacing(1),paddingRight:t.spacing(1),width:"100%",flexDirection:"column"}}}))),o=Object(r.a)((function(t){return{root:{marginBottom:t.spacing(-2),top:t.spacing(-1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},expanded:{marginBottom:t.spacing(-3),top:t.spacing(-1),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},expandIcon:{"&$expanded":{top:t.spacing(-1.3)}}}}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(936);function i(t,e){return t?Object(r.a)().x((function(t){return e(t[1])[0]})).y((function(t){return e(t[1])[1]})).addAll(t):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n.n(r),o=n(935),a=n(842),A=n(1111),s=n(92),c=n(501);function u(t){var e=t.observationsLabel,n=t.cellColorEncoding,r=t.setCellColorEncoding,u=Object(c.a)(),l=Object(s.a)(e);return i.a.createElement(A.a,null,i.a.createElement(a.a,{className:u.labelCell,htmlFor:"cell-color-encoding-select"},l," Color Encoding"),i.a.createElement(a.a,{className:u.inputCell},i.a.createElement(o.a,{native:!0,className:u.select,value:n,onChange:function(t){r(t.target.value)},inputProps:{id:"cell-color-encoding-select"}},i.a.createElement("option",{value:"cellSetSelection"},"Cell Sets"),i.a.createElement("option",{value:"geneSelection"},"Gene Expression"))))}},function(t,e,n){"use strict";var r=n(12),i=n(11),o=n(14),a=n(61),A=n(24),s=n(25),c=n(0),u=n.n(c),l=n(931),g=n(708),f=n(315);function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function d(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var I=c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p=c.createElement("path",{d:"M21 3L3 10.53v.98l6.84 2.65L12.48 21h.98L21 3z"});function C(t){var e=t.svgRef,n=t.title,r=t.titleId,i=d(t,["svgRef","title","titleId"]);return c.createElement("svg",h({width:24,height:24,viewBox:"0 0 24 24",ref:e,"aria-labelledby":r},i),n?c.createElement("title",{id:r},n):null,I,p)}var y=c.forwardRef((function(t,e){return c.createElement(C,h({svgRef:e},t))}));n.p;function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function B(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var m=c.createElement("path",{d:"       M19 19h2v2h-2v-2zm0-2h2v-2h-2v2z       M3 13h2v-2H3v2zm0 4h2v-2H3v2z       m0-8h2V7H3v2zm0-4h2V3H3v2z       m4 0h2V3H7v2zm8 16h2v-2h-2v2z       m-4 0h2v-2h-2v2z       m4 0h2v-2h-2v2z       m-8 0h2v-2H7v2z       m-4 0h2v-2H3v2z       M11 5h2v-2h-2v2z       M15 5h2v-2h-2v2z       M19 5h2v-2h-2v2z       M19 9h2v-2h-2v2z       M19 13h2v-2h-2v2z     "});function b(t){var e=t.svgRef,n=t.title,r=t.titleId,i=B(t,["svgRef","title","titleId"]);return c.createElement("svg",v({width:24,height:24,viewBox:"0 0 24 24",ref:e,"aria-labelledby":r},i),n?c.createElement("title",{id:r},n):null,m)}var E=c.forwardRef((function(t,e){return c.createElement(b,v({svgRef:e},t))}));n.p;function Q(){return(Q=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function F(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function w(t){var e=t.svgRef,n=t.title,r=t.titleId,i=F(t,["svgRef","title","titleId"]);return c.createElement("svg",Q({width:24,height:24,viewBox:"0 0 24 24",ref:e,"aria-labelledby":r},i),n?c.createElement("title",{id:r},n):null,c.createElement("g",{transform:"translate(0,3)"},c.createElement("path",{style:{strokeWidth:.343565},d:"M 23.942314,4.6958443 C 23.446206,1.8868581 19.727461,0 14.687364,0 13.437819,0 12.150138,0.11543779 10.859708,0.34287772 4.1629423,1.5250844 -0.58168816,5.2884937 0.05768601,8.911385 c 0.25355086,1.439193 1.35605049,2.63583 3.04638949,3.461072 -0.2569865,0.387198 -0.4074679,0.826617 -0.4074679,1.29524 0,1.337498 1.1863293,2.457176 2.7639791,2.728248 l -1.3615475,2.333149 c -0.1576963,0.271073 -0.066308,0.61876 0.2047647,0.776457 0.090014,0.05291 0.1886171,0.07799 0.2858459,0.07799 0.1951448,0 0.3851362,-0.100665 0.4912977,-0.281723 l 1.6803757,-2.88148 C 8.41868,16.20561 9.6895264,15.063601 9.6998333,13.683844 c 6.872e-4,-0.0055 0.00137,-0.01065 0.00137,-0.01615 0,-0.02336 -0.00344,-0.04569 -0.00481,-0.06837 1.1292977,-0.0213 2.2847067,-0.130211 3.4435507,-0.334975 6.69711,-1.181863 11.44174,-4.9456164 10.802366,-8.5685077 z M 3.83312,13.667353 c 0,-0.30749 0.1281497,-0.59849 0.3470005,-0.848261 0.1219655,0.04295 0.2456489,0.08383 0.3717372,0.123339 l 1.2234344,2.352045 C 4.6865351,15.149835 3.83312,14.46408 3.83312,13.667353 Z M 7.0141869,15.216144 6.0223152,13.309702 5.4008064,12.114097 c 0.121622,-0.03161 0.2477103,-0.05634 0.3772342,-0.07387 0.1367388,-0.0189 0.2772568,-0.02886 0.420867,-0.02886 0.5067581,0 0.980534,0.11956 1.3701366,0.317454 0.5696305,0.289968 0.9554538,0.750345 0.9904974,1.262944 0.00137,0.02542 0.0055,0.05016 0.0055,0.07593 0,0.698124 -0.6562089,1.310356 -1.5508518,1.548447 z m 5.9185921,-3.126441 c -1.217251,0.214728 -2.429691,0.323982 -3.6060571,0.324669 -0.5765018,-0.911821 -1.7614569,-1.53917 -3.1278143,-1.53917 -0.4717146,0 -0.921441,0.07593 -1.332001,0.211292 -0.3061162,0.100665 -0.5878394,0.237403 -0.8427645,0.39991 C 2.4598914,10.828133 1.4360682,9.8579062 1.2319907,8.7035283 0.72660678,5.8381974 5.2307418,2.5475333 11.067221,1.5175259 c 1.222061,-0.2161023 2.439998,-0.3246688 3.620143,-0.3246688 4.371863,0 7.694479,1.5250844 8.080645,3.7101568 0.505041,2.8653309 -3.998751,6.1566821 -9.83523,7.1866891 z",id:"path10"})))}var S=c.forwardRef((function(t,e){return c.createElement(w,Q({svgRef:e},t))}));n.p;function R(t){var e=t.alt,n=t.onClick,r=t.isActive,i=t.children,o="btn btn-outline-secondary mr-2 icon",a="".concat(o," active");return u.a.createElement("button",{className:r?a:o,onClick:n,type:"button",title:e},i)}function U(t){var e=t.setActiveTool,n=t.activeTool,r=t.visibleTools,i=void 0===r?{pan:!0,selectRectangle:!0,selectLasso:!0}:r;return u.a.createElement("div",{className:"tool"},i.pan&&u.a.createElement(R,{alt:"pointer tool",onClick:function(){return e(null)},isActive:null===n},u.a.createElement(y,null)),i.selectRectangle&&u.a.createElement(R,{alt:"select rectangle",onClick:function(){return e(f.SELECTION_TYPE.RECTANGLE)},isActive:n===f.SELECTION_TYPE.RECTANGLE},u.a.createElement(E,null)),i.selectLasso&&u.a.createElement(R,{alt:"select lasso",onClick:function(){return e(f.SELECTION_TYPE.POLYGON)},isActive:n===f.SELECTION_TYPE.POLYGON},u.a.createElement(S,null)))}var x=n(75),k=function(){return"crosshair"},O=function(t){return t.isDragging?"grabbing":"default"};n.d(e,"a",(function(){return N}));var N=function(t){Object(A.a)(n,t);var e=Object(s.a)(n);function n(t){var r;return Object(i.a)(this,n),(r=e.call(this,t)).state={gl:null,tool:null},r.viewport=null,r.onViewStateChange=r.onViewStateChange.bind(Object(a.a)(r)),r.onInitializeViewInfo=r.onInitializeViewInfo.bind(Object(a.a)(r)),r.onWebGLInitialized=r.onWebGLInitialized.bind(Object(a.a)(r)),r.onToolChange=r.onToolChange.bind(Object(a.a)(r)),r}return Object(o.a)(n,[{key:"onViewStateChange",value:function(t){var e=t.viewState;(0,this.props.setViewState)(e)}},{key:"onInitializeViewInfo",value:function(t){var e=t.viewport;this.viewport=e}},{key:"onWebGLInitialized",value:function(t){this.setState({gl:t})}},{key:"onToolChange",value:function(t){var e=this.props.onToolChange;this.setState({tool:t}),e&&e(t)}},{key:"getLayers",value:function(){return[]}},{key:"viewInfoDidUpdate",value:function(t){var e=this.props,n=e.updateViewInfo,i=e.cells,o=e.uuid,a=this.viewport;n&&a&&n({uuid:o,project:function(e){var n=i[e];try{var o=t(n),A=Object(r.a)(o,2),s=A[0],c=A[1];return a.project([s,c])}catch(u){return[null,null]}}})}},{key:"componentDidUpdate",value:function(){}},{key:"render",value:function(){var t=this.props,e=t.deckRef,n=t.viewState,r=t.uuid,i=this.state,o=i.gl,a=i.tool,A=this.getLayers(),s=null!==this.cellsLayer,c=null!==this.cellsLayer;return u.a.createElement(u.a.Fragment,null,u.a.createElement(U,{activeTool:a,setActiveTool:this.onToolChange,visibleTools:{pan:c,selectRectangle:s,selectLasso:s}}),u.a.createElement(l.a,{id:"deckgl-overlay-".concat(r),ref:e,views:[new g.a({id:"ortho"})],layers:o?A:[],glOptions:x.c,onWebGLInitialized:this.onWebGLInitialized,onViewStateChange:this.onViewStateChange,viewState:n,controller:!a||{dragPan:!1},getCursor:a?k:O},this.onInitializeViewInfo))}}]),n}(c.PureComponent)},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1360),a=n(28),A=n(9),s=(n(20),n(32)),c=n(43),u=n(552),l=r.forwardRef((function(t,e){var n=t.classes,i=t.className,o=t.component,c=void 0===o?"table":o,l=t.padding,g=void 0===l?"default":l,f=t.size,h=void 0===f?"medium":f,d=t.stickyHeader,I=void 0!==d&&d,p=Object(a.a)(t,["classes","className","component","padding","size","stickyHeader"]),C=r.useMemo((function(){return{padding:g,size:h,stickyHeader:I}}),[g,h,I]);return r.createElement(u.a.Provider,{value:C},r.createElement(c,Object(A.a)({ref:e,className:Object(s.a)(n.root,i,I&&n.stickyHeader)},p)))})),g=Object(c.a)((function(t){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":Object(A.a)({},t.typography.body2,{padding:t.spacing(2),color:t.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}}),{name:"MuiTable"})(l),f=n(483),h={variant:"body"},d=r.forwardRef((function(t,e){var n=t.classes,i=t.className,o=t.component,c=void 0===o?"tbody":o,u=Object(a.a)(t,["classes","className","component"]);return r.createElement(f.a.Provider,{value:h},r.createElement(c,Object(A.a)({className:Object(s.a)(n.root,i),ref:e},u)))})),I=Object(c.a)({root:{display:"table-row-group"}},{name:"MuiTableBody"})(d),p=r.forwardRef((function(t,e){var n=t.classes,i=t.className,o=t.component,c=void 0===o?"div":o,u=Object(a.a)(t,["classes","className","component"]);return r.createElement(c,Object(A.a)({ref:e,className:Object(s.a)(n.root,i)},u))})),C=Object(c.a)({root:{width:"100%",overflowX:"auto"}},{name:"MuiTableContainer"})(p),y=n(501);function v(t){var e=t.children,n=Object(y.a)();return i.a.createElement(o.a,{className:n.box},i.a.createElement(C,{className:n.tableContainer},i.a.createElement(g,{className:n.table,size:"small"},i.a.createElement(I,null,e))))}n.d(e,"a",(function(){return v}))},,,,,function(t,e,n){var r=n(762),i=n(731),o=n(763);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,i,o){for(var a=-1,A=r(n((e-t)/(i||1)),0),s=Array(A);A--;)s[o?A:++a]=t,t+=i;return s}},function(t,e,n){var r=n(404);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69);e.default=function(t,e){var n=!1;return r.featureCollection(function(t){if(t.length<3)return[];t.sort(o);var e,n,r,A,s,c,u=t.length-1,l=t[u].x,g=t[0].x,f=t[u].y,h=f;for(;u--;)t[u].y<f&&(f=t[u].y),t[u].y>h&&(h=t[u].y);var d,I=g-l,p=h-f,C=I>p?I:p,y=.5*(g+l),v=.5*(h+f),B=[new i({__sentinel:!0,x:y-20*C,y:v-C},{__sentinel:!0,x:y,y:v+20*C},{__sentinel:!0,x:y+20*C,y:v-C})],m=[],b=[];u=t.length;for(;u--;){for(b.length=0,d=B.length;d--;)(I=t[u].x-B[d].x)>0&&I*I>B[d].r?(m.push(B[d]),B.splice(d,1)):(p=t[u].y-B[d].y,I*I+p*p>B[d].r||(b.push(B[d].a,B[d].b,B[d].b,B[d].c,B[d].c,B[d].a),B.splice(d,1)));for(a(b),d=b.length;d;)n=b[--d],e=b[--d],r=t[u],A=n.x-e.x,s=n.y-e.y,c=2*(A*(r.y-n.y)-s*(r.x-n.x)),Math.abs(c)>1e-12&&B.push(new i(e,n,r))}Array.prototype.push.apply(m,B),u=m.length;for(;u--;)(m[u].a.__sentinel||m[u].b.__sentinel||m[u].c.__sentinel)&&m.splice(u,1);return m}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],i=[t.b.x,t.b.y],o=[t.c.x,t.c.y],a={};return n?(e.push(t.a.z),i.push(t.b.z),o.push(t.c.z)):a={a:t.a.z,b:t.b.z,c:t.c.z},r.polygon([[e,i,o,e]],a)})))};var i=function(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,a=e.y-t.y,A=n.x-t.x,s=n.y-t.y,c=o*(t.x+e.x)+a*(t.y+e.y),u=A*(t.x+n.x)+s*(t.y+n.y),l=2*(o*(n.y-e.y)-a*(n.x-e.x));this.x=(s*c-a*u)/l,this.y=(o*u-A*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i};function o(t,e){return e.x-t.x}function a(t){var e,n,r,i,o,a=t.length;t:for(;a;)for(n=t[--a],e=t[--a],r=a;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(a,2),t.splice(r,2),a-=2;continue t}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(496)),o=n(69),a=n(109),A=n(137),s=r(n(766)),c=r(n(767));e.default=function(t,e){if(void 0===e&&(e={}),e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==a.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=i.default(t));var r=function(t){var e={};A.flattenEach(t,(function(t){e[t.geometry.type]=!0}));var n=Object.keys(e);if(1===n.length)return n[0];return null}(t);if(!r)throw new Error("geojson must be homogenous");var u=t;switch(r){case"LineString":return s.default(u,e);case"Polygon":return c.default(u,e);default:throw new Error(r+" is not supported")}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(496)),o=n(69),a=n(109),A=n(137);function s(t){return t[0].toString()+","+t[1].toString()}e.default=function(t,e){if(void 0===e&&(e={}),e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==a.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=i.default(t));var r=[],c=A.lineReduce(t,(function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,a=s(r[0]),A=s(r[r.length-1]),c=s(i[0]),u=s(i[i.length-1]);if(a===u)n=i.concat(r.slice(1));else if(c===A)n=r.concat(i.slice(1));else if(a===c)n=r.slice(1).reverse().concat(i);else{if(A!==u)return null;n=r.concat(i.reverse().slice(1))}return o.lineString(n)}(t,e);return n||(r.push(t),e)}));return c&&r.push(c),r.length?1===r.length?r[0]:o.multiLineString(r.map((function(t){return t.coordinates}))):null}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(496)),o=n(69),a=n(109),A=n(137),s=n(780);e.default=function(t,e){if(void 0===e&&(e={}),"FeatureCollection"!==a.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=i.default(t));var n=[];A.flattenEach(t,(function(t){n.push(t.geometry)}));var r=s.topology({geoms:o.geometryCollection(n).geometry});return s.merge(r,r.objects.geoms.geometries)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(1052),i=n(878);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=!0},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(491);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){var r=n(533),i=n(1256),o=n(345);t.exports=function(t){return o(t)?r(t,!0):i(t)}},function(t,e){var n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}},function(t,e,n){(function(e){var n="object"===typeof e&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0})&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).NODE_DEBUG)?function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=console).error.apply(t,["SEMVER"].concat(n))}:function(){};t.exports=n}).call(this,n(68))},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return r(t,e,n)>0}},function(t,e,n){var r=n(892),i=n(893),o=Symbol("SemVer ANY"),a=function(){"use strict";function t(e,n){if(r(this,t),n&&"object"===typeof n||(n={loose:!!n,includePrerelease:!1}),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}l("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===o?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}return i(t,null,[{key:"ANY",get:function(){return o}}]),i(t,[{key:"parse",value:function(t){var e=this.options.loose?s[c.COMPARATORLOOSE]:s[c.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: ".concat(t));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new g(n[2],this.options.loose):this.semver=o}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(t){if(l("Comparator.test",t,this.options.loose),this.semver===o||t===o)return!0;if("string"===typeof t)try{t=new g(t,this.options)}catch(e){return!1}return u(t,this.operator,this.semver,this.options)}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");if(n&&"object"===typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new f(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new f(this.value,n).test(e.semver);var r=(">="===this.operator||">"===this.operator)&&(">="===e.operator||">"===e.operator),i=("<="===this.operator||"<"===this.operator)&&("<="===e.operator||"<"===e.operator),o=this.semver.version===e.semver.version,a=(">="===this.operator||"<="===this.operator)&&(">="===e.operator||"<="===e.operator),A=u(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=u(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&a||A||s}}]),t}();t.exports=a;var A=n(691),s=A.re,c=A.t,u=n(1082),l=n(776),g=n(316),f=n(393)},function(t,e,n){var r=n(393);t.exports=function(t,e,n){try{e=new r(e,n)}catch(i){return!1}return e.test(t)}},function(t,e,n){"use strict";n.r(e);var r=function(t){return t},i=function(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],A=t.translate[1];return function(t,r){r||(e=n=0);var s=2,c=t.length,u=new Array(c);for(u[0]=(e+=t[0])*i+a,u[1]=(n+=t[1])*o+A;s<c;)u[s]=t[s],++s;return u}},o=function(t){var e,n=i(t.transform),r=1/0,o=r,a=-r,A=-r;function s(t){(t=n(t))[0]<r&&(r=t[0]),t[0]>a&&(a=t[0]),t[1]<o&&(o=t[1]),t[1]>A&&(A=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":s(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(s)}}for(e in t.arcs.forEach((function(t){for(var e,i=-1,s=t.length;++i<s;)(e=n(t[i],i))[0]<r&&(r=e[0]),e[0]>a&&(a=e[0]),e[1]<o&&(o=e[1]),e[1]>A&&(A=e[1])})),t.objects)c(t.objects[e]);return[r,o,a,A]},a=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return A(t,e)}))}:A(t,e)};function A(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=s(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function s(t,e){var n=i(t.transform),r=t.arcs;function o(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function a(t){return n(t)}function A(t){for(var e=[],n=0,r=t.length;n<r;++n)o(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=A(t);e.length<4;)e.push(e[0]);return e}function c(t){return t.map(s)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=a(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(a);break;case"LineString":n=A(e.arcs);break;case"MultiLineString":n=e.arcs.map(A);break;case"Polygon":n=c(e.arcs);break;case"MultiPolygon":n=e.arcs.map(c);break;default:return null}return{type:r,coordinates:n}}(e)}var c=function(t,e){var n={},r={},i={},o=[],a=-1;function A(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),A=a[0],s=a[1];if(n=i[A])if(delete i[n.end],n.push(e),n.end=s,o=r[s]){delete r[o.start];var c=o===n?n:n.concat(o);r[c.start=n.start]=i[c.end=o.end]=c}else r[n.start]=i[n.end]=n;else if(n=r[s])if(delete r[n.start],n.unshift(e),n.start=A,o=i[A]){delete i[o.end];var u=o===n?n:o.concat(n);r[u.start=o.start]=i[u.end=n.end]=u}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=A]=i[n.end=s]=n})),A(i,r),A(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o},u=function(t){return s(t,l.apply(this,arguments))};function l(t,e,n){var r,i,o;if(arguments.length>1)r=g(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:c(t,r)}}function g(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function A(t){t.forEach(a)}function s(t){t.forEach(A)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":A(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(s)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}var f=function(t){return s(t,h.apply(this,arguments))};function h(t,e){var n={},r=[],i=[];function o(t){t.forEach((function(e){e.forEach((function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)}))})),r.push(t)}function a(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach((function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}})),r.forEach((function(t){if(!t._){var e=[],r=[t];for(t._=1,i.push(e);t=r.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){n[t<0?~t:t].forEach((function(t){t._||(t._=1,r.push(t))}))}))}))}})),r.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:i.map((function(e){var r,i=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){n[t<0?~t:t].length<2&&i.push(t)}))}))})),(r=(i=c(t,i)).length)>1)for(var o,A,s=1,u=a(i[0]);s<r;++s)(o=a(i[s]))>u&&(A=i[0],i[0]=i[s],i[s]=A,u=o);return i}))}}var d=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;t[i]<e?n=i+1:r=i}return n},I=function(t){var e={},n=t.map((function(){return[]}));function r(t,n){t.forEach((function(t){t<0&&(t=~t);var r=e[t];r?r.push(n):e[t]=[n]}))}function i(t,e){t.forEach((function(t){r(t,e)}))}var o={LineString:r,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach((function(t){i(t,e)}))}};for(var a in t.forEach((function t(e,n){"GeometryCollection"===e.type?e.geometries.forEach((function(e){t(e,n)})):e.type in o&&o[e.type](e.arcs,n)})),e)for(var A=e[a],s=A.length,c=0;c<s;++c)for(var u=c+1;u<s;++u){var l,g=A[c],f=A[u];(l=n[g])[a=d(l,f)]!==f&&l.splice(a,0,f),(l=n[f])[a=d(l,g)]!==g&&l.splice(a,0,g)}return n},p=function(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],A=t.translate[1];return function(t,r){r||(e=n=0);var s=2,c=t.length,u=new Array(c),l=Math.round((t[0]-a)/i),g=Math.round((t[1]-A)/o);for(u[0]=l-e,e=l,u[1]=g-n,n=g;s<c;)u[s]=t[s],++s;return u}},C=function(t,e){if(t.transform)throw new Error("already quantized");if(e&&e.scale)s=t.bbox;else{if(!((n=Math.floor(e))>=2))throw new Error("n must be \u22652");var n,r=(s=t.bbox||o(t))[0],i=s[1],a=s[2],A=s[3];e={scale:[a-r?(a-r)/(n-1):1,A-i?(A-i)/(n-1):1],translate:[r,i]}}var s,c,u=p(e),l=t.objects,g={};function f(t){return u(t)}function h(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(h)};break;case"Point":e={type:"Point",coordinates:f(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(f)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in l)g[c]=h(l[c]);return{type:"Topology",bbox:s,transform:e,objects:g,arcs:t.arcs.map((function(t){var e,n=0,r=1,i=t.length,o=new Array(i);for(o[0]=u(t[0],0);++n<i;)((e=u(t[n],n))[0]||e[1])&&(o[r++]=e);return 1===r&&(o[r++]=[0,0]),o.length=r,o}))}},y=function(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var a=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),A=new o(t),s=t-1,c=0;c<t;++c)a[c]=i;function u(r,o){for(var c=e(r)&s,u=a[c],l=0;u!=i;){if(n(u,r))return A[c]=o;if(++l>=t)throw new Error("full hashmap");u=a[c=c+1&s]}return a[c]=r,A[c]=o,o}function l(r,o){for(var c=e(r)&s,u=a[c],l=0;u!=i;){if(n(u,r))return A[c];if(++l>=t)throw new Error("full hashmap");u=a[c=c+1&s]}return a[c]=r,A[c]=o,o}function g(r,o){for(var c=e(r)&s,u=a[c],l=0;u!=i;){if(n(u,r))return A[c];if(++l>=t)break;u=a[c=c+1&s]}return o}function f(){for(var t=[],e=0,n=a.length;e<n;++e){var r=a[e];r!=i&&t.push(r)}return t}return{set:u,maybeSet:l,get:g,keys:f}},v=function(t,e){return t[0]===e[0]&&t[1]===e[1]},B=new ArrayBuffer(16),m=new Float64Array(B),b=new Uint32Array(B),E=function(t){m[0]=t[0],m[1]=t[1];var e=b[0]^b[1];return 2147483647&(e=e<<5^e>>7^b[2]^b[3])},Q=function(t){var e,n,r,i,o=t.coordinates,a=t.lines,A=t.rings,s=function(){for(var t=y(1.4*o.length,b,Q,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n<r;++n)e[n]=t.maybeSet(n,n);return e}(),c=new Int32Array(o.length),u=new Int32Array(o.length),l=new Int32Array(o.length),g=new Int8Array(o.length),f=0;for(e=0,n=o.length;e<n;++e)c[e]=u[e]=l[e]=-1;for(e=0,n=a.length;e<n;++e){var h=a[e],d=h[0],I=h[1];for(r=s[d],i=s[++d],++f,g[r]=1;++d<=I;)m(e,r,r=i,i=s[d]);++f,g[i]=1}for(e=0,n=o.length;e<n;++e)c[e]=-1;for(e=0,n=A.length;e<n;++e){var p=A[e],C=p[0]+1,B=p[1];for(m(e,s[B-1],r=s[C-1],i=s[C]);++C<=B;)m(e,r,r=i,i=s[C])}function m(t,e,n,r){if(c[n]!==t){c[n]=t;var i=u[n];if(i>=0){var o=l[n];i===e&&o===r||i===r&&o===e||(++f,g[n]=1)}else u[n]=e,l[n]=r}}function b(t){return E(o[t])}function Q(t,e){return v(o[t],o[e])}c=u=l=null;var F,w=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=t-1,A=0;A<t;++A)o[A]=i;function s(r){for(var A=e(r)&a,s=o[A],c=0;s!=i;){if(n(s,r))return!0;if(++c>=t)throw new Error("full hashset");s=o[A=A+1&a]}return o[A]=r,!0}function c(r){for(var A=e(r)&a,s=o[A],c=0;s!=i;){if(n(s,r))return!0;if(++c>=t)break;s=o[A=A+1&a]}return!1}function u(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}return{add:s,has:c,values:u}}(1.4*f,E,v);for(e=0,n=o.length;e<n;++e)g[F=s[e]]&&w.add(o[F]);return w};function F(t,e,n,r){w(t,e,n),w(t,e,e+r),w(t,e+r,n)}function w(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}var S=function(t){var e,n,r={};for(e in t)r[e]=null==(n=t[e])?{type:null}:("FeatureCollection"===n.type?R:"Feature"===n.type?U:x)(n);return r};function R(t){var e={type:"GeometryCollection",geometries:t.features.map(U)};return null!=t.bbox&&(e.bbox=t.bbox),e}function U(t){var e,n=x(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function x(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(x)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}var k=function(t,e){var n=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;function o(t){null!=t&&a.hasOwnProperty(t.type)&&a[t.type](t)}var a={GeometryCollection:function(t){t.geometries.forEach(o)},Point:function(t){A(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(A)},LineString:function(t){s(t.arcs)},MultiLineString:function(t){t.arcs.forEach(s)},Polygon:function(t){t.arcs.forEach(s)},MultiPolygon:function(t){t.arcs.forEach(c)}};function A(t){var o=t[0],a=t[1];o<e&&(e=o),o>r&&(r=o),a<n&&(n=a),a>i&&(i=a)}function s(t){t.forEach(A)}function c(t){t.forEach(s)}for(var u in t)o(t[u]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=S(t)),r=e>0&&n&&function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],A=o-r?(n-1)/(o-r):1,s=a-i?(n-1)/(a-i):1;function c(t){return[Math.round((t[0]-r)*A),Math.round((t[1]-i)*s)]}function u(t,e){for(var n,o,a,c,u,l=-1,g=0,f=t.length,h=new Array(f);++l<f;)n=t[l],c=Math.round((n[0]-r)*A),u=Math.round((n[1]-i)*s),c===o&&u===a||(h[g++]=[o=c,a=u]);for(h.length=g;g<e;)g=h.push([h[0][0],h[0][1]]);return h}function l(t){return u(t,2)}function g(t){return u(t,4)}function f(t){return t.map(g)}function h(t){null!=t&&d.hasOwnProperty(t.type)&&d[t.type](t)}var d={GeometryCollection:function(t){t.geometries.forEach(h)},Point:function(t){t.coordinates=c(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(c)},LineString:function(t){t.arcs=l(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(l)},Polygon:function(t){t.arcs=f(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(f)}};for(var I in t)h(t[I]);return{scale:[1/A,1/s],translate:[r,i]}}(t,n,e),i=function(t){var e,n,r,i,o=t.coordinates,a=t.lines,A=t.rings,s=a.length+A.length;for(delete t.lines,delete t.rings,r=0,i=a.length;r<i;++r)for(e=a[r];e=e.next;)++s;for(r=0,i=A.length;r<i;++r)for(n=A[r];n=n.next;)++s;var c=y(2*s*1.4,E,v),u=t.arcs=[];for(r=0,i=a.length;r<i;++r){e=a[r];do{l(e)}while(e=e.next)}for(r=0,i=A.length;r<i;++r)if((n=A[r]).next)do{l(n)}while(n=n.next);else g(n);function l(t){var e,n,r,i,a,A,s,l;if(r=c.get(e=o[t[0]]))for(s=0,l=r.length;s<l;++s)if(f(i=r[s],t))return t[0]=i[0],void(t[1]=i[1]);if(a=c.get(n=o[t[1]]))for(s=0,l=a.length;s<l;++s)if(h(A=a[s],t))return t[1]=A[0],void(t[0]=A[1]);r?r.push(t):c.set(e,[t]),a?a.push(t):c.set(n,[t]),u.push(t)}function g(t){var e,n,r,i,a;if(n=c.get(o[t[0]]))for(i=0,a=n.length;i<a;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(I(r,t))return t[0]=r[1],void(t[1]=r[0])}if(n=c.get(e=o[t[0]+p(t)]))for(i=0,a=n.length;i<a;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(I(r,t))return t[0]=r[1],void(t[1]=r[0])}n?n.push(t):c.set(e,[t]),u.push(t)}function f(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!==r-e[1])return!1;for(;n<=i;++n,++r)if(!v(o[n],o[r]))return!1;return!0}function h(t,e){var n=t[0],r=e[0],i=t[1],a=e[1];if(n-i!==r-a)return!1;for(;n<=i;++n,--a)if(!v(o[n],o[a]))return!1;return!0}function d(t,e){var n=t[0],r=e[0],i=t[1]-n;if(i!==e[1]-r)return!1;for(var a=p(t),A=p(e),s=0;s<i;++s)if(!v(o[n+(s+a)%i],o[r+(s+A)%i]))return!1;return!0}function I(t,e){var n=t[0],r=e[0],i=t[1],a=e[1],A=i-n;if(A!==a-r)return!1;for(var s=p(t),c=A-p(e),u=0;u<A;++u)if(!v(o[n+(u+s)%A],o[a-(u+c)%A]))return!1;return!0}function p(t){for(var e=t[0],n=t[1],r=e,i=r,a=o[r];++r<n;){var A=o[r];(A[0]<a[0]||A[0]===a[0]&&A[1]<a[1])&&(i=r,a=A)}return i-e}return t}(function(t){var e,n,r,i=Q(t),o=t.coordinates,a=t.lines,A=t.rings;for(n=0,r=a.length;n<r;++n)for(var s=a[n],c=s[0],u=s[1];++c<u;)i.has(o[c])&&(e={0:c,1:s[1]},s[1]=c,s=s.next=e);for(n=0,r=A.length;n<r;++n)for(var l=A[n],g=l[0],f=g,h=l[1],d=i.has(o[g]);++f<h;)i.has(o[f])&&(d?(e={0:f,1:l[1]},l[1]=f,l=l.next=e):(F(o,g,h,h-f),o[h]=o[g],d=!0,f=g));return t}(function(t){var e=-1,n=[],r=[],i=[];function o(t){t&&a.hasOwnProperty(t.type)&&a[t.type](t)}var a={GeometryCollection:function(t){t.geometries.forEach(o)},LineString:function(t){t.arcs=A(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(A)},Polygon:function(t){t.arcs=t.arcs.map(s)},MultiPolygon:function(t){t.arcs=t.arcs.map(c)}};function A(t){for(var r=0,o=t.length;r<o;++r)i[++e]=t[r];var a={0:e-o+1,1:e};return n.push(a),a}function s(t){for(var n=0,o=t.length;n<o;++n)i[++e]=t[n];var a={0:e-o+1,1:e};return r.push(a),a}function c(t){return t.map(s)}for(var u in t)o(t[u]);return{type:"Topology",coordinates:i,lines:n,rings:r,objects:t}}(t))),o=i.coordinates,a=y(1.4*i.arcs.length,O,N);function A(t){t&&s.hasOwnProperty(t.type)&&s[t.type](t)}t=i.objects,i.bbox=n,i.arcs=i.arcs.map((function(t,e){return a.set(t,e),o.slice(t[0],t[1]+1)})),delete i.coordinates,o=null;var s={GeometryCollection:function(t){t.geometries.forEach(A)},LineString:function(t){t.arcs=c(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(c)},Polygon:function(t){t.arcs=t.arcs.map(c)},MultiPolygon:function(t){t.arcs=t.arcs.map(u)}};function c(t){var e=[];do{var n=a.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function u(t){return t.map(c)}for(var l in t)A(t[l]);return r&&(i.transform=r,i.arcs=function(t){for(var e=-1,n=t.length;++e<n;){for(var r,i,o=t[e],a=0,A=1,s=o.length,c=o[0],u=c[0],l=c[1];++a<s;)r=(c=o[a])[0],i=c[1],r===u&&i===l||(o[A++]=[r-u,i-l],u=r,l=i);1===A&&(o[A++]=[0,0]),o.length=A}return t}(i.arcs)),i};function O(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function N(t,e){var n,r=t[0],i=t[1],o=e[0],a=e[1];return i<r&&(n=r,r=i,i=n),a<o&&(n=o,o=a,a=n),r===o&&i===a}var D=function(t,e){var n,r=t.objects,i={};function o(t){var e,n;switch(t.type){case"Polygon":e=(n=a(t.arcs))?{type:"Polygon",arcs:n}:{type:null};break;case"MultiPolygon":e=(n=t.arcs.map(a).filter(_)).length?{type:"MultiPolygon",arcs:n}:{type:null};break;case"GeometryCollection":e=(n=t.geometries.map(o).filter(M)).length?{type:"GeometryCollection",geometries:n}:{type:null};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function a(t){return t.length&&(n=t[0],e(n,!1))?[t[0]].concat(t.slice(1).filter(A)):null;var n}function A(t){return e(t,!0)}for(n in null==e&&(e=G),r)i[n]=o(r[n]);return function(t){var e,n,r=t.objects,i={},o=t.arcs,a=o.length,A=-1,s=new Array(a),c=0,u=-1;function l(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(l);break;case"LineString":f(t.arcs);break;case"MultiLineString":case"Polygon":t.arcs.forEach(f);break;case"MultiPolygon":t.arcs.forEach(h)}}function g(t){t<0&&(t=~t),s[t]||(s[t]=1,++c)}function f(t){t.forEach(g)}function h(t){t.forEach(f)}function d(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(d)};break;case"LineString":e={type:"LineString",arcs:p(t.arcs)};break;case"MultiLineString":e={type:"MultiLineString",arcs:t.arcs.map(p)};break;case"Polygon":e={type:"Polygon",arcs:t.arcs.map(p)};break;case"MultiPolygon":e={type:"MultiPolygon",arcs:t.arcs.map(C)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function I(t){return t<0?~s[~t]:s[t]}function p(t){return t.map(I)}function C(t){return t.map(p)}for(n in r)l(r[n]);for(e=new Array(c);++A<a;)s[A]&&(s[A]=++u,e[u]=o[A]);for(n in r)i[n]=d(r[n]);return{type:"Topology",bbox:t.bbox,transform:t.transform,objects:i,arcs:e}}({type:"Topology",bbox:t.bbox,transform:t.transform,objects:i,arcs:t.arcs})};function G(){return!0}function _(t){return t}function M(t){return null!=t.type}var T=function(t){var e,n=new Array(t.arcs.length),r=0;function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Polygon":o(t.arcs);break;case"MultiPolygon":t.arcs.forEach(o)}}function o(t){for(var e=0,i=t.length;e<i;++e,++r)for(var o=t[e],a=0,A=o.length;a<A;++a){var s=o[a];s<0&&(s=~s);var c=n[s];null==c?n[s]=r:c!==r&&(n[s]=-1)}}for(e in t.objects)i(t.objects[e]);return function(t){for(var e,r=0,i=t.length;r<i;++r)if(-1===n[(e=t[r])<0?~e:e])return!0;return!1}};function j(t){var e=t[0],n=t[1],r=t[2];return Math.abs((e[0]-r[0])*(n[1]-e[1])-(e[0]-n[0])*(r[1]-e[1]))/2}function L(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)/2}var V=function(t,e,n){return e=null==e?Number.MIN_VALUE:+e,null==n&&(n=L),function(r,i){return n(a(t,{type:"Polygon",arcs:[r]}).geometry.coordinates[0],i)>=e}},Z=function(t,e,n){var r=T(t),i=V(t,e,n);return function(t,e){return r(t,e)||i(t,e)}};function P(t,e){return t[1][2]-e[1][2]}function W(t){return[t[0],t[1],0]}var J=function(t,e){var n=t.transform?i(t.transform):W,r=function(){var t={},e=[],n=0;function r(t,n){for(;n>0;){var r=(n+1>>1)-1,i=e[r];if(P(t,i)>=0)break;e[i._=n]=i,e[t._=n=r]=t}}function i(t,r){for(;;){var i=r+1<<1,o=i-1,a=r,A=e[a];if(o<n&&P(e[o],A)<0&&(A=e[a=o]),i<n&&P(e[i],A)<0&&(A=e[a=i]),a===r)break;e[A._=r]=A,e[t._=r=a]=t}}return t.push=function(t){return r(e[t._=n]=t,n++),n},t.pop=function(){if(!(n<=0)){var t,r=e[0];return--n>0&&(t=e[n],i(e[t._=0]=t,0)),r}},t.remove=function(t){var o,a=t._;if(e[a]===t)return a!==--n&&(P(o=e[n],t)<0?r:i)(e[o._=a]=o,a),a},t}();null==e&&(e=j);var o=t.arcs.map((function(t){var i,o,A,s=[],c=0;for(o=1,A=(t=t.map(n)).length-1;o<A;++o)(i=[t[o-1],t[o],t[o+1]])[1][2]=e(i),s.push(i),r.push(i);for(t[0][2]=t[A][2]=1/0,o=0,A=s.length;o<A;++o)(i=s[o]).previous=s[o-1],i.next=s[o+1];for(;i=r.pop();){var u=i.previous,l=i.next;i[1][2]<c?i[1][2]=c:c=i[1][2],u&&(u.next=l,u[2]=i[2],a(u)),l&&(l.previous=u,l[0]=i[0],a(l))}return t}));function a(t){r.remove(t),t[1][2]=e(t),r.push(t)}return{type:"Topology",bbox:t.bbox,objects:t.objects,arcs:o}},H=function(t,e){var n=[];return t.arcs.forEach((function(t){t.forEach((function(t){isFinite(t[2])&&n.push(t[2])}))})),n.length&&function(t,e){if(!(n=t.length))return;if((e=+e)<=0||n<2)return t[0];if(e>=1)return t[n-1];var n,r=(n-1)*e,i=Math.floor(r),o=t[i],a=t[i+1];return o+(a-o)*(r-i)}(n.sort(Y),e)};function Y(t,e){return e-t}var X=function(t,e){e=null==e?Number.MIN_VALUE:+e;var n=t.arcs.map((function(t){for(var n,r=-1,i=0,o=t.length,a=new Array(o);++r<o;)(n=t[r])[2]>=e&&(a[i++]=[n[0],n[1]]);return a.length=i,a}));return{type:"Topology",transform:t.transform,bbox:t.bbox,objects:t.objects,arcs:n}},z=Math.PI,K=2*z,q=z/4,$=z/180,tt=Math.abs,et=Math.atan2,nt=Math.cos,rt=Math.sin;function it(t,e){for(var n,r,i=0,o=t.length,a=0,A=t[e?i++:o-1],s=A[0]*$,c=A[1]*$/2+q,u=nt(c),l=rt(c);i<o;++i){n=s,s=(A=t[i])[0]*$,c=A[1]*$/2+q,r=u,u=nt(c);var g=s-n,f=g>=0?1:-1,h=f*g,d=l*(l=rt(c)),I=r*u+d*nt(h),p=d*f*rt(h);a+=et(p,I)}return a}function ot(t,e){var n=it(t,!0);return e&&(n*=-1),2*(n<0?K+n:n)}function at(t){return 2*tt(it(t,!1))}n.d(e,"bbox",(function(){return o})),n.d(e,"feature",(function(){return a})),n.d(e,"mesh",(function(){return u})),n.d(e,"meshArcs",(function(){return l})),n.d(e,"merge",(function(){return f})),n.d(e,"mergeArcs",(function(){return h})),n.d(e,"neighbors",(function(){return I})),n.d(e,"quantize",(function(){return C})),n.d(e,"transform",(function(){return i})),n.d(e,"untransform",(function(){return p})),n.d(e,"topology",(function(){return k})),n.d(e,"filter",(function(){return D})),n.d(e,"filterAttached",(function(){return T})),n.d(e,"filterAttachedWeight",(function(){return Z})),n.d(e,"filterWeight",(function(){return V})),n.d(e,"planarRingArea",(function(){return L})),n.d(e,"planarTriangleArea",(function(){return j})),n.d(e,"presimplify",(function(){return J})),n.d(e,"quantile",(function(){return H})),n.d(e,"simplify",(function(){return X})),n.d(e,"sphericalRingArea",(function(){return ot})),n.d(e,"sphericalTriangleArea",(function(){return at}))},function(t,e,n){"use strict";var r=n(28),i=n(9),o=n(0),a=(n(20),n(32)),A=n(43),s=o.forwardRef((function(t,e){var n=t.classes,A=t.className,s=t.component,c=void 0===s?"div":s,u=t.square,l=void 0!==u&&u,g=t.elevation,f=void 0===g?1:g,h=t.variant,d=void 0===h?"elevation":h,I=Object(r.a)(t,["classes","className","component","square","elevation","variant"]);return o.createElement(c,Object(i.a)({className:Object(a.a)(n.root,A,"outlined"===d?n.outlined:n["elevation".concat(f)],!l&&n.rounded),ref:e},I))}));e.a=Object(A.a)((function(t){var e={};return t.shadows.forEach((function(t,n){e["elevation".concat(n)]={boxShadow:t}})),Object(i.a)({root:{backgroundColor:t.palette.background.paper,color:t.palette.text.primary,transition:t.transitions.create("box-shadow")},rounded:{borderRadius:t.shape.borderRadius},outlined:{border:"1px solid ".concat(t.palette.divider)}},e)}),{name:"MuiPaper"})(s)},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(32)),A=n(43),s=n(64),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=o.forwardRef((function(t,e){var n=t.align,A=void 0===n?"inherit":n,u=t.classes,l=t.className,g=t.color,f=void 0===g?"initial":g,h=t.component,d=t.display,I=void 0===d?"initial":d,p=t.gutterBottom,C=void 0!==p&&p,y=t.noWrap,v=void 0!==y&&y,B=t.paragraph,m=void 0!==B&&B,b=t.variant,E=void 0===b?"body1":b,Q=t.variantMapping,F=void 0===Q?c:Q,w=Object(i.a)(t,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),S=h||(m?"p":F[E]||c[E])||"span";return o.createElement(S,Object(r.a)({className:Object(a.a)(u.root,l,"inherit"!==E&&u[E],"initial"!==f&&u["color".concat(Object(s.a)(f))],v&&u.noWrap,C&&u.gutterBottom,m&&u.paragraph,"inherit"!==A&&u["align".concat(Object(s.a)(A))],"initial"!==I&&u["display".concat(Object(s.a)(I))]),ref:e},w))}));e.a=Object(A.a)((function(t){return{root:{margin:0},body2:t.typography.body2,body1:t.typography.body1,caption:t.typography.caption,button:t.typography.button,h1:t.typography.h1,h2:t.typography.h2,h3:t.typography.h3,h4:t.typography.h4,h5:t.typography.h5,h6:t.typography.h6,subtitle1:t.typography.subtitle1,subtitle2:t.typography.subtitle2,overline:t.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:t.palette.primary.main},colorSecondary:{color:t.palette.secondary.main},colorTextPrimary:{color:t.palette.text.primary},colorTextSecondary:{color:t.palette.text.secondary},colorError:{color:t.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(t,e,n){"use strict";var r=n(12),i=n(18),o=n(26),a=n(11),A=n(14),s=n(74),c=n(90),u=n(24),l=n(25),g=n(0),f=n.n(g),h=n(84),d=n.n(h),I=n(334),p=n(40),C=n(549),y=n(140),v=n(185),B=n(556),m=n(75),b=n(267),E=n(755),Q=n(753),F=function(t){return t.xy},w=function(t){Object(u.a)(n,t);var e=Object(l.a)(n);function n(t){var r;return Object(a.a)(this,n),(r=e.call(this,t)).cellsEntries=[],r.moleculesEntries=[],r.cellsQuadTree=null,r.cellsLayer=null,r.moleculesLayer=null,r.neighborhoodsLayer=null,r.imageLayers=[],r.layerLoaderSelections={},r.onUpdateCellsData(),r.onUpdateCellsLayer(),r.onUpdateMoleculesData(),r.onUpdateMoleculesLayer(),r.onUpdateNeighborhoodsData(),r.onUpdateNeighborhoodsLayer(),r.onUpdateImages(),r}return Object(A.a)(n,[{key:"createCellsLayer",value:function(t){var e=t.radius,n=t.stroked,r=t.visible,i=t.opacity,a=this.props,A=a.cellFilter,s=a.cellSelection,c=a.setCellHighlight,u=a.setComponentHover,l=a.getCellIsSelected,g=void 0===l?function(t){return function(e){return!t||t.includes(e[0])}}(s):l,f=a.cellColors,h=a.getCellColor,d=void 0===h?function(t){return function(e){return t&&t.get(e[0])||m.b}}(f):h,I=a.getCellPolygon,p=void 0===I?function(t){return function(e){var n,r=e[1];return(null===(n=r.poly)||void 0===n?void 0:n.length)?r.poly:Object(b.f)(r.xy[0],r.xy[1],t)}}(e):I,C=a.onCellClick,y=a.lineWidthScale,v=void 0===y?10:y,E=a.lineWidthMaxPixels,Q=void 0===E?2:E,F=this.cellsEntries,w=A?F.filter((function(t){return A.includes(t[0])})):F;return new B.a(Object(o.a)({id:"cells-layer",backgroundColor:[0,0,0],isSelected:g,getPolygon:p,updateTriggers:{getFillColor:[i],getLineWidth:[n]},getFillColor:function(t){var e=d(t);return e[3]=255*i,e},getLineColor:function(t){var e=d(t);return e[3]=255,e},onClick:function(t){C&&C(t)},visible:r,getLineWidth:n?1:0,lineWidthScale:v,lineWidthMaxPixels:Q},Object(m.g)(w,void 0,c,u,!0)))}},{key:"createMoleculesLayer",value:function(t){var e=this.props,n=e.setMoleculeHighlight,r=e.getMoleculeColor,i=void 0===r?function(t){return m.d[t[2]%m.d.length]}:r,o=e.getMoleculePosition,a=void 0===o?function(t){return[t[0],t[1],0]}:o,A=this.moleculesEntries;return new I.a({id:"molecules-layer",coordinateSystem:p.a.CARTESIAN,data:A,pickable:!0,autoHighlight:!0,radiusMaxPixels:3,opacity:t.opacity,visible:t.visible,getRadius:t.radius,getPosition:a,getLineColor:i,getFillColor:i,onHover:function(t){n&&(t.object?n(t.object[3]):n(null))}})}},{key:"createNeighborhoodsLayer",value:function(t){var e=this.props.getNeighborhoodPolygon,n=void 0===e?function(t){return t[1].poly}:e,r=this.neighborhoodsEntries;return new C.a({id:"neighborhoods-layer",getPolygon:n,coordinateSystem:p.a.CARTESIAN,data:r,pickable:!0,autoHighlight:!0,stroked:!0,filled:!1,getElevation:0,getLineWidth:10,visible:t.visible})}},{key:"createSelectionLayers",value:function(){var t=this.props,e=t.viewState,n=t.getCellCoords,r=void 0===n?F:n,i=t.setCellSelection,o=this.state.tool,a=this.cellsQuadTree;return Object(B.c)(o,e.zoom,"cells-layer",r,i,a)}},{key:"createScaleBarLayer",value:function(){var t=this.props,e=t.viewState,n=t.width,r=t.height,i=t.imageLayerLoaders,a=void 0===i?{}:i,A=Object.values(a);if(!e||!n||!r||A.length<1)return null;var s=A[0];if(!s)return null;var c=s.physicalSizes;if(c){var u=c.x,l=u.unit,g=u.value;return l&&g?new v.e({id:"scalebar-layer",loader:s,unit:l,size:g,viewState:Object(o.a)({},e,{width:n,height:r})}):null}return null}},{key:"createImageLayer",value:function(t,e,n){var r,i=Object(o.a)({},t,{channels:t.channels.filter((function(t){return t.selection&&t.color&&t.slider}))}),a=i.channels.map((function(t){return t.selection})),A=this.layerLoaderSelections[i.index];d()(A,a)?r=A:(r=a,this.layerLoaderSelections[i.index]=a);var s={colormap:i.colormap,opacity:i.opacity,transparentColor:i.transparentColor,colors:i.channels.map((function(t){return t.color})),sliders:i.channels.map((function(t){return t.slider})),visibilities:i.channels.map((function(t){return t.visible}))};if(!e||!s)return null;var c,u=e.scale,l=e.translate,g=e.isPyramid;return u&&l?c=(new y.Matrix4).translate([l.x,l.y,0]).scale(u):i.modelMatrix&&(c=new y.Matrix4(i.modelMatrix)),new(g?v.d:v.b)({loader:e,id:"image-layer-".concat(i.index,"-").concat(n),colorValues:s.colors,sliderValues:s.sliders,loaderSelection:r,channelIsOn:s.visibilities,opacity:s.opacity,colormap:s.colormap?s.colormap:"",modelMatrix:c,transparentColor:s.transparentColor})}},{key:"createImageLayers",value:function(){var t=this,e=this.props,n=e.layers,r=e.imageLayerLoaders,i=void 0===r?{}:r;return(n||[]).filter((function(t){return"raster"===t.type})).map((function(e,n){return t.createImageLayer(e,i[e.index],n)}))}},{key:"getLayers",value:function(){var t=this.imageLayers,e=this.cellsLayer,n=this.neighborhoodsLayer,r=this.moleculesLayer;return[].concat(Object(i.a)(t),[e,n,r,this.createScaleBarLayer()],Object(i.a)(this.createSelectionLayers()))}},{key:"onUpdateCellsData",value:function(){var t=this.props,e=t.cells,n=void 0===e?{}:e,r=t.getCellCoords,i=void 0===r?F:r,o=Object.entries(n);this.cellsEntries=o,this.cellsQuadTree=Object(Q.a)(o,i)}},{key:"onUpdateCellsLayer",value:function(){var t=(this.props.layers||[]).find((function(t){return"cells"===t.type}));this.cellsLayer=t?this.createCellsLayer(t):null}},{key:"onUpdateMoleculesData",value:function(){var t=this.props.molecules,e=void 0===t?{}:t,n=Object.entries(e).flatMap((function(t,e){var n=Object(r.a)(t,2),i=n[0];return n[1].map((function(t){var n=Object(r.a)(t,2);return[n[0],n[1],e,i]}))}));this.moleculesEntries=n}},{key:"onUpdateMoleculesLayer",value:function(){var t=(this.props.layers||[]).find((function(t){return"molecules"===t.type}));this.moleculesLayer=t?this.createMoleculesLayer(t):null}},{key:"onUpdateNeighborhoodsData",value:function(){var t=this.props.neighborhoods,e=void 0===t?{}:t,n=Object.entries(e);this.neighborhoodsEntries=n}},{key:"onUpdateNeighborhoodsLayer",value:function(){var t=(this.props.layers||[]).find((function(t){return"neighborhoods"===t.type}));this.neighborhoodsLayer=t?this.createNeighborhoodsLayer(t):null}},{key:"onUpdateImages",value:function(){this.imageLayers=this.createImageLayers()}},{key:"viewInfoDidUpdate",value:function(){var t=this.props.getCellCoords,e=void 0===t?F:t;Object(c.a)(Object(s.a)(n.prototype),"viewInfoDidUpdate",this).call(this,e)}},{key:"componentDidUpdate",value:function(t){var e=this;this.viewInfoDidUpdate();var n=function(n){return t[n]!==e.props[n]};["cells"].some(n)&&(this.onUpdateCellsData(),this.forceUpdate()),["layers","cells","cellFilter","cellSelection","cellColors"].some(n)&&(this.onUpdateCellsLayer(),this.forceUpdate()),["molecules"].some(n)&&(this.onUpdateMoleculesData(),this.forceUpdate()),["layers","molecules"].some(n)&&(this.onUpdateMoleculesLayer(),this.forceUpdate()),["neighborhoods"].some(n)&&(this.onUpdateNeighborhoodsData(),this.forceUpdate()),["layers","neighborhoods"].some(n)&&(this.onUpdateNeighborhoodsLayer(),this.forceUpdate()),["layers","imageLayerLoaders"].some(n)&&(this.onUpdateImages(),this.forceUpdate())}}]),n}(E.a),S=Object(g.forwardRef)((function(t,e){return f.a.createElement(w,Object.assign({},t,{deckRef:e}))}));e.a=S},function(t,e,n){"use strict";var r=n(18),i=n(12),o=n(26),a=n(0),A=n.n(a),s=n(331),c=n.n(s),u=n(931),l=n(708),g=n(308),f=n.n(g),h=n(273),d=n.n(h),I=n(84),p=n.n(I),C=n(15);function y(t,e){var n;if(void 0===e){var r,i=Object(C.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n<o||void 0===n&&o>=o)&&(n=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(C.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=(c=e(c,++A,t))&&(n<c||void 0===n&&c>=c)&&(n=c)}}catch(u){s.e(u)}finally{s.f()}}return n}var v=n(1360),B=n(1110),m=n(387),b=Object(m.a)((function(){return{box:{opacity:.5,height:"80px",bottom:0,right:0,backgroundColor:"transparent",position:"absolute",padding:"10px 0",transition:"opacity 0.1s","&:hover":{opacity:1}}}}));function E(t){var e=t.colorScaleLo,n=t.colorScaleHi,r=t.onColorScaleChange,i=b();return A.a.createElement(v.a,{component:"div",m:1,className:i.box},A.a.createElement(B.a,{orientation:"vertical",value:[e,n],onChange:r,"aria-labelledby":"colorscale-slider",min:0,max:1,step:.005}))}var Q=n(693),F=n(694),w=n(695),S=n(75),R=n(1094),U=n.n(R),x=n(70);function k(t){var e=t.layer,n=t.viewport;return"axisLeft"===n.id?e.id.startsWith("axisLeft"):"axisTop"===n.id?e.id.startsWith("axisTop"):"heatmap"===n.id?e.id.startsWith("heatmap"):"colorsLeft"===n.id?e.id.startsWith("colorsLeft"):"colorsTop"===n.id&&e.id.startsWith("colorsTop")}var O=Object(a.forwardRef)((function(t,e){var n=t.uuid,s=t.theme,g=t.viewState,h=t.setViewState,I=t.setHeatmapControls,C=t.heatmapControls,v=void 0===C?[0,1]:C,B=t.width,m=t.height,b=t.expressionMatrix,R=t.cellColors,O=t.clearPleaseWait,N=t.setComponentHover,D=t.setCellHighlight,G=void 0===D?Object(S.i)("Heatmap"):D,_=t.setGeneHighlight,M=void 0===_?Object(S.j)("Heatmap"):_,T=t.updateViewInfo,j=void 0===T?Object(S.k)("Heatmap"):T,L=t.setIsRendering,V=void 0===L?function(){}:L,Z=t.transpose,P=void 0!==Z&&Z,W=t.variablesTitle,J=void 0===W?"Genes":W,H=t.observationsTitle,Y=void 0===H?"Cells":H,X=Object(o.a)({},g,{target:P?[g.target[1],g.target[0]]:g.target,minZoom:0}),z=P?J:Y,K=P?Y:J;Object(a.useEffect)((function(){O&&b&&O("expression-matrix")}),[O,b]);var q=Object(a.useRef)(new U.a),$=Object(a.useRef)(),tt=Object(a.useRef)(),et=Object(a.useState)([]),nt=Object(i.a)(et,2),rt=nt[0],it=nt[1],ot=Object(a.useState)([]),at=Object(i.a)(ot,2),At=at[0],st=at[1],ct=Object(a.useState)(v[0]),ut=Object(i.a)(ct,2),lt=ut[0],gt=ut[1],ft=Object(a.useState)(v[1]),ht=Object(i.a)(ft,2),dt=ht[0],It=ht[1],pt=Object(a.useCallback)((function(t,e){gt(e[0]),It(e[1]),I(e)}),[I]),Ct=Object(a.useReducer)((function(t){return t+1}),0),yt=Object(i.a)(Ct,2),vt=yt[0],Bt=yt[1],mt=Object(a.useState)([]),bt=Object(i.a)(mt,2),Et=bt[0],Qt=bt[1];Object(a.useEffect)((function(){q.current.addEventListener("message",(function(t){$.current=t.data.tiles,tt.current=new Uint8Array(t.data.buffer),Bt();var e=t.data.curr;Qt((function(t){var n=t.indexOf(e);return t.slice(n+1,t.length)}))}))}),[q,$]),Object(a.useEffect)((function(){b&&b.matrix&&(tt.current=Object(S.h)(b.matrix))}),[tt,b]),Object(a.useEffect)((function(){if(b){var t=R&&0!==R.size?Array.from(R.keys()):b.rows,e=P?At:rt;p()(e,t)||(P?st(t):it(t))}}),[b,R,At,rt,P]),Object(a.useEffect)((function(){b&&(P?it(b.cols):st(b.cols))}),[b,P]);var Ft=Object(a.useMemo)((function(){return b?[y(b.rows.map((function(t){return t.length}))),y(b.cols.map((function(t){return t.length})))]:[0,0]}),[b]),wt=Object(i.a)(Ft,2),St=wt[0],Rt=wt[1],Ut=At.length,xt=rt.length,kt=function(t,e,n){return[d()((t?e:n)*x.b,x.e,x.d),d()((t?n:e)*x.b,x.e,x.d)]}(P,Rt,St),Ot=Object(i.a)(kt,2),Nt=Ot[0],Dt=Ot[1],Gt=Dt+x.g,_t=Nt+x.g,Mt=B-_t,Tt=m-Gt,jt=-Mt/2,Lt=Mt/2,Vt=-Tt/2,Zt=Tt/2,Pt=Math.ceil(Ut/x.l),Wt=Math.ceil(xt/x.l),Jt=1-(x.l-Ut%x.l)/(Pt*x.l),Ht=1-(x.l-xt%x.l)/(Wt*x.l),Yt=Mt/Jt/Pt,Xt=Tt/Ht/Wt,zt=Math.pow(2,X.zoom),Kt=Tt*zt/xt,qt=Mt*zt/Ut,$t=d()(Math.pow(2,Math.ceil(Math.log2(1/qt))),x.i,x.h),te=d()(Math.pow(2,Math.ceil(Math.log2(1/Kt))),x.i,x.h),ee=Object(i.a)(X.target,2),ne=ee[0],re=ee[1];Object(a.useEffect)((function(){j({uuid:n,project:function(t,e){return function(t,e,n){var r=n.offsetLeft,i=n.offsetTop,o=n.targetX,a=n.targetY,A=n.scaleFactor,s=n.matrixWidth,c=n.matrixHeight,u=n.numRows,l=n.numCols,g=null,f=null;if(null!==e){var h=-c*A/2,d=a*A-c/2,I=a*A+c/2,p=h+(e+.5)/u*(c*A/2-h);d<=p&&p<=I&&(g=i+(p-d)/(I-d)*c)}if(null!==t){var C=-s*A/2,y=o*A-s/2,v=o*A+s/2,B=C+(t+.5)/l*(s*A/2-C);y<=B&&B<=v&&(f=r+(B-y)/(v-y)*s)}return[f,g]}(P?At.indexOf(t):At.indexOf(e),P?rt.indexOf(e):rt.indexOf(t),{offsetLeft:_t,offsetTop:Gt,targetX:X.target[0],targetY:X.target[1],scaleFactor:zt,matrixWidth:Mt,matrixHeight:Tt,numRows:xt,numCols:Ut})}})}),[n,j,P,At,rt,_t,Gt,X,zt,Mt,Tt,xt,Ut]);var ie=Object(a.useCallback)((function(t){var e=t.viewState,n=e.zoom,r=Math.pow(2,n),i=0===n?0:-(Lt-Lt/r),o=-1*i,a=0===n?0:-(Zt-Zt/r),A=-1*a,s=[d()(e.target[0],i,o),d()(e.target[1],a,A)];h({zoom:n,target:P?[s[1],s[0]]:s})}),[Lt,Zt,P,h]);Object(a.useEffect)((function(){b&&Qt((function(t){return[].concat(Object(r.a)(t),[c()()])}))}),[tt,b,At,rt,Pt,Wt]),Object(a.useEffect)((function(){if(!(Et.length<1)){var t=Et[Et.length-1];if(tt.current&&tt.current.buffer.byteLength){var e=b.rows,n=b.cols;q.current.postMessage(["getTiles",{curr:t,xTiles:Pt,yTiles:Wt,tileSize:x.l,cellOrdering:P?At:rt,rows:e,cols:n,transpose:P,data:tt.current.buffer}],[tt.current.buffer])}}}),[rt,At,Et,b,P,Pt,Wt]),Object(a.useEffect)((function(){V(Et.length>0)}),[Et,V]);var oe=Object(a.useMemo)((function(){if(!$.current||Et.length)return[];return $.current.flatMap((function(t,e){return t.map((function(t,n){return function(t,e,n){return new w.a({id:"heatmapLayer-".concat(vt,"-").concat(t,"-").concat(e),image:n,bounds:[jt+e*Yt,Vt+t*Xt,jt+(e+1)*Yt,Vt+(t+1)*Xt],aggSizeX:$t,aggSizeY:te,colorScaleLo:lt,colorScaleHi:dt,updateTriggers:{image:[rt,At],bounds:[Xt,Yt]}})}(e,n,t)}))}))}),[Et,vt,jt,Yt,Vt,Xt,$t,te,lt,dt,rt,At]),ae=Object(a.useMemo)((function(){return At.map((function(t,e){return[e,t]}))}),[At]),Ae=Object(a.useMemo)((function(){return rt.map((function(t,e){return[e,t]}))}),[rt]),se=[new Q.a({targetX:ne,targetY:re,scaleFactor:zt,axisLeftLabelData:Ae,matrixTop:Vt,height:xt,matrixHeight:Tt,cellHeight:Kt,cellWidth:qt,axisTopLabelData:ae,matrixLeft:jt,width:Ut,matrixWidth:Mt,viewHeight:m,viewWidth:B,theme:s,axisLeftTitle:z,axisTopTitle:K,axisOffsetLeft:Nt,axisOffsetTop:Dt})],ce=Object(a.useMemo)((function(){if(!R)return null;var t,e,n,r,o=P?At:rt,a=P?x.l:1,A=P?1:x.l;return f()(P?Pt:Wt).map((function(s){var c=new Uint8ClampedArray(1*x.l*4);return f()(x.l).forEach((function(a){if((r=s*x.l+a)<o.length&&(t=o[r],n=R.get(t),e=4*(P?a:x.l-a-1),n)){var A=n,u=Object(i.a)(A,3),l=u[0],g=u[1],f=u[2];c[e+0]=l,c[e+1]=g,c[e+2]=f,c[e+3]=255}})),new ImageData(c,a,A)}))}),[R,P,At,rt,Pt,Wt]),ue=Object(a.useMemo)((function(){return ce?ce.map((function(t,e){return new F.a({id:"".concat(P?"colorsTopLayer":"colorsLeftLayer","-").concat(e,"-").concat(c()()),image:t,bounds:P?[jt+e*Yt,-Tt/2,jt+(e+1)*Yt,Tt/2]:[-Mt/2,Vt+e*Xt,Mt/2,Vt+(e+1)*Xt]})})):[]}),[ce,Vt,jt,Tt,Mt,Yt,Xt,P]),le=oe.concat(se).concat(ue);return A.a.createElement(A.a.Fragment,null,A.a.createElement(u.a,{id:"deckgl-overlay-".concat(n),ref:e,views:[new l.a({id:"heatmap",controller:!0,x:_t,y:Gt,width:Mt,height:Tt}),new l.a({id:"axisLeft",controller:!1,x:P?x.g:0,y:Gt,width:Nt,height:Tt}),new l.a({id:"axisTop",controller:!1,x:_t,y:P?0:x.g,width:Mt,height:Dt}),new l.a({id:"colorsLeft",controller:!1,x:Nt,y:Gt,width:x.g-x.c,height:Tt}),new l.a({id:"colorsTop",controller:!1,x:_t,y:Dt,width:Mt,height:x.g-x.c})],layers:le,layerFilter:k,getCursor:function(t){return t.isDragging?"grabbing":"default"},glOptions:S.c,onViewStateChange:ie,viewState:X,onHover:function(t,e){if(b){var n=e.offsetCenter,r=function(t,e,n){var r=n.offsetLeft,i=n.offsetTop,o=n.targetX,a=n.targetY,A=n.scaleFactor,s=n.matrixWidth,c=n.matrixHeight,u=n.numRows,l=n.numCols,g=t-r,f=e-i;if(g<0||f<0)return[null,null];var h=(o*A+s*A/2-s/2)/(s*A)+g/(s*A),d=(a*A+c*A/2-c/2)/(c*A)+f/(c*A),I=Math.floor(d*u);return[Math.floor(h*l),I]}(n.x,n.y,{offsetLeft:_t,offsetTop:Gt,targetX:ne,targetY:re,scaleFactor:zt,matrixWidth:Mt,matrixHeight:Tt,numRows:xt,numCols:Ut}),o=Object(i.a)(r,2),a=o[0],A=o[1];null===a&&(P?G(null):M(null)),null===A&&(P?M(null):G(null));var s=b.rows.indexOf(P?At[a]:rt[A]),c=b.cols.indexOf(P?rt[A]:At[a]),u=b.rows[s],l=b.cols[c];N&&N(),G(u||null),M(l||null)}}}),A.a.createElement(E,{colorScaleLo:lt,colorScaleHi:dt,onColorScaleChange:pt}))}));e.a=O},function(t,e,n){"use strict";var r=n(18),i=n(26),o=n(11),a=n(14),A=n(74),s=n(90),c=n(24),u=n(25),l=n(0),g=n.n(l),f=n(549),h=n(336),d=n(841),I=n(556),p=n(75),C=n(753),y=n(755),v=n(936);function B(t){return function(){return t}}function m(t){return t+1e-6*(Math.random()-.5)}var b=function(t){return function(e){var n=e[1].mappings;if(!(t in n)){var r=Object.keys(n).map((function(t){return'"'.concat(t,'"')})).join(", ");throw new Error('Expected to find "'.concat(t,'", but available mappings are: ').concat(r))}var i=n[t];return[i[0],-i[1],0]}},E=function(t){return function(e){return e.mappings[t]}},Q=function(t){Object(c.a)(n,t);var e=Object(u.a)(n);function n(t){var r;return Object(o.a)(this,n),(r=e.call(this,t)).cellsEntries=[],r.cellsQuadTree=null,r.cellsLayer=null,r.cellSetsForceSimulation=function(){var t,e,n,r=1,i=1,o=B([0,0]);function a(t){return t.x+t.vx+n[t.index][0]/2}function A(t){return t.y+t.vy+n[t.index][1]/2}function s(t){if(t.data)t.size=n[t.data.index];else{t.size=[0,0];for(var e=0;e<4;e++)t[e]&&t[e].size&&(t.size[0]=Math.max(t.size[0],t[e].size[0]),t.size[1]=Math.max(t.size[1],t[e].size[1]))}}function c(){var o,c,u,l,g,f=Object(v.a)(t,a,A).visitAfter(s);function h(t,n,i,s,f){var h=t.data,d=(c[0]+t.size[0])/2,I=(c[1]+t.size[1])/2;if(h&&h.index>o.index){var p=m(l-a(h)),C=m(g-A(h)),y=Math.abs(p)-d,v=Math.abs(C)-I;if(y<0&&v<0){var B=Math.sqrt(p*p+C*C),b=e[h.index]/(u+e[h.index]);Math.abs(y)<Math.abs(v)?(o.vx-=(p*=y/B*r)*b,h.vx+=p*(1-b)):(o.vy-=(C*=v/B*r)*b,h.vy+=C*(1-b))}return n>l+d||s<l-d||i>g+I||f<g-I}return!1}function d(){for(var r=0;r<t.length;r++)o=t[r],c=n[r],u=e[r],l=a(o),g=A(o),f.visit(h)}for(var I=0;I<i;I++)d()}return c.initialize=function(r){n=(t=r).map(o),e=n.map((function(t){return t[0]+t[1]}))},c.iterations=function(){return arguments.length?(i=+(arguments.length<=0?void 0:arguments[0]),c):i},c.strength=function(){return arguments.length?(r=+(arguments.length<=0?void 0:arguments[0]),c):r},c.size=function(){return arguments.length?(o="function"===typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:B(arguments.length<=0?void 0:arguments[0]),c):o},c}(),r.cellSetsLabelPrevZoom=null,r.cellSetsLayers=[],r.onUpdateCellsData(),r.onUpdateCellsLayer(),r.onUpdateCellSetsLayers(),r}return Object(a.a)(n,[{key:"createCellsLayer",value:function(){var t=this.props,e=t.theme,n=t.mapping,r=t.getCellPosition,o=void 0===r?b(n):r,a=t.cellRadiusScale,A=void 0===a?.2:a,s=t.cellOpacity,c=void 0===s?1:s,u=t.cellFilter,l=t.cellSelection,g=t.setCellHighlight,f=t.setComponentHover,h=t.getCellIsSelected,d=void 0===h?function(t){return function(e){return!t||t.includes(e[0])}}(l):h,C=t.cellColors,y=t.getCellColor,v=void 0===y?function(t){return function(e){return t&&t.get(e[0])||p.b}}(C):y,B=t.onCellClick,m=this.cellsEntries,E=u?m.filter((function(t){return u.includes(t[0])})):m;return new I.b(Object(i.a)({id:"scatterplot",backgroundColor:"dark"===e?[0,0,0]:[241,241,241],isSelected:d,opacity:c,radiusScale:A,radiusMinPixels:1,radiusMaxPixels:10,getPosition:o,getColor:v,getLineWidth:0,onClick:function(t){B&&B(t)}},Object(p.g)(E,void 0,g,f)))}},{key:"createCellSetsLayers",value:function(){var t=this.props,e=t.theme,n=t.cellSetPolygons,r=t.viewState,i=t.cellSetPolygonsVisible,o=t.cellSetLabelsVisible,a=t.cellSetLabelSize,A=[];if(i&&A.push(new f.a({id:"cell-sets-polygon-layer",data:n,stroked:!0,filled:!1,wireframe:!0,lineWidthMaxPixels:1,getPolygon:function(t){return t.hull},getLineColor:function(t){return t.color},getLineWidth:1})),o){var s=r.zoom,c=n.map((function(t){return{x:t.centroid[0],y:t.centroid[1],label:t.name}})),u=this.cellSetsForceSimulation.size((function(t){return[1*a/Math.pow(2,s)*4*t.label.length,1*a/Math.pow(2,s)*1.5]}));Object(d.a)().nodes(c).force("collision",u).tick(100),A.push(new h.a({id:"cell-sets-text-layer",data:c,getPosition:function(t){return[t.x,t.y]},getText:function(t){return t.label},getColor:"dark"===e?[255,255,255]:[0,0,0],getSize:a,getAngle:0,getTextAnchor:"middle",getAlignmentBaseline:"center",fontFamily:"-apple-system, 'Helvetica Neue', Arial, sans-serif",fontWeight:"normal"}))}return A}},{key:"createSelectionLayers",value:function(){var t=this.props,e=t.viewState,n=t.mapping,r=t.getCellCoords,i=void 0===r?E(n):r,o=t.setCellSelection,a=this.state.tool,A=this.cellsQuadTree;return Object(I.c)(a,e.zoom,"scatterplot",i,o,A,!0)}},{key:"getLayers",value:function(){var t=this.cellsLayer,e=this.cellSetsLayers;return[t].concat(Object(r.a)(e),Object(r.a)(this.createSelectionLayers()))}},{key:"onUpdateCellsData",value:function(){var t=this.props,e=t.cells,n=void 0===e?{}:e,r=t.mapping,i=t.getCellCoords,o=void 0===i?E(r):i,a=Object.entries(n);this.cellsEntries=a,this.cellsQuadTree=Object(C.a)(a,o)}},{key:"onUpdateCellsLayer",value:function(){this.cellsLayer=this.createCellsLayer()}},{key:"onUpdateCellSetsLayers",value:function(t){if(t){var e=this.props,n=e.viewState,r=e.cellSetLabelsVisible,i=n.zoom,o=this.cellSetsLabelPrevZoom;r&&(null===o||Math.abs(o-i)>.25)&&(this.cellSetsLayers=this.createCellSetsLayers(),this.cellSetsLabelPrevZoom=i)}else this.cellSetsLayers=this.createCellSetsLayers()}},{key:"viewInfoDidUpdate",value:function(){var t=this.props,e=t.mapping,r=t.getCellPosition,i=void 0===r?b(e):r;Object(s.a)(Object(A.a)(n.prototype),"viewInfoDidUpdate",this).call(this,(function(t){return i([null,t])}))}},{key:"componentDidUpdate",value:function(t){var e=this;this.viewInfoDidUpdate();var n=function(n){return t[n]!==e.props[n]};["cells"].some(n)&&(this.onUpdateCellsData(),this.forceUpdate()),["cells","cellFilter","cellSelection","cellColors","cellRadiusScale"].some(n)&&(this.onUpdateCellsLayer(),this.forceUpdate()),["cellSetPolygons","cellSetPolygonsVisible","cellSetLabelsVisible","cellSetLabelSize"].some(n)&&(this.onUpdateCellSetsLayers(!1),this.forceUpdate()),n("viewState")&&(this.onUpdateCellSetsLayers(!0),this.forceUpdate())}}]),n}(y.a),F=Object(l.forwardRef)((function(t,e){return g.a.createElement(Q,Object.assign({},t,{deckRef:e}))}));e.a=F},function(t,e,n){"use strict";(function(t){function r(e,n){var r,i="undefined"!==typeof(r="undefined"!==typeof n?n:"undefined"!==typeof window?window:"undefined"!==typeof self?self:t).document&&r.document.attachEvent;if(!i){var o=function(){var t=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(t){return r.setTimeout(t,20)};return function(e){return t(e)}}(),a=function(){var t=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||r.clearTimeout;return function(e){return t(e)}}(),A=function(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},s=function(t){if(!(t.target.className&&"function"===typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0)){var e=this;A(this),this.__resizeRAF__&&a(this.__resizeRAF__),this.__resizeRAF__=o((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}},c=!1,u="",l="animationstart",g="Webkit Moz O ms".split(" "),f="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),h=r.document.createElement("fakeelement");if(void 0!==h.style.animationName&&(c=!0),!1===c)for(var d=0;d<g.length;d++)if(void 0!==h.style[g[d]+"AnimationName"]){u="-"+g[d].toLowerCase()+"-",l=f[d],c=!0;break}var I="resizeanim",p="@"+u+"keyframes "+I+" { from { opacity: 0; } to { opacity: 0; } } ",C=u+"animation: 1ms "+I+"; "}return{addResizeListener:function(t,n){if(i)t.attachEvent("onresize",n);else{if(!t.__resizeTriggers__){var o=t.ownerDocument,a=r.getComputedStyle(t);a&&"static"==a.position&&(t.style.position="relative"),function(t){if(!t.getElementById("detectElementResize")){var n=(p||"")+".resize-triggers { "+(C||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.id="detectElementResize",i.type="text/css",null!=e&&i.setAttribute("nonce",e),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n)),r.appendChild(i)}}(o),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=o.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),A(t),t.addEventListener("scroll",s,!0),l&&(t.__resizeTriggers__.__animationListener__=function(e){e.animationName==I&&A(t)},t.__resizeTriggers__.addEventListener(l,t.__resizeTriggers__.__animationListener__))}t.__resizeListeners__.push(n)}},removeResizeListener:function(t,e){if(i)t.detachEvent("onresize",e);else if(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),!t.__resizeListeners__.length){t.removeEventListener("scroll",s,!0),t.__resizeTriggers__.__animationListener__&&(t.__resizeTriggers__.removeEventListener(l,t.__resizeTriggers__.__animationListener__),t.__resizeTriggers__.__animationListener__=null);try{t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)}catch(n){}}}}}n.d(e,"a",(function(){return r}))}).call(this,n(56))},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");e.default=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(26),i=n(0),o=n.n(i),a=n(792),A=n(1121),s=n(781),c=n(782),u=n(1110),l=n(752);function g(t){var e=t.label,n=t.layer,i=t.handleLayerChange,g=n.opacity,f=n.visible;var h=Object(l.a)();return o.a.createElement(a.a,{item:!0,style:{marginTop:"10px"}},o.a.createElement(s.a,{className:h.root},o.a.createElement(c.a,{style:{paddingTop:"15px",paddingLeft:"10px",marginBottom:"-5px"}},e),o.a.createElement(a.a,{container:!0,direction:"row",justify:"space-between"},o.a.createElement(a.a,{item:!0,xs:2},o.a.createElement(A.a,{color:"primary",checked:f,onChange:function(t,e){return function(t){i(Object(r.a)({},n,{visible:t}))}(e)}})),o.a.createElement(a.a,{item:!0,xs:9,style:{paddingRight:"8px"}},o.a.createElement(u.a,{value:g,min:0,max:1,step:.001,onChange:function(t,e){return function(t){if("cells"===n.type){var e=t<.7;i(Object(r.a)({},n,{opacity:t,stroked:e}))}else i(Object(r.a)({},n,{opacity:t}))}(e)},style:{marginTop:"7px"},orientation:"horizontal"})))))}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(4);function i(e,n){var i,o=n&&n.property?Object(r.t)(n.property):r.x;return!Object(r.F)(e)||(i=e,"function"===typeof t&&Object(r.D)(t.isBuffer)&&t.isBuffer(i))?o(JSON.parse(e)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(o(e))}i.responseType="json"}).call(this,n(96).Buffer)},function(t,e,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,e){var n,i,o;return e=e||{},n=JSON.stringify([1],void 0,void 0===e.indent?2:e.indent).slice(2,-3),i=""===n?1/0:void 0===e.maxLength?80:e.maxLength,o=e.replacer,function t(e,a,A){var s,c,u,l,g,f,h,d,I,p,C,y;if(e&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0===(C=JSON.stringify(e,o)))return C;if(h=i-a.length-A,C.length<=h&&(I=C.replace(r,(function(t,e){return e||t+" "}))).length<=h)return I;if(null!=o&&(e=JSON.parse(C),o=void 0),"object"===typeof e&&null!==e){if(d=a+n,u=[],c=0,Array.isArray(e))for(p="[",s="]",h=e.length;c<h;c++)u.push(t(e[c],d,c===h-1?0:1)||"null");else for(p="{",s="}",h=(f=Object.keys(e)).length;c<h;c++)l=f[c],g=JSON.stringify(l)+": ",void 0!==(y=t(e[l],d,g.length+(c===h-1?0:1)))&&u.push(g+y);if(u.length>0)return[p,n+u.join(",\n"+d),s].join("\n"+a)}return C}(t,"",0)}},function(t,e,n){"use strict";var r=n(28),i=n(9),o=n(0),a=(n(20),n(32)),A=n(43),s=[0,1,2,3,4,5,6,7,8,9,10],c=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(t);return"".concat(n/e).concat(String(t).replace(String(n),"")||"px")}var l=o.forwardRef((function(t,e){var n=t.alignContent,A=void 0===n?"stretch":n,s=t.alignItems,c=void 0===s?"stretch":s,u=t.classes,l=t.className,g=t.component,f=void 0===g?"div":g,h=t.container,d=void 0!==h&&h,I=t.direction,p=void 0===I?"row":I,C=t.item,y=void 0!==C&&C,v=t.justify,B=void 0===v?"flex-start":v,m=t.lg,b=void 0!==m&&m,E=t.md,Q=void 0!==E&&E,F=t.sm,w=void 0!==F&&F,S=t.spacing,R=void 0===S?0:S,U=t.wrap,x=void 0===U?"wrap":U,k=t.xl,O=void 0!==k&&k,N=t.xs,D=void 0!==N&&N,G=t.zeroMinWidth,_=void 0!==G&&G,M=Object(r.a)(t,["alignContent","alignItems","classes","className","component","container","direction","item","justify","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),T=Object(a.a)(u.root,l,d&&[u.container,0!==R&&u["spacing-xs-".concat(String(R))]],y&&u.item,_&&u.zeroMinWidth,"row"!==p&&u["direction-xs-".concat(String(p))],"wrap"!==x&&u["wrap-xs-".concat(String(x))],"stretch"!==c&&u["align-items-xs-".concat(String(c))],"stretch"!==A&&u["align-content-xs-".concat(String(A))],"flex-start"!==B&&u["justify-xs-".concat(String(B))],!1!==D&&u["grid-xs-".concat(String(D))],!1!==w&&u["grid-sm-".concat(String(w))],!1!==Q&&u["grid-md-".concat(String(Q))],!1!==b&&u["grid-lg-".concat(String(b))],!1!==O&&u["grid-xl-".concat(String(O))]);return o.createElement(f,Object(i.a)({className:T,ref:e},M))})),g=Object(A.a)((function(t){return Object(i.a)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-xs-center":{justifyContent:"center"},"justify-xs-flex-end":{justifyContent:"flex-end"},"justify-xs-space-between":{justifyContent:"space-between"},"justify-xs-space-around":{justifyContent:"space-around"},"justify-xs-space-evenly":{justifyContent:"space-evenly"}},function(t,e){var n={};return s.forEach((function(r){var i=t.spacing(r);0!==i&&(n["spacing-".concat(e,"-").concat(r)]={margin:"-".concat(u(i,2)),width:"calc(100% + ".concat(u(i),")"),"& > $item":{padding:u(i,2)}})})),n}(t,"xs"),{},t.breakpoints.keys.reduce((function(e,n){return function(t,e,n){var r={};c.forEach((function(t){var e="grid-".concat(n,"-").concat(t);if(!0!==t)if("auto"!==t){var i="".concat(Math.round(t/12*1e8)/1e6,"%");r[e]={flexBasis:i,flexGrow:0,maxWidth:i}}else r[e]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else r[e]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===n?Object(i.a)(t,r):t[e.breakpoints.up(n)]=r}(e,t,n),e}),{}))}),{name:"MuiGrid"})(l);e.a=g},,,,function(t,e,n){var r=n(971),i=n(69),o=n(137),a=n(390).default,A=o.featureEach,s=(o.coordEach,i.polygon,i.featureCollection);function c(t){var e=r(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):A(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),r.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.remove.call(this,t,e)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return s(e)},e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=r.prototype.all.call(this);return s(t)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=c,t.exports.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69),i=n(109),o=n(137);e.default=function(t){if(!t)throw new Error("geojson is required");var e=[];return o.flattenEach(t,(function(t){!function(t,e){var n=[],o=t.geometry;if(null!==o){switch(o.type){case"Polygon":n=i.getCoords(o);break;case"LineString":n=[i.getCoords(o)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,i){var o=r.lineString([t,i],e);return o.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?n:i,r>o?r:o]}(t,i),n.push(o),i})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),r.featureCollection(e)}},function(t,e,n){var r=n(799),i=n(974),o=n(975),a=n(976),A=n(979),s=n(985),c=Date.prototype.getTime;function u(t,e,n){var f=n||{};return!!(f.strict?o(t,e):t===e)||(!t||!e||"object"!==typeof t&&"object"!==typeof e?f.strict?o(t,e):t==e:function(t,e,n){var o,f;if(typeof t!==typeof e)return!1;if(l(t)||l(e))return!1;if(t.prototype!==e.prototype)return!1;if(i(t)!==i(e))return!1;var h=a(t),d=a(e);if(h!==d)return!1;if(h||d)return t.source===e.source&&A(t)===A(e);if(s(t)&&s(e))return c.call(t)===c.call(e);var I=g(t),p=g(e);if(I!==p)return!1;if(I||p){if(t.length!==e.length)return!1;for(o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}if(typeof t!==typeof e)return!1;try{var C=r(t),y=r(e)}catch(v){return!1}if(C.length!==y.length)return!1;for(C.sort(),y.sort(),o=C.length-1;o>=0;o--)if(C[o]!=y[o])return!1;for(o=C.length-1;o>=0;o--)if(f=C[o],!u(t[f],e[f],n))return!1;return!0}(t,e,f))}function l(t){return null===t||void 0===t}function g(t){return!(!t||"object"!==typeof t||"number"!==typeof t.length)&&("function"===typeof t.copy&&"function"===typeof t.slice&&!(t.length>0&&"number"!==typeof t[0]))}t.exports=u},function(t,e,n){"use strict";var r=Array.prototype.slice,i=n(800),o=Object.keys,a=o?function(t){return o(t)}:n(973),A=Object.keys;a.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return i(t)?A(r.call(t)):A(t)}):Object.keys=a;return Object.keys||a},t.exports=a},function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e,n){"use strict";var r=Object,i=TypeError;t.exports=function(){if(null!=this&&this!==r(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},function(t,e,n){"use strict";var r=n(801),i=n(735).supportsDescriptors,o=Object.getOwnPropertyDescriptor,a=TypeError;t.exports=function(){if(!i)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"===typeof t.get&&"boolean"===typeof/a/.dotAll)return t.get}return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_STYLE=e.MAX_ARROWS=e.DEFAULT_ARROWS=e.ArrowStyles=void 0;var r={NONE:0,FORWARD:1,BACKWARD:2,BOTH:3};e.ArrowStyles=r;e.DEFAULT_ARROWS=1;e.MAX_ARROWS=3;var i={arrowColor:[0,0,0,1],arrowCount:1,arrowStyle:r.NONE,fillColor:[0,0,0,1],lineColor:[0,0,0,1],lineWidthMeters:5,outlineRadiusMeters:0,opacity:1,zLevel:0};e.DEFAULT_STYLE=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SELECTION_TYPE=void 0;var r=n(142),i=n(69),o=u(n(390)),a=u(n(511)),A=u(n(750)),s=u(n(987)),c=u(n(207));function u(t){return t&&t.__esModule?t:{default:t}}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(t){if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var C=[0,255,0,255],y=[255,255,255,90],v=[20,20],B="DeckDrawerPick",m={NONE:null,RECTANGLE:"rectangle",POLYGON:"polygon"};e.SELECTION_TYPE=m;var b=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,"nebula",void 0),p(this,"usePolygon",void 0),p(this,"validPolygon",void 0),p(this,"landPoints",void 0),p(this,"mousePoints",void 0),this.nebula=e,this.usePolygon=!1,this.landPoints=[],this.mousePoints=[]}var e,n,u;return e=t,(n=[{key:"_getLayerIds",value:function(){return this.nebula.deckgl.props.layers.filter((function(t){return t&&t.props&&t.props.nebulaLayer&&t.props.nebulaLayer.enableSelection})).map((function(t){return t.id}))}},{key:"_selectFromPickingInfos",value:function(t){var e=t.map((function(t){var e=t.layer,n=t.index;return t.object.original||e.props.nebulaLayer.deckCache.originals[n]}));this.nebula.props.onSelection(e)}},{key:"_getBoundingBox",value:function(){var t=this.mousePoints,e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]})),r=Math.min.apply(Math,f(e)),i=Math.min.apply(Math,f(n));return{x:r,y:i,width:Math.max.apply(Math,f(e))-r,height:Math.max.apply(Math,f(n))-i}}},{key:"_selectRectangleObjects",value:function(){if(2===this.landPoints.length){var t=g(this.mousePoints[0],2),e=t[0],n=t[1],r=g(this.mousePoints[1],2),i=r[0],o=r[1],a=this.nebula.deckgl.pickObjects({x:Math.min(e,i),y:Math.min(n,o),width:Math.abs(i-e),height:Math.abs(o-n),layerIds:this._getLayerIds()});this._selectFromPickingInfos(a)}}},{key:"_selectPolygonObjects",value:function(){var t=this.nebula.deckgl.pickObjects(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},this._getBoundingBox(),{layerIds:[B].concat(f(this._getLayerIds()))}));this._selectFromPickingInfos(t.filter((function(t){return t.layer.id!==B})))}},{key:"_getMousePosFromEvent",value:function(t){return[t.offsetX,t.offsetY]}},{key:"handleEvent",value:function(t,e,n){"mouseup"!==t.type&&t.stopPropagation(),this.usePolygon=n===m.POLYGON;var r=!1,i=!1,o=this.usePolygon,a=this.landPoints,A=this.mousePoints;if("mousedown"===t.type){if(o&&a.length)(this.landPoints.length<3||this.validPolygon)&&(a.push(e),A.push(this._getMousePosFromEvent(t)));else{this.landPoints=[e,e];var s=this._getMousePosFromEvent(t);this.mousePoints=[s,s]}r=!0}else"mousemove"===t.type&&a.length?(a[a.length-1]=e,A[A.length-1]=this._getMousePosFromEvent(t),r=!0):"mouseup"===t.type&&(o?a.length>4&&(0,c.default)(a[0],a[a.length-1])<.01&&this.validPolygon&&(this._selectPolygonObjects(),this.reset(),r=!0,i=!0):(this._selectRectangleObjects(),this.reset(),r=!0,i=!0));return{redraw:r,deactivate:i}}},{key:"reset",value:function(){this.landPoints=[],this.mousePoints=[]}},{key:"_makeStartPointHighlight",value:function(t){var e=(0,A.default)((0,i.point)(t),.0025);return(0,a.default)((0,o.default)(e)).geometry.coordinates}},{key:"render",value:function(){var t=this,e=[],n=[];if(this.usePolygon||2!==this.landPoints.length){if(this.usePolygon&&this.landPoints.length&&(e.push({polygon:this.landPoints,lineColor:C,fillColor:y}),this.landPoints.length>=3)){var o,a=(0,i.polygon)([[].concat(f(this.landPoints),[this.landPoints[0]])]),c=(0,A.default)((0,i.point)(this.landPoints[0]),10);try{o=(0,s.default)(c,a),n.push({polygon:o.geometry.coordinates,fillColor:[0,0,0,1]}),this.validPolygon=!0}catch(E){this.validPolygon=!1}}}else{var u=g(this.mousePoints,2),l=g(u[0],2),h=l[0],d=l[1],I=g(u[1],2),p=I[0],m=I[1],b=[[h,d],[h,m],[p,m],[p,d],[h,d]].map((function(e){return t.nebula.unprojectMousePosition(e)}));e.push({polygon:b,lineColor:C,fillColor:y})}return this.landPoints.length&&e.push({polygon:this._makeStartPointHighlight(this.landPoints[0]),lineColor:[0,0,0,0],fillColor:C}),e.push({polygon:[[0,0]]}),n.push({polygon:[[0,0]]}),[new r.PolygonLayer({id:"DeckDrawerView",data:e,fp64:!1,opacity:1,pickable:!1,lineWidthMinPixels:2,lineWidthMaxPixels:2,lineDashJustified:!0,getLineDashArray:function(t){return v},getLineColor:function(t){return t.lineColor||[0,0,0,255]},getFillColor:function(t){return t.fillColor||[0,0,0,255]},getPolygon:function(t){return t.polygon}}),new r.PolygonLayer({id:B,data:n,getLineColor:function(t){return t.lineColor||[0,0,0,255]},getFillColor:function(t){return t.fillColor||[0,0,0,255]},fp64:!1,opacity:1,stroked:!1,pickable:!0,getPolygon:function(t){return t.polygon}})]}}])&&I(e.prototype,n),u&&I(e,u),t}();e.default=b},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(){function t(e,n){var r=n.data,o=n.groundPoint,a=n.nebula,A=n.metadata;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"canceled",void 0),i(this,"data",void 0),i(this,"metadata",void 0),i(this,"groundPoint",void 0),i(this,"nativeEvent",void 0),i(this,"nebula",void 0),this.nativeEvent=e,this.data=r,this.groundPoint=o,this.nebula=a,this.metadata=A}var e,n,o;return e=t,(n=[{key:"stopPropagation",value:function(){this.nativeEvent.stopPropagation(),this.canceled=!0}}])&&r(e.prototype,n),o&&r(e,o),t}();e.default=o},function(t,e,n){"use strict";function r(t){return t&&"object"===typeof t&&"default"in t?t.default:t}var i=r(n(460)),o=r(n(461)),a=n(69),A=n(109),s=n(137);function c(t){switch(t.type){case"Polygon":return o(t)>1?t:null;case"MultiPolygon":var e=[];if(s.flattenEach(t,(function(t){o(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}t.exports=function(t,e){var n=A.getGeom(t),r=A.getGeom(e),o=t.properties||{};if(n=c(n),r=c(r),!n)return null;if(!r)return a.feature(n,o);var s=i.diff(n.coordinates,r.coordinates);return 0===s.length?null:1===s.length?a.polygon(s[0],o):a.multiPolygon(s,o)}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(207)),o=n(69),a=n(109),A=n(137),s=r(n(993));function c(t,e){return t[0]*e[0]+t[1]*e[1]}function u(t,e,n){return"planar"===n.method?s.default(t,e,n):i.default(t,e,n)}e.default=function(t,e,n){if(void 0===n&&(n={}),n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=o.point(t):"Point"===t.type?t=o.feature(t):a.featureOf(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=o.lineString(e):"LineString"===e.type?e=o.feature(e):a.featureOf(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return A.segmentEach(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=c([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return u(t,e,{method:r.method,units:"degrees"});var a=c(i,i);if(a<=o)return u(t,n,{method:r.method,units:"degrees"});var A=o/a,s=[e[0]+A*i[0],e[1]+A*i[1]];return u(t,s,{method:r.method,units:"degrees"})}(i,e,o,n);a<r&&(r=a)})),o.convertLength(r,"degrees",n.units)}},function(t,e,n){"use strict";n.r(e);var r=n(259);n.d(e,"default",(function(){return r.a})),n.d(e,"WebMercatorViewport",(function(){return r.a})),n.d(e,"getBounds",(function(){return r.e})),n.d(e,"fitBounds",(function(){return r.c})),n.d(e,"normalizeViewportProps",(function(){return r.m})),n.d(e,"flyToViewport",(function(){return r.d})),n.d(e,"getFlyToDuration",(function(){return r.g})),n.d(e,"lngLatToWorld",(function(){return r.l})),n.d(e,"worldToLngLat",(function(){return r.p})),n.d(e,"worldToPixels",(function(){return r.q})),n.d(e,"pixelsToWorld",(function(){return r.n})),n.d(e,"zoomToScale",(function(){return r.r})),n.d(e,"scaleToZoom",(function(){return r.o})),n.d(e,"getMeterZoom",(function(){return r.h})),n.d(e,"getDistanceScales",(function(){return r.f})),n.d(e,"addMetersToLngLat",(function(){return r.b})),n.d(e,"getViewMatrix",(function(){return r.k})),n.d(e,"getProjectionMatrix",(function(){return r.i})),n.d(e,"getProjectionParameters",(function(){return r.j}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScaleMode=void 0;var r=I(n(390)),i=I(n(394)),o=I(n(268)),a=I(n(511)),A=n(69),s=I(n(740)),c=n(137),u=I(n(207)),l=I(n(1087)),g=n(109),f=n(230),h=n(155),d=n(330);function I(t){return t&&t.__esModule?t:{default:t}}function p(t){return(p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e){return!e||"object"!==p(e)&&"function"!==typeof e?b(t):e}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function Q(t){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function F(t,e){return(F=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var S=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&F(t,e)}(p,t);var e,n,u,h,I=(e=p,function(){var t,n=Q(e);if(E()){var r=Q(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return m(this,t)});function p(){var t;v(this,p);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return w(b(t=I.call.apply(I,[this].concat(n))),"_geometryBeingScaled",void 0),w(b(t),"_selectedEditHandle",void 0),w(b(t),"_cornerGuidePoints",void 0),w(b(t),"_cursor",void 0),w(b(t),"_isScaling",!1),w(b(t),"_isSinglePointGeometrySelected",(function(t){var e=(t||{}).features;return!(!Array.isArray(e)||1!==e.length)&&"Point"===(0,g.getGeom)(e[0]).type})),w(b(t),"_getOppositeScaleHandle",(function(e){var n=e&&e.properties&&Array.isArray(e.properties.positionIndexes)&&e.properties.positionIndexes[0];if("number"!==typeof n)return null;var r=t._cornerGuidePoints.length,i=(n+r/2)%r;return t._cornerGuidePoints.find((function(t){return!!Array.isArray(t.properties.positionIndexes)&&t.properties.positionIndexes[0]===i}))})),w(b(t),"_getUpdatedData",(function(t,e){for(var n=new d.ImmutableFeatureCollection(t.data),r=t.selectedIndexes,i=0;i<r.length;i++){var o=r[i],a=e.features[i];n=n.replaceGeometry(o,a.geometry)}return n.getObject()})),w(b(t),"isEditHandleSelected",(function(){return Boolean(t._selectedEditHandle)})),w(b(t),"getScaleAction",(function(e,n,r,i){if(!t._selectedEditHandle)return null;var o=t._getOppositeScaleHandle(t._selectedEditHandle),a=(0,g.getCoord)(o),A=R(a,e,n),s=(0,l.default)(t._geometryBeingScaled,A,{origin:a});return{updatedData:t._getUpdatedData(i,s),editType:r,editContext:{featureIndexes:i.selectedIndexes}}})),w(b(t),"updateCursor",(function(e){if(t._selectedEditHandle){t._cursor&&e.onUpdateCursor(t._cursor);var n=t.getSelectedFeaturesAsFeatureCollection(e),r=(0,i.default)(n),a=(0,o.default)(r,t._selectedEditHandle),A=a<0?a+180:a;A>=0&&A<=90||A>=180&&A<=270?(t._cursor="nesw-resize",e.onUpdateCursor("nesw-resize")):(t._cursor="nwse-resize",e.onUpdateCursor("nwse-resize"))}else e.onUpdateCursor(null),t._cursor=null})),t}return n=p,(u=[{key:"handlePointerMove",value:function(t,e){if(!this._isScaling){var n=(0,f.getPickedEditHandle)(t.picks);this._selectedEditHandle=n&&"scale"===n.properties.editHandleType?n:null,n&&this.updateCursor(e)}}},{key:"handleStartDragging",value:function(t,e){this._selectedEditHandle&&(this._isScaling=!0,this._geometryBeingScaled=this.getSelectedFeaturesAsFeatureCollection(e))}},{key:"handleDragging",value:function(t,e){if(this._isScaling){e.onUpdateCursor(this._cursor);var n=this.getScaleAction(t.pointerDownMapCoords,t.mapCoords,"scaling",e);n&&e.onEdit(n),t.cancelPan()}}},{key:"handleStopDragging",value:function(t,e){if(this._isScaling){var n=this.getScaleAction(t.pointerDownMapCoords,t.mapCoords,"scaled",e);n&&e.onEdit(n),e.onUpdateCursor(null),this._geometryBeingScaled=null,this._selectedEditHandle=null,this._cursor=null,this._isScaling=!1}}},{key:"getGuides",value:function(t){this._cornerGuidePoints=[];var e=this.getSelectedFeaturesAsFeatureCollection(t);if(this._isSinglePointGeometrySelected(e))return{type:"FeatureCollection",features:[]};var n=(0,a.default)((0,r.default)(e));n.properties.mode="scale";var i=[];return(0,c.coordEach)(n,(function(t,e){if(e<4){var n=(0,A.point)(t,{guideType:"editHandle",editHandleType:"scale",positionIndexes:[e]});i.push(n)}})),this._cornerGuidePoints=i,(0,A.featureCollection)([(0,s.default)(n)].concat(C(this._cornerGuidePoints)))}}])&&B(n.prototype,u),h&&B(n,h),p}(h.GeoJsonEditMode);function R(t,e,n){var r=(0,u.default)(t,e);return(0,u.default)(t,n)/r}e.ScaleMode=S},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RotateMode=void 0;var r=I(n(390)),i=I(n(394)),o=I(n(268)),a=I(n(511)),A=I(n(207)),s=n(137),c=n(109),u=n(69),l=I(n(751)),g=I(n(740)),f=n(230),h=n(155),d=n(330);function I(t){return t&&t.__esModule?t:{default:t}}function p(t){return(p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return!e||"object"!==p(e)&&"function"!==typeof e?B(t):e}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E(t,e)}(w,t);var e,n,I,p,F=(e=w,function(){var t,n=b(e);if(m()){var r=b(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return v(this,t)});function w(){var t;C(this,w);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Q(B(t=F.call.apply(F,[this].concat(n))),"_selectedEditHandle",void 0),Q(B(t),"_geometryBeingRotated",void 0),Q(B(t),"_isRotating",!1),Q(B(t),"_isSinglePointGeometrySelected",(function(t){var e=(t||{}).features;return!(!Array.isArray(e)||1!==e.length)&&"Point"===(0,c.getGeom)(e[0]).type})),Q(B(t),"getIsRotating",(function(){return t._isRotating})),t}return n=w,(I=[{key:"getGuides",value:function(t){var e=this._geometryBeingRotated||this.getSelectedFeaturesAsFeatureCollection(t);if(this._isSinglePointGeometrySelected(e))return{type:"FeatureCollection",features:[]};if(this._isRotating)return(0,u.featureCollection)([(0,i.default)(e)]);var n=(0,a.default)((0,r.default)(e)),o=null,c=null,l=0;(0,s.coordEach)(n,(function(t){if(o){var e=(0,h.getIntermediatePosition)(t,o);(!c||e[1]>c[1])&&(c=e);var n=(0,A.default)(t,o);l=Math.max(l,n)}o=t}));var f=c&&[c[0],c[1]+l/1e3],d=(0,u.lineString)([c,f]),I=(0,u.point)(f,{guideType:"editHandle",editHandleType:"rotate"});return(0,u.featureCollection)([(0,g.default)(n),I,d])}},{key:"handleDragging",value:function(t,e){if(this._isRotating){var n=this.getRotateAction(t.pointerDownMapCoords,t.mapCoords,"rotating",e);n&&e.onEdit(n),t.cancelPan()}}},{key:"handlePointerMove",value:function(t,e){if(!this._isRotating){var n=(0,f.getPickedEditHandle)(t.picks);this._selectedEditHandle=n&&"rotate"===n.properties.editHandleType?n:null}this.updateCursor(e)}},{key:"handleStartDragging",value:function(t,e){this._selectedEditHandle&&(this._isRotating=!0,this._geometryBeingRotated=this.getSelectedFeaturesAsFeatureCollection(e))}},{key:"handleStopDragging",value:function(t,e){if(this._isRotating){var n=this.getRotateAction(t.pointerDownMapCoords,t.mapCoords,"rotated",e);n&&e.onEdit(n),this._geometryBeingRotated=null,this._selectedEditHandle=null,this._isRotating=!1}}},{key:"updateCursor",value:function(t){this._selectedEditHandle?t.onUpdateCursor("crosshair"):t.onUpdateCursor(null)}},{key:"getRotateAction",value:function(t,e,n,r){if(!this._geometryBeingRotated)return null;for(var a=(0,i.default)(this._geometryBeingRotated),A=function(t,e,n){var r=(0,o.default)(t,e);return(0,o.default)(t,n)-r}(a,t,e),s=(0,l.default)(this._geometryBeingRotated,A,{pivot:a}),c=new d.ImmutableFeatureCollection(r.data),u=r.selectedIndexes,g=0;g<u.length;g++){var f=u[g],h=s.features[g];c=c.replaceGeometry(f,h.geometry)}return{updatedData:c.getObject(),editType:n,editContext:{featureIndexes:u}}}}])&&y(n.prototype,I),p&&y(n,p),w}(h.GeoJsonEditMode);e.RotateMode=F},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeMode=void 0;var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(h,t);var e,n,r,a,f=(e=h,function(){var t,n=l(e);if(u()){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function h(t){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),e=f.call(this),n=c(e),i=void 0,(r="_modes")in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,e._modes=t,e}return n=h,(r=[{key:"_coalesce",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=0;r<this._modes.length&&(e=t(this._modes[r]),!(n?n(e):e));r++);return e}},{key:"handleClick",value:function(t,e){this._coalesce((function(n){return n.handleClick(t,e)}))}},{key:"handlePointerMove",value:function(t,e){return this._coalesce((function(n){return n.handlePointerMove(t,e)}))}},{key:"handleStartDragging",value:function(t,e){return this._coalesce((function(n){return n.handleStartDragging(t,e)}))}},{key:"handleStopDragging",value:function(t,e){return this._coalesce((function(n){return n.handleStopDragging(t,e)}))}},{key:"handleDragging",value:function(t,e){return this._coalesce((function(n){return n.handleDragging(t,e)}))}},{key:"getGuides",value:function(t){var e,n=[],r=function(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=o(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,A=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){A=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(A)throw i}}}}(this._modes);try{for(r.s();!(e=r.n()).done;){var a=e.value;n.push.apply(n,i(a.getGuides(t).features))}}catch(A){r.e(A)}finally{r.f()}return{type:"FeatureCollection",features:n}}}])&&A(n.prototype,r),a&&A(n,a),h}(n(155).GeoJsonEditMode);e.CompositeMode=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(455),i=n(69);e.default=function(t,e,n){void 0===n&&(n={});for(var o=n.steps||64,a=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},A=[],s=0;s<o;s++)A.push(r.default(t,e,-360*s/o,n).geometry.coordinates);return A.push(A[0]),i.polygon([A],a)}},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function A(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ThreeClickPolygonMode=void 0;var l=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(f,t);var e,n,r,l,g=(e=f,function(){var t,n=c(e);if(s()){var r=c(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return A(this,t)});function f(){return i(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"handleClick",value:function(t,e){this.addClickSequence(t);var n=this.getClickSequence(),r=this.getTentativeGuide(e);if(n.length>2&&r&&"Polygon"===r.geometry.type){var i=this.getAddFeatureOrBooleanPolygonAction(r.geometry,e);this.resetClickSequence(),i&&e.onEdit(i)}}},{key:"getGuides",value:function(t){var e=t.lastPointerMoveEvent,n=t.modeConfig,r=this.getClickSequence(),i={type:"FeatureCollection",features:[]};if(0===r.length)return i;var o=e.mapCoords;if(1===r.length)i.features.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[r[0],o]}});else{var a=this.getThreeClickPolygon(r[0],r[1],o,n);a&&i.features.push({type:"Feature",properties:{guideType:"tentative"},geometry:a.geometry})}return i}},{key:"getThreeClickPolygon",value:function(t,e,n,r){return null}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell"),a(c(f.prototype),"handlePointerMove",this).call(this,t,e)}},{key:"createTentativeFeature",value:function(t){var e,n=t.lastPointerMoveEvent,r=this.getClickSequence(),i=n?[n.mapCoords]:[];return 2===r.length&&(e=this.getThreeClickPolygon(r[0],r[1],i[0],t.modeConfig)),e}}])&&o(n.prototype,r),l&&o(n,l),f}(n(155).GeoJsonEditMode);e.ThreeClickPolygonMode=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(59);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=["anyclick","pointermove","panstart","panmove","panend","keyup"],p=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(s,t);var e,n,r,i,o=(e=s,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return l(this,t)});function s(){return c(this,s),o.apply(this,arguments)}return n=s,(r=[{key:"onLayerClick",value:function(t){}},{key:"onStartDragging",value:function(t){}},{key:"onStopDragging",value:function(t){}},{key:"onDragging",value:function(t){}},{key:"onPointerMove",value:function(t){}},{key:"onLayerKeyUp",value:function(t){}},{key:"initializeState",value:function(){this.setState({_editableLayerState:{pointerDownPicks:null,pointerDownScreenCoords:null,pointerDownMapCoords:null,eventHandler:this._forwardEventToCurrentLayer.bind(this)}}),this._addEventHandlers()}},{key:"finalizeState",value:function(){this._removeEventHandlers()}},{key:"_addEventHandlers",value:function(){var t,e=this.context.deck.eventManager,n=this.state._editableLayerState.eventHandler,r=A(I);try{for(r.s();!(t=r.n()).done;){var i=t.value;e.on(i,n,{priority:100})}}catch(o){r.e(o)}finally{r.f()}}},{key:"_removeEventHandlers",value:function(){var t,e=this.context.deck.eventManager,n=this.state._editableLayerState.eventHandler,r=A(I);try{for(r.s();!(t=r.n()).done;){var i=t.value;e.off(i,n)}}catch(o){r.e(o)}finally{r.f()}}},{key:"_forwardEventToCurrentLayer",value:function(t){var e=this.getCurrentLayer(),n=e["_on".concat(t.type)].bind(e);n?n(t):console.warn("no handler for mjolnir.js event ".concat(t.type))}},{key:"_onanyclick",value:function(t){var e=t.srcEvent,n=this.getScreenCoords(e),r=this.getMapCoords(n),i=this.getPicks(n);this.onLayerClick({mapCoords:r,screenCoords:n,picks:i,sourceEvent:e})}},{key:"_onkeyup",value:function(t){var e=t.srcEvent;this.onLayerKeyUp(e)}},{key:"_onpanstart",value:function(t){var e=this.getScreenCoords(t.srcEvent),n=this.getMapCoords(e),r=this.getPicks(e);this.setState({_editableLayerState:a({},this.state._editableLayerState,{pointerDownScreenCoords:e,pointerDownMapCoords:n,pointerDownPicks:r})}),this.onStartDragging({picks:r,screenCoords:e,mapCoords:n,pointerDownScreenCoords:e,pointerDownMapCoords:n,cancelPan:t.stopImmediatePropagation,sourceEvent:t.srcEvent})}},{key:"_onpanmove",value:function(t){var e=t.srcEvent,n=this.getScreenCoords(e),r=this.getMapCoords(n),i=this.state._editableLayerState,o=i.pointerDownPicks,a=i.pointerDownScreenCoords,A=i.pointerDownMapCoords,s=this.getPicks(n);this.onDragging({screenCoords:n,mapCoords:r,picks:s,pointerDownPicks:o,pointerDownScreenCoords:a,pointerDownMapCoords:A,sourceEvent:e,cancelPan:t.stopImmediatePropagation})}},{key:"_onpanend",value:function(t){var e=t.srcEvent,n=this.getScreenCoords(e),r=this.getMapCoords(n),i=this.state._editableLayerState,o=i.pointerDownPicks,A=i.pointerDownScreenCoords,s=i.pointerDownMapCoords,c=this.getPicks(n);this.onStopDragging({picks:c,screenCoords:n,mapCoords:r,pointerDownPicks:o,pointerDownScreenCoords:A,pointerDownMapCoords:s,sourceEvent:e}),this.setState({_editableLayerState:a({},this.state._editableLayerState,{pointerDownScreenCoords:null,pointerDownMapCoords:null,pointerDownPicks:null})})}},{key:"_onpointermove",value:function(t){var e=t.srcEvent,n=this.getScreenCoords(e),r=this.getMapCoords(n),i=this.state._editableLayerState,o=i.pointerDownPicks,a=i.pointerDownScreenCoords,A=i.pointerDownMapCoords,s=this.getPicks(n);this.onPointerMove({screenCoords:n,mapCoords:r,picks:s,pointerDownPicks:o,pointerDownScreenCoords:a,pointerDownMapCoords:A,sourceEvent:e})}},{key:"getPicks",value:function(t){return this.context.deck.pickMultipleObjects({x:t[0],y:t[1],layerIds:[this.props.id],radius:this.props.pickingRadius,depth:this.props.pickingDepth})}},{key:"getScreenCoords",value:function(t){return[t.clientX-this.context.gl.canvas.getBoundingClientRect().left,t.clientY-this.context.gl.canvas.getBoundingClientRect().top]}},{key:"getMapCoords",value:function(t){return this.context.viewport.unproject([t[0],t[1]])}}])&&u(n.prototype,r),i&&u(n,i),s}(r.CompositeLayer);e.default=p,d(p,"layerName","EditableLayer")},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(3),i=n(2),o=n(153),a=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t),this.opts=e}return Object(i.a)(t,[{key:"equals",value:function(t){return this===t||this.constructor===t.constructor&&Object(o.a)(this.opts,t.opts)}},{key:"getShaders",value:function(t){return null}},{key:"getSubLayerProps",value:function(t){var e=t.constructor.defaultProps,n=void 0===e?{}:e,r={updateTriggers:{}};for(var i in n)if(i in this.props){var o=n[i],a=this.props[i];r[i]=a,o&&"accessor"===o.type&&(r.updateTriggers[i]=this.props.updateTriggers[i],"function"===typeof a&&(r[i]=this.getSubLayerAccessor(a,!0)))}return r}},{key:"initializeState",value:function(t,e){}},{key:"updateState",value:function(t,e){}},{key:"draw",value:function(t,e){}},{key:"finalizeState",value:function(t){}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(518);function i(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(Object(r.a)(t),'"'))}}},function(t,e,n){"use strict";(function(t){var r=n(91),i=n(832);n.d(e,"c",(function(){return i.a}));var o=n(833);n.d(e,"a",(function(){return o.a}));var a=n(818);n.d(e,"b",(function(){return a.a}));var A={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(A.global||A.self||A.window).mathgl={config:r.a}}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(482),c=n(108),u=n(231),l=n(33),g=n(45);function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var h=[0,0,0,1],d=function(t){Object(o.a)(n,t);var e=f(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0,-0),Array.isArray(i)&&1===arguments.length?t.copy(i):t.set(i,o,a,A),t}return Object(i.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromMatrix3",value:function(t){return l.e(this,t),this.check()}},{key:"identity",value:function(){return l.f(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return l.p(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"len",value:function(){return l.h(this)}},{key:"lengthSquared",value:function(){return l.r(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return l.d(this,t)}},{key:"rotationTo",value:function(t,e){return l.n(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return l.a(this,this,t),this.check()}},{key:"calculateW",value:function(){return l.b(this,this),this.check()}},{key:"conjugate",value:function(){return l.c(this,this),this.check()}},{key:"invert",value:function(){return l.g(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return l.i(this,t,e,n),this.check()}},{key:"multiplyRight",value:function(t,e){return Object(u.a)(!e),l.j(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Object(u.a)(!e),l.j(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return l.k(this,this,t),this.check()}},{key:"rotateY",value:function(t){return l.l(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return l.m(this,this,t),this.check()}},{key:"scale",value:function(t){return l.o(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){switch(arguments.length){case 1:var r=arguments[0],i=r.start;t=void 0===i?h:i,e=r.target,n=r.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],n=o[1],t=this}return l.q(this,t,e,n),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return g.o(e,t,this),Object(c.b)(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(c.a)(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(c.a)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=Object(c.a)(t)}}]),n}(s.a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(142),i=A(n(46)),o=n(57),a=A(n(1021));function A(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return(l="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function g(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t){var e=t.source,n=t.code,r=void 0===n?"":n;return e.replace(/}[^{}]*$/,r.concat("\n}\n"))}var C=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(I,t);var e,n,r,A,s=(e=I,function(){var t,n=h(e);if(f()){var r=h(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return g(this,t)});function I(){return c(this,I),s.apply(this,arguments)}return n=I,(r=[{key:"getShaders",value:function(){var t=l(h(I.prototype),"getShaders",this).call(this);return Object.assign({},t,{modules:t.modules.concat([a.default]),vs:p({source:t.vs,code:"  outline_setUV(gl_Position);\n  outline_setZLevel(instanceZLevel);\n"}),fs:p({source:t.fs,code:"  gl_FragColor = outline_filterColor(gl_FragColor);\n"})})}},{key:"initializeState",value:function(t){l(h(I.prototype),"initializeState",this).call(this,t),this.setState({outlineFramebuffer:new o.Framebuffer(t.gl),dummyTexture:new o.Texture2D(t.gl)}),this.state.attributeManager.addInstanced({instanceZLevel:{size:1,type:i.default.UNSIGNED_BYTE,update:this.calculateZLevels,accessor:"getZLevel"}})}},{key:"draw",value:function(t){t.moduleParameters,t.parameters;var e=t.uniforms,n=(t.context,this.props),r=n.rounded,o=n.miterLimit,a=n.widthScale,A=n.widthMinPixels,s=n.widthMaxPixels,c=n.dashJustified;e=Object.assign({},e,{jointType:Number(r),alignMode:Number(c),widthScale:a,miterLimit:o,widthMinPixels:A,widthMaxPixels:s});var u=this.state,l=u.outlineFramebuffer,g=u.dummyTexture;l.resize(),l.clear({color:!0,depth:!0}),this.state.model.updateModuleSettings({outlineEnabled:!0,outlineRenderShadowmap:!0,outlineShadowmap:g}),this.state.model.draw({uniforms:Object.assign({},e,{jointType:0,widthScale:1.3*this.props.widthScale}),parameters:{depthTest:!1,blendEquation:i.default.MAX},framebuffer:l}),this.state.model.updateModuleSettings({outlineEnabled:!0,outlineRenderShadowmap:!1,outlineShadowmap:l}),this.state.model.draw({uniforms:Object.assign({},e,{jointType:Number(r),widthScale:this.props.widthScale}),parameters:{depthTest:!1}})}},{key:"calculateZLevels",value:function(t){var e=this.props.getZLevel,n=this.state.pathTesselator;t.value=n._updateAttribute({target:t.value,size:1,getValue:function(t,n){return[e(t,n)||0]}})}}])&&u(n.prototype,r),A&&u(n,A),I}(r.PathLayer);e.default=C,I(C,"layerName","PathOutlineLayer"),I(C,"defaultProps",{getZLevel:{type:"accessor",value:0}})},function(t,e,n){"use strict";(function(t){var r=n(94),i=n(826);n.d(e,"a",(function(){return i.a}));var o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(o.global||o.self||o.window).mathgl={config:r.a}}).call(this,n(56))},function(t,e,n){"use strict";(function(t){var r=n(97),i=n(827);n.d(e,"a",(function(){return i.a}));var o={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof t&&t};(o.global||o.self||o.window).mathgl={config:r.a}}).call(this,n(56))},function(t,e,n){var r=n(709),i=n(1041),o=n(1043);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){var r=n(345),i=n(193);t.exports=function(t){return i(t)&&r(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(2),a=n(34),A=n(7),s=n(8),c=n(6),u=n(27),l=n(435),g=n(436),f=n(44),h=n(252),d=n(19),I=n(1386),p=n(817),C=n(197),y=n(47),v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id;this.id=n||Object(C.c)(this.constructor.name),this.display=!0,this.position=new p.c,this.rotation=new p.c,this.scale=new p.c(1,1,1),this.matrix=new p.a,this.userData={},this.props={},this._setScenegraphNodeProps(e)}return Object(o.a)(t,[{key:"delete",value:function(){}},{key:"setProps",value:function(t){return this._setScenegraphNodeProps(t),this}},{key:"toString",value:function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}},{key:"setPosition",value:function(t){return Object(y.a)(3===t.length,"setPosition requires vector argument"),this.position=t,this}},{key:"setRotation",value:function(t){return Object(y.a)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}},{key:"setScale",value:function(t){return Object(y.a)(3===t.length,"setScale requires vector argument"),this.scale=t,this}},{key:"setMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e?this.matrix.copy(t):this.matrix=t}},{key:"setMatrixComponents",value:function(t){var e=t.position,n=t.rotation,r=t.scale,i=t.update,o=void 0===i||i;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),o&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.position,n=t.rotation,r=t.scale;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(t,e){Object(y.a)(t),e=e||this.matrix;var n=new p.a(t).multiplyRight(e),r=n.invert(),i=r.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:r,worldInverseTransposeMatrix:i}}},{key:"_setScenegraphNodeProps",value:function(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}]),t}(),B=n(76),m=n(115),b=n(23),E=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var r=n=Array.isArray(n)?{children:n}:n,o=r.children,a=void 0===o?[]:o;return d.h.assert(a.every((function(t){return t instanceof v})),"every child must an instance of ScenegraphNode"),(t=Object(s.a)(this,Object(c.a)(e).call(this,n))).children=a,t}return Object(A.a)(e,t),Object(o.a)(e,[{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];Array.isArray(o)?this.add.apply(this,Object(b.a)(o)):this.children.push(o)}return this}},{key:"remove",value:function(t){var e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach((function(t){return t.delete()})),this.removeAll(),Object(a.a)(Object(c.a)(e.prototype),"delete",this).call(this)}},{key:"traverse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.worldMatrix,i=void 0===r?new p.a:r,o=new p.a(i).multiplyRight(this.matrix),a=!0,A=!1,s=void 0;try{for(var c,u=this.children[Symbol.iterator]();!(a=(c=u.next()).done);a=!0){var l=c.value;l instanceof e?l.traverse(t,{worldMatrix:o}):t(l,{worldMatrix:o})}}catch(g){A=!0,s=g}finally{try{a||null==u.return||u.return()}finally{if(A)throw s}}}}]),e}(v),Q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function w(t){if(!t._animation){var e=F[t.componentType],n=Q[t.type],r=n*t.count,i=t.bufferView.data,o=new e(i.buffer,i.byteOffset+(t.byteOffset||0),r);if(1===n)t._animation=Array.from(o);else{for(var a=[],A=0;A<o.length;A+=n)a.push(Array.from(o.slice(A,A+n)));t._animation=a}}return t._animation}var S=new p.a;var R=new p.b;function U(t,e,n,r){var i=e.input,o=e.interpolation,a=e.output,A=t%i[i.length-1],s=i.findIndex((function(t){return t>=A})),c=Math.max(0,s-1);if(!Array.isArray(n[r]))switch(r){case"translation":n[r]=[0,0,0];break;case"rotation":n[r]=[0,0,0,1];break;case"scale":n[r]=[1,1,1];break;default:d.h.warn("Bad animation path ".concat(r))()}Object(y.a)(n[r].length===a[c].length);var u=i[c],l=i[s];switch(o){case"STEP":!function(t,e,n){for(var r=0;r<n.length;r++)t[e][r]=n[r]}(n,r,a[c]);break;case"LINEAR":if(l>u){var g=(A-u)/(l-u);!function(t,e,n,r,i){if("rotation"===e){R.slerp({start:n,target:r,ratio:i});for(var o=0;o<R.length;o++)t[e][o]=R[o]}else for(var a=0;a<n.length;a++)t[e][a]=i*r[a]+(1-i)*n[a]}(n,r,a[c],a[s],g)}break;case"CUBICSPLINE":if(l>u){var f=(A-u)/(l-u),h=l-u;!function(t,e,n){for(var r=n.p0,i=n.outTangent0,o=n.inTangent1,a=n.p1,A=n.tDiff,s=n.ratio,c=0;c<t[e].length;c++){var u=i[c]*A,l=o[c]*A;t[e][c]=(2*Math.pow(s,3)-3*Math.pow(s,2)+1)*r[c]+(Math.pow(s,3)-2*Math.pow(s,2)+s)*u+(-2*Math.pow(s,3)+3*Math.pow(s,2))*a[c]+(Math.pow(s,3)-Math.pow(s,2))*l}}(n,r,{p0:a[3*c+1],outTangent0:a[3*c+2],inTangent1:a[3*s+0],p1:a[3*s+1],tDiff:h,ratio:f})}break;default:d.h.warn("Interpolation ".concat(o," not supported"))()}}var x=function(){function t(e){Object(i.a)(this,t),this.startTime=0,this.playing=!0,this.speed=1,Object.assign(this,e)}return Object(o.a)(t,[{key:"animate",value:function(t){if(this.playing){var e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((function(t){var n=t.sampler,r=t.target,i=t.path;U(e,n,r,i),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){var n=S.fromQuaternion(t.rotation);e.matrix.multiplyRight(n)}t.scale&&e.matrix.scale(t.scale)}(r,r._node)}))}}}]),t}(),k=function(){function t(e){Object(i.a)(this,t),this.animations=e.animations.map((function(t,n){var r=t.name||"Animation-".concat(n),i=t.samplers.map((function(t){var n=t.input,r=t.interpolation,i=void 0===r?"LINEAR":r,o=t.output;return{input:w(e.accessors[n]),interpolation:i,output:w(e.accessors[o])}})),o=t.channels.map((function(t){var n=t.sampler,r=t.target;return{sampler:i[n],target:e.nodes[r.node],path:r.path}}));return new x({name:r,channels:o})}))}return Object(o.a)(t,[{key:"animate",value:function(t){this.setTime(t)}},{key:"setTime",value:function(t){this.animations.forEach((function(e){return e.animate(t)}))}},{key:"getAnimations",value:function(){return this.animations}}]),t}(),O=n(379),N=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,e),(n=Object(s.a)(this,Object(c.a)(e).call(this,r))).onBeforeRender=null,n.AfterRender=null,t instanceof O.a?(n.model=t,n._setModelNodeProps(r)):n.model=new O.a(t,r),n.managedResources=r.managedResources||[],n}return Object(A.a)(e,t),Object(o.a)(e,[{key:"setProps",value:function(t){return Object(a.a)(Object(c.a)(e.prototype),"setProps",this).call(this,t),this._setModelNodeProps(t),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach((function(t){return t.delete()})),this.managedResources=[]}},{key:"draw",value:function(){var t;return(t=this.model).draw.apply(t,arguments)}},{key:"setUniforms",value:function(){var t;return(t=this.model).setUniforms.apply(t,arguments),this}},{key:"setAttributes",value:function(){var t;return(t=this.model).setAttributes.apply(t,arguments),this}},{key:"updateModuleSettings",value:function(){var t;return(t=this.model).updateModuleSettings.apply(t,arguments),this}},{key:"_setModelNodeProps",value:function(t){this.model.setProps(t)}}]),e}(v),D=n(702),G=n(353),_=n(218),M=function(){function t(e,n){var r=n.attributes,o=n.material,a=n.pbrDebug,A=n.imageBasedLightingEnvironment,s=n.lights,c=n.useTangents;Object(i.a)(this,t),this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Object(D.b)(e,G.a.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],A&&(this.uniforms.u_DiffuseEnvSampler=A.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=A.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=A.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(r.NORMAL,"HAS_NORMALS"),this.defineIfPresent(r.TANGENT&&c,"HAS_TANGENTS"),this.defineIfPresent(r.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(A,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),o&&this.parseMaterial(o)}return Object(o.a)(t,[{key:"defineIfPresent",value:function(t,e){t&&(this.defines[e]=1)}},{key:"parseTexture",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},o=new _.a(this.gl,{id:t.name||t.id,parameters:i,pixelStore:Object(r.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:t.texture.source.image});this.uniforms[e]=o,this.defineIfPresent(n,n),this.generatedTextures.push(o)}},{key:"parsePbrMetallicRoughness",value:function(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var e=t.metallicFactor,n=void 0===e?1:e,r=t.roughnessFactor,i=void 0===r?1:r;this.uniforms.u_MetallicRoughnessValues=[n,i]}},{key:"parseMaterial",value:function(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var e=t.normalTexture.scale,n=void 0===e?1:e;this.uniforms.u_NormalScale=n}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var r=t.occlusionTexture.strength,i=void 0===r?1:r;this.uniforms.u_OcclusionStrength=i}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){var o=t.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===t.alphaMode&&(d.h.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}]),t}();function T(t,e){return Object(d.g)(t)?"#version 300 es\n".concat(e):e}var j={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},L={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},V=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),this.gl=e,this.options=Object.assign({},L,n)}return Object(o.a)(t,[{key:"instantiate",value:function(t){var e=this;return this.gltf=t,(t.scenes||[]).map((function(t){return e.createScene(t)}))}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new k(this.gltf):null}},{key:"createScene",value:function(t){var e=this,n=(t.nodes||[]).map((function(t){return e.createNode(t)}));return new E({id:t.name||t.id,children:n})}},{key:"createNode",value:function(t){var e=this;if(!t._node){var n=(t.children||[]).map((function(t){return e.createNode(t)}));t.mesh&&n.push(this.createMesh(t.mesh));var r=new E({id:t.name||t.id,children:n});if(t.matrix)r.setMatrix(t.matrix);else{if(r.matrix.identity(),t.translation&&r.matrix.translate(t.translation),t.rotation){var i=(new p.a).fromQuaternion(t.rotation);r.matrix.multiplyRight(i)}t.scale&&r.matrix.scale(t.scale)}t._node=r}return t._node}},{key:"createMesh",value:function(t){var e=this;if(!t._mesh){var n=(t.primitives||[]).map((function(n,r){return e.createPrimitive(n,r,t)})),r=new E({id:t.name||t.id,children:n});t._mesh=r}return t._mesh}},{key:"getVertexCount",value:function(t){d.h.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(t,e,n){return function(t,e){var n=e.id,r=e.drawMode,i=e.vertexCount,o=e.attributes,a=e.modelOptions,A=new M(t,e);d.h.info(4,"createGLTFModel defines: ",A.defines)();var s=[];s.push.apply(s,Object(b.a)(A.generatedTextures)),s.push.apply(s,Object(b.a)(Object.values(o).map((function(t){return t.buffer}))));var c=new N(t,Object.assign({id:n,drawMode:r,vertexCount:i,modules:[I.a],defines:A.defines,parameters:A.parameters,vs:T(t,"\n#if (__VERSION__ < 300)\n  #define _attr attribute\n#else\n  #define _attr in\n#endif\n\n  _attr vec4 POSITION;\n\n  #ifdef HAS_NORMALS\n    _attr vec4 NORMAL;\n  #endif\n\n  #ifdef HAS_TANGENTS\n    _attr vec4 TANGENT;\n  #endif\n\n  #ifdef HAS_UV\n    _attr vec2 TEXCOORD_0;\n  #endif\n\n  void main(void) {\n    vec4 _NORMAL = vec4(0.);\n    vec4 _TANGENT = vec4(0.);\n    vec2 _TEXCOORD_0 = vec2(0.);\n\n    #ifdef HAS_NORMALS\n      _NORMAL = NORMAL;\n    #endif\n\n    #ifdef HAS_TANGENTS\n      _TANGENT = TANGENT;\n    #endif\n\n    #ifdef HAS_UV\n      _TEXCOORD_0 = TEXCOORD_0;\n    #endif\n\n    pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n    gl_Position = u_MVPMatrix * POSITION;\n  }\n"),fs:T(t,"\n#if (__VERSION__ < 300)\n  #define fragmentColor gl_FragColor\n#else\n  out vec4 fragmentColor;\n#endif\n\n  void main(void) {\n    fragmentColor = pbr_filterColor(vec4(0));\n  }\n"),managedResources:s},a));return c.setProps({attributes:o}),c.setUniforms(A.uniforms),c}(this.gl,Object.assign({id:t.name||"".concat(n.name||n.id,"-primitive-").concat(e),drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}},{key:"createAttributes",value:function(t,e){var n=this,r={};return Object.keys(t).forEach((function(e){r[e]=n.createAccessor(t[e],n.createBuffer(t[e],n.gl.ARRAY_BUFFER))})),e&&(r.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),d.h.info(4,"glTF Attributes",{attributes:t,indices:e,generated:r})(),r}},{key:"createBuffer",value:function(t,e){t.bufferView||(t.bufferView={});var n=t.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new B.a(this.gl,{id:"from-".concat(n.id),data:n.data||t.value,target:e})),n.lumaBuffers[e]}},{key:"createAccessor",value:function(t,e){return new m.a({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:j[t.type]})}},{key:"createSampler",value:function(t){return t}},{key:"needsPOT",value:function(){return!1}}]),t}();var Z=n(13),P=n.n(Z),W=n(30);function J(){return(J=Object(W.a)(P.a.mark((function t(e){var n;return P.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],e.scenes.forEach((function(t){t.traverse((function(t){Object.values(t.model.getUniforms()).forEach((function(t){!1===t.loaded&&n.push(t)}))}))})),t.next=4,H((function(){return n.some((function(t){return!t.loaded}))}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function H(t){return Y.apply(this,arguments)}function Y(){return(Y=Object(W.a)(P.a.mark((function t(e){return P.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e()){t.next=5;break}return t.next=3,new Promise((function(t){return requestAnimationFrame(t)}));case 3:t.next=0;break;case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var X=n(485);function z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function q(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}n.d(e,"a",(function(){return et}));var $=[255,255,255,255],tt={scenegraph:{type:"object",value:null,async:!0},getScene:function(t){return t&&t.scenes?"object"===Object(u.a)(t.scene)?t.scene:t.scenes[t.scene||0]:t},getAnimator:function(t){return t&&t.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:$},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},et=function(t){Object(A.a)(n,t);var e=q(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"getShaders",value:function(){var t=[l.a,g.a];return"pbr"===this.props._lighting&&t.push(I.a),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n  in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n  #ifdef HAS_NORMALS\n    in vec4 NORMAL;\n  #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n  #ifdef HAS_UV\n    out vec2 vTEXCOORD_0;\n  #endif\n#endif\nvoid main(void) {\n  #if defined(HAS_UV) && !defined(MODULE_PBR)\n    vTEXCOORD_0 = TEXCOORD_0;\n    geometry.uv = vTEXCOORD_0;\n  #endif\n\n  geometry.worldPosition = instancePositions;\n  geometry.pickingColor = instancePickingColors;\n\n  #ifdef MODULE_PBR\n    #ifdef HAS_NORMALS\n      pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n      geometry.normal = pbr_vNormal;\n    #endif\n\n    #ifdef HAS_UV\n      pbr_vUV = TEXCOORD_0;\n    #else\n      pbr_vUV = vec2(0., 0.);\n    #endif\n    geometry.uv = pbr_vUV;\n  #endif\n\n  float originalSize = project_size_to_pixel(sizeScale);\n  float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n  vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n  if(composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  #ifdef MODULE_PBR\n    pbr_vPosition = geometry.position.xyz;\n  #endif\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n  #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n    in vec2 vTEXCOORD_0;\n    uniform sampler2D u_BaseColorSampler;\n  #endif\n#endif\n\nvoid main(void) {\n  #ifdef MODULE_PBR\n    fragmentColor = vColor * pbr_filterColor(vec4(0));\n    geometry.uv = pbr_vUV;\n  #else\n    #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n      fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n      geometry.uv = vTEXCOORD_0;\n    #else\n      fragmentColor = vColor;\n    #endif\n  #endif\n\n  fragmentColor.a *= opacity;\n  DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:$,transition:!0},instanceModelMatrix:X.a})}},{key:"updateState",value:function(t){Object(a.a)(Object(c.a)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps;e.scenegraph!==r.scenegraph?this._updateScenegraph(e):e._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}},{key:"finalizeState",value:function(){Object(a.a)(Object(c.a)(n.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(t){var e=this,n=this.context.gl,r=null;if(t.scenegraph instanceof v)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){var i=t.scenegraph,o=function(t,e,n){var r=new V(t,n);return{scenes:r.instantiate(e),animator:r.createAnimator()}}(n,i,this._getModelOptions());r=Object.assign({gltf:i},o),function(t){return J.apply(this,arguments)}(o).then((function(){return e.setNeedsRedraw()}))}else t.scenegraph&&(f.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);var a={layer:this,gl:n},A=t.getScene(r,a),s=t.getAnimator(r,a);A instanceof v?(this._deleteScenegraph(),this._applyAllAttributes(A),this._applyAnimationsProp(A,s,t._animations),this.setState({scenegraph:A,animator:s})):null!==A&&f.a.warn("invalid scenegraph:",A)()}},{key:"_applyAllAttributes",value:function(t){var e=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();t.traverse((function(t){e._setModelAttributes(t.model,n)}))}}},{key:"_applyAnimationsProp",value:function(t,e,n){if(t&&e&&n){var r=e.getAnimations();Object.keys(n).sort().forEach((function(t){var e=n[t];if("*"===t)r.forEach((function(t){Object.assign(t,e)}));else if(Number.isFinite(Number(t))){var i=Number(t);i>=0&&i<r.length?Object.assign(r[i],e):f.a.warn("animation ".concat(t," not found"))()}else{var o=r.find((function(e){return e.name===t}));o?Object.assign(o,e):f.a.warn("animation ".concat(t," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof v&&t.delete()}},{key:"_getModelOptions",value:function(){var t=this.props._imageBasedLightingEnvironment,e=null;return t&&(e="function"===typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:K({isInstanced:!0,transpileToGLSL100:!Object(d.g)(this.context.gl)},this.getShaders()),useTangents:!1}}},{key:"updateAttributes",value:function(t){var e=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((function(n){e._setModelAttributes(n.model,t)}))}},{key:"draw",value:function(t){var e=t.moduleParameters,n=void 0===e?null:e,r=t.parameters,i=void 0===r?{}:r,o=t.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(o.timeline.getTime()),this.setNeedsRedraw());var a=this.context.viewport,A=this.props,s=A.sizeScale,c=A.sizeMinPixels,u=A.sizeMaxPixels,l=A.opacity,g=A.coordinateSystem,f=this.getNumInstances();this.state.scenegraph.traverse((function(t,e){var r=e.worldMatrix;t.model.setInstanceCount(f),t.updateModuleSettings(n),t.draw({parameters:i,uniforms:{sizeScale:s,opacity:l,sizeMinPixels:c,sizeMaxPixels:u,composeModelMatrix:Object(X.b)(a,g),sceneModelMatrix:r,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}}]),n}(h.a);et.layerName="ScenegraphLayer",et.defaultProps=tt},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(105),c=n(94),u=n(271);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(c.d)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(c.a)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(c.c)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(c.b)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(c.a.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(u.a)(!1),0}},{key:"RANK",get:function(){return Object(u.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(s.a)(Array)),f=n(198);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var d=function(t){Object(o.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"copy",value:function(t){return Object(u.a)(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(f.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(f.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(f.a)(this[t])}},{key:"setComponent",value:function(t,e){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(f.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(f.a)(t)}}]),n}(g),I=n(22);function p(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}n.d(e,"a",(function(){return v}));var C=[0,0,0],y={},v=function(t){Object(o.a)(n,t);var e=p(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&Object(c.d)(i)?t.copy(i):(c.a.debug&&(Object(f.a)(i),Object(f.a)(o),Object(f.a)(a)),t[0]=i,t[1]=o,t[2]=a),t}return Object(i.a)(n,null,[{key:"ZERO",get:function(){return y.ZERO=y.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(i.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return c.a.debug&&(Object(f.a)(t.x),Object(f.a)(t.y),Object(f.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return I.a(this,t)}},{key:"cross",value:function(t){return I.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?C:n;return I.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?C:n;return I.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?C:n;return I.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return I.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a}(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return I.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return I.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(f.a)(t)}}]),n}(d)},function(t,e,n){"use strict";var r=n(17),i=n(3),o=n(2),a=n(7),A=n(8),s=n(6),c=n(272),u=n(105),l=n(97),g=n(401);function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var d=function(t){Object(a.a)(n,t);var e=h(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"toString",value:function(){var t="[";if(l.a.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(c.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(function(t){Object(a.a)(n,t);var e=f(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Object(l.d)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(l.a)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(l.c)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(l.b)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"check",value:function(){if(l.a.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"ELEMENTS",get:function(){return Object(g.a)(!1),0}},{key:"RANK",get:function(){return Object(g.a)(!1),0}},{key:"elements",get:function(){return this}}]),n}(Object(u.a)(Array)));var I=n(10),p=n(36),C=n(22),y=n(45);function v(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return Q}));var B=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),b=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}),E={},Q=function(t){Object(a.a)(n,t);var e=v(n);function n(t){var r;return Object(i.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(o.a)(n,[{key:"INDICES",get:function(){return b}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return E.IDENTITY=E.IDENTITY||Object.freeze(new n(B)),E.IDENTITY}},{key:"ZERO",get:function(){return E.ZERO=E.ZERO||Object.freeze(new n(m)),E.ZERO}}]),Object(o.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(B)}},{key:"fromQuaternion",value:function(t){return I.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):I.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],I.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return I.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return I.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return I.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return I.q(this,this),this.check()}},{key:"invert",value:function(){return I.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return I.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return I.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return I.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return I.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return I.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];return this.rotateX(n).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return I.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?I.o(this,this,t):I.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return I.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=y.n(e||[-0,-0,-0,-0],t,this),Object(c.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=p.j(e||[-0,-0],t,this);break;case 3:e=C.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=function(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:e=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(c.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(c.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(d)},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(436),l=n(252),g=n(379),f=n(235);function h(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return p}));var d=[0,0,0,255],I={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getSourceColor:{type:"accessor",value:d},getTargetColor:{type:"accessor",value:d},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},p=function(t){Object(a.a)(n,t);var e=h(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n\n  float deltaZ = targetZ - sourceZ;\n  float dh = distance * instanceHeights;\n  float unitZ = dh == 0.0 ? 0.0 : deltaZ / dh;\n  float p2 = unitZ * unitZ + 1.0;\n  float dir = step(deltaZ, 0.0);\n  float z0 = mix(sourceZ, targetZ, dir);\n  float r = mix(ratio, 1.0 - ratio, dir);\n  return sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n  return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n  float distance = length(source.xy - target.xy);\n  float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n  float tiltAngle = radians(instanceTilts);\n  vec2 tiltDirection = normalize(target.xy - source.xy);\n  vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n  return vec3(\n    mix(source.xy, target.xy, segmentRatio) + tilt,\n    z * cos(tiltAngle)\n  );\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n  vec2 sourceRadians = radians(source);\n  vec2 targetRadians = radians(target);\n  vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n  vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n  float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n  return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n  vec2 lngLat;\n  if(abs(angularDist - PI) < 0.001) {\n    lngLat = (1.0 - t) * source.xy + t * target.xy;\n  } else {\n    float a = sin((1.0 - t) * angularDist);\n    float b = sin(t * angularDist);\n    vec3 p = source3D.yxz * a + target3D.yxz * b;\n    lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n  }\n\n  float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n  return vec3(lngLat, z);\n}\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  float segmentIndex = positions.x;\n  float segmentRatio = getSegmentRatio(segmentIndex);\n  float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n  float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n  float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n  isValid = 1.0;\n\n  uv = vec2(segmentRatio, positions.y);\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n\n  vec4 curr;\n  vec4 next;\n  vec3 source;\n  vec3 target;\n\n  if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n    source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n    target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n    float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n    vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n    vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n    vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n    if (abs(currPos.x - prevPos.x) > 180.0) {\n      indexDir = -1.0;\n      isValid = 0.0;\n    } else if (abs(currPos.x - nextPos.x) > 180.0) {\n      indexDir = 1.0;\n      isValid = 0.0;\n    }\n    nextPos = indexDir < 0.0 ? prevPos : nextPos;\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n    if (isValid == 0.0) {\n      nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n      float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n      currPos = mix(currPos, nextPos, t);\n      segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n    }\n\n    vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n    vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n  \n    curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n    next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n  \n  } else {\n    vec3 source_world = instanceSourcePositions;\n    vec3 target_world = instanceTargetPositions;\n    if (useShortestPath) {\n      source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n      target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n      float deltaLng = target_world.x - source_world.x;\n      if (deltaLng > 180.) target_world.x -= 360.;\n      if (deltaLng < -180.) source_world.x -= 360.;\n    }\n    source = project_position(source_world, instanceSourcePositions64Low);\n    target = project_position(target_world, instanceTargetPositions64Low);\n\n    if (useShortestPath) {\n      float thresholdRatio = -source.x / (target.x - source.x);\n\n      if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n        isValid = 0.0;\n        indexDir = sign(segmentRatio - thresholdRatio);\n        segmentRatio = thresholdRatio;\n      }\n    }\n\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n    vec3 currPos = interpolateFlat(source, target, segmentRatio);\n    vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n    if (useShortestPath) {\n      if (nextPos.x < 0.0) {\n        currPos.x += TILE_SIZE;\n        nextPos.x += TILE_SIZE;\n      }\n    }\n\n    curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n    next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n    geometry.position = vec4(currPos, 1.0);\n  }\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale),\n    widthMinPixels, widthMaxPixels\n  );\n  vec3 offset = vec3(\n    getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n  vColor = vec4(color.rgb, color.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n  if (isValid == 0.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  geometry.uv = uv;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:d},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:d},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;if(Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i}),i.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.widthUnits,o=r.widthScale,a=r.widthMinPixels,A=r.widthMaxPixels,s=r.greatCircle,c=r.wrapLongitude,u="pixels"===i?n.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({greatCircle:s,widthScale:o*u,widthMinPixels:a,widthMaxPixels:A,useShortestPath:c}).draw()}},{key:"_getModel",value:function(t){for(var e=[],n=0;n<50;n++)e=e.concat([n,1,0,n,-1,0]);var r=new g.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new f.a({drawMode:5,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}));return r.setUniforms({numSegments:50}),r}},{key:"wrapLongitude",get:function(){return!1}}]),n}(l.a);p.layerName="ArcLayer",p.defaultProps=I},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(435),u=n(933),l=n(436),g=n(252),f=n(379),h=n(235);function d(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return y}));var I=[0,0,0,255],p=[0,0,1],C={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(t){return t.position}},getNormal:{type:"accessor",value:p},getColor:{type:"accessor",value:I},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};var y=function(t){Object(a.a)(n,t);var e=d(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){return Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.normal = project_normal(instanceNormals);\n  unitPosition = positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n  vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n\n  gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n  gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n  vColor = vec4(lightColor, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition);\n\n  if (distToCenter > 1.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.a,u.a,l.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:p},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:I}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;if(Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i}),i.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}i.dataChanged&&function(t){var e=t.header,n=t.attributes;e&&n&&(t.length=e.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0&&(n.instanceColors=n.COLOR_0))}(e.data)}},{key:"draw",value:function(t){var e=t.uniforms,n=this.context.viewport,r=this.props,i=r.pointSize,o="meters"===r.sizeUnits?1/n.metersPerPixel:1;this.state.model.setUniforms(Object.assign({},e,{radiusPixels:i*o})).draw()}},{key:"_getModel",value:function(t){for(var e=[],n=0;n<3;n++){var r=n/3*Math.PI*2;e.push(2*Math.cos(r),2*Math.sin(r),0)}return new f.a(t,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new h.a({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}))}}]),n}(g.a);y.layerName="PointCloudLayer",y.defaultProps=C},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(34),a=n(7),A=n(8),s=n(6),c=n(44),u=n(435),l=n(933),g=n(436),f=n(252),h=n(235),d=n(19),I=n(218),p=n(379),C=n(702),y=n(353),v=n(485);function B(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}function m(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),c.a.assert(t.positions||t.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function b(t,e){if(t.attributes)return m(t.attributes,e),t instanceof h.a?t:new h.a(t);if(t.positions||t.POSITION)return m(t,e),new h.a({attributes:t});throw Error("Invalid mesh")}n.d(e,"a",(function(){return Q}));var E={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},Q=function(t){Object(a.a)(n,t);var e=B(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"getShaders",value:function(){var t=!Object(d.g)(this.context.gl),e={};return Object(C.b)(this.context.gl,y.a.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),Object(o.a)(Object(s.a)(n.prototype),"getShaders",this).call(this,{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = instancePickingColors;\n\n  vTexCoord = texCoords;\n  cameraPosition = project_uCameraPosition;\n  normals_commonspace = project_normal(instanceModelMatrix * normals);\n  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n  geometry.normal = normals_commonspace;\n\n  vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n  if (composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n  }\n\n  geometry.position = position_commonspace;\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n  } else {\n    normal = normals_commonspace;\n  }\n\n  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * opacity);\n\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[u.a,l.b,g.a],transpileToGLSL100:t,defines:e})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:v.a}),this.setState({emptyTexture:new I.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.changeFlags;if(Object(o.a)(Object(s.a)(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,changeFlags:i}),e.mesh!==r.mesh||i.extensionsChanged){if(this.state.model&&this.state.model.delete(),e.mesh){this.setState({model:this.getModel(e.mesh)});var a=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==r.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){Object(o.a)(Object(s.a)(n.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete()}},{key:"draw",value:function(t){var e=t.uniforms;if(this.state.model){var n=this.context.viewport,r=this.props,i=r.sizeScale,o=r.coordinateSystem,a=r._instanced;this.state.model.draw({uniforms:Object.assign({},e,{sizeScale:i,composeModelMatrix:!a||Object(v.b)(n,o),flatShading:!this.state.hasNormals})})}}},{key:"getModel",value:function(t){var e=new p.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:b(t,this.props._useMeshColors),isInstanced:!0})),n=this.props.texture,r=this.state.emptyTexture;return e.setUniforms({sampler:n||r,hasTexture:Boolean(n)}),e}},{key:"setTexture",value:function(t){this.context.gl;var e=this.state,n=e.emptyTexture,r=e.model;r&&r.setUniforms({sampler:t||n,hasTexture:Boolean(t)})}}]),n}(f.a);Q.layerName="SimpleMeshLayer",Q.defaultProps=E},function(t,e,n){"use strict";n.r(e);function r(t,e,n){if(!a(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&A(r),i&&s(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function i(t,e,n){if(!t)throw new Error("coordinates is required");for(var i=0;i<t.length;i++){var a=t[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var A=0;A<a[a.length-1].length;A++){if(0===i&&0===A&&!o(a[0][0])||!o(a[0][1]))throw new Error("coordinates must contain numbers");if(a[a.length-1][A]!==a[0][A])throw new Error("First and last Position are not equivalent.")}}return r({type:"Polygon",coordinates:t},e,n)}function o(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function a(t){return!!t&&t.constructor===Object}function A(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!o(t))throw new Error("bbox must only contain numbers")}))}function s(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}var c=n(333),u=n(751);function l(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function g(t){var e=t*Math.PI/180;return Math.tan(e)}e.default=function(t,e,n,r){var A=(r=r||{}).steps||64,s=r.units||"kilometers",f=r.angle||0,h=r.pivot||t,d=r.properties||t.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!a(r))throw new Error("options must be an object");if(!o(A))throw new Error("steps must be a number");if(!o(f))throw new Error("angle must be a number");var I=l(t);if("degrees"===s)var p=function(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}(f);else e=Object(c.a)(t,e,90,{units:s}),n=Object(c.a)(t,n,0,{units:s}),e=l(e)[0]-I[0],n=l(n)[1]-I[1];for(var C=[],y=0;y<A;y+=1){var v=-360*y/A,B=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(g(v),2)),m=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(g(v),2));if(v<-90&&v>=-270&&(B=-B),v<-180&&v>=-360&&(m=-m),"degrees"===s){var b=B*Math.cos(p)+m*Math.sin(p),E=m*Math.cos(p)-B*Math.sin(p);B=b,m=E}C.push([B+I[0],m+I[1]])}return C.push(C[0]),"degrees"===s?i([C],d):Object(u.default)(i([C],d),f,{pivot:h})}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(8),A=n(6),s=n(482),c=n(108),u=n(231);function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}var g=function(t){Object(o.a)(n,t);var e=l(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(i.a)(n,[{key:"copy",value:function(t){return Object(u.a)(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(c.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(c.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(c.a)(this[t])}},{key:"setComponent",value:function(t,e){return Object(u.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Object(c.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Object(c.a)(t)}}]),n}(s.a),f=n(91),h=n(22),d=n(486);function I(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(A.a)(t);if(e){var i=Object(A.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(a.a)(this,n)}}n.d(e,"a",(function(){return y}));var p=[0,0,0],C={},y=function(t){Object(o.a)(n,t);var e=I(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(r.a)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&Object(f.d)(i)?t.copy(i):(f.a.debug&&(Object(c.a)(i),Object(c.a)(o),Object(c.a)(a)),t[0]=i,t[1]=o,t[2]=a),t}return Object(i.a)(n,null,[{key:"ZERO",get:function(){return C.ZERO=C.ZERO||Object.freeze(new n(0,0,0,0))}}]),Object(i.a)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return f.a.debug&&(Object(c.a)(t.x),Object(c.a)(t.y),Object(c.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"angle",value:function(t){return h.a(this,t)}},{key:"cross",value:function(t){return h.c(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.k(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.l(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.m(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return h.q(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return Object(d.c)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return h.p(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Object(d.b)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return h.r(this,this,t),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Object(c.a)(t)}}]),n}(g)},function(t,e,n){"use strict";var r=n(17),i=n(3),o=n(2),a=n(7),A=n(8),s=n(6),c=n(108),u=n(482),l=n(91);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}var f=function(t){Object(a.a)(n,t);var e=g(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"toString",value:function(){var t="[";if(l.a.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=Object(c.a)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(u.a),h=n(486),d=n(10),I=n(36),p=n(22),C=n(45);function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return E}));var v=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),B=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),m=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}),b={},E=function(t){Object(a.a)(n,t);var e=y(n);function n(t){var r;return Object(i.a)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return Object(o.a)(n,[{key:"INDICES",get:function(){return m}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return b.IDENTITY=b.IDENTITY||Object.freeze(new n(v)),b.IDENTITY}},{key:"ZERO",get:function(){return b.ZERO=b.ZERO||Object.freeze(new n(B)),b.ZERO}}]),Object(o.a)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=A,this[8]=s,this[9]=c,this[10]=u,this[11]=l,this[12]=g,this[13]=f,this[14]=h,this[15]=d,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,A,s,c,u,l,g,f,h,d){return this[0]=t,this[1]=i,this[2]=s,this[3]=g,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=a,this[10]=u,this[11]=h,this[12]=r,this[13]=A,this[14]=l,this[15]=d,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(v)}},{key:"fromQuaternion",value:function(t){return d.c(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,i=t.bottom,o=t.top,a=t.near,A=t.far;return A===1/0?n._computeInfinitePerspectiveOffCenter(this,e,r,i,o,a):d.d(this,e,r,i,o,a,A),this.check()}},{key:"lookAt",value:function(t,e,n){if(1===arguments.length){var r=t;t=r.eye,e=r.center,n=r.up}return e=e||[0,0,0],n=n||[0,1,0],d.g(this,t,e,n),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,A=t.far,s=void 0===A?500:A;return d.i(this,e,n,r,i,a,s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,A=void 0===a?1:a,s=t.near,c=void 0===s?.1:s,u=t.far,l=void 0===u?500:u;if(r>2*Math.PI)throw Error("radians");var g=r/2,f=A*Math.tan(g),h=f*o;return(new n).ortho({left:-h,right:h,bottom:-f,top:f,near:c,far:l})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,n=void 0===e?void 0:e,r=t.fov,i=void 0===r?45*Math.PI/180:r,o=t.aspect,a=void 0===o?1:o,A=t.near,s=void 0===A?.1:A,c=t.far,u=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return d.j(this,n,a,s,u),this.check()}},{key:"determinant",value:function(){return d.a(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(e||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return d.q(this,this),this.check()}},{key:"invert",value:function(){return d.f(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return d.h(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return d.h(this,this,t),this.check()}},{key:"rotateX",value:function(t){return d.l(this,this,t),this.check()}},{key:"rotateY",value:function(t){return d.m(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return d.n(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Object(r.a)(t,3),n=e[0],i=e[1],o=e[2];return this.rotateX(n).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(t,e){return d.k(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?d.o(this,this,t):d.o(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return d.p(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=C.n(e||[-0,-0,-0,-0],t,this),Object(c.b)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=I.j(e||[-0,-0],t,this);break;case 3:e=p.q(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=Object(h.a)(e||[-0,-0],t,this);break;case 3:e=Object(h.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(c.b)(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}},{key:"transformPoint",value:function(t,e){return Object(c.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return Object(c.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return Object(c.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,n,r,i,o){var a=2*o/(n-e),A=2*o/(i-r),s=(n+e)/(n-e),c=(i+r)/(i-r),u=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=s,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}}]),n}(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(390),i=n(732),o=n(517),a=n(109);function A(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function s(t,e){return t[0]===e[0]&&t[1]===e[1]}e.default=function(t,e){var n=a.getType(t),c=a.getType(e),u=a.getGeom(t),l=a.getGeom(e);switch(n){case"Point":switch(c){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;n<e.coordinates.length;n++)if(s(e.coordinates[n],t.coordinates)){r=!0;break}return r}(u,l);case"LineString":return i.default(u,l,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return o.default(u,l,{ignoreBoundary:!0});default:throw new Error("feature2 "+c+" geometry not supported")}case"MultiPoint":switch(c){case"MultiPoint":return function(t,e){for(var n=0;n<t.coordinates.length;n++){for(var r=!1,i=0;i<e.coordinates.length;i++)s(t.coordinates[n],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}(u,l);case"LineString":return function(t,e){for(var n=!1,r=0;r<t.coordinates.length;r++){if(!i.default(t.coordinates[r],e))return!1;n||(n=i.default(t.coordinates[r],e,{ignoreEndVertices:!0}))}return n}(u,l);case"Polygon":case"MultiPolygon":return function(t,e){for(var n=!0,r=0;r<t.coordinates.length;r++){var i=o.default(t.coordinates[1],e);if(!i){n=!1;break}i=o.default(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&i}(u,l);default:throw new Error("feature2 "+c+" geometry not supported")}case"LineString":switch(c){case"LineString":return function(t,e){for(var n=0;n<t.coordinates.length;n++)if(!i.default(t.coordinates[n],e))return!1;return!0}(u,l);case"Polygon":case"MultiPolygon":return function(t,e){var n=r.default(e),i=r.default(t);if(!A(n,i))return!1;for(var a=!1,s=0;s<t.coordinates.length-1;s++){if(!o.default(t.coordinates[s],e))return!1;if(a||(a=o.default(t.coordinates[s],e,{ignoreBoundary:!0})),!a){var c=(u=t.coordinates[s],l=t.coordinates[s+1],[(u[0]+l[0])/2,(u[1]+l[1])/2]);a=o.default(c,e,{ignoreBoundary:!0})}}var u,l;return a}(u,l);default:throw new Error("feature2 "+c+" geometry not supported")}case"Polygon":switch(c){case"Polygon":case"MultiPolygon":return function(t,e){var n=r.default(t);if(!A(r.default(e),n))return!1;for(var i=0;i<t.coordinates[0].length;i++)if(!o.default(t.coordinates[0][i],e))return!1;return!0}(u,l);default:throw new Error("feature2 "+c+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(390)),o=r(n(517)),a=r(n(732)),A=n(109);function s(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(I(t.coordinates[n],e.coordinates)){r=!0;break}return r}function c(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){for(var i=r[n],o=!1,a=0,A=t.coordinates;a<A.length;a++){if(I(i,A[a])){o=!0;break}}if(!o)return!1}return!0}function u(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(a.default(o,t,{ignoreEndVertices:!0})&&(n=!0),!a.default(o,t))return!1}return!!n}function l(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){var i=r[n];if(!o.default(i,t,{ignoreBoundary:!0}))return!1}return!0}function g(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(a.default({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(n=!0),!a.default({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return n}function f(t,e){var n=!1,r=0;if(!d(i.default(t),i.default(e)))return!1;for(;r<e.coordinates.length-1;r++){var a=p(e.coordinates[r],e.coordinates[r+1]);if(o.default({type:"Point",coordinates:a},t,{ignoreBoundary:!0})){n=!0;break}}return n}function h(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!d(i.default(t),i.default(e)))return!1;for(var n=0,r=A.getGeom(e).coordinates;n<r.length;n++)for(var a=0,s=r[n];a<s.length;a++){var c=s[a];if(!o.default(c,t))return!1}return!0}function d(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function I(t,e){return t[0]===e[0]&&t[1]===e[1]}function p(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}e.default=function(t,e){var n=A.getGeom(t),r=A.getGeom(e),i=A.getType(t),d=A.getType(e),p=A.getCoords(t),C=A.getCoords(e);switch(i){case"Point":switch(d){case"Point":return I(p,C);default:throw new Error("feature2 "+d+" geometry not supported")}case"MultiPoint":switch(d){case"Point":return s(n,r);case"MultiPoint":return c(n,r);default:throw new Error("feature2 "+d+" geometry not supported")}case"LineString":switch(d){case"Point":return a.default(r,n,{ignoreEndVertices:!0});case"LineString":return g(n,r);case"MultiPoint":return u(n,r);default:throw new Error("feature2 "+d+" geometry not supported")}case"Polygon":switch(d){case"Point":return o.default(r,n,{ignoreBoundary:!0});case"LineString":return f(n,r);case"Polygon":return h(n,r);case"MultiPoint":return l(n,r);default:throw new Error("feature2 "+d+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},e.isPointInMultiPoint=s,e.isMultiPointInMultiPoint=c,e.isMultiPointOnLine=u,e.isMultiPointInPoly=l,e.isLineOnLine=g,e.isLineInPoly=f,e.isPolyInPoly=h,e.doBBoxOverlap=d,e.compareCoords=I,e.getMidpoint=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(137),i=n(109),o=n(970),a=n(546),A=n(986);e.default=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=i.getType(t);if(n!==i.getType(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new A({precision:6}).compare(t,e))return!1;var s=0;switch(n){case"MultiPoint":var c=r.coordAll(t),u=r.coordAll(e);c.forEach((function(t){u.forEach((function(e){t[0]===e[0]&&t[1]===e[1]&&s++}))}));break;case"LineString":case"MultiLineString":r.segmentEach(t,(function(t){r.segmentEach(e,(function(e){o.default(t,e).features.length&&s++}))}));break;case"Polygon":case"MultiPolygon":r.segmentEach(t,(function(t){r.segmentEach(e,(function(e){a.default(t,e).features.length&&s++}))}))}return s>0}},function(t,e,n){"use strict";t.exports=i;var r=n(521);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function A(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function s(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function c(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function u(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function l(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function I(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function C(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function y(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function v(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=C(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=C(this.buf,this.pos)+4294967296*C(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=C(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return A(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return A(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return A(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return A(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return A(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return A(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,n){return o.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,a,A,s=t[i],c=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u>n)break;1===u?s<128&&(c=s):2===u?128===(192&(o=t[i+1]))&&(c=(31&s)<<6|63&o)<=127&&(c=null):3===u?(o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&((c=(15&s)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+1],a=t[i+2],A=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&A)&&((c=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&A)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&s(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&s(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,i.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,I,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,p,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,n){"use strict";function r(t,e){this.x=t,this.y=e}t.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return d})),n.d(e,"c",(function(){return I}));var r,i,o=0,a=0,A=0,s=0,c=0,u=0,l="object"===typeof performance&&performance.now?performance:Date,g="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return c||(g(h),c=l.now()+u)}function h(){c=0}function d(){this._call=this._time=this._next=null}function I(t,e,n){var r=new d;return r.restart(t,e,n),r}function p(){c=(s=l.now())+u,o=a=0;try{!function(){f(),++o;for(var t,e=r;e;)(t=c-e._time)>=0&&e._call.call(null,t),e=e._next;--o}()}finally{o=0,function(){var t,e,n=r,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,y(o)}(),c=0}}function C(){var t=l.now(),e=t-s;e>1e3&&(u-=e,s=t)}function y(t){o||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(p,t-l.now()-u)),A&&(A=clearInterval(A))):(A||(s=l.now(),A=setInterval(C,1e3)),o=1,g(p)))}d.prototype=I.prototype={constructor:d,restart:function(t,e,n){if("function"!==typeof t)throw new TypeError("callback is not a function");n=(null==n?f():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#raster","title":"Vitessce image data","type":"object","definitions":{"transform":{"type":"object","additionalProperties":false,"oneOf":[{"required":["scale","translate"]},{"required":["matrix"]}],"properties":{"scale":{"type":"number"},"translate":{"type":"object","additionalProperties":false,"required":["y","x"],"properties":{"y":{"type":"number"},"x":{"type":"number"}}},"matrix":{"type":"array","items":{"type":"number"},"minItems":16,"maxItems":16}}},"dimensions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["field","type","values"],"properties":{"field":{"type":"string"},"type":{"type":"string","enum":["quantitative","nominal","ordinal","temporal"]},"values":{"type":["array","null"],"items":{"type":"string"}}}}},"metadata":{"type":"object","additionalProperties":false,"anyOf":[{"required":["dimensions","isPyramid"]},{"required":["transform"]},{"required":["omeTiffOffsetsUrl"]}],"properties":{"dimensions":{"$ref":"#/definitions/dimensions"},"isPyramid":{"type":"boolean"},"transform":{"$ref":"#/definitions/transform"},"omeTiffOffsetsUrl":{"type":"string","format":"uri"}}},"requestInit":{"type":"object","additionalProperties":false,"required":[],"properties":{"method":{"type":"string"},"headers":{"type":"object"},"body":{"type":"string"},"mode":{"type":"string"},"credentials":{"type":"string"},"cache":{"type":"string"},"redirect":{"type":"string"},"referrer":{"type":"string"},"integrity":{"type":"string"}}},"image":{"type":"object","additionalProperties":false,"required":["name","url","type"],"properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"type":{"type":"string"},"metadata":{"$ref":"#/definitions/metadata"},"requestInit":{"$ref":"#/definitions/requestInit"}}}},"additionalProperties":false,"required":["schemaVersion","images"],"properties":{"schemaVersion":{"type":"string"},"usePhysicalSizeScaling":{"type":"boolean","description":"Default is false: passing true in will infer scaling from the reported physcial size"},"renderLayers":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"$ref":"#/definitions/image"}}}}')},function(t,e,n){"use strict";var r={value:function(){}};function i(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new o(r)}function o(t){this._=t}function a(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function A(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function s(t,e,n){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=r,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}o.prototype=i.prototype={constructor:o,on:function(t,e){var n,r=this._,i=a(t+"",r),o=-1,c=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++o<c;)if(n=(t=i[o]).type)r[n]=s(r[n],t.name,e);else if(null==e)for(n in r)r[n]=s(r[n],t.name,null);return this}for(;++o<c;)if((n=(t=i[o]).type)&&(n=A(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new o(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var c=i,u=n(839),l=4294967296;function g(t){return t.x}function f(t){return t.y}n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return f}));var h=Math.PI*(3-Math.sqrt(5));e.a=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,A=new Map,s=Object(u.c)(d),g=c("tick","end"),f=function(){var t=1;return function(){return(t=(1664525*t+1013904223)%l)/l}}();function d(){I(),g.call("tick",e),n<r&&(s.stop(),g.call("end",e))}function I(r){var s,c,u=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,A.forEach((function(t){t(n)})),s=0;s<u;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function p(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*h;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function C(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),p(),e={tick:I,restart:function(){return s.restart(d),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),A.forEach(C),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,A.forEach(C),e):f},force:function(t,n){return arguments.length>1?(null==n?A.delete(t):A.set(t,C(n)),e):A.get(t)},find:function(e,n,r){var i,o,a,A,s,c=0,u=t.length;for(null==r?r=1/0:r*=r,c=0;c<u;++c)(a=(i=e-(A=t[c]).x)*i+(o=n-A.y)*o)<r&&(s=A,r=a);return s},on:function(t,n){return arguments.length>1?(g.on(t,n),e):g.on(t)}}}},function(t,e,n){"use strict";var r=n(28),i=n(9),o=n(0),a=(n(20),n(32)),A=n(43),s=n(64),c=n(77),u=n(552),l=n(483),g=o.forwardRef((function(t,e){var n,A=t.align,c=void 0===A?"inherit":A,g=t.classes,f=t.className,h=t.component,d=t.padding,I=t.scope,p=t.size,C=t.sortDirection,y=t.variant,v=Object(r.a)(t,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),B=o.useContext(u.a),m=o.useContext(l.a);n=h||(m&&"head"===m.variant?"th":"td");var b=I;!b&&m&&"head"===m.variant&&(b="col");var E=d||(B&&B.padding?B.padding:"default"),Q=p||(B&&B.size?B.size:"medium"),F=y||m&&m.variant,w=null;return C&&(w="asc"===C?"ascending":"descending"),o.createElement(n,Object(i.a)({ref:e,className:Object(a.a)(g.root,g[F],f,"inherit"!==c&&g["align".concat(Object(s.a)(c))],"default"!==E&&g["padding".concat(Object(s.a)(E))],"medium"!==Q&&g["size".concat(Object(s.a)(Q))],"head"===F&&B&&B.stickyHeader&&g.stickyHeader),"aria-sort":w,scope:b},v))}));e.a=Object(A.a)((function(t){return{root:Object(i.a)({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n    ".concat("light"===t.palette.type?Object(c.d)(Object(c.b)(t.palette.divider,1),.88):Object(c.a)(Object(c.b)(t.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:t.palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},body:{color:t.palette.text.primary},footer:{color:t.palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0px 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:t.palette.background.default}}}),{name:"MuiTableCell"})(g)},,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(9);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.baseClasses,n=t.newClasses;t.Component;if(!n)return e;var i=Object(r.a)({},e);return Object.keys(n).forEach((function(t){n[t]&&(i[t]="".concat(e[t]," ").concat(n[t]))})),i}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(382),i=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.disableGlobal,n=void 0!==e&&e,o=t.productionPrefix,a=void 0===o?"jss":o,A=t.seed,s=void 0===A?"":A,c=""===s?"":"".concat(s,"-"),u=0;return function(t,e){u+=1;var o=e.options.name;if(o&&0===o.indexOf("Mui")&&!e.options.link&&!n){if(-1!==i.indexOf(t.key))return"Mui-".concat(t.key);var A="".concat(c).concat(o,"-").concat(t.key);return e.options.theme[r.a]&&""===s?"".concat(A,"-").concat(u):A}return"".concat(c).concat(a).concat(u)}}},function(t,e,n){"use strict";function r(t){var e=t.theme,n=t.name,r=t.props;if(!e||!e.props||!e.props[n])return r;var i,o=e.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(0),i=n(65),o=(n(20),n(106)),a=n(60);var A="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,s=r.forwardRef((function(t,e){var n=t.children,s=t.container,c=t.disablePortal,u=void 0!==c&&c,l=t.onRendered,g=r.useState(null),f=g[0],h=g[1],d=Object(a.a)(r.isValidElement(n)?n.ref:null,e);return A((function(){u||h(function(t){return t="function"===typeof t?t():t,i.findDOMNode(t)}(s)||document.body)}),[s,u]),A((function(){if(f&&!u)return Object(o.a)(e,f),function(){Object(o.a)(e,null)}}),[e,f,u]),A((function(){l&&(f||u)&&l()}),[l,f,u]),u?r.isValidElement(n)?r.cloneElement(n,{ref:d}):n:f?i.createPortal(n,f):f}));e.a=s},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(32)),A=n(43),s=n(77),c=n(541),u=n(64),l=o.forwardRef((function(t,e){var n=t.edge,A=void 0!==n&&n,s=t.children,l=t.classes,g=t.className,f=t.color,h=void 0===f?"default":f,d=t.disabled,I=void 0!==d&&d,p=t.disableFocusRipple,C=void 0!==p&&p,y=t.size,v=void 0===y?"medium":y,B=Object(i.a)(t,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return o.createElement(c.a,Object(r.a)({className:Object(a.a)(l.root,g,"default"!==h&&l["color".concat(Object(u.a)(h))],I&&l.disabled,"small"===v&&l["size".concat(Object(u.a)(v))],{start:l.edgeStart,end:l.edgeEnd}[A]),centerRipple:!0,focusRipple:!C,disabled:I,ref:e},B),o.createElement("span",{className:l.label},s))}));e.a=Object(A.a)((function(t){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:t.palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(s.b)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:t.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:t.palette.primary.main,"&:hover":{backgroundColor:Object(s.b)(t.palette.primary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:t.palette.secondary.main,"&:hover":{backgroundColor:Object(s.b)(t.palette.secondary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:t.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(l)},function(t,e){t.exports=function(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}},function(t,e,n){"use strict";var r=n(1139),i=n(538),o=n(685),a=n(1033),A=n(1141);function s(t,e,n){var r=this._refs[n];if("string"==typeof r){if(!this._refs[r])return s.call(this,t,e,r);r=this._refs[r]}if((r=r||this._schemas[n])instanceof a)return h(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i,o,A,u=c.call(this,e,n);return u&&(i=u.schema,e=u.root,A=u.baseId),i instanceof a?o=i.validate||t.call(this,i.schema,e,void 0,A):void 0!==i&&(o=h(i,this._opts.inlineRefs)?i:t.call(this,i,e,void 0,A)),o}function c(t,e){var n=r.parse(e),i=I(n),o=d(this._getId(t.schema));if(0===Object.keys(t.schema).length||i!==o){var A=C(i),s=this._refs[A];if("string"==typeof s)return u.call(this,t,s,n);if(s instanceof a)s.validate||this._compile(s),t=s;else{if(!((s=this._schemas[A])instanceof a))return;if(s.validate||this._compile(s),A==C(e))return{schema:s,root:t,baseId:o};t=s}if(!t.schema)return;o=d(this._getId(t.schema))}return g.call(this,n,o,t.schema,t)}function u(t,e,n){var r=c.call(this,t,e);if(r){var i=r.schema,o=r.baseId;t=r.root;var a=this._getId(i);return a&&(o=y(o,a)),g.call(this,n,o,i,t)}}t.exports=s,s.normalizeId=C,s.fullPath=d,s.url=y,s.ids=function(t){var e=C(this._getId(t)),n={"":e},a={"":d(e,!1)},s={},c=this;return A(t,{allKeys:!0},(function(t,e,A,u,l,g,f){if(""!==e){var h=c._getId(t),d=n[u],I=a[u]+"/"+l;if(void 0!==f&&(I+="/"+("number"==typeof f?f:o.escapeFragment(f))),"string"==typeof h){h=d=C(d?r.resolve(d,h):h);var p=c._refs[h];if("string"==typeof p&&(p=c._refs[p]),p&&p.schema){if(!i(t,p.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=C(I))if("#"==h[0]){if(s[h]&&!i(t,s[h]))throw new Error('id "'+h+'" resolves to more than one schema');s[h]=t}else c._refs[h]=I}n[e]=d,a[e]=I}})),s},s.inlineRef=h,s.schema=c;var l=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function g(t,e,n,r){if(t.fragment=t.fragment||"","/"==t.fragment.slice(0,1)){for(var i=t.fragment.split("/"),a=1;a<i.length;a++){var A=i[a];if(A){if(void 0===(n=n[A=o.unescapeFragment(A)]))break;var s;if(!l[A]&&((s=this._getId(n))&&(e=y(e,s)),n.$ref)){var u=y(e,n.$ref),g=c.call(this,r,u);g&&(n=g.schema,r=g.root,e=g.baseId)}}}return void 0!==n&&n!==r.schema?{schema:n,root:r,baseId:e}:void 0}}var f=o.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function h(t,e){return!1!==e&&(void 0===e||!0===e?function t(e){var n;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(n=e[r])&&!t(n))return!1}else for(var i in e){if("$ref"==i)return!1;if("object"==typeof(n=e[i])&&!t(n))return!1}return!0}(t):e?function t(e){var n,r=0;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(n=e[i])&&(r+=t(n)),r==1/0)return 1/0}else for(var o in e){if("$ref"==o)return 1/0;if(f[o])r++;else if("object"==typeof(n=e[o])&&(r+=t(n)+1),r==1/0)return 1/0}return r}(t)<=e:void 0)}function d(t,e){return!1!==e&&(t=C(t)),I(r.parse(t))}function I(t){return r.serialize(t).split("#")[0]+"#"}var p=/#\/?$/;function C(t){return t?t.replace(p,""):""}function y(t,e){return e=C(e),r.resolve(t,e)}},function(t,e,n){"use strict";var r=n(870);function i(t,e,n){this.message=n||i.message(t,e),this.missingRef=r.url(t,e),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function o(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}t.exports={Validation:o((function(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0})),MissingRef:o(i)},i.message=function(t,e){return"can't resolve reference "+e+" from id "+t}},function(t,e,n){var r=n(194),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();t.exports=i},function(t,e,n){var r=n(688);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(877)("keys"),i=n(771);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(514),i=n(513),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(770)?"pure":"global",copyright:"\xa9 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(874);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports={}},function(t,e,n){var r=n(747),i=n(1203),o=n(878),a=n(876)("IE_PROTO"),A=function(){},s=function(){var t,e=n(1051)("iframe"),r=o.length;for(e.style.display="none",n(1204).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(A.prototype=r(t),n=new A,A.prototype=null,n[a]=t):n=s(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(536).f,i=n(537),o=n(690)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){e.f=n(690)},function(t,e,n){var r=n(513),i=n(514),o=n(770),a=n(884),A=n(536).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||A(e,t,{value:a.f(t)})}},function(t,e,n){var r=n(1061),i=n(1063);t.exports=function(t,e){return t&&r(t,i(e))}},function(t,e,n){var r=n(534)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(200),i=n(491),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(a.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(872);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e,n){var r=n(529);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Checkboard=void 0;var r=a(n(0)),i=a(n(118)),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1277));function a(t){return t&&t.__esModule?t:{default:t}}var A=e.Checkboard=function(t){var e=t.white,n=t.grey,a=t.size,A=t.renderers,s=t.borderRadius,c=t.boxShadow,u=(0,i.default)({default:{grid:{borderRadius:s,boxShadow:c,absolute:"0px 0px 0px 0px",background:"url("+o.get(e,n,a,A.canvas)+") center left"}}});return r.default.createElement("div",{style:u.grid})};A.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},e.default=A},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){var n=/^[0-9]+$/,r=function(t,e){var r=n.test(t),i=n.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:function(t,e){return r(e,t)}}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return 0===r(t,e,n)}},function(t,e,n){var r=n(316);t.exports=function(t,e,n){var i=new r(t,n),o=new r(e,n);return i.compare(o)||i.compareBuild(o)}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return r(t,e,n)<0}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return r(t,e,n)>=0}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return r(t,e,n)<=0}},function(t,e,n){var r=n(316),i=n(778),o=i.ANY,a=n(393),A=n(779),s=n(777),c=n(897),u=n(899),l=n(898);t.exports=function(t,e,n,g){var f,h,d,I,p;switch(t=new r(t,g),e=new a(e,g),n){case">":f=s,h=u,d=c,I=">",p=">=";break;case"<":f=c,h=l,d=s,I="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A(t,e,g))return!1;for(var C=function(n){var r=e.set[n],a=null,A=null;return r.forEach((function(t){t.semver===o&&(t=new i(">=0.0.0")),a=a||t,A=A||t,f(t.semver,a.semver,g)?a=t:d(t.semver,A.semver,g)&&(A=t)})),a.operator===I||a.operator===p?{v:!1}:A.operator&&A.operator!==I||!h(t,A.semver)?A.operator===p&&d(t,A.semver)?{v:!1}:void 0:{v:!1}},y=0;y<e.set.length;++y){var v=C(y);if("object"===typeof v)return v.v}return!0}},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=n.n(o),A=(n(20),n(865)),s=n(80),c=Date.now(),u="fnValues"+c,l="fnStyle"+ ++c;var g=function(){return{onCreateRule:function(t,e,n){if("function"!==typeof e)return null;var r=Object(s.c)(t,{},n);return r[l]=e,r},onProcessStyle:function(t,e){if(u in e||l in e)return t;var n={};for(var r in t){var i=t[r];"function"===typeof i&&(delete t[r],n[r]=i)}return e[u]=n,t},onUpdate:function(t,e,n,r){var i=e,o=i[l];o&&(i.style=o(t)||{});var a=i[u];if(a)for(var A in a)i.prop(A,a[A](t),r)}}},f="@global",h=function(){function t(t,e,n){for(var i in this.type="global",this.at=f,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=t,this.options=n,this.rules=new s.a(Object(r.a)({},n,{parent:this})),e)this.rules.add(i,e[i]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return this.options.jss.plugins.onProcessRule(r),r},e.indexOf=function(t){return this.rules.indexOf(t)},e.toString=function(){return this.rules.toString()},t}(),d=function(){function t(t,e,n){this.type="global",this.at=f,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=t,this.options=n;var i=t.substr("@global ".length);this.rule=n.jss.createRule(i,e,Object(r.a)({},n,{parent:this}))}return t.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},t}(),I=/\s*,\s*/g;function p(t,e){for(var n=t.split(I),r="",i=0;i<n.length;i++)r+=e+" "+n[i].trim(),n[i+1]&&(r+=", ");return r}var C=function(){return{onCreateRule:function(t,e,n){if(!t)return null;if(t===f)return new h(t,e,n);if("@"===t[0]&&"@global "===t.substr(0,"@global ".length))return new d(t,e,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=t),null},onProcessRule:function(t){"style"===t.type&&(function(t){var e=t.options,n=t.style,i=n?n[f]:null;if(i){for(var o in i)e.sheet.addRule(o,i[o],Object(r.a)({},e,{selector:p(o,t.selector)}));delete n[f]}}(t),function(t){var e=t.options,n=t.style;for(var i in n)if("@"===i[0]&&i.substr(0,f.length)===f){var o=p(i.substr(f.length),t.selector);e.sheet.addRule(o,n[i],Object(r.a)({},e,{selector:o})),delete n[i]}}(t))}}},y=/\s*,\s*/g,v=/&/g,B=/\$([\w-]+)/g;var m=function(){function t(t,e){return function(n,r){var i=t.getRule(r)||e&&e.getRule(r);return i?(i=i).selector:r}}function e(t,e){for(var n=e.split(y),r=t.split(y),i="",o=0;o<n.length;o++)for(var a=n[o],A=0;A<r.length;A++){var s=r[A];i&&(i+=", "),i+=-1!==s.indexOf("&")?s.replace(v,a):a+" "+s}return i}function n(t,e,n){if(n)return Object(r.a)({},n,{index:n.index+1});var i=t.options.nestingLevel;i=void 0===i?1:i+1;var o=Object(r.a)({},t.options,{nestingLevel:i,index:e.indexOf(t)+1});return delete o.name,o}return{onProcessStyle:function(i,o,a){if("style"!==o.type)return i;var A,s,c=o,u=c.options.parent;for(var l in i){var g=-1!==l.indexOf("&"),f="@"===l[0];if(g||f){if(A=n(c,u,A),g){var h=e(l,c.selector);s||(s=t(u,a)),h=h.replace(B,s),u.addRule(h,i[l],Object(r.a)({},A,{selector:h}))}else f&&u.addRule(l,{},A).addRule(c.key,i[l],{selector:c.selector});delete i[l]}}return i}}},b=/[A-Z]/g,E=/^ms-/,Q={};function F(t){return"-"+t.toLowerCase()}var w=function(t){if(Q.hasOwnProperty(t))return Q[t];var e=t.replace(b,F);return Q[t]=E.test(e)?"-"+e:e};function S(t){var e={};for(var n in t){e[0===n.indexOf("--")?n:w(n)]=t[n]}return t.fallbacks&&(Array.isArray(t.fallbacks)?e.fallbacks=t.fallbacks.map(S):e.fallbacks=S(t.fallbacks)),e}var R=function(){return{onProcessStyle:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]=S(t[e]);return t}return S(t)},onChangeValue:function(t,e,n){if(0===e.indexOf("--"))return t;var r=w(e);return e===r?t:(n.prop(r,t),null)}}},U=s.e&&CSS?CSS.px:"px",x=s.e&&CSS?CSS.ms:"ms",k=s.e&&CSS?CSS.percent:"%";function O(t){var e=/(-[a-z])/g,n=function(t){return t[1].toUpperCase()},r={};for(var i in t)r[i]=t[i],r[i.replace(e,n)]=t[i];return r}var N=O({"animation-delay":x,"animation-duration":x,"background-position":U,"background-position-x":U,"background-position-y":U,"background-size":U,border:U,"border-bottom":U,"border-bottom-left-radius":U,"border-bottom-right-radius":U,"border-bottom-width":U,"border-left":U,"border-left-width":U,"border-radius":U,"border-right":U,"border-right-width":U,"border-top":U,"border-top-left-radius":U,"border-top-right-radius":U,"border-top-width":U,"border-width":U,margin:U,"margin-bottom":U,"margin-left":U,"margin-right":U,"margin-top":U,padding:U,"padding-bottom":U,"padding-left":U,"padding-right":U,"padding-top":U,"mask-position-x":U,"mask-position-y":U,"mask-size":U,height:U,width:U,"min-height":U,"max-height":U,"min-width":U,"max-width":U,bottom:U,left:U,top:U,right:U,"box-shadow":U,"text-shadow":U,"column-gap":U,"column-rule":U,"column-rule-width":U,"column-width":U,"font-size":U,"font-size-delta":U,"letter-spacing":U,"text-indent":U,"text-stroke":U,"text-stroke-width":U,"word-spacing":U,motion:U,"motion-offset":U,outline:U,"outline-offset":U,"outline-width":U,perspective:U,"perspective-origin-x":k,"perspective-origin-y":k,"transform-origin":k,"transform-origin-x":k,"transform-origin-y":k,"transform-origin-z":k,"transition-delay":x,"transition-duration":x,"vertical-align":U,"flex-basis":U,"shape-margin":U,size:U,grid:U,"grid-gap":U,"grid-row-gap":U,"grid-column-gap":U,"grid-template-rows":U,"grid-template-columns":U,"grid-auto-rows":U,"grid-auto-columns":U,"box-shadow-x":U,"box-shadow-y":U,"box-shadow-blur":U,"box-shadow-spread":U,"font-line-height":U,"text-shadow-x":U,"text-shadow-y":U,"text-shadow-blur":U});function D(t,e,n){if(!e)return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=D(t,e[r],n);else if("object"===typeof e)if("fallbacks"===t)for(var i in e)e[i]=D(i,e[i],n);else for(var o in e)e[o]=D(t+"-"+o,e[o],n);else if("number"===typeof e){var a=n[t]||N[t];return a?"function"===typeof a?a(e).toString():""+e+a:e.toString()}return e}var G=function(t){void 0===t&&(t={});var e=O(t);return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r in t)t[r]=D(r,t[r],e);return t},onChangeValue:function(t,n){return D(n,t,e)}}},_=n(159),M=n(23),T="",j="",L="",V=_.a&&"ontouchstart"in document.documentElement;if(_.a){var Z={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},P=document.createElement("p").style;for(var W in Z)if(W+"Transform"in P){T=W,j=Z[W];break}"Webkit"===T&&"msHyphens"in P&&(T="ms",j=Z.ms,"edge"),"Webkit"===T&&"-apple-trailing-word"in P&&(L="apple")}var J=T,H=j,Y=L,X=V;var z={noPrefill:["appearance"],supportedProperty:function(t){return"appearance"===t&&("ms"===J?"-webkit-"+t:H+t)}},K={noPrefill:["color-adjust"],supportedProperty:function(t){return"color-adjust"===t&&("Webkit"===J?H+"print-"+t:t)}},q=/[-\s]+(.)?/g;function $(t,e){return e?e.toUpperCase():""}function tt(t){return t.replace(q,$)}function et(t){return tt("-"+t)}var nt,rt={noPrefill:["mask"],supportedProperty:function(t,e){if(!/^mask/.test(t))return!1;if("Webkit"===J){if(tt("mask-image")in e)return t;if(J+et("mask-image")in e)return H+t}return t}},it={noPrefill:["text-orientation"],supportedProperty:function(t){return"text-orientation"===t&&("apple"!==Y||X?t:H+t)}},ot={noPrefill:["transform"],supportedProperty:function(t,e,n){return"transform"===t&&(n.transform?t:H+t)}},at={noPrefill:["transition"],supportedProperty:function(t,e,n){return"transition"===t&&(n.transition?t:H+t)}},At={noPrefill:["writing-mode"],supportedProperty:function(t){return"writing-mode"===t&&("Webkit"===J||"ms"===J?H+t:t)}},st={noPrefill:["user-select"],supportedProperty:function(t){return"user-select"===t&&("Moz"===J||"ms"===J||"apple"===Y?H+t:t)}},ct={supportedProperty:function(t,e){return!!/^break-/.test(t)&&("Webkit"===J?"WebkitColumn"+et(t)in e&&H+"column-"+t:"Moz"===J&&("page"+et(t)in e&&"page-"+t))}},ut={supportedProperty:function(t,e){if(!/^(border|margin|padding)-inline/.test(t))return!1;if("Moz"===J)return t;var n=t.replace("-inline","");return J+et(n)in e&&H+n}},lt={supportedProperty:function(t,e){return tt(t)in e&&t}},gt={supportedProperty:function(t,e){var n=et(t);return"-"===t[0]||"-"===t[0]&&"-"===t[1]?t:J+n in e?H+t:"Webkit"!==J&&"Webkit"+n in e&&"-webkit-"+t}},ft={supportedProperty:function(t){return"scroll-snap"===t.substring(0,11)&&("ms"===J?""+H+t:t)}},ht={supportedProperty:function(t){return"overscroll-behavior"===t&&("ms"===J?H+"scroll-chaining":t)}},dt={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},It={supportedProperty:function(t,e){var n=dt[t];return!!n&&(J+et(n)in e&&H+n)}},pt={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},Ct=Object.keys(pt),yt=function(t){return H+t},vt=[z,K,rt,it,ot,at,At,st,ct,ut,lt,gt,ft,ht,It,{supportedProperty:function(t,e,n){var r=n.multiple;if(Ct.indexOf(t)>-1){var i=pt[t];if(!Array.isArray(i))return J+et(i)in e&&H+i;if(!r)return!1;for(var o=0;o<i.length;o++)if(!(J+et(i[0])in e))return!1;return i.map(yt)}return!1}}],Bt=vt.filter((function(t){return t.supportedProperty})).map((function(t){return t.supportedProperty})),mt=vt.filter((function(t){return t.noPrefill})).reduce((function(t,e){return t.push.apply(t,Object(M.a)(e.noPrefill)),t}),[]),bt={};if(_.a){nt=document.createElement("p");var Et=window.getComputedStyle(document.documentElement,"");for(var Qt in Et)isNaN(Qt)||(bt[Et[Qt]]=Et[Qt]);mt.forEach((function(t){return delete bt[t]}))}function Ft(t,e){if(void 0===e&&(e={}),!nt)return t;if(null!=bt[t])return bt[t];"transition"!==t&&"transform"!==t||(e[t]=t in nt.style);for(var n=0;n<Bt.length&&(bt[t]=Bt[n](t,nt.style,e),!bt[t]);n++);try{nt.style[t]=""}catch(r){return!1}return bt[t]}var wt,St={},Rt={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Ut=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function xt(t,e,n){if("var"===e)return"var";if("all"===e)return"all";if("all"===n)return", all";var r=e?Ft(e):", "+Ft(n);return r||(e||n)}function kt(t,e){var n=e;if(!wt||"content"===t)return e;if("string"!==typeof n||!isNaN(parseInt(n,10)))return n;var r=t+n;if(null!=St[r])return St[r];try{wt.style[t]=n}catch(i){return St[r]=!1,!1}if(Rt[t])n=n.replace(Ut,xt);else if(""===wt.style[t]&&("-ms-flex"===(n=H+n)&&(wt.style[t]="-ms-flexbox"),wt.style[t]=n,""===wt.style[t]))return St[r]=!1,!1;return wt.style[t]="",St[r]=n,St[r]}_.a&&(wt=document.createElement("p"));var Ot=function(){function t(e){for(var n in e){var r=e[n];if("fallbacks"===n&&Array.isArray(r))e[n]=r.map(t);else{var i=!1,o=Ft(n);o&&o!==n&&(i=!0);var a=!1,A=kt(o,Object(s.f)(r));A&&A!==r&&(a=!0),(i||a)&&(i&&delete e[n],e[o||n]=A||r)}}return e}return{onProcessRule:function(t){if("keyframes"===t.type){var e=t;e.at="-"===(n=e.at)[1]||"ms"===J?n:"@"+H+"keyframes"+n.substr(10)}var n},onProcessStyle:function(e,n){return"style"!==n.type?e:t(e)},onChangeValue:function(t,e){return kt(e,Object(s.f)(t))||t}}};var Nt=function(){var t=function(t,e){return t.length===e.length?t>e?1:-1:t.length-e.length};return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r={},i=Object.keys(e).sort(t),o=0;o<i.length;o++)r[i[o]]=e[i[o]];return r}}};function Dt(){return{plugins:[g(),C(),m(),R(),G(),"undefined"===typeof window?null:Ot(),Nt()]}}n.d(e,"a",(function(){return Tt})),n.d(e,"b",(function(){return jt}));var Gt,_t=Object(s.b)(Dt()),Mt={disableGeneration:!1,generateClassName:Object(A.a)(),jss:_t,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},Tt=a.a.createContext(Mt);function jt(t){var e=t.children,n=t.injectFirst,o=void 0!==n&&n,A=t.disableGeneration,c=void 0!==A&&A,u=Object(i.a)(t,["children","injectFirst","disableGeneration"]),l=a.a.useContext(Tt),g=Object(r.a)({},l,{disableGeneration:c},u);if(!g.jss.options.insertionPoint&&o&&"undefined"!==typeof window){if(!Gt){var f=document.head;Gt=document.createComment("mui-inject-first"),f.insertBefore(Gt,f.firstChild)}g.jss=Object(s.b)({plugins:Dt().plugins,insertionPoint:Gt})}return a.a.createElement(Tt.Provider,{value:g},e)}},function(t,e,n){"use strict";var r=n(28),i=n(1),o=n(9),a=n(0),A=(n(20),n(32)),s=n(43),c=n(541);var u=n(60),l=n(183),g=n(65),f="undefined"===typeof window?a.useEffect:a.useLayoutEffect,h=a.forwardRef((function(t,e){var n=t.alignItems,i=void 0===n?"center":n,s=t.autoFocus,h=void 0!==s&&s,d=t.button,I=void 0!==d&&d,p=t.children,C=t.classes,y=t.className,v=t.component,B=t.ContainerComponent,m=void 0===B?"li":B,b=t.ContainerProps,E=(b=void 0===b?{}:b).className,Q=Object(r.a)(b,["className"]),F=t.dense,w=void 0!==F&&F,S=t.disabled,R=void 0!==S&&S,U=t.disableGutters,x=void 0!==U&&U,k=t.divider,O=void 0!==k&&k,N=t.focusVisibleClassName,D=t.selected,G=void 0!==D&&D,_=Object(r.a)(t,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),M=a.useContext(l.a),T={dense:w||M.dense||!1,alignItems:i},j=a.useRef(null);f((function(){h&&j.current&&j.current.focus()}),[h]);var L,V,Z=a.Children.toArray(p),P=Z.length&&(L=Z[Z.length-1],V=["ListItemSecondaryAction"],a.isValidElement(L)&&-1!==V.indexOf(L.type.muiName)),W=a.useCallback((function(t){j.current=g.findDOMNode(t)}),[]),J=Object(u.a)(W,e),H=Object(o.a)({className:Object(A.a)(C.root,y,T.dense&&C.dense,!x&&C.gutters,O&&C.divider,R&&C.disabled,I&&C.button,"center"!==i&&C.alignItemsFlexStart,P&&C.secondaryAction,G&&C.selected),disabled:R},_),Y=v||"li";return I&&(H.component=v||"div",H.focusVisibleClassName=Object(A.a)(C.focusVisible,N),Y=c.a),P?(Y=H.component||v?Y:"div","li"===m&&("li"===Y?Y="div":"li"===H.component&&(H.component="div")),a.createElement(l.a.Provider,{value:T},a.createElement(m,Object(o.a)({className:Object(A.a)(C.container,E),ref:J},Q),a.createElement(Y,H,Z),Z.pop()))):a.createElement(l.a.Provider,{value:T},a.createElement(Y,Object(o.a)({ref:J},H),Z))})),d=Object(s.a)((function(t){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:t.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:t.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(t.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:t.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(h),I=a.forwardRef((function(t,e){var n,i=t.classes,s=t.className,c=t.component,u=void 0===c?"li":c,l=t.disableGutters,g=void 0!==l&&l,f=t.role,h=void 0===f?"menuitem":f,I=t.selected,p=t.tabIndex,C=Object(r.a)(t,["classes","className","component","disableGutters","role","selected","tabIndex"]);return t.disabled||(n=void 0!==p?p:-1),a.createElement(d,Object(o.a)({button:!0,role:h,tabIndex:n,component:u,selected:I,disableGutters:g,classes:{dense:i.dense},className:Object(A.a)(i.root,s,I&&i.selected,!g&&i.gutters),ref:e},C))}));e.a=Object(s.a)((function(t){return{root:Object(o.a)({},t.typography.body1,Object(i.a)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},t.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:Object(o.a)({},t.typography.body2,{minHeight:"auto"})}}),{name:"MuiMenuItem"})(I)},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(262),n(20),n(65)),A=n(88),s=n(32),c=n(43),u=n(183),l=o.forwardRef((function(t,e){var n=t.children,a=t.classes,A=t.className,c=t.component,l=void 0===c?"ul":c,g=t.dense,f=void 0!==g&&g,h=t.disablePadding,d=void 0!==h&&h,I=t.subheader,p=Object(i.a)(t,["children","classes","className","component","dense","disablePadding","subheader"]),C=o.useMemo((function(){return{dense:f}}),[f]);return o.createElement(u.a.Provider,{value:C},o.createElement(l,Object(r.a)({className:Object(s.a)(a.root,A,f&&a.dense,!d&&a.padding,I&&a.subheader),ref:e},p),I,n))})),g=Object(c.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(l),f=n(321),h=n(60);function d(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function I(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function p(t,e){if(void 0===e)return!0;var n=t.innerText;return void 0===n&&(n=t.textContent),0!==(n=n.trim().toLowerCase()).length&&(e.repeating?n[0]===e.keys[0]:0===n.indexOf(e.keys.join("")))}function C(t,e,n,r,i){for(var o=!1,a=r(t,e,!!e&&n);a;){if(a===t.firstChild){if(o)return!1;o=!0}if(a.hasAttribute("tabindex")&&!a.disabled&&"true"!==a.getAttribute("aria-disabled")&&p(a,i))return a.focus(),!0;a=r(t,a,n)}return!1}var y="undefined"===typeof window?o.useEffect:o.useLayoutEffect,v=o.forwardRef((function(t,e){var n=t.actions,s=t.autoFocus,c=void 0!==s&&s,u=t.autoFocusItem,l=void 0!==u&&u,v=t.children,B=t.className,m=t.onKeyDown,b=t.disableListWrap,E=void 0!==b&&b,Q=t.variant,F=void 0===Q?"selectedMenu":Q,w=Object(i.a)(t,["actions","autoFocus","autoFocusItem","children","className","onKeyDown","disableListWrap","variant"]),S=o.useRef(null),R=o.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});y((function(){c&&S.current.focus()}),[c]),o.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(t,e){var n=!S.current.style.width;if(t.clientHeight<S.current.clientHeight&&n){var r="".concat(Object(f.a)(!0),"px");S.current.style["rtl"===e.direction?"paddingLeft":"paddingRight"]=r,S.current.style.width="calc(100% + ".concat(r,")")}return S.current}}}),[]);var U=o.useCallback((function(t){S.current=a.findDOMNode(t)}),[]),x=Object(h.a)(U,e),k=-1;o.Children.forEach(v,(function(t,e){o.isValidElement(t)&&(t.props.disabled||("selectedMenu"===F&&t.props.selected||-1===k)&&(k=e))}));var O=o.Children.map(v,(function(t,e){if(e===k){var n={};if(l&&(n.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===F&&(n.tabIndex=0),null!==n)return o.cloneElement(t,n)}return t}));return o.createElement(g,Object(r.a)({role:"menu",ref:x,className:B,onKeyDown:function(t){var e=S.current,n=t.key,r=Object(A.a)(e).activeElement;if("ArrowDown"===n)t.preventDefault(),C(e,r,E,d);else if("ArrowUp"===n)t.preventDefault(),C(e,r,E,I);else if("Home"===n)t.preventDefault(),C(e,null,E,d);else if("End"===n)t.preventDefault(),C(e,null,E,I);else if(1===n.length){var i=R.current,o=n.toLowerCase(),a=performance.now();i.keys.length>0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);var s=r&&!i.repeating&&p(r,i);i.previousKeyMatched&&(s||C(e,r,!1,d,i))?t.preventDefault():i.previousKeyMatched=!1}m&&m(t)},tabIndex:c?0:-1},w),O)}));e.a=v},function(t,e,n){"use strict";var r=n(17),i=n(319),o=n(180);n.d(e,"a",(function(){return l}));var a={m:"margin",p:"padding"},A={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},s={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){if(t.length>2){if(!s[t])return[t];t=s[t]}var e=t.split(""),n=Object(r.a)(e,2),i=n[0],o=n[1],c=a[i],u=A[o]||"";return Array.isArray(u)?u.map((function(t){return c+t})):[c+u]})),u=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function l(t){var e=t.spacing||8;return"number"===typeof e?function(t){return e*t}:Array.isArray(e)?function(t){return e[t]}:"function"===typeof e?e:function(){}}function g(t,e){return function(n){return t.reduce((function(t,r){return t[r]=function(t,e){if("string"===typeof e)return e;var n=t(Math.abs(e));return e>=0?n:"number"===typeof n?-n:"-".concat(n)}(e,n),t}),{})}}function f(t){var e=l(t.theme);return Object.keys(t).map((function(n){if(-1===u.indexOf(n))return null;var r=g(c(n),e),o=t[n];return Object(i.a)(t,o,r)})).reduce(o.a,{})}f.propTypes={},f.filterProps=u;e.b=f},function(t,e,n){"use strict";var r=n(26),i=n(18),o=n(16),a=n(12),A=n(0),s=n.n(A),c=n(201),u=n(92),l=n(141),g=n(75),f=n(156),h=n(539),d=n(783),I=n(756),p=n(754);function C(t){var e=t.observationsLabel,n=t.cellColorEncoding,r=t.setCellColorEncoding;return s.a.createElement(I.a,null,s.a.createElement(p.a,{observationsLabel:e,cellColorEncoding:n,setCellColorEncoding:r}))}var y=n(499),v=n(500),B=n(63);function m(t){var e=t.parentUuid,n=t.cellHighlight,r=t.width,o=t.height,A=t.getCellInfo,c=Object(B.b)(),u=Object(B.c)(e),l=n&&A?[A(n)].concat(Object(i.a)(u&&u.project?u.project(n):[null,null])):[null,null,null],g=Object(a.a)(l,3),f=g[0],h=g[1],d=g[2];return f?s.a.createElement(y.a,{x:h,y:d,parentUuid:e,sourceUuid:c,parentWidth:r,parentHeight:o},s.a.createElement(v.a,{info:f})):null}var b=n(267),E=n(120),Q=n(158);n.d(e,"a",(function(){return S}));var F=["cells","molecules","raster","cell-sets","expression-matrix"],w=["cells","molecules","raster","neighborhoods"];function S(t){var e,n,I,p=t.uuid,y=t.coordinationScopes,v=t.removeGridComponent,S=t.initializeLayers,R=void 0===S||S,U=t.observationsLabelOverride,x=void 0===U?"cell":U,k=t.observationsPluralLabelOverride,O=void 0===k?"".concat(x,"s"):k,N=t.subobservationsLabelOverride,D=void 0===N?"molecule":N,G=t.subobservationsPluralLabelOverride,_=void 0===G?"".concat(D,"s"):G,M=t.theme,T=t.disableTooltip,j=void 0!==T&&T,L=Object(B.h)(),V=Object(B.j)(),Z=Object(B.k)(p),P=Object(B.d)(Q.b.spatial,y),W=Object(a.a)(P,2),J=W[0],H=J.dataset,Y=J.spatialZoom,X=J.spatialTargetX,z=J.spatialTargetY,K=J.spatialTargetZ,q=J.spatialLayers,$=J.cellFilter,tt=J.cellHighlight,et=J.geneSelection,nt=J.cellSetSelection,rt=J.cellSetColor,it=J.cellColorEncoding,ot=J.additionalCellSets,at=W[1],At=at.setSpatialZoom,st=at.setSpatialTargetX,ct=at.setSpatialTargetY,ut=at.setSpatialTargetZ,lt=at.setSpatialLayers,gt=at.setCellFilter,ft=at.setCellSetSelection,ht=at.setCellHighlight,dt=at.setCellSetColor,It=at.setCellColorEncoding,pt=at.setAdditionalCellSets,Ct=at.setMoleculeHighlight,yt=Object(A.useState)(Object(o.a)({},H,[(null===(e=L[H].loaders.cells)||void 0===e?void 0:e.url)?E.a:null,(null===(n=L[H].loaders.molecules)||void 0===n?void 0:n.url)?E.c:null,(null===(I=L[H].loaders.neighborhoods)||void 0===I?void 0:I.url)?E.d:null].filter(Boolean))),vt=Object(a.a)(yt,2),Bt=vt[0],mt=vt[1],bt=Object(l.d)(),Et=Object(a.a)(bt,3),Qt=Et[0],Ft=Et[1],wt=Et[2],St=Object(l.c)(F),Rt=Object(a.a)(St,3),Ut=Rt[0],xt=Rt[1],kt=Rt[2],Ot=Object(l.a)(),Nt=Object(a.a)(Ot,3),Dt=Nt[0],Gt=Nt[1],_t=Nt[2];Object(A.useEffect)((function(){var t,e,n;wt(),kt(),mt(Object(o.a)({},H,[(null===(t=L[H].loaders.cells)||void 0===t?void 0:t.url)?E.a:null,(null===(e=L[H].loaders.molecules)||void 0===e?void 0:e.url)?E.c:null,(null===(n=L[H].loaders.neighborhoods)||void 0===n?void 0:n.url)?E.d:null].filter(Boolean)))}),[L,H]);var Mt=Object(f.b)(L,H,xt,Ft,!1,(function(){})),Tt=Object(a.a)(Mt,2),jt=Tt[0],Lt=Tt[1],Vt=Object(f.f)(L,H,xt,Ft,!1,(function(){})),Zt=Object(a.a)(Vt,3),Pt=Zt[0],Wt=Zt[1],Jt=Zt[2],Ht=Object(f.g)(L,H,xt,Ft,!1,(function(){})),Yt=Object(a.a)(Ht,1)[0],Xt=Object(f.a)(L,H,xt,Ft,!1),zt=Object(a.a)(Xt,1)[0],Kt=Object(f.d)(L,H,xt,Ft,!1),qt=Object(a.a)(Kt,1)[0],$t=Object(f.h)(L,H,xt,Ft,!1,(function(t){return mt((function(e){return Object.keys(e).includes(H)?Object(o.a)({},H,[].concat(Object(i.a)(e[H]||[]),Object(i.a)(t))):e}))})),te=Object(a.a)($t,2),ee=(te[0],te[1]);Object(A.useEffect)((function(){var t,e=null===(t=Object.keys(L[H].loaders))||void 0===t?void 0:t.every((function(t){return!w.includes(t)||Bt[H]&&Bt[H].filter((function(e){return e.type===t})).length>0}));Ut&&R&&(!q&&Bt[H]&&e?lt(Object(b.e)(Bt[H])):q&&Object(b.b)(q,ee).then((function(t){var e=Object(a.a)(t,2),n=e[0];e[1]&&lt(n)})))}),[H,L,Bt,ee,Ut,q,lt,R]);var ne=Object(A.useMemo)((function(){return Object(g.n)(zt,ot)}),[zt,ot]),re=Object(A.useCallback)((function(t){Object(g.o)(t,ot,rt,ft,pt,dt,It)}),[ot,rt,It,pt,dt,ft]),ie=Object(A.useMemo)((function(){return Object(h.a)({cellColorEncoding:it,expressionMatrix:qt,geneSelection:et,cellSets:ne,cellSetSelection:nt,cellSetColor:rt})}),[it,et,ne,rt,nt,qt]),oe=Object(A.useMemo)((function(){return Array.from(ie.keys())}),[ie]),ae=Object(b.d)({observationsCount:Lt,observationsLabel:x,observationsPluralLabel:O,subobservationsCount:Wt,subobservationsLabel:D,subobservationsPluralLabel:_,locationsCount:Jt});return s.a.createElement(c.a,{title:"Spatial",info:ae,isSpatial:!0,urls:Qt,theme:M,removeGridComponent:v,isReady:Ut,options:s.a.createElement(C,{observationsLabel:x,cellColorEncoding:it,setCellColorEncoding:It})},s.a.createElement(d.a,{ref:_t,uuid:p,width:Dt,height:Gt,viewState:{zoom:Y,target:[X,z,K]},setViewState:function(t){var e=t.zoom,n=t.target;At(e),st(n[0]),ct(n[1]),ut(n[2])},layers:q,cells:jt,cellFilter:$,cellSelection:oe,cellHighlight:tt,cellColors:ie,molecules:Pt,neighborhoods:Yt,imageLayerLoaders:ee,setCellFilter:gt,setCellSelection:re,setCellHighlight:ht,setMoleculeHighlight:Ct,setComponentHover:function(){V(p)},updateViewInfo:Z}),!j&&s.a.createElement(m,{parentUuid:p,cellHighlight:tt,width:Dt,height:Gt,getCellInfo:function(t){var e=jt[t];return e?Object(r.a)(Object(o.a)({},"".concat(Object(u.a)(x)," ID"),t),e.factors):null}}))}},function(t,e,n){"use strict";var r=n(16),i=n(26),o=n(12),a=n(0),A=n.n(a),s=n(1415),c=n(273),u=n.n(c),l=n(201),g=n(92),f=n(141),h=n(75),d=n(121),I=n(156),p=n(539),C=n(785),y=n(18),v=n(499),B=n(500),m=n(63);function b(t){var e=t.parentUuid,n=t.cellHighlight,r=t.width,i=t.height,a=t.getCellInfo,s=Object(m.b)(),c=Object(m.c)(e),u=n&&a?[a(n)].concat(Object(y.a)(c&&c.project?c.project(n):[null,null])):[null,null,null],l=Object(o.a)(u,3),g=l[0],f=l[1],h=l[2];return g?A.a.createElement(v.a,{x:f,y:h,parentUuid:e,sourceUuid:s,parentWidth:r,parentHeight:i},A.a.createElement(B.a,{info:g})):null}var E=n(1121),Q=n(1110),F=n(842),w=n(1111),S=n(501),R=n(756),U=n(754);function x(t){var e=t.observationsLabel,n=t.cellRadius,r=t.setCellRadius,i=t.cellSetLabelsVisible,o=t.setCellSetLabelsVisible,a=t.cellSetLabelSize,s=t.setCellSetLabelSize,c=t.cellSetPolygonsVisible,u=t.setCellSetPolygonsVisible,l=t.cellColorEncoding,f=t.setCellColorEncoding,h=Object(g.a)(e),d=Object(S.a)();return A.a.createElement(R.a,null,A.a.createElement(w.a,null,A.a.createElement(F.a,{className:d.labelCell},h," Set Labels Visible"),A.a.createElement(F.a,{className:d.inputCell},A.a.createElement(E.a,{className:d.checkbox,checked:i,onChange:function(t){o(t.target.checked)},name:"scatterplot-option-cell-set-labels",color:"default"}))),A.a.createElement(w.a,null,A.a.createElement(F.a,{className:d.labelCell},h," Set Label Size"),A.a.createElement(F.a,{className:d.inputCell},A.a.createElement(Q.a,{disabled:!i,classes:{root:d.slider,valueLabel:d.sliderValueLabel},value:a,onChange:function(t,e){s(e)},"aria-labelledby":"cell-set-label-size-slider",valueLabelDisplay:"auto",step:1,min:8,max:36}))),A.a.createElement(w.a,null,A.a.createElement(F.a,{className:d.labelCell},h," Set Polygons Visible"),A.a.createElement(F.a,{className:d.inputCell},A.a.createElement(E.a,{className:d.checkbox,checked:c,onChange:function(t){u(t.target.checked)},name:"scatterplot-option-cell-set-polygons",color:"default"}))),A.a.createElement(w.a,null,A.a.createElement(F.a,{className:d.labelCell},h," Radius"),A.a.createElement(F.a,{className:d.inputCell},A.a.createElement(Q.a,{classes:{root:d.slider,valueLabel:d.sliderValueLabel},value:n,onChange:function(t,e){r(e)},"aria-labelledby":"cell-radius-slider",valueLabelDisplay:"auto",step:.25,min:.25,max:8}))),A.a.createElement(U.a,{observationsLabel:e,cellColorEncoding:l,setCellColorEncoding:f}))}var k=n(158);n.d(e,"a",(function(){return N}));var O=["cells","expression-matrix","cell-sets"];function N(t){var e=t.uuid,n=t.coordinationScopes,c=t.removeGridComponent,y=t.theme,v=t.disableTooltip,B=void 0!==v&&v,E=t.observationsLabelOverride,Q=void 0===E?"cell":E,F=t.observationsPluralLabelOverride,w=void 0===F?"".concat(Q,"s"):F,S=Object(m.h)(),R=Object(m.j)(),U=Object(m.k)(e),N=Object(m.d)(k.b.scatterplot,n),D=Object(o.a)(N,2),G=D[0],_=G.dataset,M=G.embeddingZoom,T=G.embeddingTargetX,j=G.embeddingTargetY,L=G.embeddingTargetZ,V=G.embeddingType,Z=G.cellFilter,P=G.cellHighlight,W=G.geneSelection,J=G.cellSetSelection,H=G.cellSetColor,Y=G.cellColorEncoding,X=G.additionalCellSets,z=G.embeddingCellSetPolygonsVisible,K=G.embeddingCellSetLabelsVisible,q=G.embeddingCellSetLabelSize,$=G.embeddingCellRadius,tt=D[1],et=tt.setEmbeddingZoom,nt=tt.setEmbeddingTargetX,rt=tt.setEmbeddingTargetY,it=tt.setEmbeddingTargetZ,ot=tt.setCellFilter,at=tt.setCellSetSelection,At=tt.setCellHighlight,st=tt.setCellSetColor,ct=tt.setCellColorEncoding,ut=tt.setAdditionalCellSets,lt=tt.setEmbeddingCellSetPolygonsVisible,gt=tt.setEmbeddingCellSetLabelsVisible,ft=tt.setEmbeddingCellSetLabelSize,ht=tt.setEmbeddingCellRadius,dt=Object(f.d)(),It=Object(o.a)(dt,3),pt=It[0],Ct=It[1],yt=It[2],vt=Object(f.a)(),Bt=Object(o.a)(vt,3),mt=Bt[0],bt=Bt[1],Et=Bt[2],Qt=Object(f.c)(O),Ft=Object(o.a)(Qt,3),wt=Ft[0],St=Ft[1],Rt=Ft[2];Object(a.useEffect)((function(){yt(),Rt()}),[S,_]);var Ut=Object(I.b)(S,_,St,Ct,!0),xt=Object(o.a)(Ut,2),kt=xt[0],Ot=xt[1],Nt=Object(I.a)(S,_,St,Ct,!1),Dt=Object(o.a)(Nt,1)[0],Gt=Object(I.d)(S,_,St,Ct,!1),_t=Object(o.a)(Gt,1)[0],Mt=Object(a.useState)(.2),Tt=Object(o.a)(Mt,2),jt=Tt[0],Lt=Tt[1],Vt=Object(a.useMemo)((function(){return Object(h.n)(Dt,X)}),[Dt,X]),Zt=Object(a.useCallback)((function(t){Object(h.o)(t,X,H,at,ut,st,ct)}),[X,H,ct,ut,st,at]),Pt=Object(a.useMemo)((function(){return Object(p.a)({cellColorEncoding:Y,expressionMatrix:_t,geneSelection:W,cellSets:Vt,cellSetSelection:J,cellSetColor:H})}),[Y,W,Vt,J,H,_t]),Wt=Object(a.useMemo)((function(){return Object(d.b)({cells:kt,mapping:V,cellSets:Vt,cellSetSelection:J,cellSetColor:H})}),[kt,V,Vt,J,H]),Jt=Object(a.useMemo)((function(){return Array.from(Pt.keys())}),[Pt]);Object(a.useEffect)((function(){if(kt){var t=Object.values(kt).map((function(t){return t.mappings[V]})),e=Object(s.a)(t,(function(t){return t[0]})),n=Object(s.a)(t,(function(t){return t[1]})),r=e[1]-e[0],i=n[1]-n[0],o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2)),a=u()(o/300,0,.2);a&&Lt(a)}}),[kt,V]);var Ht=Object(a.useCallback)((function(t){var e=kt[t];return Object(i.a)(Object(r.a)({},"".concat(Object(g.a)(Q)," ID"),t),e?e.factors:{})}),[kt,Q]);return A.a.createElement(l.a,{title:"Scatterplot (".concat(V,")"),info:"".concat(Ot," ").concat(Object(g.d)(Q,w,Ot)),removeGridComponent:c,urls:pt,theme:y,isReady:wt,options:A.a.createElement(x,{observationsLabel:Q,cellRadius:$,setCellRadius:ht,cellSetLabelsVisible:K,setCellSetLabelsVisible:gt,cellSetLabelSize:q,setCellSetLabelSize:ft,cellSetPolygonsVisible:z,setCellSetPolygonsVisible:lt,cellColorEncoding:Y,setCellColorEncoding:ct})},A.a.createElement(C.a,{ref:Et,uuid:e,theme:y,viewState:{zoom:M,target:[T,j,L]},setViewState:function(t){var e=t.zoom,n=t.target;et(e),nt(n[0]),rt(n[1]),it(n[2])},cells:kt,mapping:V,cellFilter:Z,cellSelection:Jt,cellHighlight:P,cellColors:Pt,cellSetPolygons:Wt,cellSetLabelSize:q,cellSetLabelsVisible:K,cellSetPolygonsVisible:z,setCellFilter:ot,setCellSelection:Zt,setCellHighlight:At,cellRadiusScale:jt*$,setComponentHover:function(){R(e)},updateViewInfo:U}),!B&&A.a.createElement(b,{parentUuid:e,cellHighlight:P,width:mt,height:bt,getCellInfo:Ht}))}},function(t,e,n){"use strict";var r=n(16),i=n(26),o=n(12),a=n(0),A=n.n(a),s=n(201),c=n(92),u=n(141),l=n(75),g=n(156),f=n(539),h=n(63),d=n(158),I=n(784),p=n(499),C=n(500);function y(t){var e=t.parentUuid,n=t.width,r=t.height,a=t.transpose,s=t.getCellInfo,c=t.getGeneInfo,u=t.cellHighlight,l=t.geneHighlight,g=Object(h.b)(),f=Object(h.c)(e),d=u&&s?[s(u),f&&f.project?f.project(u,null)[a?0:1]:null]:[null,null],I=Object(o.a)(d,2),y=I[0],v=I[1],B=l&&c?[c(l),f&&f.project?f.project(null,l)[a?1:0]:null]:[null,null],m=Object(o.a)(B,2),b=m[0],E=m[1],Q=a?v:E,F=a?E:v;return y||b?A.a.createElement(p.a,{x:Q,y:F,parentUuid:e,parentWidth:n,parentHeight:r,sourceUuid:g},A.a.createElement(C.a,{info:Object(i.a)({},b,{},y)})):null}n.d(e,"a",(function(){return B}));var v=["cells","cell-sets","expression-matrix"];function B(t){var e=t.uuid,n=t.coordinationScopes,p=t.removeGridComponent,C=t.theme,B=t.transpose,m=t.observationsLabelOverride,b=void 0===m?"cell":m,E=t.observationsPluralLabelOverride,Q=void 0===E?"".concat(b,"s"):E,F=t.variablesLabelOverride,w=void 0===F?"gene":F,S=t.variablesPluralLabelOverride,R=void 0===S?"".concat(w,"s"):S,U=t.disableTooltip,x=void 0!==U&&U,k=Object(h.h)(),O=Object(h.j)(),N=Object(h.k)(e),D=Object(h.d)(d.b.heatmap,n),G=Object(o.a)(D,2),_=G[0],M=_.dataset,T=_.heatmapZoomX,j=_.heatmapTargetX,L=_.heatmapTargetY,V=_.geneSelection,Z=_.cellHighlight,P=_.geneHighlight,W=_.cellSetSelection,J=_.cellSetColor,H=_.cellColorEncoding,Y=_.additionalCellSets,X=_.geneExpressionColormapRange,z=G[1],K=z.setHeatmapZoomX,q=z.setHeatmapZoomY,$=z.setHeatmapTargetX,tt=z.setHeatmapTargetY,et=z.setCellHighlight,nt=z.setGeneHighlight,rt=z.setGeneExpressionColormapRange,it=Object(c.a)(Q),ot=Object(c.a)(R),at=Object(a.useState)(!1),At=Object(o.a)(at,2),st=At[0],ct=At[1],ut=Object(u.c)(v),lt=Object(o.a)(ut,3),gt=lt[0],ft=lt[1],ht=lt[2],dt=Object(u.d)(),It=Object(o.a)(dt,3),pt=It[0],Ct=It[1],yt=It[2],vt=Object(u.a)(),Bt=Object(o.a)(vt,3),mt=Bt[0],bt=Bt[1],Et=Bt[2];Object(a.useEffect)((function(){yt(),ht()}),[k,M]);var Qt=Object(g.b)(k,M,ft,Ct,!0),Ft=Object(o.a)(Qt,1)[0],wt=Object(g.d)(k,M,ft,Ct,!0),St=Object(o.a)(wt,1)[0],Rt=Object(g.a)(k,M,ft,Ct,!1),Ut=Object(o.a)(Rt,1)[0],xt=Object(a.useMemo)((function(){return Object(l.n)(Ut,Y)}),[Ut,Y]),kt=Object(a.useMemo)((function(){return Object(f.a)({cellColorEncoding:H,expressionMatrix:St,geneSelection:V,cellSets:xt,cellSetSelection:W,cellSetColor:J})}),[H,V,xt,J,W,St]),Ot=Object(a.useCallback)((function(t){if(t){var e=Ft[t];return Object(i.a)(Object(r.a)({},"".concat(Object(c.a)(b)," ID"),t),e?e.factors:{})}return null}),[Ft,b]),Nt=Object(a.useCallback)((function(t){return t?Object(r.a)({},"".concat(Object(c.a)(w)," ID"),t):null}),[w]),Dt=St&&St.rows?St.rows.length:0,Gt=St&&St.cols?St.cols.length:0,_t=kt.size;return A.a.createElement(s.a,{title:"Heatmap",info:"".concat(Dt," ").concat(Object(c.d)(b,Q,Dt)," \xd7 ").concat(Gt," ").concat(Object(c.d)(w,R,Gt),",\n             with ").concat(_t," ").concat(Object(c.d)(b,Q,_t)," selected"),urls:pt,theme:C,removeGridComponent:p,isReady:gt&&!st},A.a.createElement(I.a,{ref:Et,transpose:B,viewState:{zoom:T,target:[j,L]},setViewState:function(t){var e=t.zoom,n=t.target;K(e),q(e),$(n[0]),tt(n[1])},heatmapControls:X,setHeatmapControls:rt,height:bt,width:mt,theme:C,uuid:e,expressionMatrix:St,cellColors:kt,setIsRendering:ct,setCellHighlight:et,setGeneHighlight:nt,setComponentHover:function(){O(e)},updateViewInfo:N,observationsTitle:it,variablesTitle:ot}),!x&&A.a.createElement(y,{parentUuid:e,width:mt,height:bt,transpose:B,getCellInfo:Ot,getGeneInfo:Nt,cellHighlight:Z,geneHighlight:P}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n.n(r);function o(t){var e=t.info,n=t.warn,r=[];return e&&r.push(i.a.createElement("p",{className:"details",key:"info"},e)),n&&r.push(i.a.createElement("p",{className:"alert alert-warning my-0 details",key:"warn"},n)),r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(26),i=n(0),o=n.n(i),a=n(273),A=n.n(a),s=n(523),c=n(116);function u(t){var e=t.data,n=t.theme,i=t.width,a=t.height,u=t.marginRight,l=void 0===u?90:u,g=t.marginBottom,f=void 0===g?120:g,h=t.keyLength,d=void 0===h?36:h,I=e.map((function(t){return Object(r.a)({},t,{keyName:t.key+t.name,colorString:Object(c.c)(t.color)})})),p={domain:I.map((function(t){return t.key})),range:I.map((function(t){return t.colorString}))},C=I.map((function(t){return t.keyName})),y={mark:{type:"bar"},encoding:{x:{field:"keyName",type:"nominal",axis:{labelExpr:"substring(datum.label, ".concat(d,")")},title:"Cell Set",sort:C},y:{field:"size",type:"quantitative",title:"Cell Set Size"},color:{field:"key",type:"nominal",scale:p,legend:null},tooltip:{field:"size",type:"quantitative"}},width:A()(i-l,10,1/0),height:A()(a-f,10,1/0),config:s.b[n]};return o.a.createElement(s.c,{data:I,spec:y})}},function(t,e,n){"use strict";var r=n(12),i=n(0),o=n.n(i),a=n(16),A=n(117),s=n.n(A),c=n(119),u=n.n(c),l=n(170),g=n.n(l),f=n(171),h=n.n(f),d=n(50),I=n.n(d),p=n(172),C=n.n(p),y=n(42),v=n.n(y),B=n(298),m=n(225),b=n.n(m),E=n(32);function Q(t){var e=t.cellCount,n=t.cellSize,r=t.computeMetadataCallback,i=t.computeMetadataCallbackProps,o=t.nextCellsCount,a=t.nextCellSize,A=t.nextScrollToIndex,s=t.scrollToIndex,c=t.updateScrollOffsetForScrollToIndex;e===o&&("number"!==typeof n&&"number"!==typeof a||n===a)||(r(i),s>=0&&s===A&&c())}var F=n(543),w=n.n(F),S=(n(20),function(){function t(e){var n=e.cellCount,r=e.cellSizeGetter,i=e.estimatedCellSize;s()(this,t),v()(this,"_cellSizeAndPositionData",{}),v()(this,"_lastMeasuredIndex",-1),v()(this,"_lastBatchedIndex",-1),v()(this,"_cellCount",void 0),v()(this,"_cellSizeGetter",void 0),v()(this,"_estimatedCellSize",void 0),this._cellSizeGetter=r,this._cellCount=n,this._estimatedCellSize=i}return u()(t,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(t){var e=t.cellCount,n=t.estimatedCellSize,r=t.cellSizeGetter;this._cellCount=e,this._estimatedCellSize=n,this._cellSizeGetter=r}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(t){if(t<0||t>=this._cellCount)throw Error("Requested index ".concat(t," is outside of range 0..").concat(this._cellCount));if(t>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),n=e.offset+e.size,r=this._lastMeasuredIndex+1;r<=t;r++){var i=this._cellSizeGetter({index:r});if(void 0===i||isNaN(i))throw Error("Invalid size returned for cell ".concat(r," of value ").concat(i));null===i?(this._cellSizeAndPositionData[r]={offset:n,size:0},this._lastBatchedIndex=t):(this._cellSizeAndPositionData[r]={offset:n,size:i},n+=i,this._lastMeasuredIndex=t)}return this._cellSizeAndPositionData[t]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var t=this.getSizeAndPositionOfLastMeasuredCell();return t.offset+t.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,n=void 0===e?"auto":e,r=t.containerSize,i=t.currentOffset,o=t.targetIndex;if(r<=0)return 0;var a,A=this.getSizeAndPositionOfCell(o),s=A.offset,c=s-r+A.size;switch(n){case"start":a=s;break;case"end":a=c;break;case"center":a=s-(r-A.size)/2;break;default:a=Math.max(c,Math.min(s,i))}var u=this.getTotalSize();return Math.max(0,Math.min(u-r,a))}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,n=t.offset;if(0===this.getTotalSize())return{};var r=n+e,i=this._findNearestCell(n),o=this.getSizeAndPositionOfCell(i);n=o.offset+o.size;for(var a=i;n<r&&a<this._cellCount-1;)a++,n+=this.getSizeAndPositionOfCell(a).size;return{start:i,stop:a}}},{key:"resetCell",value:function(t){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,t-1)}},{key:"_binarySearch",value:function(t,e,n){for(;e<=t;){var r=e+Math.floor((t-e)/2),i=this.getSizeAndPositionOfCell(r).offset;if(i===n)return r;i<n?e=r+1:i>n&&(t=r-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(t,e){for(var n=1;t<this._cellCount&&this.getSizeAndPositionOfCell(t).offset<e;)t+=n,n*=2;return this._binarySearch(Math.min(t,this._cellCount-1),Math.floor(t/2),e)}},{key:"_findNearestCell",value:function(t){if(isNaN(t))throw Error("Invalid offset ".concat(t," specified"));t=Math.max(0,t);var e=this.getSizeAndPositionOfLastMeasuredCell(),n=Math.max(0,this._lastMeasuredIndex);return e.offset>=t?this._binarySearch(n,0,t):this._exponentialSearch(n,t)}}]),t}()),R=function(){return"undefined"!==typeof window&&window.chrome?16777100:15e5},U=function(){function t(e){var n=e.maxScrollSize,r=void 0===n?R():n,i=w()(e,["maxScrollSize"]);s()(this,t),v()(this,"_cellSizeAndPositionManager",void 0),v()(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new S(i),this._maxScrollSize=r}return u()(t,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(t){this._cellSizeAndPositionManager.configure(t)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize(),o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:i});return Math.round(o*(i-r))}},{key:"getSizeAndPositionOfCell",value:function(t){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(t)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,n=void 0===e?"auto":e,r=t.containerSize,i=t.currentOffset,o=t.targetIndex;i=this._safeOffsetToOffset({containerSize:r,offset:i});var a=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:n,containerSize:r,currentOffset:i,targetIndex:o});return this._offsetToSafeOffset({containerSize:r,offset:a})}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,n=t.offset;return n=this._safeOffsetToOffset({containerSize:e,offset:n}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:n})}},{key:"resetCell",value:function(t){this._cellSizeAndPositionManager.resetCell(t)}},{key:"_getOffsetPercentage",value:function(t){var e=t.containerSize,n=t.offset,r=t.totalSize;return r<=e?0:n/(r-e)}},{key:"_offsetToSafeOffset",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;var o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:r});return Math.round(o*(i-e))}},{key:"_safeOffsetToOffset",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;var o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:i});return Math.round(o*(r-e))}}]),t}();function x(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return function(n){var r=n.callback,i=n.indices,o=Object.keys(i),a=!t||o.every((function(t){var e=i[t];return Array.isArray(e)?e.length>0:e>=0})),A=o.length!==Object.keys(e).length||o.some((function(t){var n=e[t],r=i[t];return Array.isArray(r)?n.join(",")!==r.join(","):n!==r}));e=i,a&&A&&r(i)}}function k(t){var e=t.cellSize,n=t.cellSizeAndPositionManager,r=t.previousCellsCount,i=t.previousCellSize,o=t.previousScrollToAlignment,a=t.previousScrollToIndex,A=t.previousSize,s=t.scrollOffset,c=t.scrollToAlignment,u=t.scrollToIndex,l=t.size,g=t.sizeJustIncreasedFromZero,f=t.updateScrollIndexCallback,h=n.getCellCount(),d=u>=0&&u<h;d&&(l!==A||g||!i||"number"===typeof e&&e!==i||c!==o||u!==a)?f(u):!d&&h>0&&(l<A||h<r)&&s>n.getTotalSize()-l&&f(h-1)}var O,N,D=!("undefined"===typeof window||!window.document||!window.document.createElement);function G(t){if((!O&&0!==O||t)&&D){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),O=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return O}var _,M,T=(N="undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).requestAnimationFrame||N.webkitRequestAnimationFrame||N.mozRequestAnimationFrame||N.oRequestAnimationFrame||N.msRequestAnimationFrame||function(t){return N.setTimeout(t,1e3/60)},j=N.cancelAnimationFrame||N.webkitCancelAnimationFrame||N.mozCancelAnimationFrame||N.oCancelAnimationFrame||N.msCancelAnimationFrame||function(t){N.clearTimeout(t)},L=T,V=j,Z=function(t){return V(t.id)},P=function(t,e){var n;Promise.resolve().then((function(){n=Date.now()}));var r={id:L((function i(){Date.now()-n>=e?t.call():r.id=L(i)}))};return r};function W(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?W(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var H="observed",Y="requested",X=(M=_=function(t){function e(t){var n;s()(this,e),n=g()(this,h()(e).call(this,t)),v()(I()(n),"_onGridRenderedMemoizer",x()),v()(I()(n),"_onScrollMemoizer",x(!1)),v()(I()(n),"_deferredInvalidateColumnIndex",null),v()(I()(n),"_deferredInvalidateRowIndex",null),v()(I()(n),"_recomputeScrollLeftFlag",!1),v()(I()(n),"_recomputeScrollTopFlag",!1),v()(I()(n),"_horizontalScrollBarSize",0),v()(I()(n),"_verticalScrollBarSize",0),v()(I()(n),"_scrollbarPresenceChanged",!1),v()(I()(n),"_scrollingContainer",void 0),v()(I()(n),"_childrenToDisplay",void 0),v()(I()(n),"_columnStartIndex",void 0),v()(I()(n),"_columnStopIndex",void 0),v()(I()(n),"_rowStartIndex",void 0),v()(I()(n),"_rowStopIndex",void 0),v()(I()(n),"_renderedColumnStartIndex",0),v()(I()(n),"_renderedColumnStopIndex",0),v()(I()(n),"_renderedRowStartIndex",0),v()(I()(n),"_renderedRowStopIndex",0),v()(I()(n),"_initialScrollTop",void 0),v()(I()(n),"_initialScrollLeft",void 0),v()(I()(n),"_disablePointerEventsTimeoutId",void 0),v()(I()(n),"_styleCache",{}),v()(I()(n),"_cellCache",{}),v()(I()(n),"_debounceScrollEndedCallback",(function(){n._disablePointerEventsTimeoutId=null,n.setState({isScrolling:!1,needToResetStyleCache:!1})})),v()(I()(n),"_invokeOnGridRenderedHelper",(function(){var t=n.props.onSectionRendered;n._onGridRenderedMemoizer({callback:t,indices:{columnOverscanStartIndex:n._columnStartIndex,columnOverscanStopIndex:n._columnStopIndex,columnStartIndex:n._renderedColumnStartIndex,columnStopIndex:n._renderedColumnStopIndex,rowOverscanStartIndex:n._rowStartIndex,rowOverscanStopIndex:n._rowStopIndex,rowStartIndex:n._renderedRowStartIndex,rowStopIndex:n._renderedRowStopIndex}})})),v()(I()(n),"_setScrollingContainerRef",(function(t){n._scrollingContainer=t})),v()(I()(n),"_onScroll",(function(t){t.target===n._scrollingContainer&&n.handleScrollEvent(t.target)}));var r=new U({cellCount:t.columnCount,cellSizeGetter:function(n){return e._wrapSizeGetter(t.columnWidth)(n)},estimatedCellSize:e._getEstimatedColumnSize(t)}),i=new U({cellCount:t.rowCount,cellSizeGetter:function(n){return e._wrapSizeGetter(t.rowHeight)(n)},estimatedCellSize:e._getEstimatedRowSize(t)});return n.state={instanceProps:{columnSizeAndPositionManager:r,rowSizeAndPositionManager:i,prevColumnWidth:t.columnWidth,prevRowHeight:t.rowHeight,prevColumnCount:t.columnCount,prevRowCount:t.rowCount,prevIsScrolling:!0===t.isScrolling,prevScrollToColumn:t.scrollToColumn,prevScrollToRow:t.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:1,scrollDirectionVertical:1,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},t.scrollToRow>0&&(n._initialScrollTop=n._getCalculatedScrollTop(t,n.state)),t.scrollToColumn>0&&(n._initialScrollLeft=n._getCalculatedScrollLeft(t,n.state)),n}return C()(e,t),u()(e,[{key:"getOffsetForCell",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.alignment,n=void 0===e?this.props.scrollToAlignment:e,r=t.columnIndex,i=void 0===r?this.props.scrollToColumn:r,o=t.rowIndex,a=void 0===o?this.props.scrollToRow:o,A=J({},this.props,{scrollToAlignment:n,scrollToColumn:i,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(A),scrollTop:this._getCalculatedScrollTop(A)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(t){var e=t.scrollLeft,n=void 0===e?0:e,r=t.scrollTop,i=void 0===r?0:r;if(!(i<0)){this._debounceScrollEnded();var o=this.props,a=o.autoHeight,A=o.autoWidth,s=o.height,c=o.width,u=this.state.instanceProps,l=u.scrollbarSize,g=u.rowSizeAndPositionManager.getTotalSize(),f=u.columnSizeAndPositionManager.getTotalSize(),h=Math.min(Math.max(0,f-c+l),n),d=Math.min(Math.max(0,g-s+l),i);if(this.state.scrollLeft!==h||this.state.scrollTop!==d){var I={isScrolling:!0,scrollDirectionHorizontal:h!==this.state.scrollLeft?h>this.state.scrollLeft?1:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:d!==this.state.scrollTop?d>this.state.scrollTop?1:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:H};a||(I.scrollTop=d),A||(I.scrollLeft=h),I.needToResetStyleCache=!1,this.setState(I)}this._invokeOnScrollMemoizer({scrollLeft:h,scrollTop:d,totalColumnsWidth:f,totalRowsHeight:g})}}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,n=t.rowIndex;this._deferredInvalidateColumnIndex="number"===typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,e):e,this._deferredInvalidateRowIndex="number"===typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,n):n}},{key:"measureAllCells",value:function(){var t=this.props,e=t.columnCount,n=t.rowCount,r=this.state.instanceProps;r.columnSizeAndPositionManager.getSizeAndPositionOfCell(e-1),r.rowSizeAndPositionManager.getSizeAndPositionOfCell(n-1)}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r,o=this.props,a=o.scrollToColumn,A=o.scrollToRow,s=this.state.instanceProps;s.columnSizeAndPositionManager.resetCell(n),s.rowSizeAndPositionManager.resetCell(i),this._recomputeScrollLeftFlag=a>=0&&(1===this.state.scrollDirectionHorizontal?n<=a:n>=a),this._recomputeScrollTopFlag=A>=0&&(1===this.state.scrollDirectionVertical?i<=A:i>=A),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(t){var e=t.columnIndex,n=t.rowIndex,r=this.props.columnCount,i=this.props;r>1&&void 0!==e&&this._updateScrollLeftForScrollToColumn(J({},i,{scrollToColumn:e})),void 0!==n&&this._updateScrollTopForScrollToRow(J({},i,{scrollToRow:n}))}},{key:"componentDidMount",value:function(){var t=this.props,n=t.getScrollbarSize,r=t.height,i=t.scrollLeft,o=t.scrollToColumn,a=t.scrollTop,A=t.scrollToRow,s=t.width,c=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),c.scrollbarSizeMeasured||this.setState((function(t){var e=J({},t,{needToResetStyleCache:!1});return e.instanceProps.scrollbarSize=n(),e.instanceProps.scrollbarSizeMeasured=!0,e})),"number"===typeof i&&i>=0||"number"===typeof a&&a>=0){var u=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:i,scrollTop:a});u&&(u.needToResetStyleCache=!1,this.setState(u))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var l=r>0&&s>0;o>=0&&l&&this._updateScrollLeftForScrollToColumn(),A>=0&&l&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:i||0,scrollTop:a||0,totalColumnsWidth:c.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:c.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(t,e){var n=this,r=this.props,i=r.autoHeight,o=r.autoWidth,a=r.columnCount,A=r.height,s=r.rowCount,c=r.scrollToAlignment,u=r.scrollToColumn,l=r.scrollToRow,g=r.width,f=this.state,h=f.scrollLeft,d=f.scrollPositionChangeReason,I=f.scrollTop,p=f.instanceProps;this._handleInvalidatedGridSize();var C=a>0&&0===t.columnCount||s>0&&0===t.rowCount;d===Y&&(!o&&h>=0&&(h!==this._scrollingContainer.scrollLeft||C)&&(this._scrollingContainer.scrollLeft=h),!i&&I>=0&&(I!==this._scrollingContainer.scrollTop||C)&&(this._scrollingContainer.scrollTop=I));var y=(0===t.width||0===t.height)&&A>0&&g>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):k({cellSizeAndPositionManager:p.columnSizeAndPositionManager,previousCellsCount:t.columnCount,previousCellSize:t.columnWidth,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToColumn,previousSize:t.width,scrollOffset:h,scrollToAlignment:c,scrollToIndex:u,size:g,sizeJustIncreasedFromZero:y,updateScrollIndexCallback:function(){return n._updateScrollLeftForScrollToColumn(n.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):k({cellSizeAndPositionManager:p.rowSizeAndPositionManager,previousCellsCount:t.rowCount,previousCellSize:t.rowHeight,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToRow,previousSize:t.height,scrollOffset:I,scrollToAlignment:c,scrollToIndex:l,size:A,sizeJustIncreasedFromZero:y,updateScrollIndexCallback:function(){return n._updateScrollTopForScrollToRow(n.props)}}),this._invokeOnGridRenderedHelper(),h!==e.scrollLeft||I!==e.scrollTop){var v=p.rowSizeAndPositionManager.getTotalSize(),B=p.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:h,scrollTop:I,totalColumnsWidth:B,totalRowsHeight:v})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&Z(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,e=t.autoContainerWidth,n=t.autoHeight,r=t.autoWidth,o=t.className,a=t.containerProps,A=t.containerRole,s=t.containerStyle,c=t.height,u=t.id,l=t.noContentRenderer,g=t.role,f=t.style,h=t.tabIndex,d=t.width,I=this.state,p=I.instanceProps,C=I.needToResetStyleCache,y=this._isScrolling(),v={boxSizing:"border-box",direction:"ltr",height:n?"auto":c,position:"relative",width:r?"auto":d,WebkitOverflowScrolling:"touch",willChange:"transform"};C&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var B=p.columnSizeAndPositionManager.getTotalSize(),m=p.rowSizeAndPositionManager.getTotalSize(),Q=m>c?p.scrollbarSize:0,F=B>d?p.scrollbarSize:0;F===this._horizontalScrollBarSize&&Q===this._verticalScrollBarSize||(this._horizontalScrollBarSize=F,this._verticalScrollBarSize=Q,this._scrollbarPresenceChanged=!0),v.overflowX=B+Q<=d?"hidden":"auto",v.overflowY=m+F<=c?"hidden":"auto";var w=this._childrenToDisplay,S=0===w.length&&c>0&&d>0;return i.createElement("div",b()({ref:this._setScrollingContainerRef},a,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:Object(E.a)("ReactVirtualized__Grid",o),id:u,onScroll:this._onScroll,role:g,style:J({},v,{},f),tabIndex:h}),w.length>0&&i.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:A,style:J({width:e?"auto":B,height:m,maxWidth:B,maxHeight:m,overflow:"hidden",pointerEvents:y?"none":"",position:"relative"},s)},w),S&&l())}},{key:"_calculateChildrenToRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,n=t.cellRenderer,r=t.cellRangeRenderer,i=t.columnCount,o=t.deferredMeasurementCache,a=t.height,A=t.overscanColumnCount,s=t.overscanIndicesGetter,c=t.overscanRowCount,u=t.rowCount,l=t.width,g=t.isScrollingOptOut,f=e.scrollDirectionHorizontal,h=e.scrollDirectionVertical,d=e.instanceProps,I=this._initialScrollTop>0?this._initialScrollTop:e.scrollTop,p=this._initialScrollLeft>0?this._initialScrollLeft:e.scrollLeft,C=this._isScrolling(t,e);if(this._childrenToDisplay=[],a>0&&l>0){var y=d.columnSizeAndPositionManager.getVisibleCellRange({containerSize:l,offset:p}),v=d.rowSizeAndPositionManager.getVisibleCellRange({containerSize:a,offset:I}),B=d.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:l,offset:p}),m=d.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:a,offset:I});this._renderedColumnStartIndex=y.start,this._renderedColumnStopIndex=y.stop,this._renderedRowStartIndex=v.start,this._renderedRowStopIndex=v.stop;var b=s({direction:"horizontal",cellCount:i,overscanCellsCount:A,scrollDirection:f,startIndex:"number"===typeof y.start?y.start:0,stopIndex:"number"===typeof y.stop?y.stop:-1}),E=s({direction:"vertical",cellCount:u,overscanCellsCount:c,scrollDirection:h,startIndex:"number"===typeof v.start?v.start:0,stopIndex:"number"===typeof v.stop?v.stop:-1}),Q=b.overscanStartIndex,F=b.overscanStopIndex,w=E.overscanStartIndex,S=E.overscanStopIndex;if(o){if(!o.hasFixedHeight())for(var R=w;R<=S;R++)if(!o.has(R,0)){Q=0,F=i-1;break}if(!o.hasFixedWidth())for(var U=Q;U<=F;U++)if(!o.has(0,U)){w=0,S=u-1;break}}this._childrenToDisplay=r({cellCache:this._cellCache,cellRenderer:n,columnSizeAndPositionManager:d.columnSizeAndPositionManager,columnStartIndex:Q,columnStopIndex:F,deferredMeasurementCache:o,horizontalOffsetAdjustment:B,isScrolling:C,isScrollingOptOut:g,parent:this,rowSizeAndPositionManager:d.rowSizeAndPositionManager,rowStartIndex:w,rowStopIndex:S,scrollLeft:p,scrollTop:I,styleCache:this._styleCache,verticalOffsetAdjustment:m,visibleColumnIndices:y,visibleRowIndices:v}),this._columnStartIndex=Q,this._columnStopIndex=F,this._rowStartIndex=w,this._rowStopIndex=S}}},{key:"_debounceScrollEnded",value:function(){var t=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&Z(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=P(this._debounceScrollEndedCallback,t)}},{key:"_handleInvalidatedGridSize",value:function(){if("number"===typeof this._deferredInvalidateColumnIndex&&"number"===typeof this._deferredInvalidateRowIndex){var t=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:e})}}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,n=t.scrollLeft,r=t.scrollTop,i=t.totalColumnsWidth,o=t.totalRowsHeight;this._onScrollMemoizer({callback:function(t){var n=t.scrollLeft,r=t.scrollTop,a=e.props,A=a.height;(0,a.onScroll)({clientHeight:A,clientWidth:a.width,scrollHeight:o,scrollLeft:n,scrollTop:r,scrollWidth:i})},indices:{scrollLeft:n,scrollTop:r}})}},{key:"_isScrolling",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(t,"isScrolling")?Boolean(t.isScrolling):Boolean(e.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var t=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,t({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(t){var n=t.scrollLeft,r=t.scrollTop,i=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:n,scrollTop:r});i&&(i.needToResetStyleCache=!1,this.setState(i))}},{key:"_getCalculatedScrollLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollLeft(t,n)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e._getScrollLeftForScrollToColumnStateUpdate(t,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}},{key:"_getCalculatedScrollTop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollTop(t,n)}},{key:"_resetStyleCache",value:function(){var t=this._styleCache,e=this._cellCache,n=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var r=this._rowStartIndex;r<=this._rowStopIndex;r++)for(var i=this._columnStartIndex;i<=this._columnStopIndex;i++){var o="".concat(r,"-").concat(i);this._styleCache[o]=t[o],n&&(this._cellCache[o]=e[o])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e._getScrollTopForScrollToRowStateUpdate(t,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}}],[{key:"getDerivedStateFromProps",value:function(t,n){var r={};0===t.columnCount&&0!==n.scrollLeft||0===t.rowCount&&0!==n.scrollTop?(r.scrollLeft=0,r.scrollTop=0):(t.scrollLeft!==n.scrollLeft&&t.scrollToColumn<0||t.scrollTop!==n.scrollTop&&t.scrollToRow<0)&&Object.assign(r,e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}));var i,o,a=n.instanceProps;return r.needToResetStyleCache=!1,t.columnWidth===a.prevColumnWidth&&t.rowHeight===a.prevRowHeight||(r.needToResetStyleCache=!0),a.columnSizeAndPositionManager.configure({cellCount:t.columnCount,estimatedCellSize:e._getEstimatedColumnSize(t),cellSizeGetter:e._wrapSizeGetter(t.columnWidth)}),a.rowSizeAndPositionManager.configure({cellCount:t.rowCount,estimatedCellSize:e._getEstimatedRowSize(t),cellSizeGetter:e._wrapSizeGetter(t.rowHeight)}),0!==a.prevColumnCount&&0!==a.prevRowCount||(a.prevColumnCount=0,a.prevRowCount=0),t.autoHeight&&!1===t.isScrolling&&!0===a.prevIsScrolling&&Object.assign(r,{isScrolling:!1}),Q({cellCount:a.prevColumnCount,cellSize:"number"===typeof a.prevColumnWidth?a.prevColumnWidth:null,computeMetadataCallback:function(){return a.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.columnCount,nextCellSize:"number"===typeof t.columnWidth?t.columnWidth:null,nextScrollToIndex:t.scrollToColumn,scrollToIndex:a.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){i=e._getScrollLeftForScrollToColumnStateUpdate(t,n)}}),Q({cellCount:a.prevRowCount,cellSize:"number"===typeof a.prevRowHeight?a.prevRowHeight:null,computeMetadataCallback:function(){return a.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.rowCount,nextCellSize:"number"===typeof t.rowHeight?t.rowHeight:null,nextScrollToIndex:t.scrollToRow,scrollToIndex:a.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){o=e._getScrollTopForScrollToRowStateUpdate(t,n)}}),a.prevColumnCount=t.columnCount,a.prevColumnWidth=t.columnWidth,a.prevIsScrolling=!0===t.isScrolling,a.prevRowCount=t.rowCount,a.prevRowHeight=t.rowHeight,a.prevScrollToColumn=t.scrollToColumn,a.prevScrollToRow=t.scrollToRow,a.scrollbarSize=t.getScrollbarSize(),void 0===a.scrollbarSize?(a.scrollbarSizeMeasured=!1,a.scrollbarSize=0):a.scrollbarSizeMeasured=!0,r.instanceProps=a,J({},r,{},i,{},o)}},{key:"_getEstimatedColumnSize",value:function(t){return"number"===typeof t.columnWidth?t.columnWidth:t.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(t){return"number"===typeof t.rowHeight?t.rowHeight:t.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(t){var e=t.prevState,n=t.scrollLeft,r=t.scrollTop,i={scrollPositionChangeReason:Y};return"number"===typeof n&&n>=0&&(i.scrollDirectionHorizontal=n>e.scrollLeft?1:-1,i.scrollLeft=n),"number"===typeof r&&r>=0&&(i.scrollDirectionVertical=r>e.scrollTop?1:-1,i.scrollTop=r),"number"===typeof n&&n>=0&&n!==e.scrollLeft||"number"===typeof r&&r>=0&&r!==e.scrollTop?i:{}}},{key:"_wrapSizeGetter",value:function(t){return"function"===typeof t?t:function(){return t}}},{key:"_getCalculatedScrollLeft",value:function(t,e){var n=t.columnCount,r=t.height,i=t.scrollToAlignment,o=t.scrollToColumn,a=t.width,A=e.scrollLeft,s=e.instanceProps;if(n>0){var c=n-1,u=o<0?c:Math.min(c,o),l=s.rowSizeAndPositionManager.getTotalSize(),g=s.scrollbarSizeMeasured&&l>r?s.scrollbarSize:0;return s.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:a-g,currentOffset:A,targetIndex:u})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(t,n){var r=n.scrollLeft,i=e._getCalculatedScrollLeft(t,n);return"number"===typeof i&&i>=0&&r!==i?e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:i,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(t,e){var n=t.height,r=t.rowCount,i=t.scrollToAlignment,o=t.scrollToRow,a=t.width,A=e.scrollTop,s=e.instanceProps;if(r>0){var c=r-1,u=o<0?c:Math.min(c,o),l=s.columnSizeAndPositionManager.getTotalSize(),g=s.scrollbarSizeMeasured&&l>a?s.scrollbarSize:0;return s.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:n-g,currentOffset:A,targetIndex:u})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(t,n){var r=n.scrollTop,i=e._getCalculatedScrollTop(t,n);return"number"===typeof i&&i>=0&&r!==i?e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:-1,scrollTop:i}):{}}}]),e}(i.PureComponent),v()(_,"propTypes",null),M);v()(X,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:function(t){for(var e=t.cellCache,n=t.cellRenderer,r=t.columnSizeAndPositionManager,i=t.columnStartIndex,o=t.columnStopIndex,a=t.deferredMeasurementCache,A=t.horizontalOffsetAdjustment,s=t.isScrolling,c=t.isScrollingOptOut,u=t.parent,l=t.rowSizeAndPositionManager,g=t.rowStartIndex,f=t.rowStopIndex,h=t.styleCache,d=t.verticalOffsetAdjustment,I=t.visibleColumnIndices,p=t.visibleRowIndices,C=[],y=r.areOffsetsAdjusted()||l.areOffsetsAdjusted(),v=!s&&!y,B=g;B<=f;B++)for(var m=l.getSizeAndPositionOfCell(B),b=i;b<=o;b++){var E=r.getSizeAndPositionOfCell(b),Q=b>=I.start&&b<=I.stop&&B>=p.start&&B<=p.stop,F="".concat(B,"-").concat(b),w=void 0;v&&h[F]?w=h[F]:a&&!a.has(B,b)?w={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(w={height:m.size,left:E.offset+A,position:"absolute",top:m.offset+d,width:E.size},h[F]=w);var S={columnIndex:b,isScrolling:s,isVisible:Q,key:F,parent:u,rowIndex:B,style:w},R=void 0;!c&&!s||A||d?R=n(S):(e[F]||(e[F]=n(S)),R=e[F]),null!=R&&!1!==R&&C.push(R)}return C},containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:G,noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:function(t){var e=t.cellCount,n=t.overscanCellsCount,r=t.scrollDirection,i=t.startIndex,o=t.stopIndex;return 1===r?{overscanStartIndex:Math.max(0,i),overscanStopIndex:Math.min(e-1,o+n)}:{overscanStartIndex:Math.max(0,i-n),overscanStopIndex:Math.min(e-1,o)}},overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1}),Object(B.a)(X);var z=X;function K(t){var e=t.cellCount,n=t.overscanCellsCount,r=t.scrollDirection,i=t.startIndex,o=t.stopIndex;return n=Math.max(1,n),1===r?{overscanStartIndex:Math.max(0,i-1),overscanStopIndex:Math.min(e-1,o+n)}:{overscanStartIndex:Math.max(0,i-n),overscanStopIndex:Math.min(e-1,o+1)}}var q,$;function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var et=($=q=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"state",{scrollToColumn:0,scrollToRow:0,instanceProps:{prevScrollToColumn:0,prevScrollToRow:0}}),v()(I()(n),"_columnStartIndex",0),v()(I()(n),"_columnStopIndex",0),v()(I()(n),"_rowStartIndex",0),v()(I()(n),"_rowStopIndex",0),v()(I()(n),"_onKeyDown",(function(t){var e=n.props,r=e.columnCount,i=e.disabled,o=e.mode,a=e.rowCount;if(!i){var A=n._getScrollState(),s=A.scrollToColumn,c=A.scrollToRow,u=n._getScrollState(),l=u.scrollToColumn,g=u.scrollToRow;switch(t.key){case"ArrowDown":g="cells"===o?Math.min(g+1,a-1):Math.min(n._rowStopIndex+1,a-1);break;case"ArrowLeft":l="cells"===o?Math.max(l-1,0):Math.max(n._columnStartIndex-1,0);break;case"ArrowRight":l="cells"===o?Math.min(l+1,r-1):Math.min(n._columnStopIndex+1,r-1);break;case"ArrowUp":g="cells"===o?Math.max(g-1,0):Math.max(n._rowStartIndex-1,0)}l===s&&g===c||(t.preventDefault(),n._updateScrollState({scrollToColumn:l,scrollToRow:g}))}})),v()(I()(n),"_onSectionRendered",(function(t){var e=t.columnStartIndex,r=t.columnStopIndex,i=t.rowStartIndex,o=t.rowStopIndex;n._columnStartIndex=e,n._columnStopIndex=r,n._rowStartIndex=i,n._rowStopIndex=o})),n}return C()(e,t),u()(e,[{key:"setScrollIndexes",value:function(t){var e=t.scrollToColumn,n=t.scrollToRow;this.setState({scrollToRow:n,scrollToColumn:e})}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.children,r=this._getScrollState(),o=r.scrollToColumn,a=r.scrollToRow;return i.createElement("div",{className:e,onKeyDown:this._onKeyDown},n({onSectionRendered:this._onSectionRendered,scrollToColumn:o,scrollToRow:a}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(t){var e=t.scrollToColumn,n=t.scrollToRow,r=this.props,i=r.isControlled,o=r.onScrollToChange;"function"===typeof o&&o({scrollToColumn:e,scrollToRow:n}),i||this.setState({scrollToColumn:e,scrollToRow:n})}}],[{key:"getDerivedStateFromProps",value:function(t,e){return t.isControlled?{}:t.scrollToColumn!==e.instanceProps.prevScrollToColumn||t.scrollToRow!==e.instanceProps.prevScrollToRow?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tt(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{scrollToColumn:t.scrollToColumn,scrollToRow:t.scrollToRow,instanceProps:{prevScrollToColumn:t.scrollToColumn,prevScrollToRow:t.scrollToRow}}):{}}}]),e}(i.PureComponent),v()(q,"propTypes",null),$);v()(et,"defaultProps",{disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0}),Object(B.a)(et);var nt,rt,it=n(786);function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var At=(rt=nt=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"state",{height:n.props.defaultHeight||0,width:n.props.defaultWidth||0}),v()(I()(n),"_parentNode",void 0),v()(I()(n),"_autoSizer",void 0),v()(I()(n),"_window",void 0),v()(I()(n),"_detectElementResize",void 0),v()(I()(n),"_onResize",(function(){var t=n.props,e=t.disableHeight,r=t.disableWidth,i=t.onResize;if(n._parentNode){var o=n._parentNode.offsetHeight||0,a=n._parentNode.offsetWidth||0,A=(n._window||window).getComputedStyle(n._parentNode)||{},s=parseInt(A.paddingLeft,10)||0,c=parseInt(A.paddingRight,10)||0,u=parseInt(A.paddingTop,10)||0,l=parseInt(A.paddingBottom,10)||0,g=o-u-l,f=a-s-c;(!e&&n.state.height!==g||!r&&n.state.width!==f)&&(n.setState({height:o-u-l,width:a-s-c}),i({height:o,width:a}))}})),v()(I()(n),"_setRef",(function(t){n._autoSizer=t})),n}return C()(e,t),u()(e,[{key:"componentDidMount",value:function(){var t=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=Object(it.a)(t,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var t=this.props,e=t.children,n=t.className,r=t.disableHeight,o=t.disableWidth,a=t.style,A=this.state,s=A.height,c=A.width,u={overflow:"visible"},l={};return r||(u.height=0,l.height=s),o||(u.width=0,l.width=c),i.createElement("div",{className:n,ref:this._setRef,style:at({},u,{},a)},e(l))}}]),e}(i.Component),v()(nt,"propTypes",null),rt);v()(At,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}});var st,ct,ut=n(65),lt=(ct=st=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"_child",void 0),v()(I()(n),"_measure",(function(){var t=n.props,e=t.cache,r=t.columnIndex,i=void 0===r?0:r,o=t.parent,a=t.rowIndex,A=void 0===a?n.props.index||0:a,s=n._getCellMeasurements(),c=s.height,u=s.width;c===e.getHeight(A,i)&&u===e.getWidth(A,i)||(e.set(A,i,u,c),o&&"function"===typeof o.recomputeGridSize&&o.recomputeGridSize({columnIndex:i,rowIndex:A}))})),v()(I()(n),"_registerChild",(function(t){!t||t instanceof Element||console.warn("CellMeasurer registerChild expects to be passed Element or null"),n._child=t,t&&n._maybeMeasureCell()})),n}return C()(e,t),u()(e,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var t=this.props.children;return"function"===typeof t?t({measure:this._measure,registerChild:this._registerChild}):t}},{key:"_getCellMeasurements",value:function(){var t=this.props.cache,e=this._child||Object(ut.findDOMNode)(this);if(e&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.HTMLElement){var n=e.style.width,r=e.style.height;t.hasFixedWidth()||(e.style.width="auto"),t.hasFixedHeight()||(e.style.height="auto");var i=Math.ceil(e.offsetHeight),o=Math.ceil(e.offsetWidth);return n&&(e.style.width=n),r&&(e.style.height=r),{height:i,width:o}}return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var t=this.props,e=t.cache,n=t.columnIndex,r=void 0===n?0:n,i=t.parent,o=t.rowIndex,a=void 0===o?this.props.index||0:o;if(!e.has(a,r)){var A=this._getCellMeasurements(),s=A.height,c=A.width;e.set(a,r,c,s),i&&"function"===typeof i.invalidateCellSizeAfterRender&&i.invalidateCellSizeAfterRender({columnIndex:r,rowIndex:a})}}}]),e}(i.PureComponent),v()(st,"propTypes",null),ct);v()(lt,"__internalCellMeasurerFlag",!1);function gt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ft(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gt(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ht="observed",dt="requested",It=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"state",{isScrolling:!1,scrollLeft:0,scrollTop:0}),v()(I()(n),"_calculateSizeAndPositionDataOnNextUpdate",!1),v()(I()(n),"_onSectionRenderedMemoizer",x()),v()(I()(n),"_onScrollMemoizer",x(!1)),v()(I()(n),"_invokeOnSectionRenderedHelper",(function(){var t=n.props,e=t.cellLayoutManager,r=t.onSectionRendered;n._onSectionRenderedMemoizer({callback:r,indices:{indices:e.getLastRenderedIndices()}})})),v()(I()(n),"_setScrollingContainerRef",(function(t){n._scrollingContainer=t})),v()(I()(n),"_updateScrollPositionForScrollToCell",(function(){var t=n.props,e=t.cellLayoutManager,r=t.height,i=t.scrollToAlignment,o=t.scrollToCell,a=t.width,A=n.state,s=A.scrollLeft,c=A.scrollTop;if(o>=0){var u=e.getScrollPositionForCell({align:i,cellIndex:o,height:r,scrollLeft:s,scrollTop:c,width:a});u.scrollLeft===s&&u.scrollTop===c||n._setScrollPosition(u)}})),v()(I()(n),"_onScroll",(function(t){if(t.target===n._scrollingContainer){n._enablePointerEventsAfterDelay();var e=n.props,r=e.cellLayoutManager,i=e.height,o=e.isScrollingChange,a=e.width,A=n._scrollbarSize,s=r.getTotalSize(),c=s.height,u=s.width,l=Math.max(0,Math.min(u-a+A,t.target.scrollLeft)),g=Math.max(0,Math.min(c-i+A,t.target.scrollTop));if(n.state.scrollLeft!==l||n.state.scrollTop!==g){var f=t.cancelable?ht:dt;n.state.isScrolling||o(!0),n.setState({isScrolling:!0,scrollLeft:l,scrollPositionChangeReason:f,scrollTop:g})}n._invokeOnScrollMemoizer({scrollLeft:l,scrollTop:g,totalWidth:u,totalHeight:c})}})),n._scrollbarSize=G(),void 0===n._scrollbarSize?(n._scrollbarSizeMeasured=!1,n._scrollbarSize=0):n._scrollbarSizeMeasured=!0,n}return C()(e,t),u()(e,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.cellLayoutManager,n=t.scrollLeft,r=t.scrollToCell,i=t.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=G(),this._scrollbarSizeMeasured=!0,this.setState({})),r>=0?this._updateScrollPositionForScrollToCell():(n>=0||i>=0)&&this._setScrollPosition({scrollLeft:n,scrollTop:i}),this._invokeOnSectionRenderedHelper();var o=e.getTotalSize(),a=o.height,A=o.width;this._invokeOnScrollMemoizer({scrollLeft:n||0,scrollTop:i||0,totalHeight:a,totalWidth:A})}},{key:"componentDidUpdate",value:function(t,e){var n=this.props,r=n.height,i=n.scrollToAlignment,o=n.scrollToCell,a=n.width,A=this.state,s=A.scrollLeft,c=A.scrollPositionChangeReason,u=A.scrollTop;c===dt&&(s>=0&&s!==e.scrollLeft&&s!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=s),u>=0&&u!==e.scrollTop&&u!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=u)),r===t.height&&i===t.scrollToAlignment&&o===t.scrollToCell&&a===t.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,e=t.autoHeight,n=t.cellCount,r=t.cellLayoutManager,o=t.className,a=t.height,A=t.horizontalOverscanSize,s=t.id,c=t.noContentRenderer,u=t.style,l=t.verticalOverscanSize,g=t.width,f=this.state,h=f.isScrolling,d=f.scrollLeft,I=f.scrollTop;(this._lastRenderedCellCount!==n||this._lastRenderedCellLayoutManager!==r||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=n,this._lastRenderedCellLayoutManager=r,this._calculateSizeAndPositionDataOnNextUpdate=!1,r.calculateSizeAndPositionData());var p=r.getTotalSize(),C=p.height,y=p.width,v=Math.max(0,d-A),B=Math.max(0,I-l),m=Math.min(y,d+g+A),b=Math.min(C,I+a+l),Q=a>0&&g>0?r.cellRenderers({height:b-B,isScrolling:h,width:m-v,x:v,y:B}):[],F={boxSizing:"border-box",direction:"ltr",height:e?"auto":a,position:"relative",WebkitOverflowScrolling:"touch",width:g,willChange:"transform"},w=C>a?this._scrollbarSize:0,S=y>g?this._scrollbarSize:0;return F.overflowX=y+w<=g?"hidden":"auto",F.overflowY=C+S<=a?"hidden":"auto",i.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Object(E.a)("ReactVirtualized__Collection",o),id:s,onScroll:this._onScroll,role:"grid",style:ft({},F,{},u),tabIndex:0},n>0&&i.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:C,maxHeight:C,maxWidth:y,overflow:"hidden",pointerEvents:h?"none":"",width:y}},Q),0===n&&c())}},{key:"_enablePointerEventsAfterDelay",value:function(){var t=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout((function(){(0,t.props.isScrollingChange)(!1),t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1})}),150)}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,n=t.scrollLeft,r=t.scrollTop,i=t.totalHeight,o=t.totalWidth;this._onScrollMemoizer({callback:function(t){var n=t.scrollLeft,r=t.scrollTop,a=e.props,A=a.height;(0,a.onScroll)({clientHeight:A,clientWidth:a.width,scrollHeight:i,scrollLeft:n,scrollTop:r,scrollWidth:o})},indices:{scrollLeft:n,scrollTop:r}})}},{key:"_setScrollPosition",value:function(t){var e=t.scrollLeft,n=t.scrollTop,r={scrollPositionChangeReason:dt};e>=0&&(r.scrollLeft=e),n>=0&&(r.scrollTop=n),(e>=0&&e!==this.state.scrollLeft||n>=0&&n!==this.state.scrollTop)&&this.setState(r)}}],[{key:"getDerivedStateFromProps",value:function(t,e){return 0!==t.cellCount||0===e.scrollLeft&&0===e.scrollTop?t.scrollLeft!==e.scrollLeft||t.scrollTop!==e.scrollTop?{scrollLeft:null!=t.scrollLeft?t.scrollLeft:e.scrollLeft,scrollTop:null!=t.scrollTop?t.scrollTop:e.scrollTop,scrollPositionChangeReason:dt}:null:{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:dt}}}]),e}(i.PureComponent);v()(It,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0}),It.propTypes={},Object(B.a)(It);var pt=It,Ct=function(){function t(e){var n=e.height,r=e.width,i=e.x,o=e.y;s()(this,t),this.height=n,this.width=r,this.x=i,this.y=o,this._indexMap={},this._indices=[]}return u()(t,[{key:"addCellIndex",value:function(t){var e=t.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}]),t}(),yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;s()(this,t),this._sectionSize=e,this._cellMetadata=[],this._sections={}}return u()(t,[{key:"getCellIndices",value:function(t){var e=t.height,n=t.width,r=t.x,i=t.y,o={};return this.getSections({height:e,width:n,x:r,y:i}).forEach((function(t){return t.getCellIndices().forEach((function(t){o[t]=t}))})),Object.keys(o).map((function(t){return o[t]}))}},{key:"getCellMetadata",value:function(t){var e=t.index;return this._cellMetadata[e]}},{key:"getSections",value:function(t){for(var e=t.height,n=t.width,r=t.x,i=t.y,o=Math.floor(r/this._sectionSize),a=Math.floor((r+n-1)/this._sectionSize),A=Math.floor(i/this._sectionSize),s=Math.floor((i+e-1)/this._sectionSize),c=[],u=o;u<=a;u++)for(var l=A;l<=s;l++){var g="".concat(u,".").concat(l);this._sections[g]||(this._sections[g]=new Ct({height:this._sectionSize,width:this._sectionSize,x:u*this._sectionSize,y:l*this._sectionSize})),c.push(this._sections[g])}return c}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var t=this;return Object.keys(this._sections).map((function(e){return t._sections[e].toString()}))}},{key:"registerCell",value:function(t){var e=t.cellMetadatum,n=t.index;this._cellMetadata[n]=e,this.getSections(e).forEach((function(t){return t.addCellIndex({index:n})}))}}]),t}();function vt(t){var e=t.align,n=void 0===e?"auto":e,r=t.cellOffset,i=t.cellSize,o=t.containerSize,a=t.currentOffset,A=r,s=A-o+i;switch(n){case"start":return A;case"end":return s;case"center":return A-(o-i)/2;default:return Math.max(s,Math.min(A,a))}}var Bt=function(t){function e(t,n){var r;return s()(this,e),(r=g()(this,h()(e).call(this,t,n)))._cellMetadata=[],r._lastRenderedCellIndices=[],r._cellCache=[],r._isScrollingChange=r._isScrollingChange.bind(I()(r)),r._setCollectionViewRef=r._setCollectionViewRef.bind(I()(r)),r}return C()(e,t),u()(e,[{key:"forceUpdate",value:function(){void 0!==this._collectionView&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var t=b()({},this.props);return i.createElement(pt,b()({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},t))}},{key:"calculateSizeAndPositionData",value:function(){var t=this.props,e=function(t){for(var e=t.cellCount,n=t.cellSizeAndPositionGetter,r=t.sectionSize,i=[],o=new yt(r),a=0,A=0,s=0;s<e;s++){var c=n({index:s});if(null==c.height||isNaN(c.height)||null==c.width||isNaN(c.width)||null==c.x||isNaN(c.x)||null==c.y||isNaN(c.y))throw Error("Invalid metadata returned for cell ".concat(s,":\n        x:").concat(c.x,", y:").concat(c.y,", width:").concat(c.width,", height:").concat(c.height));a=Math.max(a,c.y+c.height),A=Math.max(A,c.x+c.width),i[s]=c,o.registerCell({cellMetadatum:c,index:s})}return{cellMetadata:i,height:a,sectionManager:o,width:A}}({cellCount:t.cellCount,cellSizeAndPositionGetter:t.cellSizeAndPositionGetter,sectionSize:t.sectionSize});this._cellMetadata=e.cellMetadata,this._sectionManager=e.sectionManager,this._height=e.height,this._width=e.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(t){var e=t.align,n=t.cellIndex,r=t.height,i=t.scrollLeft,o=t.scrollTop,a=t.width,A=this.props.cellCount;if(n>=0&&n<A){var s=this._cellMetadata[n];i=vt({align:e,cellOffset:s.x,cellSize:s.width,containerSize:a,currentOffset:i,targetIndex:n}),o=vt({align:e,cellOffset:s.y,cellSize:s.height,containerSize:r,currentOffset:o,targetIndex:n})}return{scrollLeft:i,scrollTop:o}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(t){var e=this,n=t.height,r=t.isScrolling,i=t.width,o=t.x,a=t.y,A=this.props,s=A.cellGroupRenderer,c=A.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:n,width:i,x:o,y:a}),s({cellCache:this._cellCache,cellRenderer:c,cellSizeAndPositionGetter:function(t){var n=t.index;return e._sectionManager.getCellMetadata({index:n})},indices:this._lastRenderedCellIndices,isScrolling:r})}},{key:"_isScrollingChange",value:function(t){t||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(t){this._collectionView=t}}]),e}(i.PureComponent);v()(Bt,"defaultProps",{"aria-label":"grid",cellGroupRenderer:function(t){var e=t.cellCache,n=t.cellRenderer,r=t.cellSizeAndPositionGetter,i=t.indices,o=t.isScrolling;return i.map((function(t){var i=r({index:t}),a={index:t,isScrolling:o,key:t,style:{height:i.height,left:i.x,position:"absolute",top:i.y,width:i.width}};return o?(t in e||(e[t]=n(a)),e[t]):n(a)})).filter((function(t){return!!t}))}}),Bt.propTypes={};var mt=function(t){function e(t,n){var r;return s()(this,e),(r=g()(this,h()(e).call(this,t,n)))._registerChild=r._registerChild.bind(I()(r)),r}return C()(e,t),u()(e,[{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.columnMaxWidth,r=e.columnMinWidth,i=e.columnCount,o=e.width;n===t.columnMaxWidth&&r===t.columnMinWidth&&i===t.columnCount&&o===t.width||this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var t=this.props,e=t.children,n=t.columnMaxWidth,r=t.columnMinWidth,i=t.columnCount,o=t.width,a=r||1,A=n?Math.min(n,o):o,s=o/i;return s=Math.max(a,s),s=Math.min(A,s),s=Math.floor(s),e({adjustedWidth:Math.min(o,s*i),columnWidth:s,getColumnWidth:function(){return s},registerChild:this._registerChild})}},{key:"_registerChild",value:function(t){if(t&&"function"!==typeof t.recomputeGridSize)throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=t,this._registeredChild&&this._registeredChild.recomputeGridSize()}}]),e}(i.PureComponent);mt.propTypes={};var bt=n(1096),Et=n.n(bt),Qt=function(t){function e(t,n){var r;return s()(this,e),(r=g()(this,h()(e).call(this,t,n)))._loadMoreRowsMemoizer=x(),r._onRowsRendered=r._onRowsRendered.bind(I()(r)),r._registerChild=r._registerChild.bind(I()(r)),r}return C()(e,t),u()(e,[{key:"resetLoadMoreRowsCache",value:function(t){this._loadMoreRowsMemoizer=x(),t&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){return(0,this.props.children)({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(t){var e=this,n=this.props.loadMoreRows;t.forEach((function(t){var r=n(t);r&&r.then((function(){(function(t){var e=t.lastRenderedStartIndex,n=t.lastRenderedStopIndex,r=t.startIndex,i=t.stopIndex;return!(r>n||i<e)})({lastRenderedStartIndex:e._lastRenderedStartIndex,lastRenderedStopIndex:e._lastRenderedStopIndex,startIndex:t.startIndex,stopIndex:t.stopIndex})&&e._registeredChild&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="function"===typeof t.recomputeGridSize?t.recomputeGridSize:t.recomputeRowHeights;n?n.call(t,e):t.forceUpdate()}(e._registeredChild,e._lastRenderedStartIndex)}))}))}},{key:"_onRowsRendered",value:function(t){var e=t.startIndex,n=t.stopIndex;this._lastRenderedStartIndex=e,this._lastRenderedStopIndex=n,this._doStuff(e,n)}},{key:"_doStuff",value:function(t,e){var n,r=this,i=this.props,o=i.isRowLoaded,a=i.minimumBatchSize,A=i.rowCount,s=i.threshold,c=function(t){for(var e=t.isRowLoaded,n=t.minimumBatchSize,r=t.rowCount,i=t.startIndex,o=t.stopIndex,a=[],A=null,s=null,c=i;c<=o;c++){e({index:c})?null!==s&&(a.push({startIndex:A,stopIndex:s}),A=s=null):(s=c,null===A&&(A=c))}if(null!==s){for(var u=Math.min(Math.max(s,A+n-1),r-1),l=s+1;l<=u&&!e({index:l});l++)s=l;a.push({startIndex:A,stopIndex:s})}if(a.length)for(var g=a[0];g.stopIndex-g.startIndex+1<n&&g.startIndex>0;){var f=g.startIndex-1;if(e({index:f}))break;g.startIndex=f}return a}({isRowLoaded:o,minimumBatchSize:a,rowCount:A,startIndex:Math.max(0,t-s),stopIndex:Math.min(A-1,e+s)}),u=(n=[]).concat.apply(n,Et()(c.map((function(t){return[t.startIndex,t.stopIndex]}))));this._loadMoreRowsMemoizer({callback:function(){r._loadUnloadedRanges(c)},indices:{squashedUnloadedRanges:u}})}},{key:"_registerChild",value:function(t){this._registeredChild=t}}]),e}(i.PureComponent);v()(Qt,"defaultProps",{minimumBatchSize:10,rowCount:0,threshold:15}),Qt.propTypes={};var Ft,wt,St=(wt=Ft=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"Grid",void 0),v()(I()(n),"_cellRenderer",(function(t){var e=t.parent,r=t.rowIndex,i=t.style,o=t.isScrolling,a=t.isVisible,A=t.key,s=n.props.rowRenderer,c=Object.getOwnPropertyDescriptor(i,"width");return c&&c.writable&&(i.width="100%"),s({index:r,style:i,isScrolling:o,isVisible:a,key:A,parent:e})})),v()(I()(n),"_setRef",(function(t){n.Grid=t})),v()(I()(n),"_onScroll",(function(t){var e=t.clientHeight,r=t.scrollHeight,i=t.scrollTop;(0,n.props.onScroll)({clientHeight:e,scrollHeight:r,scrollTop:i})})),v()(I()(n),"_onSectionRendered",(function(t){var e=t.rowOverscanStartIndex,r=t.rowOverscanStopIndex,i=t.rowStartIndex,o=t.rowStopIndex;(0,n.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:r,startIndex:i,stopIndex:o})})),n}return C()(e,t),u()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var e=t.alignment,n=t.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:n,columnIndex:0}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,n=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:n,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this.Grid&&this.Grid.recomputeGridSize({rowIndex:i,columnIndex:n})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t,columnIndex:0})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.noRowsRenderer,r=t.scrollToIndex,o=t.width,a=Object(E.a)("ReactVirtualized__List",e);return i.createElement(z,b()({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:a,columnWidth:o,columnCount:1,noContentRenderer:n,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:r}))}}]),e}(i.PureComponent),v()(Ft,"propTypes",null),wt);v()(St,"defaultProps",{autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:K,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}});var Rt=n(1097),Ut=n.n(Rt);var xt={ge:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=n+1;e<=n;){var a=e+n>>>1;i(t[a],r)>=0?(o=a,n=a-1):e=a+1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=n+1;e<=n;){var o=e+n>>>1;t[o]>=r?(i=o,n=o-1):e=o+1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},gt:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=n+1;e<=n;){var a=e+n>>>1;i(t[a],r)>0?(o=a,n=a-1):e=a+1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=n+1;e<=n;){var o=e+n>>>1;t[o]>r?(i=o,n=o-1):e=o+1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},lt:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=e-1;e<=n;){var a=e+n>>>1;i(t[a],r)<0?(o=a,e=a+1):n=a-1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=e-1;e<=n;){var o=e+n>>>1;t[o]<r?(i=o,e=o+1):n=o-1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},le:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=e-1;e<=n;){var a=e+n>>>1;i(t[a],r)<=0?(o=a,e=a+1):n=a-1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=e-1;e<=n;){var o=e+n>>>1;t[o]<=r?(i=o,e=o+1):n=o-1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},eq:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(;e<=n;){var o=e+n>>>1,a=i(t[o],r);if(0===a)return o;a<=0?e=o+1:n=o-1}return-1}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(;e<=n;){var i=e+n>>>1,o=t[i];if(o===r)return i;o<=r?e=i+1:n=i-1}return-1}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)}};function kt(t,e,n,r,i){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var Ot=kt.prototype;function Nt(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function Dt(t,e){var n=Pt(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function Gt(t,e){var n=t.intervals([]);n.push(e),Dt(t,n)}function _t(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?0:(n.splice(r,1),Dt(t,n),1)}function Mt(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var i=n(t[r]);if(i)return i}}function Tt(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var i=n(t[r]);if(i)return i}}function jt(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}function Lt(t,e){return t-e}function Vt(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function Zt(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function Pt(t){if(0===t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(Lt);var r=e[e.length>>1],i=[],o=[],a=[];for(n=0;n<t.length;++n){var A=t[n];A[1]<r?i.push(A):r<A[0]?o.push(A):a.push(A)}var s=a,c=a.slice();return s.sort(Vt),c.sort(Zt),new kt(r,Pt(i),Pt(o),s,c)}function Wt(t){this.root=t}Ot.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},Ot.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?Gt(this,t):this.left.insert(t):this.left=Pt([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?Gt(this,t):this.right.insert(t):this.right=Pt([t]);else{var n=xt.ge(this.leftPoints,t,Vt),r=xt.ge(this.rightPoints,t,Zt);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}},Ot.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?_t(this,t):2===(o=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?_t(this,t):2===(o=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,r=this.left;r.right;)n=r,r=r.right;if(n===this)r.right=this.right;else{var i=this.left,o=this.right;n.count-=r.count,n.right=r.left,r.left=i,r.right=o}Nt(this,r),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?Nt(this,this.left):Nt(this,this.right);return 1}for(i=xt.ge(this.leftPoints,t,Vt);i<this.leftPoints.length&&this.leftPoints[i][0]===t[0];++i)if(this.leftPoints[i]===t){this.count-=1,this.leftPoints.splice(i,1);for(o=xt.ge(this.rightPoints,t,Zt);o<this.rightPoints.length&&this.rightPoints[o][1]===t[1];++o)if(this.rightPoints[o]===t)return this.rightPoints.splice(o,1),1}return 0},Ot.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(n=this.left.queryPoint(t,e))return n;return Mt(this.leftPoints,t,e)}if(t>this.mid){var n;if(this.right)if(n=this.right.queryPoint(t,e))return n;return Tt(this.rightPoints,t,e)}return jt(this.leftPoints,e)},Ot.queryInterval=function(t,e,n){var r;if(t<this.mid&&this.left&&(r=this.left.queryInterval(t,e,n)))return r;if(e>this.mid&&this.right&&(r=this.right.queryInterval(t,e,n)))return r;return e<this.mid?Mt(this.leftPoints,e,n):t>this.mid?Tt(this.rightPoints,t,n):jt(this.leftPoints,n)};var Jt=Wt.prototype;Jt.insert=function(t){this.root?this.root.insert(t):this.root=new kt(t[0],null,null,[t],[t])},Jt.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},Jt.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},Jt.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(Jt,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(Jt,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});var Ht,Yt,Xt=function(){function t(){var e;s()(this,t),v()(this,"_columnSizeMap",{}),v()(this,"_intervalTree",e&&0!==e.length?new Wt(Pt(e)):new Wt(null)),v()(this,"_leftMap",{})}return u()(t,[{key:"estimateTotalHeight",value:function(t,e,n){var r=t-this.count;return this.tallestColumnSize+Math.ceil(r/e)*n}},{key:"range",value:function(t,e,n){var r=this;this._intervalTree.queryInterval(t,t+e,(function(t){var e=Ut()(t,3),i=e[0],o=(e[1],e[2]);return n(o,r._leftMap[o],i)}))}},{key:"setPosition",value:function(t,e,n,r){this._intervalTree.insert([n,n+r,t]),this._leftMap[t]=e;var i=this._columnSizeMap,o=i[e];i[e]=void 0===o?n+r:Math.max(o,n+r)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var n in t){var r=t[n];e=0===e?r:Math.min(e,r)}return e}},{key:"tallestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var n in t){var r=t[n];e=Math.max(e,r)}return e}}]),t}();function zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zt(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var qt=(Yt=Ht=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"state",{isScrolling:!1,scrollTop:0}),v()(I()(n),"_debounceResetIsScrollingId",void 0),v()(I()(n),"_invalidateOnUpdateStartIndex",null),v()(I()(n),"_invalidateOnUpdateStopIndex",null),v()(I()(n),"_positionCache",new Xt),v()(I()(n),"_startIndex",null),v()(I()(n),"_startIndexMemoized",null),v()(I()(n),"_stopIndex",null),v()(I()(n),"_stopIndexMemoized",null),v()(I()(n),"_debounceResetIsScrollingCallback",(function(){n.setState({isScrolling:!1})})),v()(I()(n),"_setScrollingContainerRef",(function(t){n._scrollingContainer=t})),v()(I()(n),"_onScroll",(function(t){var e=n.props.height,r=t.currentTarget.scrollTop,i=Math.min(Math.max(0,n._getEstimatedTotalHeight()-e),r);r===i&&(n._debounceResetIsScrolling(),n.state.scrollTop!==i&&n.setState({isScrolling:!0,scrollTop:i}))})),n}return C()(e,t),u()(e,[{key:"clearCellPositions",value:function(){this._positionCache=new Xt,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.rowIndex;null===this._invalidateOnUpdateStartIndex?(this._invalidateOnUpdateStartIndex=e,this._invalidateOnUpdateStopIndex=e):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,e),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,e))}},{key:"recomputeCellPositions",value:function(){var t=this._positionCache.count-1;this._positionCache=new Xt,this._populatePositionCache(0,t),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(t,e){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==t.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&Z(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var t,e=this,n=this.props,r=n.autoHeight,o=n.cellCount,a=n.cellMeasurerCache,A=n.cellRenderer,s=n.className,c=n.height,u=n.id,l=n.keyMapper,g=n.overscanByPixels,f=n.role,h=n.style,d=n.tabIndex,I=n.width,p=n.rowDirection,C=this.state,y=C.isScrolling,B=C.scrollTop,m=[],b=this._getEstimatedTotalHeight(),Q=this._positionCache.shortestColumnSize,F=this._positionCache.count,w=0;if(this._positionCache.range(Math.max(0,B-g),c+2*g,(function(n,r,i){var o;"undefined"===typeof t?(w=n,t=n):(w=Math.min(w,n),t=Math.max(t,n)),m.push(A({index:n,isScrolling:y,key:l(n),parent:e,style:(o={height:a.getHeight(n)},v()(o,"ltr"===p?"left":"right",r),v()(o,"position","absolute"),v()(o,"top",i),v()(o,"width",a.getWidth(n)),o)}))})),Q<B+c+g&&F<o)for(var S=Math.min(o-F,Math.ceil((B+c+g-Q)/a.defaultHeight*I/a.defaultWidth)),R=F;R<F+S;R++)t=R,m.push(A({index:R,isScrolling:y,key:l(R),parent:this,style:{width:a.getWidth(R)}}));return this._startIndex=w,this._stopIndex=t,i.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Object(E.a)("ReactVirtualized__Masonry",s),id:u,onScroll:this._onScroll,role:f,style:Kt({boxSizing:"border-box",direction:"ltr",height:r?"auto":c,overflowX:"hidden",overflowY:b<c?"hidden":"auto",position:"relative",width:I,WebkitOverflowScrolling:"touch",willChange:"transform"},h),tabIndex:d},i.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:b,maxWidth:"100%",maxHeight:b,overflow:"hidden",pointerEvents:y?"none":"",position:"relative"}},m))}},{key:"_checkInvalidateOnUpdate",value:function(){if("number"===typeof this._invalidateOnUpdateStartIndex){var t=this._invalidateOnUpdateStartIndex,e=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(t,e),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var t=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&Z(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=P(this._debounceResetIsScrollingCallback,t)}},{key:"_getEstimatedTotalHeight",value:function(){var t=this.props,e=t.cellCount,n=t.cellMeasurerCache,r=t.width,i=Math.max(1,Math.floor(r/n.defaultWidth));return this._positionCache.estimateTotalHeight(e,i,n.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var t=this.props,e=t.height,n=t.onScroll,r=this.state.scrollTop;this._onScrollMemoized!==r&&(n({clientHeight:e,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:r}),this._onScrollMemoized=r)}},{key:"_invokeOnCellsRenderedCallback",value:function(){this._startIndexMemoized===this._startIndex&&this._stopIndexMemoized===this._stopIndex||((0,this.props.onCellsRendered)({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex)}},{key:"_populatePositionCache",value:function(t,e){for(var n=this.props,r=n.cellMeasurerCache,i=n.cellPositioner,o=t;o<=e;o++){var a=i(o),A=a.left,s=a.top;this._positionCache.setPosition(o,A,s,r.getHeight(o))}}}],[{key:"getDerivedStateFromProps",value:function(t,e){return void 0!==t.scrollTop&&e.scrollTop!==t.scrollTop?{isScrolling:!0,scrollTop:t.scrollTop}:null}}]),e}(i.PureComponent),v()(Ht,"propTypes",null),Yt);function $t(){}v()(qt,"defaultProps",{autoHeight:!1,keyMapper:function(t){return t},onCellsRendered:$t,onScroll:$t,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:150,style:{},tabIndex:0,rowDirection:"ltr"});Object(B.a)(qt);var te=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s()(this,t),v()(this,"_cellMeasurerCache",void 0),v()(this,"_columnIndexOffset",void 0),v()(this,"_rowIndexOffset",void 0),v()(this,"columnWidth",(function(t){var n=t.index;e._cellMeasurerCache.columnWidth({index:n+e._columnIndexOffset})})),v()(this,"rowHeight",(function(t){var n=t.index;e._cellMeasurerCache.rowHeight({index:n+e._rowIndexOffset})}));var r=n.cellMeasurerCache,i=n.columnIndexOffset,o=void 0===i?0:i,a=n.rowIndexOffset,A=void 0===a?0:a;this._cellMeasurerCache=r,this._columnIndexOffset=o,this._rowIndexOffset=A}return u()(t,[{key:"clear",value:function(t,e){this._cellMeasurerCache.clear(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getHeight(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"getWidth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getWidth(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"has",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.has(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"set",value:function(t,e,n,r){this._cellMeasurerCache.set(t+this._rowIndexOffset,e+this._columnIndexOffset,n,r)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),t}();function ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ee(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ee(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var re=function(t){function e(t,n){var r;s()(this,e),r=g()(this,h()(e).call(this,t,n)),v()(I()(r),"state",{scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1}),v()(I()(r),"_deferredInvalidateColumnIndex",null),v()(I()(r),"_deferredInvalidateRowIndex",null),v()(I()(r),"_bottomLeftGridRef",(function(t){r._bottomLeftGrid=t})),v()(I()(r),"_bottomRightGridRef",(function(t){r._bottomRightGrid=t})),v()(I()(r),"_cellRendererBottomLeftGrid",(function(t){var e=t.rowIndex,n=w()(t,["rowIndex"]),o=r.props,a=o.cellRenderer,A=o.fixedRowCount;return e===o.rowCount-A?i.createElement("div",{key:n.key,style:ne({},n.style,{height:20})}):a(ne({},n,{parent:I()(r),rowIndex:e+A}))})),v()(I()(r),"_cellRendererBottomRightGrid",(function(t){var e=t.columnIndex,n=t.rowIndex,i=w()(t,["columnIndex","rowIndex"]),o=r.props,a=o.cellRenderer,A=o.fixedColumnCount,s=o.fixedRowCount;return a(ne({},i,{columnIndex:e+A,parent:I()(r),rowIndex:n+s}))})),v()(I()(r),"_cellRendererTopRightGrid",(function(t){var e=t.columnIndex,n=w()(t,["columnIndex"]),o=r.props,a=o.cellRenderer,A=o.columnCount,s=o.fixedColumnCount;return e===A-s?i.createElement("div",{key:n.key,style:ne({},n.style,{width:20})}):a(ne({},n,{columnIndex:e+s,parent:I()(r)}))})),v()(I()(r),"_columnWidthRightGrid",(function(t){var e=t.index,n=r.props,i=n.columnCount,o=n.fixedColumnCount,a=n.columnWidth,A=r.state,s=A.scrollbarSize;return A.showHorizontalScrollbar&&e===i-o?s:"function"===typeof a?a({index:e+o}):a})),v()(I()(r),"_onScroll",(function(t){var e=t.scrollLeft,n=t.scrollTop;r.setState({scrollLeft:e,scrollTop:n});var i=r.props.onScroll;i&&i(t)})),v()(I()(r),"_onScrollbarPresenceChange",(function(t){var e=t.horizontal,n=t.size,i=t.vertical,o=r.state,a=o.showHorizontalScrollbar,A=o.showVerticalScrollbar;if(e!==a||i!==A){r.setState({scrollbarSize:n,showHorizontalScrollbar:e,showVerticalScrollbar:i});var s=r.props.onScrollbarPresenceChange;"function"===typeof s&&s({horizontal:e,size:n,vertical:i})}})),v()(I()(r),"_onScrollLeft",(function(t){var e=t.scrollLeft;r._onScroll({scrollLeft:e,scrollTop:r.state.scrollTop})})),v()(I()(r),"_onScrollTop",(function(t){var e=t.scrollTop;r._onScroll({scrollTop:e,scrollLeft:r.state.scrollLeft})})),v()(I()(r),"_rowHeightBottomGrid",(function(t){var e=t.index,n=r.props,i=n.fixedRowCount,o=n.rowCount,a=n.rowHeight,A=r.state,s=A.scrollbarSize;return A.showVerticalScrollbar&&e===o-i?s:"function"===typeof a?a({index:e+i}):a})),v()(I()(r),"_topLeftGridRef",(function(t){r._topLeftGrid=t})),v()(I()(r),"_topRightGridRef",(function(t){r._topRightGrid=t}));var o=t.deferredMeasurementCache,a=t.fixedColumnCount,A=t.fixedRowCount;return r._maybeCalculateCachedStyles(!0),o&&(r._deferredMeasurementCacheBottomLeftGrid=A>0?new te({cellMeasurerCache:o,columnIndexOffset:0,rowIndexOffset:A}):o,r._deferredMeasurementCacheBottomRightGrid=a>0||A>0?new te({cellMeasurerCache:o,columnIndexOffset:a,rowIndexOffset:A}):o,r._deferredMeasurementCacheTopRightGrid=a>0?new te({cellMeasurerCache:o,columnIndexOffset:a,rowIndexOffset:0}):o),r}return C()(e,t),u()(e,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this._deferredInvalidateColumnIndex="number"===typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,n):n,this._deferredInvalidateRowIndex="number"===typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,i):i}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r,o=this.props,a=o.fixedColumnCount,A=o.fixedRowCount,s=Math.max(0,n-a),c=Math.max(0,i-A);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:n,rowIndex:c}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:s,rowIndex:c}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:n,rowIndex:i}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:s,rowIndex:i}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var t=this.props,e=t.scrollLeft,n=t.scrollTop;if(e>0||n>0){var r={};e>0&&(r.scrollLeft=e),n>0&&(r.scrollTop=n),this.setState(r)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var t=this.props,e=t.onScroll,n=t.onSectionRendered,r=(t.onScrollbarPresenceChange,t.scrollLeft,t.scrollToColumn),o=(t.scrollTop,t.scrollToRow),a=w()(t,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(this._prepareForRender(),0===this.props.width||0===this.props.height)return null;var A=this.state,s=A.scrollLeft,c=A.scrollTop;return i.createElement("div",{style:this._containerOuterStyle},i.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(a),this._renderTopRightGrid(ne({},a,{onScroll:e,scrollLeft:s}))),i.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(ne({},a,{onScroll:e,scrollTop:c})),this._renderBottomRightGrid(ne({},a,{onScroll:e,onSectionRendered:n,scrollLeft:s,scrollToColumn:r,scrollToRow:o,scrollTop:c}))))}},{key:"_getBottomGridHeight",value:function(t){return t.height-this._getTopGridHeight(t)}},{key:"_getLeftGridWidth",value:function(t){var e=t.fixedColumnCount,n=t.columnWidth;if(null==this._leftGridWidth)if("function"===typeof n){for(var r=0,i=0;i<e;i++)r+=n({index:i});this._leftGridWidth=r}else this._leftGridWidth=n*e;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(t){return t.width-this._getLeftGridWidth(t)}},{key:"_getTopGridHeight",value:function(t){var e=t.fixedRowCount,n=t.rowHeight;if(null==this._topGridHeight)if("function"===typeof n){for(var r=0,i=0;i<e;i++)r+=n({index:i});this._topGridHeight=r}else this._topGridHeight=n*e;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if("number"===typeof this._deferredInvalidateColumnIndex){var t=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:e}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(t){var e=this.props,n=e.columnWidth,r=e.enableFixedColumnScroll,i=e.enableFixedRowScroll,o=e.height,a=e.fixedColumnCount,A=e.fixedRowCount,s=e.rowHeight,c=e.style,u=e.styleBottomLeftGrid,l=e.styleBottomRightGrid,g=e.styleTopLeftGrid,f=e.styleTopRightGrid,h=e.width,d=t||o!==this._lastRenderedHeight||h!==this._lastRenderedWidth,I=t||n!==this._lastRenderedColumnWidth||a!==this._lastRenderedFixedColumnCount,p=t||A!==this._lastRenderedFixedRowCount||s!==this._lastRenderedRowHeight;(t||d||c!==this._lastRenderedStyle)&&(this._containerOuterStyle=ne({height:o,overflow:"visible",width:h},c)),(t||d||p)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:h},this._containerBottomStyle={height:o-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:h}),(t||u!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=ne({left:0,overflowX:"hidden",overflowY:r?"auto":"hidden",position:"absolute"},u)),(t||I||l!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=ne({left:this._getLeftGridWidth(this.props),position:"absolute"},l)),(t||g!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=ne({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},g)),(t||I||f!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=ne({left:this._getLeftGridWidth(this.props),overflowX:i?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},f)),this._lastRenderedColumnWidth=n,this._lastRenderedFixedColumnCount=a,this._lastRenderedFixedRowCount=A,this._lastRenderedHeight=o,this._lastRenderedRowHeight=s,this._lastRenderedStyle=c,this._lastRenderedStyleBottomLeftGrid=u,this._lastRenderedStyleBottomRightGrid=l,this._lastRenderedStyleTopLeftGrid=g,this._lastRenderedStyleTopRightGrid=f,this._lastRenderedWidth=h}},{key:"_prepareForRender",value:function(){this._lastRenderedColumnWidth===this.props.columnWidth&&this._lastRenderedFixedColumnCount===this.props.fixedColumnCount||(this._leftGridWidth=null),this._lastRenderedFixedRowCount===this.props.fixedRowCount&&this._lastRenderedRowHeight===this.props.rowHeight||(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(t){var e=t.enableFixedColumnScroll,n=t.fixedColumnCount,r=t.fixedRowCount,o=t.rowCount,a=t.hideBottomLeftGridScrollbar,A=this.state.showVerticalScrollbar;if(!n)return null;var s=A?1:0,c=this._getBottomGridHeight(t),u=this._getLeftGridWidth(t),l=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,g=a?u+l:u,f=i.createElement(z,b()({},t,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:n,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:c,onScroll:e?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,o-r)+s,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:g}));return a?i.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:ne({},this._bottomLeftGridStyle,{height:c,width:u,overflowY:"hidden"})},f):f}},{key:"_renderBottomRightGrid",value:function(t){var e=t.columnCount,n=t.fixedColumnCount,r=t.fixedRowCount,o=t.rowCount,a=t.scrollToColumn,A=t.scrollToRow;return i.createElement(z,b()({},t,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,e-n),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(t),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,o-r),rowHeight:this._rowHeightBottomGrid,scrollToColumn:a-n,scrollToRow:A-r,style:this._bottomRightGridStyle,width:this._getRightGridWidth(t)}))}},{key:"_renderTopLeftGrid",value:function(t){var e=t.fixedColumnCount,n=t.fixedRowCount;return e&&n?i.createElement(z,b()({},t,{className:this.props.classNameTopLeftGrid,columnCount:e,height:this._getTopGridHeight(t),ref:this._topLeftGridRef,rowCount:n,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(t)})):null}},{key:"_renderTopRightGrid",value:function(t){var e=t.columnCount,n=t.enableFixedRowScroll,r=t.fixedColumnCount,o=t.fixedRowCount,a=t.scrollLeft,A=t.hideTopRightGridScrollbar,s=this.state,c=s.showHorizontalScrollbar,u=s.scrollbarSize;if(!o)return null;var l=c?1:0,g=this._getTopGridHeight(t),f=this._getRightGridWidth(t),h=c?u:0,d=g,I=this._topRightGridStyle;A&&(d=g+h,I=ne({},this._topRightGridStyle,{left:0}));var p=i.createElement(z,b()({},t,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,e-r)+l,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:d,onScroll:n?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:o,scrollLeft:a,style:I,tabIndex:null,width:f}));return A?i.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:ne({},this._topRightGridStyle,{height:g,width:f,overflowX:"hidden"})},p):p}}],[{key:"getDerivedStateFromProps",value:function(t,e){return t.scrollLeft!==e.scrollLeft||t.scrollTop!==e.scrollTop?{scrollLeft:null!=t.scrollLeft&&t.scrollLeft>=0?t.scrollLeft:e.scrollLeft,scrollTop:null!=t.scrollTop&&t.scrollTop>=0?t.scrollTop:e.scrollTop}:null}}]),e}(i.PureComponent);v()(re,"defaultProps",{classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1}),re.propTypes={},Object(B.a)(re);var ie=function(t){function e(t,n){var r;return s()(this,e),(r=g()(this,h()(e).call(this,t,n))).state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},r._onScroll=r._onScroll.bind(I()(r)),r}return C()(e,t),u()(e,[{key:"render",value:function(){var t=this.props.children,e=this.state,n=e.clientHeight,r=e.clientWidth,i=e.scrollHeight,o=e.scrollLeft,a=e.scrollTop,A=e.scrollWidth;return t({clientHeight:n,clientWidth:r,onScroll:this._onScroll,scrollHeight:i,scrollLeft:o,scrollTop:a,scrollWidth:A})}},{key:"_onScroll",value:function(t){var e=t.clientHeight,n=t.clientWidth,r=t.scrollHeight,i=t.scrollLeft,o=t.scrollTop,a=t.scrollWidth;this.setState({clientHeight:e,clientWidth:n,scrollHeight:r,scrollLeft:i,scrollTop:o,scrollWidth:a})}}]),e}(i.PureComponent);ie.propTypes={};function oe(t){var e=t.className,n=t.columns,r=t.style;return i.createElement("div",{className:e,role:"row",style:r},n)}oe.propTypes=null;var ae={ASC:"ASC",DESC:"DESC"};function Ae(t){var e=t.sortDirection,n=Object(E.a)("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":e===ae.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":e===ae.DESC});return i.createElement("svg",{className:n,width:18,height:18,viewBox:"0 0 24 24"},e===ae.ASC?i.createElement("path",{d:"M7 14l5-5 5 5z"}):i.createElement("path",{d:"M7 10l5 5 5-5z"}),i.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}function se(t){var e=t.dataKey,n=t.label,r=t.sortBy,o=t.sortDirection,a=r===e,A=[i.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:"string"===typeof n?n:null},n)];return a&&A.push(i.createElement(Ae,{key:"SortIndicator",sortDirection:o})),A}function ce(t){var e=t.className,n=t.columns,r=t.index,o=t.key,a=t.onRowClick,A=t.onRowDoubleClick,s=t.onRowMouseOut,c=t.onRowMouseOver,u=t.onRowRightClick,l=t.rowData,g=t.style,f={"aria-rowindex":r+1};return(a||A||s||c||u)&&(f["aria-label"]="row",f.tabIndex=0,a&&(f.onClick=function(t){return a({event:t,index:r,rowData:l})}),A&&(f.onDoubleClick=function(t){return A({event:t,index:r,rowData:l})}),s&&(f.onMouseOut=function(t){return s({event:t,index:r,rowData:l})}),c&&(f.onMouseOver=function(t){return c({event:t,index:r,rowData:l})}),u&&(f.onContextMenu=function(t){return u({event:t,index:r,rowData:l})})),i.createElement("div",b()({},f,{className:e,key:o,role:"row",style:g}),n)}Ae.propTypes={},se.propTypes=null,ce.propTypes=null;var ue=function(t){function e(){return s()(this,e),g()(this,h()(e).apply(this,arguments))}return C()(e,t),e}(i.Component);function le(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ge(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?le(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):le(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}v()(ue,"defaultProps",{cellDataGetter:function(t){var e=t.dataKey,n=t.rowData;return"function"===typeof n.get?n.get(e):n[e]},cellRenderer:function(t){var e=t.cellData;return null==e?"":String(e)},defaultSortDirection:ae.ASC,flexGrow:0,flexShrink:1,headerRenderer:se,style:{}}),ue.propTypes={};var fe=function(t){function e(t){var n;return s()(this,e),(n=g()(this,h()(e).call(this,t))).state={scrollbarWidth:0},n._createColumn=n._createColumn.bind(I()(n)),n._createRow=n._createRow.bind(I()(n)),n._onScroll=n._onScroll.bind(I()(n)),n._onSectionRendered=n._onSectionRendered.bind(I()(n)),n._setRef=n._setRef.bind(I()(n)),n}return C()(e,t),u()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var e=t.alignment,n=t.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:n}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,n=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:n,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this.Grid&&this.Grid.recomputeGridSize({rowIndex:i,columnIndex:n})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"getScrollbarWidth",value:function(){if(this.Grid){var t=Object(ut.findDOMNode)(this.Grid),e=t.clientWidth||0;return(t.offsetWidth||0)-e}return 0}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var t=this,e=this.props,n=e.children,r=e.className,o=e.disableHeader,a=e.gridClassName,A=e.gridStyle,s=e.headerHeight,c=e.headerRowRenderer,u=e.height,l=e.id,g=e.noRowsRenderer,f=e.rowClassName,h=e.rowStyle,d=e.scrollToIndex,I=e.style,p=e.width,C=this.state.scrollbarWidth,y=o?u:u-s,v="function"===typeof f?f({index:-1}):f,B="function"===typeof h?h({index:-1}):h;return this._cachedColumnStyles=[],i.Children.toArray(n).forEach((function(e,n){var r=t._getFlexStyleForColumn(e,e.props.style);t._cachedColumnStyles[n]=ge({overflow:"hidden"},r)})),i.createElement("div",{"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-colcount":i.Children.toArray(n).length,"aria-rowcount":this.props.rowCount,className:Object(E.a)("ReactVirtualized__Table",r),id:l,role:"grid",style:I},!o&&c({className:Object(E.a)("ReactVirtualized__Table__headerRow",v),columns:this._getHeaderColumns(),style:ge({height:s,overflow:"hidden",paddingRight:C,width:p},B)}),i.createElement(z,b()({},this.props,{"aria-readonly":null,autoContainerWidth:!0,className:Object(E.a)("ReactVirtualized__Table__Grid",a),cellRenderer:this._createRow,columnWidth:p,columnCount:1,height:y,id:void 0,noContentRenderer:g,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:C,scrollToRow:d,style:ge({},A,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(t){var e=t.column,n=t.columnIndex,r=t.isScrolling,o=t.parent,a=t.rowData,A=t.rowIndex,s=this.props.onColumnClick,c=e.props,u=c.cellDataGetter,l=c.cellRenderer,g=c.className,f=c.columnData,h=c.dataKey,d=c.id,I=l({cellData:u({columnData:f,dataKey:h,rowData:a}),columnData:f,columnIndex:n,dataKey:h,isScrolling:r,parent:o,rowData:a,rowIndex:A}),p=this._cachedColumnStyles[n],C="string"===typeof I?I:null;return i.createElement("div",{"aria-colindex":n+1,"aria-describedby":d,className:Object(E.a)("ReactVirtualized__Table__rowColumn",g),key:"Row"+A+"-Col"+n,onClick:function(t){s&&s({columnData:f,dataKey:h,event:t})},role:"gridcell",style:p,title:C},I)}},{key:"_createHeader",value:function(t){var e,n,r,o,a,A=t.column,s=t.index,c=this.props,u=c.headerClassName,l=c.headerStyle,g=c.onHeaderClick,f=c.sort,h=c.sortBy,d=c.sortDirection,I=A.props,p=I.columnData,C=I.dataKey,y=I.defaultSortDirection,v=I.disableSort,B=I.headerRenderer,m=I.id,b=I.label,Q=!v&&f,F=Object(E.a)("ReactVirtualized__Table__headerColumn",u,A.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:Q}),w=this._getFlexStyleForColumn(A,ge({},l,{},A.props.headerStyle)),S=B({columnData:p,dataKey:C,disableSort:v,label:b,sortBy:h,sortDirection:d});if(Q||g){var R=h!==C?y:d===ae.DESC?ae.ASC:ae.DESC,U=function(t){Q&&f({defaultSortDirection:y,event:t,sortBy:C,sortDirection:R}),g&&g({columnData:p,dataKey:C,event:t})};a=A.props["aria-label"]||b||C,o="none",r=0,e=U,n=function(t){"Enter"!==t.key&&" "!==t.key||U(t)}}return h===C&&(o=d===ae.ASC?"ascending":"descending"),i.createElement("div",{"aria-label":a,"aria-sort":o,className:F,id:m,key:"Header-Col"+s,onClick:e,onKeyDown:n,role:"columnheader",style:w,tabIndex:r},S)}},{key:"_createRow",value:function(t){var e=this,n=t.rowIndex,r=t.isScrolling,o=t.key,a=t.parent,A=t.style,s=this.props,c=s.children,u=s.onRowClick,l=s.onRowDoubleClick,g=s.onRowRightClick,f=s.onRowMouseOver,h=s.onRowMouseOut,d=s.rowClassName,I=s.rowGetter,p=s.rowRenderer,C=s.rowStyle,y=this.state.scrollbarWidth,v="function"===typeof d?d({index:n}):d,B="function"===typeof C?C({index:n}):C,m=I({index:n}),b=i.Children.toArray(c).map((function(t,i){return e._createColumn({column:t,columnIndex:i,isScrolling:r,parent:a,rowData:m,rowIndex:n,scrollbarWidth:y})})),Q=Object(E.a)("ReactVirtualized__Table__row",v),F=ge({},A,{height:this._getRowHeight(n),overflow:"hidden",paddingRight:y},B);return p({className:Q,columns:b,index:n,isScrolling:r,key:o,onRowClick:u,onRowDoubleClick:l,onRowRightClick:g,onRowMouseOver:f,onRowMouseOut:h,rowData:m,style:F})}},{key:"_getFlexStyleForColumn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="".concat(t.props.flexGrow," ").concat(t.props.flexShrink," ").concat(t.props.width,"px"),r=ge({},e,{flex:n,msFlex:n,WebkitFlex:n});return t.props.maxWidth&&(r.maxWidth=t.props.maxWidth),t.props.minWidth&&(r.minWidth=t.props.minWidth),r}},{key:"_getHeaderColumns",value:function(){var t=this,e=this.props,n=e.children;return(e.disableHeader?[]:i.Children.toArray(n)).map((function(e,n){return t._createHeader({column:e,index:n})}))}},{key:"_getRowHeight",value:function(t){var e=this.props.rowHeight;return"function"===typeof e?e({index:t}):e}},{key:"_onScroll",value:function(t){var e=t.clientHeight,n=t.scrollHeight,r=t.scrollTop;(0,this.props.onScroll)({clientHeight:e,scrollHeight:n,scrollTop:r})}},{key:"_onSectionRendered",value:function(t){var e=t.rowOverscanStartIndex,n=t.rowOverscanStopIndex,r=t.rowStartIndex,i=t.rowStopIndex;(0,this.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:n,startIndex:r,stopIndex:i})}},{key:"_setRef",value:function(t){this.Grid=t}},{key:"_setScrollbarWidth",value:function(){var t=this.getScrollbarWidth();this.setState({scrollbarWidth:t})}}]),e}(i.PureComponent);v()(fe,"defaultProps",{disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:K,overscanRowCount:10,rowRenderer:ce,headerRowRenderer:oe,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}}),fe.propTypes={};var he=[],de=null,Ie=null;function pe(){Ie&&(Ie=null,document.body&&null!=de&&(document.body.style.pointerEvents=de),de=null)}function Ce(){pe(),he.forEach((function(t){return t.__resetIsScrolling()}))}function ye(t){t.currentTarget===window&&null==de&&document.body&&(de=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),function(){Ie&&Z(Ie);var t=0;he.forEach((function(e){t=Math.max(t,e.props.scrollingResetTimeInterval)})),Ie=P(Ce,t)}(),he.forEach((function(e){e.props.scrollElement===t.currentTarget&&e.__handleWindowScrollEvent()}))}function ve(t,e){he.some((function(t){return t.props.scrollElement===e}))||e.addEventListener("scroll",ye),he.push(t)}function Be(t,e){(he=he.filter((function(e){return e!==t}))).length||(e.removeEventListener("scroll",ye),Ie&&(Z(Ie),pe()))}var me,be,Ee=function(t){return t===window},Qe=function(t){return t.getBoundingClientRect()};function Fe(t,e){if(t){if(Ee(t)){var n=window,r=n.innerHeight,i=n.innerWidth;return{height:"number"===typeof r?r:0,width:"number"===typeof i?i:0}}return Qe(t)}return{height:e.serverHeight,width:e.serverWidth}}function we(t,e){if(Ee(e)&&document.documentElement){var n=document.documentElement,r=Qe(t),i=Qe(n);return{top:r.top-i.top,left:r.left-i.left}}var o=Se(e),a=Qe(t),A=Qe(e);return{top:a.top+o.top-A.top,left:a.left+o.left-A.left}}function Se(t){return Ee(t)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:t.scrollTop,left:t.scrollLeft}}function Re(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Re(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Re(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var xe=function(){return"undefined"!==typeof window?window:void 0},ke=(be=me=function(t){function e(){var t,n;s()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=g()(this,(t=h()(e)).call.apply(t,[this].concat(i))),v()(I()(n),"_window",xe()),v()(I()(n),"_isMounted",!1),v()(I()(n),"_positionFromTop",0),v()(I()(n),"_positionFromLeft",0),v()(I()(n),"_detectElementResize",void 0),v()(I()(n),"_child",void 0),v()(I()(n),"state",Ue({},Fe(n.props.scrollElement,n.props),{isScrolling:!1,scrollLeft:0,scrollTop:0})),v()(I()(n),"_registerChild",(function(t){!t||t instanceof Element||console.warn("WindowScroller registerChild expects to be passed Element or null"),n._child=t,n.updatePosition()})),v()(I()(n),"_onChildScroll",(function(t){var e=t.scrollTop;if(n.state.scrollTop!==e){var r=n.props.scrollElement;r&&("function"===typeof r.scrollTo?r.scrollTo(0,e+n._positionFromTop):r.scrollTop=e+n._positionFromTop)}})),v()(I()(n),"_registerResizeListener",(function(t){t===window?window.addEventListener("resize",n._onResize,!1):n._detectElementResize.addResizeListener(t,n._onResize)})),v()(I()(n),"_unregisterResizeListener",(function(t){t===window?window.removeEventListener("resize",n._onResize,!1):t&&n._detectElementResize.removeResizeListener(t,n._onResize)})),v()(I()(n),"_onResize",(function(){n.updatePosition()})),v()(I()(n),"__handleWindowScrollEvent",(function(){if(n._isMounted){var t=n.props.onScroll,e=n.props.scrollElement;if(e){var r=Se(e),i=Math.max(0,r.left-n._positionFromLeft),o=Math.max(0,r.top-n._positionFromTop);n.setState({isScrolling:!0,scrollLeft:i,scrollTop:o}),t({scrollLeft:i,scrollTop:o})}}})),v()(I()(n),"__resetIsScrolling",(function(){n.setState({isScrolling:!1})})),n}return C()(e,t),u()(e,[{key:"updatePosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollElement,e=this.props.onResize,n=this.state,r=n.height,i=n.width,o=this._child||ut.findDOMNode(this);if(o instanceof Element&&t){var a=we(o,t);this._positionFromTop=a.top,this._positionFromLeft=a.left}var A=Fe(t,this.props);r===A.height&&i===A.width||(this.setState({height:A.height,width:A.width}),e({height:A.height,width:A.width}))}},{key:"componentDidMount",value:function(){var t=this.props.scrollElement;this._detectElementResize=Object(it.a)(),this.updatePosition(t),t&&(ve(this,t),this._registerResizeListener(t)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(t,e){var n=this.props.scrollElement,r=t.scrollElement;r!==n&&null!=r&&null!=n&&(this.updatePosition(n),Be(this,r),ve(this,n),this._unregisterResizeListener(r),this._registerResizeListener(n))}},{key:"componentWillUnmount",value:function(){var t=this.props.scrollElement;t&&(Be(this,t),this._unregisterResizeListener(t)),this._isMounted=!1}},{key:"render",value:function(){var t=this.props.children,e=this.state,n=e.isScrolling,r=e.scrollTop,i=e.scrollLeft,o=e.height,a=e.width;return t({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:o,isScrolling:n,scrollLeft:i,scrollTop:r,width:a})}}]),e}(i.PureComponent),v()(me,"propTypes",null),be);v()(ke,"defaultProps",{onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:150,scrollElement:xe(),serverHeight:0,serverWidth:0});var Oe=n(331),Ne=n.n(Oe),De=n(1098),Ge=n.n(De),_e=n(1099),Me=n.n(_e),Te=n(84),je=n.n(Te);function Le(t){var e=t.hasColorEncoding,n=t.columns,A=t.data,s=t.onChange,c=t.idKey,u=void 0===c?"id":c,l=t.valueKey,g=void 0===l?"value":l,f=t.allowMultiple,h=void 0!==f&&f,d=t.allowUncheck,I=void 0!==d&&d,p=t.showTableHead,C=void 0===p||p,y=t.showTableInputs,v=void 0!==y&&y,B=t.testHeight,m=void 0===B?void 0:B,b=t.testWidth,E=void 0===b?void 0:b,Q=Object(i.useState)(null),F=Object(r.a)(Q,2),w=F[0],S=F[1],R=Object(i.useCallback)((function(t,e){(e||I)&&S(h?e?Ge()(w||[],[t]):Me()(w||[],[t]):e?[t]:[])}),[h,I,w]),U=Object(i.useCallback)((function(t){var e=t.target,n=e.checked,r=e.value;R(r,n)}),[R]),x=Object(i.useCallback)((function(t){return t.map((function(t){var e;return e={},Object(a.a)(e,u,t),Object(a.a)(e,"data",A.find((function(e){return e[u]===t}))),e}))}),[A,u]),k=Object(i.useCallback)((function(t){return Array.isArray(w)&&w.includes(t)}),[w]);Object(i.useEffect)((function(){var t=A.map((function(t){return t[g]?t[u]:null})).filter(Boolean);je()(t,w)||(t.length>0?S(t):S(null))}),[A,u,g]),Object(i.useEffect)((function(){if(s&&w){var t=x(w);h?s(t):1===w.length?s(t[0]):0===w.length&&s(null)}}),[w]);var O=Ne()(),N=v?"":"hidden-input-column",D=function(t){var r=t.index,i=t.style;return o.a.createElement("div",{key:A[r][u],className:"table-item table-row ".concat(k(A[r][u])?"row-checked ":""),style:i,role:"button",onClick:function(){return R(A[r][u],!k(A[r][u])||!e)}},o.a.createElement("div",{className:"input-container ".concat(N," table-cell")},o.a.createElement("label",{htmlFor:"".concat(O,"_").concat(A[r][u])},o.a.createElement("input",{id:"".concat(O,"_").concat(A[r][u]),type:"checkbox",className:h?"checkbox":"radio",name:O,value:A[r][u],onChange:U,checked:k(A[r][u])}))),n.map((function(t){return o.a.createElement("div",{className:"table-cell",key:t},A[r][t])})))},G=function(t){var e=t.style;return o.a.createElement("div",{className:"".concat(N," table-row"),style:e},n.map((function(t){return o.a.createElement("div",{key:t},t)})))};return o.a.createElement("div",{className:"selectable-table"},o.a.createElement(At,null,(function(t){var e=t.width,n=t.height;return o.a.createElement(fe,{height:m||n,gridStyle:{outline:"none"},rowCount:A.length,rowHeight:24,headerHeight:C?24:void 0,rowRenderer:D,width:E||e,headerRowRenderer:C?G:void 0,rowGetter:function(t){var e=t.index;return A[e]}})})))}function Ve(t){var e=t.hasColorEncoding,n=t.geneList,a=void 0===n?[]:n,A=t.geneSelection,s=void 0===A?[]:A,c=t.geneFilter,u=void 0===c?null:c,l=t.setGeneSelection,g=Object(i.useState)(""),f=Object(r.a)(g,2),h=f[0],d=f[1],I=Object(i.useState)(a),p=Object(r.a)(I,2),C=p[0],y=p[1];Object(i.useEffect)((function(){var t=a.filter((function(t){return t.toLowerCase().includes(h.toLowerCase())}));y(t)}),[h,a]);var v=C.filter((function(t){return!u||u.includes(t)})).sort((function(t,e){return t.localeCompare(e)})).map((function(t){return{name:t,value:!!s&&s.includes(t)}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement("input",{className:"search-bar",type:"text",placeholder:"Search",value:h,onChange:function(t){d(t.target.value)}}),o.a.createElement(Le,{columns:["name"],data:v,hasColorEncoding:e,idKey:"name",valueKey:"value",onChange:function(t){l&&t&&t.name&&l([t.name])},allowUncheck:!1,showTableHead:!1}))}n.d(e,"a",(function(){return Ve}))},function(t,e,n){"use strict";var r=n(12),i=n(26),o=n(18),a=n(0),A=n.n(a),s=n(84),c=n.n(s),u=n(16),l=n(264),g=n.n(l),f=n(274),h=n.n(f),d=n(696),I=n.n(d),p=n(697),C=n.n(p),y=n(698),v=n.n(y),B=n(699),m=n.n(B),b=n(20),E=n.n(b),Q=n(166),F=n.n(Q),w=n(544),S=n.n(w),R=n(262);function U(t){var e=[];return A.a.Children.forEach(t,(function(t){void 0!==t&&null!==t&&(Array.isArray(t)?e=e.concat(U(t)):Object(R.isFragment)(t)&&t.props?e=e.concat(U(t.props.children)):e.push(t))})),e}var x=n(298),k={rcTree:E.a.shape({root:E.a.object,prefixCls:E.a.string,selectable:E.a.bool,showIcon:E.a.bool,icon:E.a.oneOfType([E.a.node,E.a.func]),draggable:E.a.bool,checkable:E.a.oneOfType([E.a.bool,E.a.node]),checkStrictly:E.a.bool,disabled:E.a.bool,openTransitionName:E.a.string,openAnimation:E.a.oneOfType([E.a.string,E.a.object]),loadData:E.a.func,filterTreeNode:E.a.func,renderTreeNode:E.a.func,isKeyChecked:E.a.func,onNodeClick:E.a.func,onNodeDoubleClick:E.a.func,onNodeExpand:E.a.func,onNodeSelect:E.a.func,onNodeCheck:E.a.func,onNodeMouseEnter:E.a.func,onNodeMouseLeave:E.a.func,onNodeContextMenu:E.a.func,onNodeDragStart:E.a.func,onNodeDragEnter:E.a.func,onNodeDragOver:E.a.func,onNodeDragLeave:E.a.func,onNodeDragEnd:E.a.func,onNodeDrop:E.a.func})},O=g()({},k,{rcTreeNode:E.a.shape({onUpCheckConduct:E.a.func})}),N=n(787),D=n.n(N),G=n(65),_=n.n(G);function M(t){return t instanceof HTMLElement?t:_.a.findDOMNode(t)}var T=n(498),j=n.n(T),L=!("undefined"===typeof window||!window.document||!window.document.createElement);function V(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n["ms"+t]="MS"+e,n["O"+t]="o"+e.toLowerCase(),n}var Z=function(t,e){var n={animationend:V("Animation","AnimationEnd"),transitionend:V("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}(L,"undefined"!==typeof window?window:{}),P={};L&&(P=document.createElement("div").style);var W={};function J(t){if(W[t])return W[t];var e=Z[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var o=n[i];if(Object.prototype.hasOwnProperty.call(e,o)&&o in P)return W[t]=e[o],W[t]}return""}var H=J("animationend"),Y=J("transitionend"),X=!(!H||!Y);function z(t,e){return t?"object"===typeof t?t[e.replace(/-\w/g,(function(t){return t[1].toUpperCase()}))]:t+"-"+e:null}var K={eventProps:E.a.object,visible:E.a.bool,children:E.a.func,motionName:E.a.oneOfType([E.a.string,E.a.object]),motionAppear:E.a.bool,motionEnter:E.a.bool,motionLeave:E.a.bool,motionLeaveImmediately:E.a.bool,removeOnLeave:E.a.bool,leavedClassName:E.a.string,onAppearStart:E.a.func,onAppearActive:E.a.func,onAppearEnd:E.a.func,onEnterStart:E.a.func,onEnterActive:E.a.func,onEnterEnd:E.a.func,onLeaveStart:E.a.func,onLeaveActive:E.a.func,onLeaveEnd:E.a.func};var q=function(t){var e=t,n=!!A.a.forwardRef;function r(t){return!(!t.motionName||!e)}"object"===typeof t&&(e=t.transitionSupport,n="forwardRef"in t?t.forwardRef:n);var i=function(t){function e(){I()(this,e);var t=v()(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.onDomUpdate=function(){var e=t.state,n=e.status,i=e.newStatus,o=t.props,a=o.onAppearStart,A=o.onEnterStart,s=o.onLeaveStart,c=o.onAppearActive,u=o.onEnterActive,l=o.onLeaveActive,g=o.motionAppear,f=o.motionEnter,h=o.motionLeave;if(r(t.props)){var d=t.getElement();t.$cacheEle!==d&&(t.removeEventListener(t.$cacheEle),t.addEventListener(d),t.$cacheEle=d),i&&"appear"===n&&g?t.updateStatus(a,null,null,(function(){t.updateActiveStatus(c,"appear")})):i&&"enter"===n&&f?t.updateStatus(A,null,null,(function(){t.updateActiveStatus(u,"enter")})):i&&"leave"===n&&h&&t.updateStatus(s,null,null,(function(){t.updateActiveStatus(l,"leave")}))}},t.onMotionEnd=function(e){var n=t.state,r=n.status,i=n.statusActive,o=t.props,a=o.onAppearEnd,A=o.onEnterEnd,s=o.onLeaveEnd;"appear"===r&&i?t.updateStatus(a,{status:"none"},e):"enter"===r&&i?t.updateStatus(A,{status:"none"},e):"leave"===r&&i&&t.updateStatus(s,{status:"none"},e)},t.setNodeRef=function(e){var n=t.props.internalRef;t.node=e,"function"===typeof n?n(e):n&&"current"in n&&(n.current=e)},t.getElement=function(){return M(t.node||t)},t.addEventListener=function(e){e&&(e.addEventListener(Y,t.onMotionEnd),e.addEventListener(H,t.onMotionEnd))},t.removeEventListener=function(e){e&&(e.removeEventListener(Y,t.onMotionEnd),e.removeEventListener(H,t.onMotionEnd))},t.updateStatus=function(e,n,r,i){var o=e?e(t.getElement(),r):null;if(!1!==o&&!t._destroyed){var a=void 0;i&&(a=function(){t.nextFrame(i)}),t.setState(g()({statusStyle:"object"===typeof o?o:null,newStatus:!1},n),a)}},t.updateActiveStatus=function(e,n){t.nextFrame((function(){t.state.status===n&&t.updateStatus(e,{statusActive:!0})}))},t.nextFrame=function(e){t.cancelNextFrame(),t.raf=j()(e)},t.cancelNextFrame=function(){t.raf&&(j.a.cancel(t.raf),t.raf=null)},t.state={status:"none",statusActive:!1,newStatus:!1,statusStyle:null},t.$cacheEle=null,t.node=null,t.raf=null,t}return m()(e,t),C()(e,[{key:"componentDidMount",value:function(){this.onDomUpdate()}},{key:"componentDidUpdate",value:function(){this.onDomUpdate()}},{key:"componentWillUnmount",value:function(){this._destroyed=!0,this.removeEventListener(this.$cacheEle),this.cancelNextFrame()}},{key:"render",value:function(){var t,e=this.state,n=e.status,i=e.statusActive,o=e.statusStyle,a=this.props,A=a.children,s=a.motionName,c=a.visible,u=a.removeOnLeave,l=a.leavedClassName,f=a.eventProps;return A?"none"!==n&&r(this.props)?A(g()({},f,{className:F()((t={},h()(t,z(s,n),"none"!==n),h()(t,z(s,n+"-active"),"none"!==n&&i),h()(t,s,"string"===typeof s),t)),style:o}),this.setNodeRef):c?A(g()({},f),this.setNodeRef):u?null:A(g()({},f,{className:l}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,i=e.status;if(!r(t))return{};var o=t.visible,a=t.motionAppear,A=t.motionEnter,s=t.motionLeave,c=t.motionLeaveImmediately,u={prevProps:t};return("appear"===i&&!a||"enter"===i&&!A||"leave"===i&&!s)&&(u.status="none",u.statusActive=!1,u.newStatus=!1),!n&&o&&a&&(u.status="appear",u.statusActive=!1,u.newStatus=!0),n&&!n.visible&&o&&A&&(u.status="enter",u.statusActive=!1,u.newStatus=!0),(n&&n.visible&&!o&&s||!n&&c&&!o&&s)&&(u.status="leave",u.statusActive=!1,u.newStatus=!0),u}}]),e}(A.a.Component);return i.propTypes=g()({},K,{internalRef:E.a.oneOfType([E.a.object,E.a.func])}),i.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},Object(x.a)(i),n?A.a.forwardRef((function(t,e){return A.a.createElement(i,g()({internalRef:e},t))})):i}(X),$=function(t){function e(t){I()(this,e);var n=v()(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return tt.call(n),n.state={dragNodeHighlight:!1},n}return m()(e,t),C()(e,[{key:"getChildContext",value:function(){return g()({},this.context,{rcTreeNode:{}})}},{key:"componentDidMount",value:function(){var t=this.props.eventKey,e=this.context.rcTree.registerTreeNode;this.syncLoadData(this.props),e(t,this)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"componentWillUnmount",value:function(){var t=this.props.eventKey;(0,this.context.rcTree.registerTreeNode)(t,null)}},{key:"isSelectable",value:function(){var t=this.props.selectable,e=this.context.rcTree.selectable;return"boolean"===typeof t?t:e}},{key:"render",value:function(){var t,e=this.props.loading,n=this.props,r=n.className,i=n.style,o=n.dragOver,a=n.dragOverGapTop,s=n.dragOverGapBottom,c=n.isLeaf,u=n.expanded,l=n.selected,f=n.checked,d=n.halfChecked,I=D()(n,["className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked"]),p=this.context.rcTree,C=p.prefixCls,y=p.filterTreeNode,v=p.draggable,B=this.isDisabled(),m=vt(I);return A.a.createElement("li",g()({className:F()(r,(t={},h()(t,C+"-treenode-disabled",B),h()(t,C+"-treenode-switcher-"+(u?"open":"close"),!c),h()(t,C+"-treenode-checkbox-checked",f),h()(t,C+"-treenode-checkbox-indeterminate",d),h()(t,C+"-treenode-selected",l),h()(t,C+"-treenode-loading",e),h()(t,"drag-over",!B&&o),h()(t,"drag-over-gap-top",!B&&a),h()(t,"drag-over-gap-bottom",!B&&s),h()(t,"filter-node",y&&y(this)),t)),style:i,role:"treeitem",onDragEnter:v?this.onDragEnter:void 0,onDragOver:v?this.onDragOver:void 0,onDragLeave:v?this.onDragLeave:void 0,onDrop:v?this.onDrop:void 0,onDragEnd:v?this.onDragEnd:void 0},m),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector(),this.renderChildren())}}]),e}(A.a.Component);$.propTypes={eventKey:E.a.string,prefixCls:E.a.string,className:E.a.string,style:E.a.object,root:E.a.object,onSelect:E.a.func,expanded:E.a.bool,selected:E.a.bool,checked:E.a.bool,loaded:E.a.bool,loading:E.a.bool,halfChecked:E.a.bool,children:E.a.node,title:E.a.node,pos:E.a.string,dragOver:E.a.bool,dragOverGapTop:E.a.bool,dragOverGapBottom:E.a.bool,isLeaf:E.a.bool,checkable:E.a.bool,selectable:E.a.bool,disabled:E.a.bool,disableCheckbox:E.a.bool,icon:E.a.oneOfType([E.a.node,E.a.func]),switcherIcon:E.a.oneOfType([E.a.node,E.a.func])},$.contextTypes=O,$.childContextTypes=O,$.defaultProps={title:"---"};var tt=function(){var t=this;this.onSelectorClick=function(e){(0,t.context.rcTree.onNodeClick)(e,t),t.isSelectable()?t.onSelect(e):t.onCheck(e)},this.onSelectorDoubleClick=function(e){(0,t.context.rcTree.onNodeDoubleClick)(e,t)},this.onSelect=function(e){if(!t.isDisabled()){var n=t.context.rcTree.onNodeSelect;e.preventDefault(),n(e,t)}},this.onCheck=function(e){if(!t.isDisabled()){var n=t.props,r=n.disableCheckbox,i=n.checked,o=t.context.rcTree.onNodeCheck;if(t.isCheckable()&&!r)e.preventDefault(),o(e,t,!i)}},this.onMouseEnter=function(e){(0,t.context.rcTree.onNodeMouseEnter)(e,t)},this.onMouseLeave=function(e){(0,t.context.rcTree.onNodeMouseLeave)(e,t)},this.onContextMenu=function(e){(0,t.context.rcTree.onNodeContextMenu)(e,t)},this.onDragStart=function(e){var n=t.context.rcTree.onNodeDragStart;e.stopPropagation(),t.setState({dragNodeHighlight:!0}),n(e,t);try{e.dataTransfer.setData("text/plain","")}catch(r){}},this.onDragEnter=function(e){var n=t.context.rcTree.onNodeDragEnter;e.preventDefault(),e.stopPropagation(),n(e,t)},this.onDragOver=function(e){var n=t.context.rcTree.onNodeDragOver;e.preventDefault(),e.stopPropagation(),n(e,t)},this.onDragLeave=function(e){var n=t.context.rcTree.onNodeDragLeave;e.stopPropagation(),n(e,t)},this.onDragEnd=function(e){var n=t.context.rcTree.onNodeDragEnd;e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,t)},this.onDrop=function(e){var n=t.context.rcTree.onNodeDrop;e.preventDefault(),e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,t)},this.onExpand=function(e){(0,t.context.rcTree.onNodeExpand)(e,t)},this.setSelectHandle=function(e){t.selectHandle=e},this.getNodeChildren=function(){var e=U(t.props.children).filter((function(t){return t})),n=st(e);return e.length!==n.length&&rt(),n},this.getNodeState=function(){var e=t.props.expanded;return t.isLeaf()?null:e?"open":"close"},this.isLeaf=function(){var e=t.props,n=e.isLeaf,r=e.loaded,i=t.context.rcTree.loadData,o=0!==t.getNodeChildren().length;return!1!==n&&(n||!i&&!o||i&&r&&!o)},this.isDisabled=function(){var e=t.props.disabled,n=t.context.rcTree.disabled;return!1!==e&&!(!n&&!e)},this.isCheckable=function(){var e=t.props.checkable,n=t.context.rcTree.checkable;return!(!n||!1===e)&&n},this.syncLoadData=function(e){var n=e.expanded,r=e.loading,i=e.loaded,o=t.context.rcTree,a=o.loadData,A=o.onNodeLoad;r||a&&n&&!t.isLeaf()&&(0!==t.getNodeChildren().length||i||A(t))},this.renderSwitcher=function(){var e=t.props,n=e.expanded,r=e.switcherIcon,i=t.context.rcTree,o=i.prefixCls,a=i.switcherIcon,s=r||a;if(t.isLeaf())return A.a.createElement("span",{className:F()(o+"-switcher",o+"-switcher-noop")},"function"===typeof s?s(g()({},t.props,{isLeaf:!0})):s);var c=F()(o+"-switcher",o+"-switcher_"+(n?"open":"close"));return A.a.createElement("span",{onClick:t.onExpand,className:c},"function"===typeof s?s(g()({},t.props,{isLeaf:!1})):s)},this.renderCheckbox=function(){var e=t.props,n=e.checked,r=e.halfChecked,i=e.disableCheckbox,o=t.context.rcTree.prefixCls,a=t.isDisabled(),s=t.isCheckable();if(!s)return null;var c="boolean"!==typeof s?s:null;return A.a.createElement("span",{className:F()(o+"-checkbox",n&&o+"-checkbox-checked",!n&&r&&o+"-checkbox-indeterminate",(a||i)&&o+"-checkbox-disabled"),onClick:t.onCheck},c)},this.renderIcon=function(){var e=t.props.loading,n=t.context.rcTree.prefixCls;return A.a.createElement("span",{className:F()(n+"-iconEle",n+"-icon__"+(t.getNodeState()||"docu"),e&&n+"-icon_loading")})},this.renderSelector=function(){var e=t.state.dragNodeHighlight,n=t.props,r=n.title,i=n.selected,o=n.icon,a=n.loading,s=t.context.rcTree,c=s.prefixCls,u=s.showIcon,l=s.icon,f=s.draggable,h=s.loadData,d=t.isDisabled(),I=c+"-node-content-wrapper",p=void 0;if(u){var C=o||l;p=C?A.a.createElement("span",{className:F()(c+"-iconEle",c+"-icon__customize")},"function"===typeof C?A.a.createElement(C,g()({},t.props)):C):t.renderIcon()}else h&&a&&(p=t.renderIcon());var y=A.a.createElement("span",{className:c+"-title"},r);return A.a.createElement("span",{ref:t.setSelectHandle,title:"string"===typeof r?r:"",className:F()(""+I,I+"-"+(t.getNodeState()||"normal"),!d&&(i||e)&&c+"-node-selected",!d&&f&&"draggable"),draggable:!d&&f||void 0,"aria-grabbed":!d&&f||void 0,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onContextMenu:t.onContextMenu,onClick:t.onSelectorClick,onDoubleClick:t.onSelectorDoubleClick,onDragStart:f?t.onDragStart:void 0},p,y)},this.renderChildren=function(){var e=t.props,n=e.expanded,r=e.pos,i=t.context.rcTree,o=i.prefixCls,a=i.motion,s=i.renderTreeNode,c=t.getNodeChildren();return 0===c.length?null:A.a.createElement(q,g()({visible:n},a),(function(t){var e=t.style,i=t.className;return A.a.createElement("ul",{className:F()(i,o+"-child-tree",n&&o+"-child-tree-open"),style:e,"data-expanded":n,role:"group"},lt(c,(function(t,e){return s(t,e,r)})))}))}};$.isTreeNode=1,Object(x.a)($);var et=$,nt=!1;function rt(){nt||(nt=!0,S()(!1,"Tree only accept TreeNode as children."))}function it(t,e){var n=t.slice(),r=n.indexOf(e);return r>=0&&n.splice(r,1),n}function ot(t,e){var n=t.slice();return-1===n.indexOf(e)&&n.push(e),n}function at(t,e){return t+"-"+e}function At(t){return t&&t.type&&t.type.isTreeNode}function st(t){return U(t).filter(At)}function ct(t){var e=t.props||{},n=e.disabled,r=e.disableCheckbox;return!(!n&&!r)}function ut(t,e){!function n(r,i,o){var A=r?r.props.children:t,s=r?at(o.pos,i):0,c=st(A);if(r){var u={node:r,index:i,pos:s,key:r.key||s,parentPos:o.node?o.pos:null};e(u)}a.Children.forEach(c,(function(t,e){n(t,e,{node:r,pos:s})}))}(null)}function lt(t,e){var n=U(t).map(e);return 1===n.length?n[0]:n}function gt(t,e){var n=e.props,r=n.eventKey,i=n.pos,o=[];return ut(t,(function(t){var e=t.key;o.push(e)})),o.push(r||i),o}function ft(t,e){var n=t.clientY,r=e.selectHandle.getBoundingClientRect(),i=r.top,o=r.bottom,a=r.height,A=Math.max(.25*a,2);return n<=i+A?-1:n>=o-A?1:0}function ht(t,e){if(t)return e.multiple?t.slice():t.length?[t[0]]:t}function dt(t){return t?t.map((function(t){return String(t)})):t}var It=function(t){return t};function pt(t){if(!t)return null;var e=void 0;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else{if("object"!==typeof t)return S()(!1,"`checkedKeys` is not an array or an object"),null;e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0}}return e.checkedKeys=dt(e.checkedKeys),e.halfCheckedKeys=dt(e.halfCheckedKeys),e}function Ct(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={},o={};function a(t){if(i[t]!==e){var r=n[t];if(r){var A=r.children,s=r.parent;if(!ct(r.node)){var c=!0,u=!1;(A||[]).filter((function(t){return!ct(t.node)})).forEach((function(t){var e=t.key,n=i[e],r=o[e];(n||r)&&(u=!0),n||(c=!1)})),i[t]=!!e&&c,o[t]=u,s&&a(s.key)}}}}function A(t){if(i[t]!==e){var r=n[t];if(r){var o=r.children;ct(r.node)||(i[t]=e,(o||[]).forEach((function(t){A(t.key)})))}}}function s(t){var r=n[t];if(r){var o=r.children,s=r.parent,c=r.node;i[t]=e,ct(c)||((o||[]).filter((function(t){return!ct(t.node)})).forEach((function(t){A(t.key)})),s&&a(s.key))}else S()(!1,"'"+t+"' does not exist in the tree.")}(r.checkedKeys||[]).forEach((function(t){i[t]=!0})),(r.halfCheckedKeys||[]).forEach((function(t){o[t]=!0})),(t||[]).forEach((function(t){s(t)}));var c=[],u=[];return Object.keys(i).forEach((function(t){i[t]&&c.push(t)})),Object.keys(o).forEach((function(t){!i[t]&&o[t]&&u.push(t)})),{checkedKeys:c,halfCheckedKeys:u}}function yt(t,e){var n={};return(t||[]).forEach((function(t){!function t(r){if(!n[r]){var i=e[r];if(i){n[r]=!0;var o=i.parent;ct(i.node)||o&&t(o.key)}}}(t)})),Object.keys(n)}function vt(t){return Object.keys(t).reduce((function(e,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)||(e[n]=t[n]),e}),{})}var Bt=function(t){function e(t){I()(this,e);var n=v()(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.onNodeDragStart=function(t,e){var r=n.state.expandedKeys,i=n.props.onDragStart,o=e.props,a=o.eventKey,A=o.children;n.dragNode=e,n.setState({dragNodesKeys:gt(A,e),expandedKeys:it(r,a)}),i&&i({event:t,node:e})},n.onNodeDragEnter=function(t,e){var r=n.state.expandedKeys,i=n.props.onDragEnter,o=e.props,a=o.pos,A=o.eventKey;if(n.dragNode){var s=ft(t,e);n.dragNode.props.eventKey!==A||0!==s?setTimeout((function(){n.setState({dragOverNodeKey:A,dropPosition:s}),n.delayedDragEnterLogic||(n.delayedDragEnterLogic={}),Object.keys(n.delayedDragEnterLogic).forEach((function(t){clearTimeout(n.delayedDragEnterLogic[t])})),n.delayedDragEnterLogic[a]=setTimeout((function(){var o=ot(r,A);"expandedKeys"in n.props||n.setState({expandedKeys:o}),i&&i({event:t,node:e,expandedKeys:o})}),400)}),0):n.setState({dragOverNodeKey:"",dropPosition:null})}},n.onNodeDragOver=function(t,e){var r=n.props.onDragOver,i=e.props.eventKey;if(n.dragNode&&i===n.state.dragOverNodeKey){var o=ft(t,e);if(o===n.state.dropPosition)return;n.setState({dropPosition:o})}r&&r({event:t,node:e})},n.onNodeDragLeave=function(t,e){var r=n.props.onDragLeave;n.setState({dragOverNodeKey:""}),r&&r({event:t,node:e})},n.onNodeDragEnd=function(t,e){var r=n.props.onDragEnd;n.setState({dragOverNodeKey:""}),r&&r({event:t,node:e}),n.dragNode=null},n.onNodeDrop=function(t,e){var r=n.state,i=r.dragNodesKeys,o=void 0===i?[]:i,a=r.dropPosition,A=n.props.onDrop,s=e.props,c=s.eventKey,u=s.pos;if(n.setState({dragOverNodeKey:""}),-1===o.indexOf(c)){var l=function(t){return t.split("-")}(u),g={event:t,node:e,dragNode:n.dragNode,dragNodesKeys:o.slice(),dropPosition:a+Number(l[l.length-1])};0!==a&&(g.dropToGap=!0),A&&A(g),n.dragNode=null}else S()(!1,"Can not drop to dragNode(include it's children node)")},n.onNodeClick=function(t,e){var r=n.props.onClick;r&&r(t,e)},n.onNodeDoubleClick=function(t,e){var r=n.props.onDoubleClick;r&&r(t,e)},n.onNodeSelect=function(t,e){var r=n.state.selectedKeys,i=n.state.keyEntities,o=n.props,a=o.onSelect,A=o.multiple,s=e.props,c=s.selected,u=s.eventKey,l=!c,g=(r=l?A?ot(r,u):[u]:it(r,u)).map((function(t){var e=i[t];return e?e.node:null})).filter((function(t){return t}));(n.setUncontrolledState({selectedKeys:r}),a)&&a(r,{event:"select",selected:l,node:e,selectedNodes:g,nativeEvent:t.nativeEvent})},n.onNodeCheck=function(t,e,r){var i=n.state,o=i.keyEntities,a=i.checkedKeys,A=i.halfCheckedKeys,s=n.props,c=s.checkStrictly,u=s.onCheck,l=e.props.eventKey,g=void 0,f={event:"check",node:e,checked:r,nativeEvent:t.nativeEvent};if(c){var h=r?ot(a,l):it(a,l);g={checked:h,halfChecked:it(A,l)},f.checkedNodes=h.map((function(t){return o[t]})).filter((function(t){return t})).map((function(t){return t.node})),n.setUncontrolledState({checkedKeys:h})}else{var d=Ct([l],r,o,{checkedKeys:a,halfCheckedKeys:A}),I=d.checkedKeys,p=d.halfCheckedKeys;g=I,f.checkedNodes=[],f.checkedNodesPositions=[],f.halfCheckedKeys=p,I.forEach((function(t){var e=o[t];if(e){var n=e.node,r=e.pos;f.checkedNodes.push(n),f.checkedNodesPositions.push({node:n,pos:r})}})),n.setUncontrolledState({checkedKeys:I,halfCheckedKeys:p})}u&&u(g,f)},n.onNodeLoad=function(t){return new Promise((function(e){n.setState((function(r){var i=r.loadedKeys,o=void 0===i?[]:i,a=r.loadingKeys,A=void 0===a?[]:a,s=n.props,c=s.loadData,u=s.onLoad,l=t.props.eventKey;return c&&-1===o.indexOf(l)&&-1===A.indexOf(l)?(c(t).then((function(){var r=ot(n.state.loadedKeys,l),i=it(n.state.loadingKeys,l);u&&u(r,{event:"load",node:t});n.setUncontrolledState({loadedKeys:r}),n.setState({loadingKeys:i}),e()})),{loadingKeys:ot(A,l)}):{}}))}))},n.onNodeExpand=function(t,e){var r=n.state.expandedKeys,i=n.props,o=i.onExpand,a=i.loadData,A=e.props,s=A.eventKey,c=A.expanded,u=r.indexOf(s),l=!c;if(S()(c&&-1!==u||!c&&-1===u,"Expand state not sync with index check"),r=l?ot(r,s):it(r,s),n.setUncontrolledState({expandedKeys:r}),o&&o(r,{node:e,expanded:l,nativeEvent:t.nativeEvent}),l&&a){var g=n.onNodeLoad(e);return g?g.then((function(){n.setUncontrolledState({expandedKeys:r})})):null}return null},n.onNodeMouseEnter=function(t,e){var r=n.props.onMouseEnter;r&&r({event:t,node:e})},n.onNodeMouseLeave=function(t,e){var r=n.props.onMouseLeave;r&&r({event:t,node:e})},n.onNodeContextMenu=function(t,e){var r=n.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:e}))},n.setUncontrolledState=function(t){var e=!1,r={};Object.keys(t).forEach((function(i){i in n.props||(e=!0,r[i]=t[i])})),e&&n.setState(r)},n.registerTreeNode=function(t,e){e?n.domTreeNodes[t]=e:delete n.domTreeNodes[t]},n.isKeyChecked=function(t){var e=n.state.checkedKeys;return-1!==(void 0===e?[]:e).indexOf(t)},n.renderTreeNode=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=n.state,o=i.keyEntities,a=i.expandedKeys,s=void 0===a?[]:a,c=i.selectedKeys,u=void 0===c?[]:c,l=i.halfCheckedKeys,g=void 0===l?[]:l,f=i.loadedKeys,h=void 0===f?[]:f,d=i.loadingKeys,I=void 0===d?[]:d,p=i.dragOverNodeKey,C=i.dropPosition,y=at(r,e),v=t.key||y;return o[v]?A.a.cloneElement(t,{key:v,eventKey:v,expanded:-1!==s.indexOf(v),selected:-1!==u.indexOf(v),loaded:-1!==h.indexOf(v),loading:-1!==I.indexOf(v),checked:n.isKeyChecked(v),halfChecked:-1!==g.indexOf(v),pos:y,dragOver:p===v&&0===C,dragOverGapTop:p===v&&-1===C,dragOverGapBottom:p===v&&1===C}):(rt(),null)},n.state={posEntities:{},keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],treeNode:[]},n.domTreeNodes={},n}return m()(e,t),C()(e,[{key:"getChildContext",value:function(){var t=this.props,e=t.prefixCls,n=t.selectable,r=t.showIcon,i=t.icon,o=t.draggable,a=t.checkable,A=t.checkStrictly,s=t.disabled,c=t.loadData,u=t.filterTreeNode,l=t.motion;return{rcTree:{prefixCls:e,selectable:n,showIcon:r,icon:i,switcherIcon:t.switcherIcon,draggable:o,checkable:a,checkStrictly:A,disabled:s,motion:l,loadData:c,filterTreeNode:u,renderTreeNode:this.renderTreeNode,isKeyChecked:this.isKeyChecked,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop,registerTreeNode:this.registerTreeNode}}}},{key:"render",value:function(){var t=this,e=this.state.treeNode,n=this.props,r=n.prefixCls,i=n.className,o=n.focusable,a=n.style,s=n.showLine,c=n.tabIndex,u=void 0===c?0:c,l=vt(this.props);return o&&(l.tabIndex=u,l.onKeyDown=this.onKeyDown),A.a.createElement("ul",g()({},l,{className:F()(r,i,h()({},r+"-show-line",s)),style:a,role:"tree",unselectable:"on"}),lt(e,(function(e,n){return t.renderTreeNode(e,n)})))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,r={prevProps:t};function i(e){return!n&&e in t||n&&n[e]!==t[e]}var o=null;if(i("treeData")?o=function t(e,n){if(!e)return[];var r=(n||{}).processProps,i=void 0===r?It:r;return(Array.isArray(e)?e:[e]).map((function(e){var r=e.children,o=D()(e,["children"]),a=t(r,n);return A.a.createElement(et,i(o),a)}))}(t.treeData):i("children")&&(o=U(t.children)),o){r.treeNode=o;var a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.initWrapper,r=e.processEntity,i=e.onProcessFinished,o={},a={},A={posEntities:o,keyEntities:a};return n&&(A=n(A)||A),ut(t,(function(t){var e=t.node,n=t.index,i=t.pos,s=t.key,c=t.parentPos,u={node:e,index:n,key:s,pos:i};o[i]=u,a[s]=u,u.parent=o[c],u.parent&&(u.parent.children=u.parent.children||[],u.parent.children.push(u)),r&&r(u,A)})),i&&i(A),A}(o);r.posEntities=a.posEntities,r.keyEntities=a.keyEntities}var s=r.keyEntities||e.keyEntities;if(i("expandedKeys")||n&&i("autoExpandParent")?r.expandedKeys=t.autoExpandParent||!n&&t.defaultExpandParent?yt(t.expandedKeys,s):t.expandedKeys:!n&&t.defaultExpandAll?r.expandedKeys=Object.keys(s):!n&&t.defaultExpandedKeys&&(r.expandedKeys=t.autoExpandParent||t.defaultExpandParent?yt(t.defaultExpandedKeys,s):t.defaultExpandedKeys),t.selectable&&(i("selectedKeys")?r.selectedKeys=ht(t.selectedKeys,t):!n&&t.defaultSelectedKeys&&(r.selectedKeys=ht(t.defaultSelectedKeys,t))),t.checkable){var c=void 0;if(i("checkedKeys")?c=pt(t.checkedKeys)||{}:!n&&t.defaultCheckedKeys?c=pt(t.defaultCheckedKeys)||{}:o&&(c=pt(t.checkedKeys)||{checkedKeys:e.checkedKeys,halfCheckedKeys:e.halfCheckedKeys}),c){var u=c,l=u.checkedKeys,g=void 0===l?[]:l,f=u.halfCheckedKeys,h=void 0===f?[]:f;if(!t.checkStrictly){var d=Ct(g,!0,s);g=d.checkedKeys,h=d.halfCheckedKeys}r.checkedKeys=g,r.halfCheckedKeys=h}}return i("loadedKeys")&&(r.loadedKeys=t.loadedKeys),r}}]),e}(A.a.Component);Bt.propTypes={prefixCls:E.a.string,className:E.a.string,style:E.a.object,tabIndex:E.a.oneOfType([E.a.string,E.a.number]),children:E.a.any,treeData:E.a.array,showLine:E.a.bool,showIcon:E.a.bool,icon:E.a.oneOfType([E.a.node,E.a.func]),focusable:E.a.bool,selectable:E.a.bool,disabled:E.a.bool,multiple:E.a.bool,checkable:E.a.oneOfType([E.a.bool,E.a.node]),checkStrictly:E.a.bool,draggable:E.a.bool,defaultExpandParent:E.a.bool,autoExpandParent:E.a.bool,defaultExpandAll:E.a.bool,defaultExpandedKeys:E.a.arrayOf(E.a.string),expandedKeys:E.a.arrayOf(E.a.string),defaultCheckedKeys:E.a.arrayOf(E.a.string),checkedKeys:E.a.oneOfType([E.a.arrayOf(E.a.oneOfType([E.a.string,E.a.number])),E.a.object]),defaultSelectedKeys:E.a.arrayOf(E.a.string),selectedKeys:E.a.arrayOf(E.a.string),onClick:E.a.func,onDoubleClick:E.a.func,onExpand:E.a.func,onCheck:E.a.func,onSelect:E.a.func,onLoad:E.a.func,loadData:E.a.func,loadedKeys:E.a.arrayOf(E.a.string),onMouseEnter:E.a.func,onMouseLeave:E.a.func,onRightClick:E.a.func,onDragStart:E.a.func,onDragEnter:E.a.func,onDragOver:E.a.func,onDragLeave:E.a.func,onDragEnd:E.a.func,onDrop:E.a.func,filterTreeNode:E.a.func,motion:E.a.object,switcherIcon:E.a.oneOfType([E.a.node,E.a.func])},Bt.childContextTypes=k,Bt.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},Object(x.a)(Bt);var mt=Bt;mt.TreeNode=et;var bt=mt,Et=A.a.forwardRef((function(t,e){var n,r=t.prefixCls,i=t.className,o=t.showIcon,a=t.blockNode,s=t.children,c=t.checkable;return A.a.createElement(bt,Object.assign({itemHeight:32,ref:e},t,{className:F()(i,(n={},Object(u.a)(n,"".concat(r,"-icon-hide"),!o),Object(u.a)(n,"".concat(r,"-block-node"),a),n)),checkable:c?A.a.createElement("span",{className:"".concat(r,"-checkbox-inner")}):c}),s)}));Et.defaultProps={virtual:!1,checkable:!1,showIcon:!1,blockNode:!0,prefixCls:"rc-tree"};var Qt=Et,Ft=n(325),wt=n(11),St=n(14),Rt=n(61),Ut=n(24),xt=n(25),kt=n(32),Ot=n(308),Nt=n.n(Ot),Dt=n(1100),Gt=n(116),_t=n(75);function Mt(t,e){for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}function Tt(t){return(Tt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){"function"===typeof t?t(e):"object"===Tt(t)&&t&&"current"in t&&(t.current=e)}function Lt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){e.forEach((function(e){jt(e,t)}))}}var Vt=n(1101),Zt=n.n(Vt);function Pt(t,e,n,r){var i=_.a.unstable_batchedUpdates?function(t){_.a.unstable_batchedUpdates(n,t)}:n;return Zt()(t,e,i,r)}function Wt(t){return(Wt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yt(t,e){return!e||"object"!==Wt(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Xt(t){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zt(t,e){return(zt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Kt,qt=function(t){function e(){return Jt(this,e),Yt(this,Xt(e).apply(this,arguments))}var n,r,i;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zt(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){this.createContainer()}},{key:"componentDidUpdate",value:function(t){var e=this.props.didUpdate;e&&e(t)}},{key:"componentWillUnmount",value:function(){this.removeContainer()}},{key:"createContainer",value:function(){this._container=this.props.getContainer(),this.forceUpdate()}},{key:"removeContainer",value:function(){this._container&&this._container.parentNode.removeChild(this._container)}},{key:"render",value:function(){return this._container?_.a.createPortal(this.props.children,this._container):null}}])&&Ht(n.prototype,r),i&&Ht(n,i),e}(A.a.Component);function $t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function te(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(n),!0).forEach((function(e){ee(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ne(t,e,n){return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function re(t){return(re="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ie(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}qt.propTypes={getContainer:E.a.func.isRequired,children:E.a.node.isRequired,didUpdate:E.a.func};var ae={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Ae(){if(void 0!==Kt)return Kt;Kt="";var t=document.createElement("p").style;for(var e in ae)e+"Transform"in t&&(Kt=e);return Kt}function se(){return Ae()?"".concat(Ae(),"TransitionProperty"):"transitionProperty"}function ce(){return Ae()?"".concat(Ae(),"Transform"):"transform"}function ue(t,e){var n=se();n&&(t.style[n]=e,"transitionProperty"!==n&&(t.style.transitionProperty=e))}function le(t,e){var n=ce();n&&(t.style[n]=e,"transform"!==n&&(t.style.transform=e))}var ge,fe=/matrix\((.*)\)/,he=/matrix3d\((.*)\)/;function de(t){var e=t.style.display;t.style.display="none",t.offsetHeight,t.style.display=e}function Ie(t,e,n){var r=n;if("object"!==re(e))return"undefined"!==typeof r?("number"===typeof r&&(r="".concat(r,"px")),void(t.style[e]=r)):ge(t,e);for(var i in e)e.hasOwnProperty(i)&&Ie(t,i,e[i])}function pe(t,e){var n=t["page".concat(e?"Y":"X","Offset")],r="scroll".concat(e?"Top":"Left");if("number"!==typeof n){var i=t.document;"number"!==typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function Ce(t){return pe(t)}function ye(t){return pe(t,!0)}function ve(t){var e=function(t){var e,n,r,i=t.ownerDocument,o=i.body,a=i&&i.documentElement;return n=(e=t.getBoundingClientRect()).left,r=e.top,{left:n-=a.clientLeft||o.clientLeft||0,top:r-=a.clientTop||o.clientTop||0}}(t),n=t.ownerDocument,r=n.defaultView||n.parentWindow;return e.left+=Ce(r),e.top+=ye(r),e}function Be(t){return null!==t&&void 0!==t&&t==t.window}function me(t){return Be(t)?t.document:9===t.nodeType?t:t.ownerDocument}var be=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Ee=/^(top|right|bottom|left)$/,Qe="left";function Fe(t,e){return"left"===t?e.useCssRight?"right":t:e.useCssBottom?"bottom":t}function we(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"bottom"===t?"top":void 0}function Se(t,e,n){"static"===Ie(t,"position")&&(t.style.position="relative");var r=-999,i=-999,o=Fe("left",n),a=Fe("top",n),A=we(o),s=we(a);"left"!==o&&(r=999),"top"!==a&&(i=999);var c,u="",l=ve(t);("left"in e||"top"in e)&&(u=(c=t).style.transitionProperty||c.style[se()]||"",ue(t,"none")),"left"in e&&(t.style[A]="",t.style[o]="".concat(r,"px")),"top"in e&&(t.style[s]="",t.style[a]="".concat(i,"px")),de(t);var g=ve(t),f={};for(var h in e)if(e.hasOwnProperty(h)){var d=Fe(h,n),I="left"===h?r:i,p=l[h]-g[h];f[d]=d===h?I+p:I-p}Ie(t,f),de(t),("left"in e||"top"in e)&&ue(t,u);var C={};for(var y in e)if(e.hasOwnProperty(y)){var v=Fe(y,n),B=e[y]-l[y];C[v]=y===v?f[v]+B:f[v]-B}Ie(t,C)}function Re(t,e){var n=ve(t),r=function(t){var e=window.getComputedStyle(t,null),n=e.getPropertyValue("transform")||e.getPropertyValue(ce());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(t),i={x:r.x,y:r.y};"left"in e&&(i.x=r.x+e.left-n.left),"top"in e&&(i.y=r.y+e.top-n.top),function(t,e){var n=window.getComputedStyle(t,null),r=n.getPropertyValue("transform")||n.getPropertyValue(ce());if(r&&"none"!==r){var i,o=r.match(fe);if(o)(i=(o=o[1]).split(",").map((function(t){return parseFloat(t,10)})))[4]=e.x,i[5]=e.y,le(t,"matrix(".concat(i.join(","),")"));else(i=r.match(he)[1].split(",").map((function(t){return parseFloat(t,10)})))[12]=e.x,i[13]=e.y,le(t,"matrix3d(".concat(i.join(","),")"))}else le(t,"translateX(".concat(e.x,"px) translateY(").concat(e.y,"px) translateZ(0)"))}(t,i)}function Ue(t,e){for(var n=0;n<t.length;n++)e(t[n])}function xe(t){return"border-box"===ge(t,"boxSizing")}"undefined"!==typeof window&&(ge=window.getComputedStyle?function(t,e,n){var r=n,i="",o=me(t);return(r=r||o.defaultView.getComputedStyle(t,null))&&(i=r.getPropertyValue(e)||r[e]),i}:function(t,e){var n=t.currentStyle&&t.currentStyle[e];if(be.test(n)&&!Ee.test(e)){var r=t.style,i=r[Qe],o=t.runtimeStyle[Qe];t.runtimeStyle[Qe]=t.currentStyle[Qe],r[Qe]="fontSize"===e?"1em":n||0,n=r.pixelLeft+"px",r[Qe]=i,t.runtimeStyle[Qe]=o}return""===n?"auto":n});var ke=["margin","border","padding"];function Oe(t,e,n){var r,i={},o=t.style;for(r in e)e.hasOwnProperty(r)&&(i[r]=o[r],o[r]=e[r]);for(r in n.call(t),e)e.hasOwnProperty(r)&&(o[r]=i[r])}function Ne(t,e,n){var r,i,o,a=0;for(i=0;i<e.length;i++)if(r=e[i])for(o=0;o<n.length;o++){var A=void 0;A="border"===r?"".concat(r).concat(n[o],"Width"):r+n[o],a+=parseFloat(ge(t,A))||0}return a}var De={getParent:function(t){var e=t;do{e=11===e.nodeType&&e.host?e.host:e.parentNode}while(e&&1!==e.nodeType&&9!==e.nodeType);return e}};function Ge(t,e,n){var r=n;if(Be(t))return"width"===e?De.viewportWidth(t):De.viewportHeight(t);if(9===t.nodeType)return"width"===e?De.docWidth(t):De.docHeight(t);var i="width"===e?["Left","Right"]:["Top","Bottom"],o="width"===e?t.getBoundingClientRect().width:t.getBoundingClientRect().height,a=(ge(t),xe(t)),A=0;(null===o||void 0===o||o<=0)&&(o=void 0,(null===(A=ge(t,e))||void 0===A||Number(A)<0)&&(A=t.style[e]||0),A=parseFloat(A)||0),void 0===r&&(r=a?1:-1);var s=void 0!==o||a,c=o||A;return-1===r?s?c-Ne(t,["border","padding"],i):A:s?1===r?c:c+(2===r?-Ne(t,["border"],i):Ne(t,["margin"],i)):A+Ne(t,ke.slice(r),i)}Ue(["Width","Height"],(function(t){De["doc".concat(t)]=function(e){var n=e.document;return Math.max(n.documentElement["scroll".concat(t)],n.body["scroll".concat(t)],De["viewport".concat(t)](n))},De["viewport".concat(t)]=function(e){var n="client".concat(t),r=e.document,i=r.body,o=r.documentElement[n];return"CSS1Compat"===r.compatMode&&o||i&&i[n]||o}}));var _e={position:"absolute",visibility:"hidden",display:"block"};function Me(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e[0];return 0!==i.offsetWidth?r=Ge.apply(void 0,e):Oe(i,_e,(function(){r=Ge.apply(void 0,e)})),r}function Te(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}Ue(["width","height"],(function(t){var e=t.charAt(0).toUpperCase()+t.slice(1);De["outer".concat(e)]=function(e,n){return e&&Me(e,t,n?0:1)};var n="width"===t?["Left","Right"]:["Top","Bottom"];De[t]=function(e,r){var i=r;if(void 0===i)return e&&Me(e,t,-1);if(e){ge(e);return xe(e)&&(i+=Ne(e,["padding","border"],n)),Ie(e,t,i)}}}));var je={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},getDocument:me,offset:function(t,e,n){if("undefined"===typeof e)return ve(t);!function(t,e,n){if(n.ignoreShake){var r=ve(t),i=r.left.toFixed(0),o=r.top.toFixed(0),a=e.left.toFixed(0),A=e.top.toFixed(0);if(i===a&&o===A)return}n.useCssRight||n.useCssBottom?Se(t,e,n):n.useCssTransform&&ce()in document.body.style?Re(t,e):Se(t,e,n)}(t,e,n||{})},isWindow:Be,each:Ue,css:Ie,clone:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);if(t.overflow)for(e in t)t.hasOwnProperty(e)&&(n.overflow[e]=t.overflow[e]);return n},mix:Te,getWindowScrollLeft:function(t){return Ce(t)},getWindowScrollTop:function(t){return ye(t)},merge:function(){for(var t={},e=0;e<arguments.length;e++)je.mix(t,e<0||arguments.length<=e?void 0:arguments[e]);return t},viewportWidth:0,viewportHeight:0};Te(je,De);var Le=je.getParent;function Ve(t){if(je.isWindow(t)||9===t.nodeType)return null;var e,n=je.getDocument(t).body,r=je.css(t,"position");if(!("fixed"===r||"absolute"===r))return"html"===t.nodeName.toLowerCase()?null:Le(t);for(e=Le(t);e&&e!==n&&9!==e.nodeType;e=Le(e))if("static"!==(r=je.css(e,"position")))return e;return null}var Ze=je.getParent;function Pe(t,e){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=Ve(t),i=je.getDocument(t),o=i.defaultView||i.parentWindow,a=i.body,A=i.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===A||"visible"===je.css(r,"overflow")){if(r===a||r===A)break}else{var s=je.offset(r);s.left+=r.clientLeft,s.top+=r.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+r.clientWidth),n.bottom=Math.min(n.bottom,s.top+r.clientHeight),n.left=Math.max(n.left,s.left)}r=Ve(r)}var c=null;je.isWindow(t)||9===t.nodeType||(c=t.style.position,"absolute"===je.css(t,"position")&&(t.style.position="fixed"));var u=je.getWindowScrollLeft(o),l=je.getWindowScrollTop(o),g=je.viewportWidth(o),f=je.viewportHeight(o),h=A.scrollWidth,d=A.scrollHeight,I=window.getComputedStyle(a);if("hidden"===I.overflowX&&(h=o.innerWidth),"hidden"===I.overflowY&&(d=o.innerHeight),t.style&&(t.style.position=c),e||function(t){if(je.isWindow(t)||9===t.nodeType)return!1;var e=je.getDocument(t).body,n=null;for(n=Ze(t);n&&n!==e;n=Ze(n)){if("fixed"===je.css(n,"position"))return!0}return!1}(t))n.left=Math.max(n.left,u),n.top=Math.max(n.top,l),n.right=Math.min(n.right,u+g),n.bottom=Math.min(n.bottom,l+f);else{var p=Math.max(h,u+g);n.right=Math.min(n.right,p);var C=Math.max(d,l+f);n.bottom=Math.min(n.bottom,C)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function We(t){var e,n,r;if(je.isWindow(t)||9===t.nodeType){var i=je.getWindow(t);e={left:je.getWindowScrollLeft(i),top:je.getWindowScrollTop(i)},n=je.viewportWidth(i),r=je.viewportHeight(i)}else e=je.offset(t),n=je.outerWidth(t),r=je.outerHeight(t);return e.width=n,e.height=r,e}function Je(t,e){var n=e.charAt(0),r=e.charAt(1),i=t.width,o=t.height,a=t.left,A=t.top;return"c"===n?A+=o/2:"b"===n&&(A+=o),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:A}}function He(t,e,n,r,i){var o=Je(e,n[1]),a=Je(t,n[0]),A=[a.left-o.left,a.top-o.top];return{left:Math.round(t.left-A[0]+r[0]-i[0]),top:Math.round(t.top-A[1]+r[1]-i[1])}}function Ye(t,e,n){return t.left<n.left||t.left+e.width>n.right}function Xe(t,e,n){return t.top<n.top||t.top+e.height>n.bottom}function ze(t,e,n){var r=[];return je.each(t,(function(t){r.push(t.replace(e,(function(t){return n[t]})))})),r}function Ke(t,e){return t[e]=-t[e],t}function qe(t,e){return(/%$/.test(t)?parseInt(t.substring(0,t.length-1),10)/100*e:parseInt(t,10))||0}function $e(t,e){t[0]=qe(t[0],e.width),t[1]=qe(t[1],e.height)}function tn(t,e,n,r){var i=n.points,o=n.offset||[0,0],a=n.targetOffset||[0,0],A=n.overflow,s=n.source||t;o=[].concat(o),a=[].concat(a);var c={},u=0,l=Pe(s,!(!(A=A||{})||!A.alwaysByViewport)),g=We(s);$e(o,g),$e(a,e);var f=He(g,e,i,o,a),h=je.merge(g,f);if(l&&(A.adjustX||A.adjustY)&&r){if(A.adjustX&&Ye(f,g,l)){var d=ze(i,/[lr]/gi,{l:"r",r:"l"}),I=Ke(o,0),p=Ke(a,0);(function(t,e,n){return t.left>n.right||t.left+e.width<n.left})(He(g,e,d,I,p),g,l)||(u=1,i=d,o=I,a=p)}if(A.adjustY&&Xe(f,g,l)){var C=ze(i,/[tb]/gi,{t:"b",b:"t"}),y=Ke(o,1),v=Ke(a,1);(function(t,e,n){return t.top>n.bottom||t.top+e.height<n.top})(He(g,e,C,y,v),g,l)||(u=1,i=C,o=y,a=v)}u&&(f=He(g,e,i,o,a),je.mix(h,f));var B=Ye(f,g,l),m=Xe(f,g,l);(B||m)&&(i=n.points,o=n.offset||[0,0],a=n.targetOffset||[0,0]),c.adjustX=A.adjustX&&B,c.adjustY=A.adjustY&&m,(c.adjustX||c.adjustY)&&(h=function(t,e,n,r){var i=je.clone(t),o={width:e.width,height:e.height};return r.adjustX&&i.left<n.left&&(i.left=n.left),r.resizeWidth&&i.left>=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top<n.top&&(i.top=n.top),r.resizeHeight&&i.top>=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),je.mix(i,o)}(f,g,l,c))}return h.width!==g.width&&je.css(s,"width",je.width(s)+h.width-g.width),h.height!==g.height&&je.css(s,"height",je.height(s)+h.height-g.height),je.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:o,targetOffset:a,overflow:c}}function en(t,e,n){var r=n.target||e;return tn(t,We(r),n,!function(t,e){var n=Pe(t,e),r=We(t);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport))}function nn(t,e,n){var r,i,o=je.getDocument(t),a=o.defaultView||o.parentWindow,A=je.getWindowScrollLeft(a),s=je.getWindowScrollTop(a),c=je.viewportWidth(a),u=je.viewportHeight(a);r="pageX"in e?e.pageX:A+e.clientX,i="pageY"in e?e.pageY:s+e.clientY;var l=r>=0&&r<=A+c&&i>=0&&i<=s+u;return tn(t,{left:r,top:i,width:0,height:0},function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oe(n,!0).forEach((function(e){ie(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oe(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n,{points:[n.points[0],"cc"]}),l)}en.__getOffsetParent=Ve,en.__getVisibleRectForElement=Pe;var rn=n(1102);function on(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return an(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return an(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function an(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function An(t,e){var n=null,r=null;var i=new rn.a((function(t){var i=on(t,1)[0].target.getBoundingClientRect(),o=i.width,a=i.height,A=Math.floor(o),s=Math.floor(a);n===A&&r===s||e({width:A,height:s}),n=A,r=s}));return t&&i.observe(t),function(){i.disconnect()}}function sn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function un(t){return(un="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ln(t){return"function"!==typeof t?null:t()}function gn(t){return"object"===un(t)&&t?t:null}var fn=A.a.forwardRef((function(t,e){var n=t.children,r=t.disabled,i=t.target,o=t.align,a=t.onAlign,s=t.monitorWindowResize,c=t.monitorBufferTime,u=void 0===c?0:c,l=A.a.useRef({}),g=A.a.useRef(),f=A.a.Children.only(n),h=A.a.useRef({});h.current.disabled=r,h.current.target=i,h.current.onAlign=a;var d=sn(function(t,e){var n=A.a.useRef(!1),r=A.a.useRef(null);function i(){window.clearTimeout(r.current)}return[function o(a){if(n.current&&!0!==a)i(),r.current=window.setTimeout((function(){n.current=!1,o()}),e);else{if(!1===t())return;n.current=!0,i(),r.current=window.setTimeout((function(){n.current=!1}),e)}},function(){n.current=!1,i()}]}((function(){var t=h.current,e=t.disabled,n=t.target;if(!e&&n){var r,i=g.current,A=ln(n),s=gn(n);l.current.element=A,l.current.point=s;var c=document.activeElement;return A?r=en(i,A,o):s&&(r=nn(i,s,o)),function(t,e){t!==document.activeElement&&Mt(e,t)&&t.focus()}(c,i),a&&a(i,r),!0}return!1}),u),2),I=d[0],p=d[1],C=A.a.useRef({cancel:function(){}}),y=A.a.useRef({cancel:function(){}});A.a.useEffect((function(){var t,e,n=ln(i),r=gn(i);g.current!==y.current.element&&(y.current.cancel(),y.current.element=g.current,y.current.cancel=An(g.current,I)),l.current.element===n&&((t=l.current.point)===(e=r)||t&&e&&("pageX"in e&&"pageY"in e?t.pageX===e.pageX&&t.pageY===e.pageY:"clientX"in e&&"clientY"in e&&t.clientX===e.clientX&&t.clientY===e.clientY))||(I(),C.current.element!==n&&(C.current.cancel(),C.current.element=n,C.current.cancel=An(n,I)))})),A.a.useEffect((function(){r?p():I()}),[r]);var v=A.a.useRef(null);return A.a.useEffect((function(){s?v.current||(v.current=Pt(window,"resize",I)):v.current&&(v.current.remove(),v.current=null)}),[s]),A.a.useEffect((function(){return function(){C.current.cancel(),y.current.cancel(),v.current&&v.current.remove(),p()}}),[]),A.a.useImperativeHandle(e,(function(){return{forceAlign:function(){return I(!0)}}})),A.a.isValidElement(f)&&(f=A.a.cloneElement(f,{ref:Lt(f.ref,g)})),f}));fn.displayName="Align";var hn=fn,dn=!("undefined"===typeof window||!window.document||!window.document.createElement);function In(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n["ms"+t]="MS"+e,n["O"+t]="o"+e.toLowerCase(),n}var pn=function(t,e){var n={animationend:In("Animation","AnimationEnd"),transitionend:In("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}(dn,"undefined"!==typeof window?window:{}),Cn={};dn&&(Cn=document.createElement("div").style);var yn={};function vn(t){if(yn[t])return yn[t];var e=pn[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var o=n[i];if(Object.prototype.hasOwnProperty.call(e,o)&&o in Cn)return yn[t]=e[o],yn[t]}return""}var Bn=vn("animationend"),mn=vn("transitionend"),bn=!(!Bn||!mn);function En(t,e){return t?"object"===typeof t?t[e.replace(/-\w/g,(function(t){return t[1].toUpperCase()}))]:t+"-"+e:null}var Qn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Fn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function wn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sn=function(t){var e=t,n=!!A.a.forwardRef;function r(t){return!(!t.motionName||!e)}"object"===typeof t&&(e=t.transitionSupport,n="forwardRef"in t?t.forwardRef:n);var i=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.onDomUpdate=function(){var e=t.state,n=e.status,i=e.newStatus,o=t.props,a=o.onAppearStart,A=o.onEnterStart,s=o.onLeaveStart,c=o.onAppearActive,u=o.onEnterActive,l=o.onLeaveActive,g=o.motionAppear,f=o.motionEnter,h=o.motionLeave;if(r(t.props)){var d=t.getElement();t.$cacheEle!==d&&(t.removeEventListener(t.$cacheEle),t.addEventListener(d),t.$cacheEle=d),i&&"appear"===n&&g?t.updateStatus(a,null,null,(function(){t.updateActiveStatus(c,"appear")})):i&&"enter"===n&&f?t.updateStatus(A,null,null,(function(){t.updateActiveStatus(u,"enter")})):i&&"leave"===n&&h&&t.updateStatus(s,null,null,(function(){t.updateActiveStatus(l,"leave")}))}},t.onMotionEnd=function(e){var n=t.state,r=n.status,i=n.statusActive,o=t.props,a=o.onAppearEnd,A=o.onEnterEnd,s=o.onLeaveEnd;"appear"===r&&i?t.updateStatus(a,{status:"none"},e):"enter"===r&&i?t.updateStatus(A,{status:"none"},e):"leave"===r&&i&&t.updateStatus(s,{status:"none"},e)},t.setNodeRef=function(e){var n=t.props.internalRef;t.node=e,"function"===typeof n?n(e):n&&"current"in n&&(n.current=e)},t.getElement=function(){try{return M(t.node||t)}catch(e){return t.$cacheEle}},t.addEventListener=function(e){e&&(e.addEventListener(mn,t.onMotionEnd),e.addEventListener(Bn,t.onMotionEnd))},t.removeEventListener=function(e){e&&(e.removeEventListener(mn,t.onMotionEnd),e.removeEventListener(Bn,t.onMotionEnd))},t.updateStatus=function(e,n,r,i){var o=e?e(t.getElement(),r):null;if(!1!==o&&!t._destroyed){var a=void 0;i&&(a=function(){t.nextFrame(i)}),t.setState(Qn({statusStyle:"object"===typeof o?o:null,newStatus:!1},n),a)}},t.updateActiveStatus=function(e,n){t.nextFrame((function(){if(t.state.status===n){var r=t.props.motionDeadline;t.updateStatus(e,{statusActive:!0}),r>0&&setTimeout((function(){t.onMotionEnd({deadline:!0})}),r)}}))},t.nextFrame=function(e){t.cancelNextFrame(),t.raf=j()(e)},t.cancelNextFrame=function(){t.raf&&(j.a.cancel(t.raf),t.raf=null)},t.state={status:"none",statusActive:!1,newStatus:!1,statusStyle:null},t.$cacheEle=null,t.node=null,t.raf=null,t}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Fn(e,[{key:"componentDidMount",value:function(){this.onDomUpdate()}},{key:"componentDidUpdate",value:function(){this.onDomUpdate()}},{key:"componentWillUnmount",value:function(){this._destroyed=!0,this.removeEventListener(this.$cacheEle),this.cancelNextFrame()}},{key:"render",value:function(){var t,e=this.state,n=e.status,i=e.statusActive,o=e.statusStyle,a=this.props,A=a.children,s=a.motionName,c=a.visible,u=a.removeOnLeave,l=a.leavedClassName,g=a.eventProps;return A?"none"!==n&&r(this.props)?A(Qn({},g,{className:F()((t={},wn(t,En(s,n),"none"!==n),wn(t,En(s,n+"-active"),"none"!==n&&i),wn(t,s,"string"===typeof s),t)),style:o}),this.setNodeRef):c?A(Qn({},g),this.setNodeRef):u?null:A(Qn({},g,{className:l}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,i=e.status;if(!r(t))return{};var o=t.visible,a=t.motionAppear,A=t.motionEnter,s=t.motionLeave,c=t.motionLeaveImmediately,u={prevProps:t};return("appear"===i&&!a||"enter"===i&&!A||"leave"===i&&!s)&&(u.status="none",u.statusActive=!1,u.newStatus=!1),!n&&o&&a&&(u.status="appear",u.statusActive=!1,u.newStatus=!0),n&&!n.visible&&o&&A&&(u.status="enter",u.statusActive=!1,u.newStatus=!0),(n&&n.visible&&!o&&s||!n&&c&&!o&&s)&&(u.status="leave",u.statusActive=!1,u.newStatus=!0),u}}]),e}(A.a.Component);return i.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},n?A.a.forwardRef((function(t,e){return A.a.createElement(i,Qn({internalRef:e},t))})):i}(bn),Rn=A.a.forwardRef((function(t,e){var n=t.prefixCls,r=t.className,i=t.visible,o=t.style,a=t.children,s=t.onMouseEnter,c=t.onMouseLeave,u=t.onMouseDown,l=t.onTouchStart,g=a;return A.a.Children.count(a)>1&&(g=A.a.createElement("div",{className:"".concat(n,"-content")},a)),A.a.createElement("div",{ref:e,className:F()(r,!i&&"".concat(t.hiddenClassName)),onMouseEnter:s,onMouseLeave:c,onMouseDown:u,onTouchStart:l,style:o},g)}));Rn.displayName="PopupInner";var Un=Rn;function xn(t){var e=t.prefixCls,n=t.motion,r=t.animation,i=t.transitionName;return n||(r?{motionName:"".concat(e,"-").concat(r)}:i?{motionName:i}:null)}function kn(t){return(kn="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function On(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nn(Object(n),!0).forEach((function(e){Gn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tn(t,e){return(Tn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Vn(t);if(e){var i=Vn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ln(this,n)}}function Ln(t,e){return!e||"object"!==kn(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vn(t){return(Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zn=Sn;function Pn(t){return t&&t.motionName}var Wn=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Tn(t,e)}(o,t);var e,n,r,i=jn(o);function o(){var t;return _n(this,o),(t=i.apply(this,arguments)).state={targetWidth:void 0,targetHeight:void 0,status:null,prevVisible:null,alignClassName:null},t.popupRef=A.a.createRef(),t.alignRef=A.a.createRef(),t.nextFrameState=null,t.nextFrameId=null,t.onAlign=function(e,n){var r=t.state.status,i=t.props,o=i.getClassNameFromAlign,a=i.onAlign,A=o(n);"align"===r?t.setState({alignClassName:A,status:"aligned"},(function(){t.alignRef.current.forceAlign()})):"aligned"===r?(t.setState({alignClassName:A,status:"afterAlign"}),a(e,n)):t.setState({alignClassName:A})},t.onMotionEnd=function(){var e=t.props.visible;t.setState({status:e?"AfterMotion":"stable"})},t.setStateOnNextFrame=function(e){t.cancelFrameState(),t.nextFrameState=Dn(Dn({},t.nextFrameState),e),t.nextFrameId=j()((function(){var e=Dn({},t.nextFrameState);t.nextFrameState=null,t.setState(e)}))},t.getMotion=function(){return Dn({},xn(t.props))},t.getAlignTarget=function(){var e=t.props,n=e.point,r=e.getRootDomNode;return n||r},t.cancelFrameState=function(){j.a.cancel(t.nextFrameId)},t.renderPopupElement=function(){var e=t.state,n=e.status,r=e.targetHeight,i=e.targetWidth,o=e.alignClassName,a=t.props,s=a.prefixCls,c=a.className,u=a.style,l=a.stretch,g=a.visible,f=a.align,h=a.destroyPopupOnHide,d=a.onMouseEnter,I=a.onMouseLeave,p=a.onMouseDown,C=a.onTouchStart,y=a.children,v=F()(s,c,o),B="".concat(s,"-hidden"),m={};l&&(-1!==l.indexOf("height")?m.height=r:-1!==l.indexOf("minHeight")&&(m.minHeight=r),-1!==l.indexOf("width")?m.width=i:-1!==l.indexOf("minWidth")&&(m.minWidth=i));var b=Dn(Dn(Dn(Dn({},m),t.getZIndexStyle()),u),{},{opacity:"stable"!==n&&g?0:void 0}),E=t.getMotion(),Q=g;g&&"beforeMotion"!==n&&"motion"!==n&&"stable"!==n&&(E.motionAppear=!1,E.motionEnter=!1,E.motionLeave=!1),"afterAlign"!==n&&"beforeMotion"!==n||(Q=!1);var w=!g||"align"!==n&&"aligned"!==n&&"stable"!==n,S=!0;return"stable"===n&&(S=g),h&&!S?null:A.a.createElement(Zn,Object.assign({visible:Q},E,{removeOnLeave:!1,onEnterEnd:t.onMotionEnd,onLeaveEnd:t.onMotionEnd}),(function(e,n){var r=e.style,i=e.className;return A.a.createElement(hn,{target:t.getAlignTarget(),key:"popup",ref:t.alignRef,monitorWindowResize:!0,disabled:w,align:f,onAlign:t.onAlign},A.a.createElement(Un,{prefixCls:s,visible:S,hiddenClassName:B,className:F()(v,i),ref:Lt(n,t.popupRef),onMouseEnter:d,onMouseLeave:I,onMouseDown:p,onTouchStart:C,style:Dn(Dn({},b),r)},y))}))},t.renderMaskElement=function(){var e=t.props,n=e.mask,r=e.maskMotion,i=e.maskTransitionName,o=e.maskAnimation,a=e.prefixCls,s=e.visible;if(!n)return null;var c={};return r&&r.motionName&&(c=Dn({motionAppear:!0},xn({motion:r,prefixCls:a,transitionName:i,animation:o}))),A.a.createElement(Zn,Object.assign({},c,{visible:s,removeOnLeave:!0}),(function(e){var n=e.className;return A.a.createElement("div",{style:t.getZIndexStyle(),key:"mask",className:F()("".concat(a,"-mask"),n)})}))},t}return e=o,r=[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.visible,r=On(t,["visible"]),i=e.prevVisible,o=e.status,a={prevVisible:n,status:o},A=xn(r);return null===i&&!1===n?a.status="stable":n!==i&&(n||Pn(A)&&["motion","AfterMotion","stable"].includes(o)?a.status=null:a.status="stable",n&&(a.alignClassName=null)),a}}],(n=[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var t=this.state.status,e=this.props,n=e.getRootDomNode,r=e.visible,i=e.stretch;if(this.cancelFrameState(),r&&"stable"!==t)switch(t){case null:this.setStateOnNextFrame({status:i?"measure":"align"});break;case"afterAlign":this.setStateOnNextFrame({status:Pn(this.getMotion())?"beforeMotion":"stable"});break;case"AfterMotion":this.setStateOnNextFrame({status:"stable"});break;default:var o=["measure","align",null,"beforeMotion","motion"],a=o.indexOf(t),A=o[a+1];-1!==a&&A&&this.setStateOnNextFrame({status:A})}if("measure"===t){var s=n();s&&this.setStateOnNextFrame({targetHeight:s.offsetHeight,targetWidth:s.offsetWidth})}}},{key:"componentWillUnmount",value:function(){this.cancelFrameState()}},{key:"getZIndexStyle",value:function(){return{zIndex:this.props.zIndex}}},{key:"render",value:function(){return A.a.createElement("div",null,this.renderMaskElement(),this.renderPopupElement())}}])&&Mn(e.prototype,n),r&&Mn(e,r),o}(a.Component),Jn=A.a.createContext(null);function Hn(t){return(Hn="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kn(t,e){return(Kn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=er(t);if(e){var i=er(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $n(this,n)}}function $n(t,e){return!e||"object"!==Hn(e)&&"function"!==typeof e?tr(t):e}function tr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function er(t){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nr(){}function rr(){return""}function ir(){return window.document}var or=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var ar=function(t){var e=function(e){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kn(t,e)}(a,e);var n,r,i,o=qn(a);function a(t){var e,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).popupRef=A.a.createRef(),e.triggerRef=A.a.createRef(),e.onMouseEnter=function(t){var n=e.props.mouseEnterDelay;e.fireEvents("onMouseEnter",t),e.delaySetPopupVisible(!0,n,n?null:t)},e.onMouseMove=function(t){e.fireEvents("onMouseMove",t),e.setPoint(t)},e.onMouseLeave=function(t){e.fireEvents("onMouseLeave",t),e.delaySetPopupVisible(!1,e.props.mouseLeaveDelay)},e.onPopupMouseEnter=function(){e.clearDelayTimer()},e.onPopupMouseLeave=function(t){t.relatedTarget&&!t.relatedTarget.setTimeout&&e.popupRef.current&&e.popupRef.current.popupRef.current&&Mt(e.popupRef.current.popupRef.current,t.relatedTarget)||e.delaySetPopupVisible(!1,e.props.mouseLeaveDelay)},e.onFocus=function(t){e.fireEvents("onFocus",t),e.clearDelayTimer(),e.isFocusToShow()&&(e.focusTime=Date.now(),e.delaySetPopupVisible(!0,e.props.focusDelay))},e.onMouseDown=function(t){e.fireEvents("onMouseDown",t),e.preClickTime=Date.now()},e.onTouchStart=function(t){e.fireEvents("onTouchStart",t),e.preTouchTime=Date.now()},e.onBlur=function(t){e.fireEvents("onBlur",t),e.clearDelayTimer(),e.isBlurToHide()&&e.delaySetPopupVisible(!1,e.props.blurDelay)},e.onContextMenu=function(t){t.preventDefault(),e.fireEvents("onContextMenu",t),e.setPopupVisible(!0,t)},e.onContextMenuClose=function(){e.isContextMenuToShow()&&e.close()},e.onClick=function(t){if(e.fireEvents("onClick",t),e.focusTime){var n;if(e.preClickTime&&e.preTouchTime?n=Math.min(e.preClickTime,e.preTouchTime):e.preClickTime?n=e.preClickTime:e.preTouchTime&&(n=e.preTouchTime),Math.abs(n-e.focusTime)<20)return;e.focusTime=0}e.preClickTime=0,e.preTouchTime=0,e.isClickToShow()&&(e.isClickToHide()||e.isBlurToHide())&&t&&t.preventDefault&&t.preventDefault();var r=!e.state.popupVisible;(e.isClickToHide()&&!r||r&&e.isClickToShow())&&e.setPopupVisible(!e.state.popupVisible,t)},e.onPopupMouseDown=function(){var t;(e.hasPopupMouseDown=!0,clearTimeout(e.mouseDownTimeout),e.mouseDownTimeout=window.setTimeout((function(){e.hasPopupMouseDown=!1}),0),e.context)&&(t=e.context).onPopupMouseDown.apply(t,arguments)},e.onDocumentClick=function(t){if(!e.props.mask||e.props.maskClosable){var n=t.target,r=e.getRootDomNode(),i=e.getPopupDomNode();Mt(r,n)||Mt(i,n)||e.hasPopupMouseDown||e.close()}},e.getRootDomNode=function(){var t=e.props.getTriggerDOMNode;if(t)return t(e.triggerRef.current);try{var n=M(e.triggerRef.current);if(n)return n}catch(r){}return _.a.findDOMNode(tr(e))},e.getPopupClassNameFromAlign=function(t){var n=[],r=e.props,i=r.popupPlacement,o=r.builtinPlacements,a=r.prefixCls,A=r.alignPoint,s=r.getPopupClassNameFromAlign;return i&&o&&n.push(function(t,e,n,r){for(var i=n.points,o=Object.keys(t),a=0;a<o.length;a+=1){var A=o[a];if(ne(t[A].points,i,r))return"".concat(e,"-placement-").concat(A)}return""}(o,a,t,A)),s&&n.push(s(t)),n.join(" ")},e.getComponent=function(){var t=e.props,n=t.prefixCls,r=t.destroyPopupOnHide,i=t.popupClassName,o=t.onPopupAlign,a=t.popupMotion,s=t.popupAnimation,c=t.popupTransitionName,u=t.popupStyle,l=t.mask,g=t.maskAnimation,f=t.maskTransitionName,h=t.maskMotion,d=t.zIndex,I=t.popup,p=t.stretch,C=t.alignPoint,y=e.state,v=y.popupVisible,B=y.point,m=e.getPopupAlign(),b={};return e.isMouseEnterToShow()&&(b.onMouseEnter=e.onPopupMouseEnter),e.isMouseLeaveToHide()&&(b.onMouseLeave=e.onPopupMouseLeave),b.onMouseDown=e.onPopupMouseDown,b.onTouchStart=e.onPopupMouseDown,A.a.createElement(Wn,Object.assign({prefixCls:n,destroyPopupOnHide:r,visible:v,point:C&&B,className:i,align:m,onAlign:o,animation:s,getClassNameFromAlign:e.getPopupClassNameFromAlign},b,{stretch:p,getRootDomNode:e.getRootDomNode,style:u,mask:l,zIndex:d,transitionName:c,maskAnimation:g,maskTransitionName:f,maskMotion:h,ref:e.popupRef,motion:a}),"function"===typeof I?I():I)},e.getContainer=function(){var t=tr(e).props,n=document.createElement("div");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",(t.getPopupContainer?t.getPopupContainer(e.getRootDomNode()):t.getDocument().body).appendChild(n),n},e.setPoint=function(t){e.props.alignPoint&&t&&e.setState({point:{pageX:t.pageX,pageY:t.pageY}})},e.handlePortalUpdate=function(){e.state.prevPopupVisible!==e.state.popupVisible&&e.props.afterPopupVisibleChange(e.state.popupVisible)},n="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,e.state={prevPopupVisible:n,popupVisible:n},or.forEach((function(t){e["fire".concat(t)]=function(n){e.fireEvents(t,n)}})),e}return n=a,i=[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.popupVisible,r={};return void 0!==n&&e.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=e.popupVisible),r}}],(r=[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var t,e=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(t=e.getDocument(),this.clickOutsideHandler=Pt(t,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(t=t||e.getDocument(),this.touchOutsideHandler=Pt(t,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(t=t||e.getDocument(),this.contextMenuOutsideHandler1=Pt(t,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Pt(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout)}},{key:"getPopupDomNode",value:function(){return this.popupRef.current&&this.popupRef.current.popupRef.current?this.popupRef.current.popupRef.current:null}},{key:"getPopupAlign",value:function(){var t=this.props,e=t.popupPlacement,n=t.popupAlign,r=t.builtinPlacements;return e&&r?function(t,e,n){return te(te({},t[e]||{}),n)}(r,e,n):n}},{key:"setPopupVisible",value:function(t,e){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==t&&("popupVisible"in this.props||this.setState({popupVisible:t,prevPopupVisible:r}),this.props.onPopupVisibleChange(t)),n&&e&&this.setPoint(e)}},{key:"delaySetPopupVisible",value:function(t,e,n){var r=this,i=1e3*e;if(this.clearDelayTimer(),i){var o=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(t,o),r.clearDelayTimer()}),i)}else this.setPopupVisible(t,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(t){var e=this.props.children.props,n=this.props;return e[t]&&n[t]?this["fire".concat(t)]:e[t]||n[t]}},{key:"isClickToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){this.state.popupVisible&&this.popupRef.current&&this.popupRef.current.alignRef.current&&this.popupRef.current.alignRef.current.forceAlign()}},{key:"fireEvents",value:function(t,e){var n=this.props.children.props[t];n&&n(e);var r=this.props[t];r&&r(e)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var e=this.state.popupVisible,n=this.props,r=n.children,i=n.forceRender,o=n.alignPoint,a=n.className,s=A.a.Children.only(r),c={key:"trigger"};this.isContextMenuToShow()?c.onContextMenu=this.onContextMenu:c.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(c.onClick=this.onClick,c.onMouseDown=this.onMouseDown,c.onTouchStart=this.onTouchStart):(c.onClick=this.createTwoChains("onClick"),c.onMouseDown=this.createTwoChains("onMouseDown"),c.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(c.onMouseEnter=this.onMouseEnter,o&&(c.onMouseMove=this.onMouseMove)):c.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?c.onMouseLeave=this.onMouseLeave:c.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(c.onFocus=this.onFocus,c.onBlur=this.onBlur):(c.onFocus=this.createTwoChains("onFocus"),c.onBlur=this.createTwoChains("onBlur"));var u=F()(s&&s.props&&s.props.className,a);u&&(c.className=u);var l,g=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yn(Object(n),!0).forEach((function(e){Xn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},c);(l=s).type&&l.type.prototype&&!l.type.prototype.render||"function"===typeof l&&l.prototype&&!l.prototype.render||(g.ref=Lt(this.triggerRef,s.ref));var f,h=A.a.cloneElement(s,g);return(e||this.popupRef.current||i)&&(f=A.a.createElement(t,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),A.a.createElement(Jn.Provider,{value:{onPopupMouseDown:this.onPopupMouseDown}},h,f)}}])&&zn(n.prototype,r),i&&zn(n,i),a}(A.a.Component);return e.contextType=Jn,e.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:rr,getDocument:ir,onPopupVisibleChange:nr,afterPopupVisibleChange:nr,onPopupAlign:nr,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[]},e}(qt),Ar={adjustX:1,adjustY:1},sr=[0,0],cr={left:{points:["cr","cl"],overflow:Ar,offset:[-4,0],targetOffset:sr},right:{points:["cl","cr"],overflow:Ar,offset:[4,0],targetOffset:sr},top:{points:["bc","tc"],overflow:Ar,offset:[0,-4],targetOffset:sr},bottom:{points:["tc","bc"],overflow:Ar,offset:[0,4],targetOffset:sr},topLeft:{points:["bl","tl"],overflow:Ar,offset:[0,-4],targetOffset:sr},leftTop:{points:["tr","tl"],overflow:Ar,offset:[-4,0],targetOffset:sr},topRight:{points:["br","tr"],overflow:Ar,offset:[0,-4],targetOffset:sr},rightTop:{points:["tl","tr"],overflow:Ar,offset:[4,0],targetOffset:sr},bottomRight:{points:["tr","br"],overflow:Ar,offset:[0,4],targetOffset:sr},rightBottom:{points:["bl","br"],overflow:Ar,offset:[4,0],targetOffset:sr},bottomLeft:{points:["tl","bl"],overflow:Ar,offset:[0,4],targetOffset:sr},leftBottom:{points:["br","bl"],overflow:Ar,offset:[-4,0],targetOffset:sr}},ur=function(t){var e=t.overlay,n=t.prefixCls,r=t.id;return A.a.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip"},"function"===typeof e?e():e)};function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var hr=Object(a.forwardRef)((function(t,e){var n=t.overlayClassName,r=t.trigger,i=void 0===r?["hover"]:r,o=t.mouseEnterDelay,s=void 0===o?0:o,c=t.mouseLeaveDelay,u=void 0===c?.1:c,l=t.overlayStyle,g=t.prefixCls,f=void 0===g?"rc-tooltip":g,h=t.children,d=t.onVisibleChange,I=t.afterVisibleChange,p=t.transitionName,C=t.animation,y=t.placement,v=void 0===y?"right":y,B=t.align,m=void 0===B?{}:B,b=t.destroyTooltipOnHide,E=void 0!==b&&b,Q=t.defaultVisible,F=t.getTooltipContainer,w=fr(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer"]),S=Object(a.useRef)(null);Object(a.useImperativeHandle)(e,(function(){return S.current}));var R=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(n),!0).forEach((function(e){gr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},w);"visible"in t&&(R.popupVisible=t.visible);return A.a.createElement(ar,Object.assign({popupClassName:n,prefixCls:f,popup:function(){var e=t.arrowContent,n=void 0===e?null:e,r=t.overlay,i=t.id;return[A.a.createElement("div",{className:"".concat(f,"-arrow"),key:"arrow"},n),A.a.createElement(ur,{key:"content",prefixCls:f,id:i,overlay:r})]},action:i,builtinPlacements:cr,popupPlacement:v,ref:S,popupAlign:m,getPopupContainer:F,onPopupVisibleChange:d,afterPopupVisibleChange:I,popupTransitionName:p,popupAnimation:C,defaultPopupVisible:Q,destroyPopupOnHide:E,mouseLeaveDelay:u,popupStyle:l,mouseEnterDelay:s},R),h)}));function dr(t){var e=t.title,n=t.content,r=t.overlayClassName,i=Object(a.useRef)(),o=Object(a.useCallback)((function(){return i.current?i.current.closest(".vitessce-container"):null}),[i]),s=e||n;return A.a.createElement(A.a.Fragment,null,A.a.createElement("span",{ref:i}),A.a.createElement(hr,Object.assign({getTooltipContainer:o,overlayClassName:r,overlay:s},t)))}function Ir(t){return A.a.createElement(dr,t)}function pr(t){var e=t.title,n=t.subtitle,i=t.onClick,o=t.handler,s=t.handlerKey,c=t.confirm,u=t.visible,l=Object(a.useState)(!1),g=Object(r.a)(l,2),f=g[0],h=g[1];function d(){!c||f?(i(),o()):h(!0)}Object(a.useEffect)((function(){h(!1)}),[u]);var I="".concat(f?"Confirm ":"").concat(e);return A.a.createElement("button",{title:I,type:"button",onClick:d,onKeyPress:function(t){return Object(Gt.b)(t,s,d)}},I,n&&A.a.createElement(A.a.Fragment,null,A.a.createElement("br",null),A.a.createElement("span",{className:"small"},n)))}function Cr(t){var e=t.menuConfig,n=t.onClick,r=t.color,i=void 0===r?null:r,o=t.palette,a=void 0===o?null:o,s=t.setColor,c=void 0===s?null:s,u=t.visible;var l=a?a.map(Gt.c):_t.d.concat([[255,255,255],[128,128,128],[0,0,0]]).map(Gt.c);return A.a.createElement("div",null,i&&c&&l&&A.a.createElement(Dt.TwitterPicker,{className:"popover-menu-color",disableAlpha:!0,width:108,triangle:"hide",colors:l,color:Object(Gt.c)(i),onChangeComplete:function(t){var e=t.rgb;e&&c&&c([e.r,e.g,e.b])}}),A.a.createElement("ul",{className:"popover-menu-list"},e.map((function(t){return A.a.createElement("li",{key:t.title+t.subtitle},A.a.createElement(pr,Object.assign({},t,{onClick:n,visible:u})))}))))}function yr(t){var e=t.menuConfig,n=t.placement,i=t.children,o=t.color,s=void 0===o?null:o,c=t.setColor,u=void 0===c?null:c,l=t.palette,g=void 0===l?null:l,f=Object(a.useState)(!1),h=Object(r.a)(f,2),d=h[0],I=h[1];return A.a.createElement(Ir,{content:A.a.createElement(Cr,{menuConfig:e,onClick:function(){return I(!1)},color:s,setColor:u,palette:g,visible:d}),placement:n,visible:d,onVisibleChange:I},i)}function vr(){return(vr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Br(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}dr.defaultProps={overlayClassName:"help-tooltip",placement:"top",trigger:"hover",mouseEnterDelay:.2,mouseLeaveDelay:0},Ir.defaultProps={overlayClassName:"popover",placement:"top",trigger:"click",mouseEnterDelay:0,mouseLeaveDelay:0};var mr=a.createElement("path",{d:"M12 18c1.657 0 3 1.343 3 3s-1.343 3-3 3-3-1.343-3-3 1.343-3 3-3zm0-9c1.657 0 3 1.343 3 3s-1.343 3-3 3-3-1.343-3-3 1.343-3 3-3zm0-9c1.657 0 3 1.343 3 3s-1.343 3-3 3-3-1.343-3-3 1.343-3 3-3z"});function br(t){var e=t.svgRef,n=t.title,r=t.titleId,i=Br(t,["svgRef","title","titleId"]);return a.createElement("svg",vr({width:24,height:24,viewBox:"0 0 24 24",ref:e,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,mr)}var Er=a.forwardRef((function(t,e){return a.createElement(br,vr({svgRef:e},t))}));n.p;function Qr(t){var e=t.path,n=t.level,r=t.height,i=t.onCheckNode,a=t.onNodeRemove,A=t.onNodeSetIsEditing,s=t.onExportLevelZeroNodeJSON,c=t.onExportLevelZeroNodeTabular,u=t.onExportSetJSON,l=t.checkable,g=t.editable,f=t.exportable,h=t.checked;return[].concat(Object(o.a)(g?[{title:"Rename",handler:function(){A(e,!0)},handlerKey:"r"},{title:"Delete",confirm:!0,handler:function(){a(e)},handlerKey:"d"}]:[]),Object(o.a)(0===n&&f?[{title:"Export hierarchy",subtitle:"(to JSON file)",handler:function(){s(e)},handlerKey:"j"}].concat(Object(o.a)(r<=1?[{title:"Export hierarchy",subtitle:"(to CSV file)",handler:function(){c(e)},handlerKey:"t"}]:[])):[]),Object(o.a)(n>0?[].concat(Object(o.a)(l?[{title:h?"Uncheck":"Check",handler:function(){i(e,!h)},handlerKey:"s"}]:[]),Object(o.a)(f?[{title:"Export set",subtitle:"(to JSON file)",handler:function(){u(e)},handlerKey:"e"}]:[])):[]))}function Fr(t){var e,n=t.title,r=t.path,i=t.nodeKey,o=t.level,a=t.height,s=t.color,u=t.checkbox,l=t.isChecking,g=t.isLeaf,f=t.onNodeSetColor,h=t.onNodeView,d=t.expanded,I=t.onCheckLevel,p=t.checkedLevelPath,C=t.checkedLevelIndex,y=t.disableTooltip,v=t.size,B=t.datatype,m=t.editable,b=0===o&&!d,E=C&&c()(r,p)&&C<a?C+1:1,Q=new Intl.NumberFormat("en-US").format(v);e=b?Object(Gt.e)(E):g||!d?"Color individual set (".concat(Q," ").concat(B).concat(1===v?"":"s",")"):"Color by expanded descendants";var F=0!==o||d?function(){return h(r)}:function(){return I(i,E)},w=y?{visible:!1}:{},S=Qr(t);return A.a.createElement("span",null,A.a.createElement(dr,Object.assign({title:e},w),A.a.createElement("button",{type:"button",onClick:F,onKeyPress:function(t){return Object(Gt.b)(t,"v",(function(){return h(r)}))},className:"title-button"},n)),S.length>0?A.a.createElement(yr,{menuConfig:Qr(t),color:o>0&&m?s||_t.b:null,setColor:function(t){return f(r,t)}},A.a.createElement(Er,{className:"node-menu-icon"})):null,o>0&&l?u:null,o>0&&A.a.createElement("span",{className:"node-size-label"},Q))}function wr(t){var e=t.title,n=t.path,i=t.onNodeSetName,o=t.onNodeCheckNewName,s=Object(a.useState)(e),c=Object(r.a)(s,2),u=c[0],l=c[1],g=o(n,u);function f(){g||i(n,u,!0)}return A.a.createElement("span",{className:"title-button-with-input"},A.a.createElement("input",{autoFocus:!0,className:"title-input",type:"text",value:u,onChange:function(t){l(t.target.value)},onKeyPress:function(t){return Object(Gt.b)(t,"Enter",f)},onFocus:function(t){return t.target.select()}}),!g&&A.a.createElement("button",{type:"button",className:"title-save-button",onClick:f},"Save"))}function Sr(t){var e=t.isEditing,n=t.isCurrentSet;return e||n?A.a.createElement(wr,t):A.a.createElement(Fr,t)}function Rr(t){var e=t.nodeKey,n=t.path,r=t.height,i=t.onCheckLevel,o=t.checkedLevelPath,a=t.checkedLevelIndex,s=t.hasColorEncoding;function u(t){if(t.target.checked){var n=parseInt(t.target.value,10);i(e,n)}}return A.a.createElement("div",{className:"level-buttons-container"},Nt()(1,r+1).map((function(t){var e=c()(n,o)&&t===a;return A.a.createElement("div",{className:"level-buttons",key:t},A.a.createElement(dr,{title:Object(Gt.e)(t)},A.a.createElement("input",{className:Object(kt.a)("level-radio-button",{checked:e&&!s}),type:"checkbox",value:t,checked:e&&s,onChange:u})))})))}function Ur(t){var e=t.isLeaf,n=t.isOpen,r=t.color,i=r?Object(Gt.c)(r):void 0;return e?A.a.createElement("i",{className:"anticon anticon-circle rc-tree-switcher-icon"},A.a.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em","aria-hidden":"true"},A.a.createElement("rect",{fill:i,x:300,y:300,width:424,height:424}))):A.a.createElement("i",{className:"anticon anticon-caret-down rc-tree-switcher-icon"},A.a.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em","aria-hidden":"true"},A.a.createElement("path",{fill:n?"#444":i,d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})))}var xr=function(t){Object(Ut.a)(n,t);var e=Object(xt.a)(n);function n(){var t;Object(wt.a)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).renderSelector=function(){var e=t.props,n=e.title,r=e.isCurrentSet,i=e.isSelected,o=e.isEditing,a=e.onDragStart,s=t.context.rcTree,c=s.prefixCls,u=s.draggable,l="".concat(c,"-node-content-wrapper"),g=!r&&!o&&u;return A.a.createElement("span",{ref:t.setSelectHandle,title:n,className:F()(l,"".concat(l,"-").concat(t.getNodeState()||"normal"),i&&"".concat(c,"-node-selected"),g&&"draggable"),draggable:g,"aria-grabbed":g,onDragStart:g?function(e){a(),t.onDragStart(e)}:void 0},A.a.createElement(Sr,Object.assign({},t.props,{prefixClass:c,checkbox:t.renderCheckbox()})),t.renderLevels())},t.renderLevels=function(){var e=t.props,n=e.level,r=e.expanded;return 0!==n||r?null:A.a.createElement(Rr,t.props)},t.renderSwitcher=function(){var e=t.props,n=e.expanded,r=e.isLeaf,i=e.color,o=t.context.rcTree,a=o.prefixCls,s=o.onNodeExpand,c=function(e){r||s(e,Object(Rt.a)(t))},l=F()("".concat(a,"-switcher"),Object(u.a)({},"".concat(a,"-switcher_").concat(n?"open":"close"),!r));return A.a.createElement("span",{className:l,onClick:c,onKeyPress:function(t){return Object(Gt.b)(t,"d",c)},role:"button",tabIndex:"0"},A.a.createElement(Ur,{isLeaf:r,isOpen:n,color:i}))},t}return Object(St.a)(n,[{key:"render",value:function(){var t,e=this,n=this.props,r=n.style,i=n.loading,o=n.level,a=n.dragOver,s=n.dragOverGapTop,c=n.dragOverGapBottom,l=n.isLeaf,g=n.expanded,f=n.selected,h=n.checked,d=n.halfChecked,I=n.onDragEnd,p=n.expandable,C=Object(Ft.a)(n,["style","loading","level","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked","onDragEnd","expandable"]),y=this.context.rcTree,v=y.prefixCls,B=y.filterTreeNode,m=y.draggable,b=this.isDisabled(),E=vt(C);return A.a.createElement("li",Object.assign({className:F()("rc-tree-treenode","level-".concat(o,"-treenode"),(t={},Object(u.a)(t,"".concat(v,"-treenode-disabled"),b),Object(u.a)(t,"".concat(v,"-treenode-switcher-").concat(g?"open":"close"),!l),Object(u.a)(t,"".concat(v,"-treenode-checkbox-checked"),h),Object(u.a)(t,"".concat(v,"-treenode-checkbox-indeterminate"),d),Object(u.a)(t,"".concat(v,"-treenode-selected"),f),Object(u.a)(t,"".concat(v,"-treenode-loading"),i),Object(u.a)(t,"drag-over",!b&&a),Object(u.a)(t,"drag-over-gap-top",!b&&s),Object(u.a)(t,"drag-over-gap-bottom",!b&&c),Object(u.a)(t,"filter-node",B&&B(this)),t)),style:r,role:"treeitem",onDragEnter:m?this.onDragEnter:void 0,onDragOver:m?this.onDragOver:void 0,onDragLeave:m?this.onDragLeave:void 0,onDrop:m?this.onDrop.bind(this):void 0,onDragEnd:m?function(t){I(),e.onDragEnd(t)}:void 0},E),p?this.renderSwitcher():null,this.renderSelector(),this.renderChildren())}}]),n}(et),kr=n(384),Or=n(85);function Nr(){return(Nr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Dr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Gr(t){var e=t.svgRef,n=t.title,r=t.titleId,i=Dr(t,["svgRef","title","titleId"]);return a.createElement("svg",Nr({viewBox:"0 0 16.433999 10.234",height:12,width:18,ref:e,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,a.createElement("g",{transform:"translate(0.117,-2.883)"},a.createElement("path",{d:"m 11.467471,11.811278 c 0.198237,-0.322177 0.508,-1.011333 0.653661,-1.454255 0.659343,-2.0049141 0.44323,-4.2620847 -0.577734,-6.0340822 l -0.168844,-0.2930481 0.105744,0.017887 c 0.759902,0.1285441 1.368762,0.3699553 1.856675,0.7361658 1.988296,1.4923476 2.192477,4.3353549 0.434717,6.0529895 -0.641216,0.626581 -1.299647,0.94683 -2.294136,1.115833 l -0.108488,0.01844 z M 4.3162122,11.919169 C 1.9278944,11.487872 0.46692382,9.0323123 1.234873,6.7401372 1.5621727,5.763213 2.2610593,4.9489746 3.1840041,4.4693005 3.5978035,4.2542401 3.9427842,4.145371 4.5197023,4.0477802 L 4.6254464,4.0298927 4.4571836,4.3223069 C 3.4332707,6.1017061 3.2180432,8.3476022 3.878868,10.357023 c 0.1458466,0.443487 0.4554716,1.132155 0.6542959,1.455285 0.054471,0.08853 0.087814,0.159599 0.074096,0.157937 -0.013718,-0.0017 -0.1446898,-0.02465 -0.2910477,-0.05108 z M 5.0000001,3 C 2.2,3 0,5.2 0,8 c 0,2.8 2.2,5 5.0000001,5 0.6,0 1.1,-0.1 1.6,-0.3 C 5.3000001,11.6 4.5,9.7999998 4.5,8 4.5,6.2 5.3000001,4.5 6.6000001,3.3 c -0.5,-0.2 -1,-0.3 -1.6,-0.3 z M 4.65,4.02 C 3.92,5.17 3.51,6.54 3.51,8 c 0,1.4599998 0.42,2.83 1.14,3.98 C 2.61,11.8 1.01,10.08 1.01,8 1.01,5.92 2.61,4.2 4.65,4.02 Z M 8,4 C 6.8,4.9 6,6.4 6,8 6,9.6 6.8,11.1 8,12 9.2,11.1 10,9.7 10,8 10,6.3 9.2,4.9 8,4 Z m 3,-1 c 2.8,0 5,2.2 5,5 0,2.8 -2.2,5 -5,5 C 10.4,13 9.9,12.9 9.4,12.7 10.7,11.6 11.5,9.8 11.5,8 11.5,6.2 10.7,4.5 9.4,3.3 9.9,3.1 10.4,3 11,3 Z m 0.35,1.02 c 0.73,1.15 1.14,2.52 1.14,3.98 0,1.46 -0.42,2.83 -1.14,3.98 2.04,-0.18 3.64,-1.9 3.64,-3.98 0,-2.08 -1.6,-3.8 -3.64,-3.98 z",style:{strokeWidth:.234,strokeMiterlimit:4,strokeDasharray:"none",strokeOpacity:1}})))}var _r=a.forwardRef((function(t,e){return a.createElement(Gr,Nr({svgRef:e},t))}));n.p;function Mr(){return(Mr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Tr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function jr(t){var e=t.svgRef,n=t.title,r=t.titleId,i=Tr(t,["svgRef","title","titleId"]);return a.createElement("svg",Mr({width:18,height:12,viewBox:"0 0 16 10",ref:e,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,a.createElement("g",{transform:"translate(0,-3)"},a.createElement("path",{d:"M 5.0000001,3 C 2.2,3 0,5.2 0,8 c 0,2.8 2.2,5 5.0000001,5 0.6,0 1.1,-0.1 1.6,-0.3 C 5.3000001,11.6 4.5,9.7999998 4.5,8 4.5,6.2 5.3000001,4.5 6.6000001,3.3 c -0.5,-0.2 -1,-0.3 -1.6,-0.3 z M 4.65,4.02 C 3.92,5.17 3.51,6.54 3.51,8 c 0,1.4599998 0.42,2.83 1.14,3.98 C 2.61,11.8 1.01,10.08 1.01,8 1.01,5.92 2.61,4.2 4.65,4.02 Z M 8,4 C 6.8,4.9 6,6.4 6,8 6,9.6 6.8,11.1 8,12 9.2,11.1 10,9.7 10,8 10,6.3 9.2,4.9 8,4 Z m 3,-1 c 2.8,0 5,2.2 5,5 0,2.8 -2.2,5 -5,5 C 10.4,13 9.9,12.9 9.4,12.7 10.7,11.6 11.5,9.8 11.5,8 11.5,6.2 10.7,4.5 9.4,3.3 9.9,3.1 10.4,3 11,3 Z m 0.35,1.02 c 0.73,1.15 1.14,2.52 1.14,3.98 0,1.46 -0.42,2.83 -1.14,3.98 2.04,-0.18 3.64,-1.9 3.64,-3.98 0,-2.08 -1.6,-3.8 -3.64,-3.98 z",style:{strokeWidth:.234,strokeMiterlimit:4,strokeDasharray:"none",strokeOpacity:1}})))}var Lr=a.forwardRef((function(t,e){return a.createElement(jr,Mr({svgRef:e},t))}));n.p;function Vr(){return(Vr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Zr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Pr=a.createElement("rect",{x:"5%",width:"90%",height:"100%",fill:"white"}),Wr=a.createElement("g",null,a.createElement("rect",{x:0,y:0,width:25.3804963846,height:16,mask:"url(#union-mask)"}));function Jr(t){var e=t.svgRef,n=t.title,r=t.titleId,i=Zr(t,["svgRef","title","titleId"]);return a.createElement("svg",Vr({id:"svg14",viewBox:"0 0 25.3804963846 16",height:16,width:25.3804963846,ref:e,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,a.createElement("defs",null,a.createElement("mask",{id:"union-mask",x:0,y:0,width:25.3804963846,height:16},Pr,a.createElement("g",{transform:"translate(4.69,0)"},a.createElement("path",{d:"m 11.467471,11.811278 c 0.198237,-0.322177 0.508,-1.011333 0.653661,-1.454255 0.659343,-2.0049141 0.44323,-4.2620847 -0.577734,-6.0340822 l -0.168844,-0.2930481 0.105744,0.017887 c 0.759902,0.1285441 1.368762,0.3699553 1.856675,0.7361658 1.988296,1.4923476 2.192477,4.3353549 0.434717,6.0529895 -0.641216,0.626581 -1.299647,0.94683 -2.294136,1.115833 l -0.108488,0.01844 z M 4.3162122,11.919169 C 1.9278944,11.487872 0.46692382,9.0323123 1.234873,6.7401372 1.5621727,5.763213 2.2610593,4.9489746 3.1840041,4.4693005 3.5978035,4.2542401 3.9427842,4.145371 4.5197023,4.0477802 L 4.6254464,4.0298927 4.4571836,4.3223069 C 3.4332707,6.1017061 3.2180432,8.3476022 3.878868,10.357023 c 0.1458466,0.443487 0.4554716,1.132155 0.6542959,1.455285 0.054471,0.08853 0.087814,0.159599 0.074096,0.157937 -0.013718,-0.0017 -0.1446898,-0.02465 -0.2910477,-0.05108 z M 5.0000001,3 C 2.2,3 0,5.2 0,8 c 0,2.8 2.2,5 5.0000001,5 0.6,0 1.1,-0.1 1.6,-0.3 C 5.3000001,11.6 4.5,9.7999998 4.5,8 4.5,6.2 5.3000001,4.5 6.6000001,3.3 c -0.5,-0.2 -1,-0.3 -1.6,-0.3 z M 4.65,4.02 C 3.92,5.17 3.51,6.54 3.51,8 c 0,1.4599998 0.42,2.83 1.14,3.98 C 2.61,11.8 1.01,10.08 1.01,8 1.01,5.92 2.61,4.2 4.65,4.02 Z M 8,4 C 6.8,4.9 6,6.4 6,8 6,9.6 6.8,11.1 8,12 9.2,11.1 10,9.7 10,8 10,6.3 9.2,4.9 8,4 Z m 3,-1 c 2.8,0 5,2.2 5,5 0,2.8 -2.2,5 -5,5 C 10.4,13 9.9,12.9 9.4,12.7 10.7,11.6 11.5,9.8 11.5,8 11.5,6.2 10.7,4.5 9.4,3.3 9.9,3.1 10.4,3 11,3 Z m 0.35,1.02 c 0.73,1.15 1.14,2.52 1.14,3.98 0,1.46 -0.42,2.83 -1.14,3.98 2.04,-0.18 3.64,-1.9 3.64,-3.98 0,-2.08 -1.6,-3.8 -3.64,-3.98 z",style:{strokeWidth:.234,strokeMiterlimit:4,strokeDasharray:"none",strokeOpacity:1},fill:"black"})))),Wr)}var Hr=a.forwardRef((function(t,e){return a.createElement(Jr,Vr({svgRef:e},t))}));n.p;function Yr(t){var e=t.datatype,n=t.onError,r=t.onImportTree,i=t.onCreateLevelZeroNode,s=t.importable,c=t.editable,u=Object(a.useCallback)((function(t,i){return function(){var o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("accept",i),document.body.appendChild(o),o.click(),o.addEventListener("change",(function(i){if(window.File&&window.FileReader&&window.FileList&&window.Blob){var o=i.target.files;if(o&&1===o.length){var a=new FileReader;a.addEventListener("load",(function(){var i=a.result;try{var o=t(i,e);n(!1),r(o)}catch(A){n(A.message)}}),!1),a.readAsText(o[0])}else n("Incorrect number of files selected.")}else n("Local file reading APIs are not fully supported in this browser.")})),o.remove()}}),[e,n,r]),l=[].concat(Object(o.a)(c?[{title:"Create hierarchy",handler:i,handlerKey:"n"}]:[]),Object(o.a)(s?[{title:"Import hierarchy",subtitle:"(from CSV file)",handler:u(kr.e,Or.e),handlerKey:"c"},{title:"Import hierarchy",subtitle:"(from JSON file)",handler:u(kr.d,Or.d),handlerKey:"j"}]:[]));return l.length>0?A.a.createElement(yr,{menuConfig:l},A.a.createElement("button",{className:"plus-button",type:"submit"},"+")):null}function Xr(t){var e=t.onUnion,n=t.onIntersection,r=t.onComplement,i=t.operatable,o=t.hasCheckedSetsToUnion,a=t.hasCheckedSetsToIntersect,s=t.hasCheckedSetsToComplement;return A.a.createElement(A.a.Fragment,null,i&&A.a.createElement(A.a.Fragment,null,A.a.createElement("button",{onClick:e,title:"New set from union of checked sets",type:"submit",disabled:!o},A.a.createElement(_r,null)),A.a.createElement("button",{onClick:n,title:"New set from intersection of checked sets",type:"submit",disabled:!a},A.a.createElement(Lr,null)),A.a.createElement("button",{onClick:r,title:"New set from complement of checked sets",type:"submit",disabled:!s},A.a.createElement(Hr,null))))}var zr=n(121);function Kr(t,e){return Object(i.a)({},t,{tree:t?t.tree.map((function(t){return function t(e,n,r){var a,A=[].concat(Object(o.a)(n),[e.name]);return Object(i.a)({},e,{},e.children?{children:e.children.map((function(e){return t(e,A,r)}))}:{},{color:(null===r||void 0===r||null===(a=r.find((function(t){return c()(t.path,A)})))||void 0===a?void 0:a.color)||_t.b})}(t,[],e)})):[]})}function qr(t){var e=t.sets,n=t.additionalSets,i=t.setColor,s=t.levelSelection,u=t.setSelection,l=t.setExpansion,g=t.hasColorEncoding,f=t.datatype,h=t.draggable,d=void 0===h||h,I=t.checkable,p=void 0===I||I,C=t.editable,y=void 0===C||C,v=t.expandable,B=void 0===v||v,m=t.operatable,b=void 0===m||m,E=t.exportable,Q=void 0===E||E,F=t.importable,w=void 0===F||F,S=t.onError,R=t.onCheckNode,U=t.onExpandNode,x=t.onDropNode,k=t.onCheckLevel,O=t.onNodeSetColor,N=t.onNodeSetName,D=t.onNodeCheckNewName,G=t.onNodeRemove,_=t.onNodeView,M=t.onImportTree,T=t.onCreateLevelZeroNode,j=t.onExportLevelZeroNodeJSON,L=t.onExportLevelZeroNodeTabular,V=t.onExportSetJSON,Z=t.onUnion,P=t.onIntersection,W=t.onComplement,J=t.hasCheckedSetsToUnion,H=t.hasCheckedSetsToIntersect,Y=t.hasCheckedSetsToComplement,X=Object(a.useState)(!1),z=Object(r.a)(X,2),K=z[0],q=z[1],$=Object(a.useState)(null),tt=Object(r.a)($,2),et=tt[0],nt=tt[1],rt=Object(a.useMemo)((function(){return Kr(e,i)}),[e,i]),it=Object(a.useMemo)((function(){return Kr(n,i)}),[n,i]),ot=it?it.tree.flatMap((function(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return null;var r=[].concat(Object(o.a)(n),[e.name]);return e.children?[Object(Gt.g)(r)].concat(Object(o.a)(e.children.flatMap((function(e){return t(e,r)})))):Object(Gt.g)(r)}(t,[])})):[],at=(u||[]).map(Gt.g),At=(l||[]).map(Gt.g),st=at.filter((function(t){return!ot.includes(t)})),ct=At.filter((function(t){return!ot.includes(t)})),ut=at.filter((function(t){return ot.includes(t)})),lt=At.filter((function(t){return ot.includes(t)}));function gt(t,e,n){return t?t.map((function(t){var r=[].concat(Object(o.a)(n),[t.name]);return A.a.createElement(xr,Object.assign({key:Object(Gt.g)(r)},Object(zr.h)(t,r,i),{isEditing:c()(et,r),datatype:f,draggable:d&&!e,editable:y&&!e,checkable:p,expandable:B,exportable:Q,hasColorEncoding:g,isChecking:!0,checkedLevelPath:s?s.levelZeroPath:null,checkedLevelIndex:s?s.levelIndex:null,onCheckNode:R,onCheckLevel:k,onNodeView:_,onNodeSetColor:O,onNodeSetName:function(t,e){N(t,e),nt(null)},onNodeCheckNewName:D,onNodeSetIsEditing:nt,onNodeRemove:G,onExportLevelZeroNodeJSON:j,onExportLevelZeroNodeTabular:L,onExportSetJSON:V,disableTooltip:K,onDragStart:function(){return q(!0)},onDragEnd:function(){return q(!1)}}),gt(t.children,e,r))})):null}return A.a.createElement("div",{className:"sets-manager"},A.a.createElement("div",{className:"sets-manager-tree"},A.a.createElement(Qt,{draggable:!1,checkable:p,checkedKeys:st,expandedKeys:ct,autoExpandParent:!0,onCheck:function(t,e){return R(e.node.props.nodeKey,e.checked)},onExpand:function(t,e){return U(t,e.node.props.nodeKey,e.expanded)}},gt(rt.tree,!0,[])),A.a.createElement(Qt,{draggable:!0,checkable:p,checkedKeys:ut,expandedKeys:lt,autoExpandParent:!0,onCheck:function(t,e){return R(e.node.props.nodeKey,e.checked)},onExpand:function(t,e){return U(t,e.node.props.nodeKey,e.expanded)},onDrop:function(t){var e=t.node.props.eventKey,n=t.dragNode.props.eventKey,r=t.dropToGap,i=t.dropPosition;x(e,n,i,r)}},gt(it.tree,!1,[])),A.a.createElement(Yr,{datatype:f,onError:S,onImportTree:M,onCreateLevelZeroNode:T,importable:w,editable:y})),A.a.createElement("div",{className:"set-operation-buttons"},A.a.createElement(Xr,{onUnion:Z,onIntersection:P,onComplement:W,operatable:b,hasCheckedSetsToUnion:J,hasCheckedSetsToIntersect:H,hasCheckedSetsToComplement:Y})))}n.d(e,"a",(function(){return qr}))},function(t,e,n){"use strict";var r=n(5),i=n.n(r),o=n(18),a=n(16),A=n(26),s=n(12),c=n(21),u=n(0),l=n.n(u),g=n(185),f=n(792),h=n(28),d=n(9),I=(n(20),n(32)),p=n(43),C=n(77),y=n(541),v=n(64),B=u.forwardRef((function(t,e){var n=t.children,r=t.classes,i=t.className,o=t.color,a=void 0===o?"default":o,A=t.component,s=void 0===A?"button":A,c=t.disabled,l=void 0!==c&&c,g=t.disableElevation,f=void 0!==g&&g,p=t.disableFocusRipple,C=void 0!==p&&p,B=t.endIcon,m=t.focusVisibleClassName,b=t.fullWidth,E=void 0!==b&&b,Q=t.size,F=void 0===Q?"medium":Q,w=t.startIcon,S=t.type,R=void 0===S?"button":S,U=t.variant,x=void 0===U?"text":U,k=Object(h.a)(t,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),O=w&&u.createElement("span",{className:Object(I.a)(r.startIcon,r["iconSize".concat(Object(v.a)(F))])},w),N=B&&u.createElement("span",{className:Object(I.a)(r.endIcon,r["iconSize".concat(Object(v.a)(F))])},B);return u.createElement(y.a,Object(d.a)({className:Object(I.a)(r.root,r[x],i,"inherit"===a?r.colorInherit:"default"!==a&&r["".concat(x).concat(Object(v.a)(a))],"medium"!==F&&[r["".concat(x,"Size").concat(Object(v.a)(F))],r["size".concat(Object(v.a)(F))]],f&&r.disableElevation,l&&r.disabled,E&&r.fullWidth),component:s,disabled:l,focusRipple:!C,focusVisibleClassName:Object(I.a)(r.focusVisible,m),ref:e,type:R},k),u.createElement("span",{className:r.label},O,n,N))})),m=Object(p.a)((function(t){return{root:Object(d.a)({},t.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:t.shape.borderRadius,color:t.palette.text.primary,transition:t.transitions.create(["background-color","box-shadow","border"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(C.b)(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:t.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:t.palette.primary.main,"&:hover":{backgroundColor:Object(C.b)(t.palette.primary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:t.palette.secondary.main,"&:hover":{backgroundColor:Object(C.b)(t.palette.secondary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===t.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(t.palette.action.disabledBackground)}},outlinedPrimary:{color:t.palette.primary.main,border:"1px solid ".concat(Object(C.b)(t.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(t.palette.primary.main),backgroundColor:Object(C.b)(t.palette.primary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:t.palette.secondary.main,border:"1px solid ".concat(Object(C.b)(t.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(t.palette.secondary.main),backgroundColor:Object(C.b)(t.palette.secondary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(t.palette.action.disabled)}},contained:{color:t.palette.getContrastText(t.palette.grey[300]),backgroundColor:t.palette.grey[300],boxShadow:t.shadows[2],"&:hover":{backgroundColor:t.palette.grey.A100,boxShadow:t.shadows[4],"@media (hover: none)":{boxShadow:t.shadows[2],backgroundColor:t.palette.grey[300]},"&$disabled":{backgroundColor:t.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:t.shadows[6]},"&:active":{boxShadow:t.shadows[8]},"&$disabled":{color:t.palette.action.disabled,boxShadow:t.shadows[0],backgroundColor:t.palette.action.disabledBackground}},containedPrimary:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:hover":{backgroundColor:t.palette.primary.dark,"@media (hover: none)":{backgroundColor:t.palette.primary.main}}},containedSecondary:{color:t.palette.secondary.contrastText,backgroundColor:t.palette.secondary.main,"&:hover":{backgroundColor:t.palette.secondary.dark,"@media (hover: none)":{backgroundColor:t.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(B),b=n(788),E=n.n(b),Q=n(349),F=n(348),w=n(350);var S=n(17),R=(n(262),n(1361)),U=n(351),x=n(383),k=n(258),O=u.forwardRef((function(t,e){var n=t.children,r=t.classes,i=t.className,o=t.collapsedHeight,a=void 0===o?"0px":o,A=t.component,s=void 0===A?"div":A,c=t.in,l=t.onEnter,g=t.onEntered,f=t.onEntering,p=t.onExit,C=t.onExiting,y=t.style,v=t.timeout,B=void 0===v?U.b.standard:v,m=Object(h.a)(t,["children","classes","className","collapsedHeight","component","in","onEnter","onEntered","onEntering","onExit","onExiting","style","timeout"]),b=Object(k.a)(),E=u.useRef(),Q=u.useRef(null),F=u.useRef(),w="number"===typeof a?"".concat(a,"px"):a;u.useEffect((function(){return function(){clearTimeout(E.current)}}),[]);return u.createElement(R.a,Object(d.a)({in:c,onEnter:function(t,e){t.style.height=w,l&&l(t,e)},onEntered:function(t,e){t.style.height="auto",g&&g(t,e)},onEntering:function(t,e){var n=Q.current?Q.current.clientHeight:0,r=Object(x.a)({style:y,timeout:B},{mode:"enter"}).duration;if("auto"===B){var i=b.transitions.getAutoHeightDuration(n);t.style.transitionDuration="".concat(i,"ms"),F.current=i}else t.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");t.style.height="".concat(n,"px"),f&&f(t,e)},onExit:function(t){var e=Q.current?Q.current.clientHeight:0;t.style.height="".concat(e,"px"),p&&p(t)},onExiting:function(t){var e=Q.current?Q.current.clientHeight:0,n=Object(x.a)({style:y,timeout:B},{mode:"exit"}).duration;if("auto"===B){var r=b.transitions.getAutoHeightDuration(e);t.style.transitionDuration="".concat(r,"ms"),F.current=r}else t.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");t.style.height=w,C&&C(t)},addEndListener:function(t,e){"auto"===B&&(E.current=setTimeout(e,F.current||0))},timeout:"auto"===B?null:B},m),(function(t,o){return u.createElement(s,Object(d.a)({className:Object(I.a)(r.container,i,{entered:r.entered,exited:!c&&"0px"===w&&r.hidden}[t]),style:Object(d.a)({minHeight:w},y),ref:e},o),u.createElement("div",{className:r.wrapper,ref:Q},u.createElement("div",{className:r.wrapperInner},n)))}))}));O.muiSupportAuto=!0;var N=Object(p.a)((function(t){return{container:{height:0,overflow:"hidden",transition:t.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}}),{name:"MuiCollapse"})(O),D=n(781);var G=u.createContext({}),_=n(326),M=u.forwardRef((function(t,e){var n,r=t.children,i=t.classes,o=t.className,a=t.defaultExpanded,A=void 0!==a&&a,s=t.disabled,c=void 0!==s&&s,l=t.expanded,g=t.onChange,f=t.square,p=void 0!==f&&f,C=t.TransitionComponent,y=void 0===C?N:C,v=t.TransitionProps,B=Object(h.a)(t,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),m=Object(_.a)({controlled:l,default:A,name:"ExpansionPanel"}),b=Object(S.a)(m,2),E=b[0],R=b[1],U=u.useCallback((function(t){R(!E),g&&g(t,!E)}),[E,g,R]),x=u.Children.toArray(r),k=(n=x,Object(Q.a)(n)||Object(F.a)(n)||Object(w.a)()),O=k[0],M=k.slice(1),T=u.useMemo((function(){return{expanded:E,disabled:c,toggle:U}}),[E,c,U]);return u.createElement(D.a,Object(d.a)({className:Object(I.a)(i.root,o,E&&i.expanded,c&&i.disabled,!p&&i.rounded),ref:e,square:p},B),u.createElement(G.Provider,{value:T},O),u.createElement(y,Object(d.a)({in:E,timeout:"auto"},v),u.createElement("div",{"aria-labelledby":O.props.id,id:O.props["aria-controls"],role:"region"},M)))})),T=Object(p.a)((function(t){var e={duration:t.transitions.duration.shortest};return{root:{position:"relative",transition:t.transitions.create(["margin"],e),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:t.palette.divider,transition:t.transitions.create(["opacity","background-color"],e)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:t.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:t.shape.borderRadius,borderTopRightRadius:t.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:t.shape.borderRadius,borderBottomRightRadius:t.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}}),{name:"MuiExpansionPanel"})(M),j=n(868),L=u.forwardRef((function(t,e){var n=t.children,r=t.classes,i=t.className,o=t.expandIcon,a=t.IconButtonProps,A=t.onBlur,s=t.onClick,c=t.onFocusVisible,l=Object(h.a)(t,["children","classes","className","expandIcon","IconButtonProps","onBlur","onClick","onFocusVisible"]),g=u.useState(!1),f=g[0],p=g[1],C=u.useContext(G),v=C.disabled,B=void 0!==v&&v,m=C.expanded,b=C.toggle;return u.createElement(y.a,Object(d.a)({focusRipple:!1,disableRipple:!0,disabled:B,component:"div","aria-expanded":m,className:Object(I.a)(r.root,i,B&&r.disabled,m&&r.expanded,f&&r.focused),onFocusVisible:function(t){p(!0),c&&c(t)},onBlur:function(t){p(!1),A&&A(t)},onClick:function(t){b&&b(t),s&&s(t)},ref:e},l),u.createElement("div",{className:Object(I.a)(r.content,m&&r.expanded)},n),o&&u.createElement(j.a,Object(d.a)({className:Object(I.a)(r.expandIcon,m&&r.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},a),o))})),V=Object(p.a)((function(t){var e={duration:t.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:t.transitions.create(["min-height","background-color"],e),padding:"0 24px 0 24px","&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused":{backgroundColor:t.palette.grey[300]},"&$disabled":{opacity:.38}},expanded:{},focused:{},disabled:{},content:{display:"flex",flexGrow:1,transition:t.transitions.create(["margin"],e),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:t.transitions.create("transform",e),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}}),{name:"MuiExpansionPanelSummary"})(L),Z=u.forwardRef((function(t,e){var n=t.classes,r=t.className,i=Object(h.a)(t,["classes","className"]);return u.createElement("div",Object(d.a)({className:Object(I.a)(n.root,r),ref:e},i))})),P=Object(p.a)({root:{display:"flex",padding:"8px 24px 24px"}},{name:"MuiExpansionPanelDetails"})(Z),W=n(1105),J=n.n(W),H=n(1121),Y=n(1110),X=n(935),z=n(269),K=n.n(z),q=n(84),$=n.n(q),tt=n(387),et=n(1104),nt=n.n(et),rt=n(902),it=n(234),ot=n(1103),at=n.n(ot),At=n(75),st=Object(tt.a)((function(t){return{container:{width:"70px",height:"40px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},button:{padding:"3px",width:"16px"},icon:{width:"17px",height:"17px",stroke:t.palette.action.selected,"stroke-width":"1px"}}})),ct=function(t){var e=t.handleChange,n=st();return l.a.createElement("div",{className:n.container,"aria-label":"color-swatch"},At.e.map((function(t){return l.a.createElement(j.a,{className:n.button,key:t,onClick:function(){return e(t)}},l.a.createElement(at.a,{fontSize:"small",style:{color:"rgb(".concat(t,")")},className:n.icon}))})))},ut=Object(tt.a)((function(){return{menuButton:{backgroundColor:"transparent"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"}}}));var lt=function(t){var e=t.handlePropertyChange,n=t.handleChannelRemove,r=t.handleIQRUpdate,i=Object(u.useReducer)((function(t){return!t}),!1),o=Object(s.a)(i,2),a=o[0],A=o[1],c=ut();return l.a.createElement(it.b,{open:a,toggle:A,buttonIcon:l.a.createElement(nt.a,{fontSize:"small"}),buttonClassName:c.menuButton},l.a.createElement(rt.a,{dense:!0,disableGutters:!0,onClick:function(){A(),n()}},l.a.createElement(it.a,null,"Remove")),l.a.createElement(rt.a,{dense:!0,disableGutters:!0,onClick:r},l.a.createElement(it.a,null,"Use IQR")),l.a.createElement(rt.a,{dense:!0,disableGutters:!0,className:c.colors},l.a.createElement(ct,{handleChange:function(t){e("color",t)}})))};function gt(t){var e=5;Number.isInteger(t)||--e,t<1&&--e;var n=Intl.NumberFormat("en-US",{maximumSignificantDigits:e,useGrouping:!1}).format(t);return n.length<=5?n:t.toExponential(0)}function ft(t){var e=t.handleChange,n=t.disableOptions,r=t.channelOptions,i=t.selectionIndex;return l.a.createElement(X.a,{native:!0,value:i,onChange:function(t){return e(Number(t.target.value))}},r.map((function(t,e){return l.a.createElement("option",{disabled:n,key:t,value:e},t)})))}function ht(t){var e=t.color,n=t.slider,r=void 0===n?[0,0]:n,i=t.handleChange,o=t.domain,a=void 0===o?[0,0]:o,A=t.dtype,c=Object(s.a)(a,2),g=c[0],f=c[1],h=Object(u.useCallback)(K()(i,3,{trailing:!0}),[i]),d=f-g<500&&"<f4"===A?(f-g)/500:1;return l.a.createElement(Y.a,{value:r,valueLabelFormat:gt,onChange:function(t,e){return h(e)},valueLabelDisplay:"auto",getAriaLabel:function(){return"".concat(e,"-").concat(r)},min:g,max:f,step:d,orientation:"horizontal",style:{color:e,marginTop:"7px"}})}function dt(t){var e=t.color,n=t.checked,r=t.toggle;return l.a.createElement(H.a,{onChange:r,checked:n,style:{color:e,"&$checked":{color:e}}})}var It=function(t){var e=t.visibility,n=void 0!==e&&e,r=t.slider,i=t.color,o=t.channels,c=t.channelId,h=t.domainType,d=t.dimName,I=t.theme,p=t.loader,C=t.colormapOn,y=t.channelOptions,v=t.handlePropertyChange,B=t.handleChannelRemove,m=t.handleIQRUpdate,b=t.selectionIndex,E=t.disableOptions,Q=void 0!==E&&E,F=p.dtype,w=Object(u.useState)(null),S=Object(s.a)(w,2),R=S[0],U=S[1],x=Object(u.useState)(null),k=Object(s.a)(x,2),O=k[0],N=k[1],D=Object(u.useState)([Object(A.a)({},o[c].selection)]),G=Object(s.a)(D,2),_=G[0],M=G[1],T=function(t,e,n){var r=t||"light"===n&&e.every((function(t){return 255===t}))?[220,220,220]:e;return"rgb(".concat(r,")")}(C,i,I);return Object(u.useEffect)((function(){var t=!0;if(F&&p&&o){var e=[Object(A.a)({},o[c].selection)],n=h!==O,r=!$()(e,_);if(n||r)if("Full"===h){var i=[[0,g.a[F].max]],a=Object(s.a)(i,1)[0];t&&(U(a),N(h),r&&M(e))}else Object(g.h)({loader:p,loaderSelection:e}).then((function(n){var i=n.map((function(t){return t.domain})),o=Object(s.a)(i,1)[0];t&&(U(o),N(h),r&&M(e))}))}return function(){t=!1}}),[O,o,c,p,F,h,_]),l.a.createElement(f.a,{container:!0,direction:"column",m:1,justify:"center"},l.a.createElement(f.a,{container:!0,direction:"row",justify:"space-between"},l.a.createElement(f.a,{item:!0,xs:10},l.a.createElement(ft,{handleChange:function(t){return v("selection",function(t){return Object(a.a)({},d,t)}(t))},selectionIndex:b,disableOptions:Q,channelOptions:y})),l.a.createElement(f.a,{item:!0,xs:1,style:{marginTop:"4px"}},l.a.createElement(lt,{handlePropertyChange:v,handleChannelRemove:B,handleIQRUpdate:m}))),l.a.createElement(f.a,{container:!0,direction:"row",justify:"space-between"},l.a.createElement(f.a,{item:!0,xs:2},l.a.createElement(dt,{color:T,checked:n,toggle:function(){return v("visible",!n)}})),l.a.createElement(f.a,{item:!0,xs:9},R&&l.a.createElement(ht,{color:T,slider:r,domain:R,dtype:F,handleChange:function(t){return v("slider",t)}}))))},pt=n(270),Ct=n(306),yt=u.forwardRef((function(t,e){var n=t.children,r=t.classes,i=t.className,o=(t.color,t.component),a=void 0===o?"label":o,A=(t.disabled,t.error,t.filled,t.focused,t.required,Object(h.a)(t,["children","classes","className","color","component","disabled","error","filled","focused","required"])),s=Object(Ct.a)(),c=Object(pt.a)({props:t,muiFormControl:s,states:["color","required","focused","disabled","error","filled"]});return u.createElement(a,Object(d.a)({className:Object(I.a)(r.root,r["color".concat(Object(v.a)(c.color||"primary"))],i,c.disabled&&r.disabled,c.error&&r.error,c.filled&&r.filled,c.focused&&r.focused,c.required&&r.required),ref:e},A),n,c.required&&u.createElement("span",{className:Object(I.a)(r.asterisk,c.error&&r.error)},"\u2009","*"))})),vt=Object(p.a)((function(t){return{root:Object(d.a)({color:t.palette.text.secondary},t.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:t.palette.primary.main},"&$disabled":{color:t.palette.text.disabled},"&$error":{color:t.palette.error.main}}),colorSecondary:{"&$focused":{color:t.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:t.palette.error.main}}}}),{name:"MuiFormLabel"})(yt),Bt=u.forwardRef((function(t,e){var n=t.classes,r=t.className,i=t.disableAnimation,o=void 0!==i&&i,a=(t.margin,t.shrink),A=(t.variant,Object(h.a)(t,["classes","className","disableAnimation","margin","shrink","variant"])),s=Object(Ct.a)(),c=a;"undefined"===typeof c&&s&&(c=s.filled||s.focused||s.adornedStart);var l=Object(pt.a)({props:t,muiFormControl:s,states:["margin","variant"]});return u.createElement(vt,Object(d.a)({"data-shrink":c,className:Object(I.a)(n.root,r,s&&n.formControl,!o&&n.animated,c&&n.shrink,"dense"===l.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[l.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:e},A))})),mt=Object(p.a)((function(t){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:t.transitions.create(["color","transform"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(Bt),bt=n(120),Et=["Full","Min/Max"];function Qt(t){var e=t.value,n=t.inputId,r=t.handleChange;return l.a.createElement(X.a,{native:!0,onChange:function(t){return r(""===t.target.value?null:t.target.value)},value:e,inputProps:{name:"colormap",id:n},style:{width:"100%"}},l.a.createElement("option",{"aria-label":"None",value:""},"None"),At.a.map((function(t){return l.a.createElement("option",{key:t,value:t},t)})))}function Ft(t){var e=t.value,n=t.handleChange;return l.a.createElement(H.a,{style:{float:"left",padding:0},color:"default",onChange:function(){n(e?null:[0,0,0])},checked:Boolean(e)})}function wt(t){var e=t.value,n=t.handleChange;return l.a.createElement(Y.a,{value:e,onChange:function(t,e){return n(e)},valueLabelDisplay:"auto",getAriaLabel:function(){return"opacity slider"},min:0,max:1,step:.01,orientation:"horizontal",style:{marginTop:"7px"}})}function St(t){var e=t.value,n=t.inputId,r=t.handleChange;return l.a.createElement(X.a,{native:!0,onChange:function(t){return r(t.target.value)},value:e,inputProps:{name:"domain-selector",id:n},style:{width:"100%"}},Et.map((function(t){return l.a.createElement("option",{key:t,value:t},t)})))}function Rt(t){var e=t.field,n=t.value,r=t.handleChange,i=t.possibleValues;return l.a.createElement(Y.a,{value:n,onChange:function(t,n){r({selection:Object(a.a)({},e,n),event:t})},onChangeCommitted:function(t,n){r({selection:Object(a.a)({},e,n),event:t})},valueLabelDisplay:"auto",getAriaLabel:function(){return"".concat(e," slider")},marks:i.map((function(t){return{value:t}})),min:Number(i[0]),max:Number(i.slice(-1)),orientation:"horizontal",style:{marginTop:"7px"},step:null})}function Ut(t){var e=t.name,n=t.inputId,r=t.children;return l.a.createElement(f.a,{container:!0,direction:"row",alignItems:"center",justify:"center"},l.a.createElement(f.a,{item:!0,xs:6},l.a.createElement(mt,{htmlFor:n},e,":")),l.a.createElement(f.a,{item:!0,xs:6},r))}var xt=function(t){var e=t.colormap,n=t.opacity,r=t.handleColormapChange,i=t.handleOpacityChange,o=t.handleTransparentColorChange,a=t.globalControlDimensions,A=t.globalDimensionValues,s=t.handleGlobalChannelsSelectionChange,c=t.handleDomainChange,u=t.transparentColor,g=t.channels,h=t.dimensions,d=t.domainType,I=t.isRgb,p=h.length>0&&g.length>0;return l.a.createElement(f.a,{container:!0,direction:"column",style:{width:"100%"}},I?null:l.a.createElement(l.a.Fragment,null,l.a.createElement(f.a,{item:!0},l.a.createElement(Ut,{name:"Colormap",inputId:"colormap-select"},l.a.createElement(Qt,{value:e||"",inputId:"colormap-select",handleChange:r}))),l.a.createElement(f.a,{item:!0},l.a.createElement(Ut,{name:"Domain",inputId:"domain-selector"},l.a.createElement(St,{value:d||bt.e,handleChange:function(t){c(t)}})))),l.a.createElement(f.a,{item:!0},l.a.createElement(Ut,{name:"Opacity",inputId:"opacity-slider"},l.a.createElement(wt,{value:n,handleChange:i}))),l.a.createElement(f.a,{item:!0},l.a.createElement(Ut,{name:"Zero Transparent",inputId:"transparent-color-selector"},l.a.createElement(Ft,{value:u,handleChange:o}))),p&&a.map((function(t){var e=t.field,n=t.values;return n.length>1&&l.a.createElement(Ut,{name:e,inputId:"".concat(e,"-slider"),key:e},l.a.createElement(Rt,{field:e,value:A[e],handleChange:s,possibleValues:n}))})))},kt=n(752);function Ot(t,e,n){return Nt.apply(this,arguments)}function Nt(){return(Nt=Object(c.a)(i.a.mark((function t(e,n,r){var o,a,A;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(g.h)({loader:e,loaderSelection:n});case 2:return a=t.sent,A=a.map((function(t){return t.autoSliders})),"Min/Max"===r&&(o=a.map((function(t){return t.domain}))),"Full"===r&&(o=n.map((function(){return[0,g.a[e.dtype].max]}))),t.abrupt("return",{domains:o,sliders:A});case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n.d(e,"a",(function(){return Gt}));var Dt={borderStyle:"dashed",marginTop:"10px",fontWeight:400};function Gt(t){var e,n=t.layer,r=t.name,h=t.loader,d=t.theme,I=t.handleLayerRemove,p=t.handleLayerChange,C=n.colormap,y=n.opacity,v=n.channels,B=n.transparentColor,b=(null===(e=v[0])||void 0===e?void 0:e.selection)||{},Q=h.dimensions,F=Object(u.useState)(n.domainType),w=Object(s.a)(F,2),S=w[0],R=w[1],U=Object(u.useState)(bt.g.filter((function(t){return b[t]})).reduce((function(t,e){return Object(A.a)({},t,Object(a.a)({},e,b[e]))}),{})),x=Object(s.a)(U,2),k=x[0],O=x[1];function N(t,e){p(Object(A.a)({},n,{channels:t,domainType:e}))}function D(t,e){var r=Object(o.a)(v);r[e]=t,p(Object(A.a)({},n,{channels:r}))}function G(t){var e=[].concat(Object(o.a)(v),[t]);p(Object(A.a)({},n,{channels:e}))}var _=function(){var t=Object(c.a)(i.a.mark((function t(){var e,n,r,o,a,A;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={},Q.forEach((function(t){e[t.field]=bt.g.includes(t.field)?k[t.field]:0})),t.next=4,Ot(h,[e],S);case 4:n=t.sent,r=n.domains,o=n.sliders,a=r[0],A=o[0]||a,!0,G({selection:e,slider:A,visible:!0,color:[255,255,255]});case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),M=function(){var t=Object(c.a)(i.a.mark((function t(e){var n,r,o,a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return R(e),n=v.map((function(t){return t.selection})),r=v.map((function(t){return t.slider})),t.next=5,Ot(h,n,e);case 5:o=t.sent,a=o.domains,r=r.map((function(t,e){var n=Object(s.a)(t,2),r=n[0],i=n[1];return[Math.max(r,a[e][0]),Math.min(i,a[e][1])]})),N(v.map((function(t,e){return Object(A.a)({},t,{slider:r[e]})})),e);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=Object(c.a)(i.a.mark((function t(e){var r,o,a,s,c,u,l;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.selection,o=e.event,a=v.map((function(t){return Object(A.a)({},t.selection,{},r)})),!(s="mouseup"===o.type)){t.next=9;break}return t.next=6,Ot(h,a,S);case 6:t.t0=t.sent,t.next=10;break;case 9:t.t0={domains:[],sliders:[]};case 10:c=t.t0,u=c.sliders,s&&(l=v.map((function(t,e){return Object(A.a)({},t,{slider:u[e],selection:Object(A.a)({},t.selection,{},r)})})),i=l,p(Object(A.a)({},n,{channels:i}))),O((function(t){return Object(A.a)({},t,{},r)}));case 14:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}(),L=[];if(Q.length>0){var Z="ome-tiff"===h.type?Q.find((function(t){return"channel"===t.field})):Q[0],W=Z.values,H=Z.field;L=v.map((function(t,e){var r=function(){var n=Object(c.a)(i.a.mark((function n(r,o){var c,u,l,g,f;return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=Object(a.a)({},r,o),"selection"!==r){n.next=10;break}return c.selection=Object(A.a)({},k,{},c.selection),u=[Object(A.a)({},v[e][r],{},o)],n.next=6,Ot(h,u,S);case 6:l=n.sent,g=l.sliders,f=Object(s.a)(g,1),c.slider=f[0];case 10:D(Object(A.a)({},t,{},c),e);case 11:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),u=function(){var n=Object(c.a)(i.a.mark((function n(){var r,o,a,s;return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(g.h)({loader:h,loaderSelection:[v[e].selection]});case 2:r=n.sent,o=r[0],a=o.q1,s=o.q3,D(Object(A.a)({},t,{slider:[a,s]}),e);case 5:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();return l.a.createElement(f.a,{key:"channel-controller-".concat(e),item:!0,style:{width:"100%"}},l.a.createElement(It,{dimName:H,visibility:t.visible,selectionIndex:t.selection[H],slider:t.slider,color:t.color,channels:v,channelId:e,domainType:S,loader:h,globalDimensionValues:k,theme:d,channelOptions:W,colormapOn:Boolean(C),handlePropertyChange:r,handleChannelRemove:function(){!function(t){var e=Object(o.a)(v);e.splice(t,1),p(Object(A.a)({},n,{channels:e}))}(e)},handleIQRUpdate:u}))}))}var Y=Object(kt.a)(),X=Object(kt.b)();return l.a.createElement(T,{defaultExpanded:!0,className:Y.root},l.a.createElement(V,{expandIcon:l.a.createElement(J.a,null),"aria-controls":"layer-".concat(r,"-controls"),classes:Object(A.a)({},X)},r),l.a.createElement(P,{className:Y.root},l.a.createElement(f.a,{item:!0},l.a.createElement(xt,{channels:v,dimensions:Q,opacity:y,colormap:C,transparentColor:B,domainType:S,globalControlDimensions:Q.filter((function(t){return bt.g.includes(t.field)})),globalDimensionValues:k,handleOpacityChange:function(t){p(Object(A.a)({},n,{opacity:t}))},handleColormapChange:function(t){p(Object(A.a)({},n,{colormap:t}))},handleGlobalChannelsSelectionChange:j,handleTransparentColorChange:function(t){p(Object(A.a)({},n,{transparentColor:t}))},isRgb:h.isRgb,handleDomainChange:M})),h.isRgb?null:L,!h.isRgb&&l.a.createElement(f.a,{item:!0},l.a.createElement(m,{disabled:v.length===g.c,onClick:_,fullWidth:!0,variant:"outlined",style:Dt,startIcon:l.a.createElement(E.a,null),size:"small"},"Add Channel")),l.a.createElement(f.a,{item:!0},l.a.createElement(m,{onClick:I,fullWidth:!0,variant:"outlined",style:Dt,size:"small"},"Remove Image Layer"))))}},function(t,e,n){var r=n(691);t.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(775).SEMVER_SPEC_VERSION,SemVer:n(316),compareIdentifiers:n(894).compareIdentifiers,rcompareIdentifiers:n(894).rcompareIdentifiers,parse:n(692),valid:n(1332),clean:n(1333),inc:n(1334),diff:n(1335),major:n(1336),minor:n(1337),patch:n(1338),prerelease:n(1339),compare:n(392),rcompare:n(1340),compareLoose:n(1341),compareBuild:n(896),sort:n(1342),rsort:n(1343),gt:n(777),lt:n(897),eq:n(895),neq:n(1081),gte:n(898),lte:n(899),cmp:n(1082),coerce:n(1344),Comparator:n(778),Range:n(393),satisfies:n(779),toComparators:n(1345),maxSatisfying:n(1346),minSatisfying:n(1347),minVersion:n(1348),validRange:n(1349),outside:n(900),gtr:n(1350),ltr:n(1351),intersects:n(1352),simplifyRange:n(1353),subset:n(1358)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e[0],version:e[1]}}},,,,,,,,,function(t,e,n){"use strict";e.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n  float r, s, t, x;\n\n  if (a == 0.0) {\n    return 0.0;\n  }\n\n  x = -a * a;\n  s = a;\n  r = a;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_3;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_5;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_7;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_9;\n  s = s + t;\n\n  return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n  if (a == 0.0) {\n    sin_t = 0.0;\n    cos_t = 1.0;\n  }\n  sin_t = sin_taylor_fp32(a);\n  cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n    float sin_a;\n    float cos_a;\n\n    if (a == 0.0) {\n        return 0.0;\n    }\n    float z = floor(a / TWO_PI);\n    float r = a - TWO_PI * z;\n\n    float t;\n    float q = floor(r / PI_2 + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return 0.0 / 0.0;\n    }\n\n    t = r - PI_2 * q;\n\n    q = floor(t / PI_16 + 0.5);\n    int k = int(q);\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return 0.0 / 0.0;\n    } else {\n        t = t - PI_16 * q;\n    }\n\n    float u = 0.0;\n    float v = 0.0;\n\n    float sin_t, cos_t;\n    float s, c;\n    sincos_taylor_fp32(t, sin_t, cos_t);\n\n    if (k == 0) {\n        s = sin_t;\n        c = cos_t;\n    } else {\n        if (abs(float(abs_k) - 1.0) < 0.5) {\n            u = COS_TABLE_0;\n            v = SIN_TABLE_0;\n        } else if (abs(float(abs_k) - 2.0) < 0.5) {\n            u = COS_TABLE_1;\n            v = SIN_TABLE_1;\n        } else if (abs(float(abs_k) - 3.0) < 0.5) {\n            u = COS_TABLE_2;\n            v = SIN_TABLE_2;\n        } else if (abs(float(abs_k) - 4.0) < 0.5) {\n            u = COS_TABLE_3;\n            v = SIN_TABLE_3;\n        }\n        if (k > 0) {\n            s = u * sin_t + v * cos_t;\n            c = u * cos_t - v * sin_t;\n        } else {\n            s = u * sin_t - v * cos_t;\n            c = u * cos_t + v * sin_t;\n        }\n    }\n\n    if (j == 0) {\n        sin_a = s;\n        cos_a = c;\n    } else if (j == 1) {\n        sin_a = c;\n        cos_a = -s;\n    } else if (j == -1) {\n        sin_a = -c;\n        cos_a = s;\n    } else {\n        sin_a = -s;\n        cos_a = -c;\n    }\n    return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n  return tan_taylor_fp32(a);\n#else\n  return tan(a);\n#endif\n}\n",fs:null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n(8),o=n(6),a=n(54),A=n(2),s=n(7),c=n(19),u=n(82),l=n(76),g=n(127),f=n(197),h=function(t){function e(t){var n,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,e),Object(g.a)(t),(n=Object(i.a)(this,Object(o.a)(e).call(this,t,A))).initialize(A),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(a.a)(n)),n}return Object(s.a)(e,t),Object(A.a)(e,null,[{key:"isSupported",value:function(t){return Object(c.g)(t)}}]),Object(A.a)(e,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(f.a)(this.buffers)||this.bind((function(){return t._unbindBuffers()})),this.setProps(e),this}},{key:"setProps",value:function(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}},{key:"setBuffers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((function(){for(var n in e)t.setBuffer(n,e[n])})),this}},{key:"setBuffer",value:function(t,e){var n=this,r=this._getVaryingIndex(t),i=this._getBufferParams(e),o=i.buffer,a=i.byteSize,A=i.byteOffset;return r<0?(this.unused[t]=o,c.h.warn((function(){return"".concat(n.id," unused varying buffer ").concat(t)}))(),this):(this.buffers[r]=e,this.bindOnUse||this._bindBuffer(r,o,A,a),this)}},{key:"begin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(t){var e,n,r;return t instanceof l.a===!1?(r=t.buffer,n=t.byteSize,e=t.byteOffset):r=t,void 0===e&&void 0===n||(e=e||0,n=n||r.byteLength-e),{buffer:r,byteOffset:e,byteSize:n}}},{key:"_getVaryingInfo",value:function(t){return this.configuration&&this.configuration.getVaryingInfo(t)}},{key:"_getVaryingIndex",value:function(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;var e=Number(t);return Number.isFinite(e)?e:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers){var e=this._getBufferParams(this.buffers[t]),n=e.buffer,r=e.byteSize,i=e.byteOffset;this._bindBuffer(t,n,i,r)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers)this._bindBuffer(t,null)}},{key:"_bindBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=e&&e.handle;return i&&void 0!==r?this.gl.bindBufferRange(35982,t,i,n,r):this.gl.bindBufferBase(35982,t,i),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(t){this.gl.bindTransformFeedback(36386,this.handle)}}]),e}(u.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(17),i=n(3),o=n(2),a=1,A=1,s=function(){function t(){Object(i.a)(this,t),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}return Object(o.a)(t,[{key:"addChannel",value:function(t){var e=t.delay,n=void 0===e?0:e,r=t.duration,i=void 0===r?Number.POSITIVE_INFINITY:r,o=t.rate,A=void 0===o?1:o,s=t.repeat,c=a++,u={time:0,delay:n,duration:i,rate:A,repeat:void 0===s?1:s};return this._setChannelTime(u,this.time),this.channels.set(c,u),c}},{key:"removeChannel",value:function(t){this.channels.delete(t);var e=!0,n=!1,i=void 0;try{for(var o,a=this.animations[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var A=Object(r.a)(o.value,2),s=A[0];A[1].channel===t&&this.detachAnimation(s)}}catch(c){n=!0,i=c}finally{try{e||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isFinished",value:function(t){var e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}},{key:"getTime",value:function(t){if(void 0===t)return this.time;var e=this.channels.get(t);return void 0===e?-1:e.time}},{key:"setTime",value:function(t){this.time=Math.max(0,t);var e=this.channels.values(),n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var A=o.value;this._setChannelTime(A,this.time)}}catch(p){r=!0,i=p}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var s=this.animations.values(),c=!0,u=!1,l=void 0;try{for(var g,f=s[Symbol.iterator]();!(c=(g=f.next()).done);c=!0){var h=g.value,d=h.animation,I=h.channel;d.setTime(this.getTime(I))}}catch(p){u=!0,l=p}finally{try{c||null==f.return||f.return()}finally{if(u)throw l}}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(t,e){var n=A++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}},{key:"detachAnimation",value:function(t){this.animations.delete(t)}},{key:"update",value:function(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}},{key:"_setChannelTime",value:function(t,e){var n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bottom=c,e.cloneLayout=function(t){for(var e=Array(t.length),n=0,r=t.length;n<r;n++)e[n]=u(t[n]);return e},e.cloneLayoutItem=u,e.childrenEqual=function(t,e){return(0,r.default)(i.default.Children.map(t,(function(t){return t.key})),i.default.Children.map(e,(function(t){return t.key})))},e.fastPositionEqual=function(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height},e.collides=g,e.compact=f,e.compactItem=I,e.correctBounds=p,e.getLayoutItem=C,e.getFirstCollision=y,e.getAllCollisions=v,e.getStatics=B,e.moveElement=m,e.moveElementAwayFromCollision=b,e.perc=function(t){return 100*t+"%"},e.setTransform=function(t){var e=t.top,n=t.left,r=t.width,i=t.height,o="translate(".concat(n,"px,").concat(e,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}},e.setTopLeft=function(t){var e=t.top,n=t.left,r=t.width,i=t.height;return{top:"".concat(e,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}},e.sortLayoutItems=E,e.sortLayoutItemsByRowCol=Q,e.sortLayoutItemsByColRow=F,e.synchronizeLayoutWithChildren=function(t,e,n,r){t=t||[];var o=[];return i.default.Children.forEach(e,(function(e,n){var r=C(t,String(e.key));if(r)o[n]=u(r);else{0;var i=e.props["data-grid"]||e.props._grid;o[n]=u(i?A(A({},i),{},{i:e.key}):{w:1,h:1,x:0,y:c(o),i:String(e.key)})}})),f(p(o,{cols:n}),r,n)},e.validateLayout=w,e.compactType=function(t){var e=t||{},n=e.verticalCompact,r=e.compactType;return!1===n?null:r},e.autoBindHandlers=function(t,e){e.forEach((function(e){return t[e]=t[e].bind(t)}))},e.noop=e.fastRGLPropsEqual=void 0;var r=o(n(1136)),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){for(var e,n=0,r=0,i=t.length;r<i;r++)(e=t[r].y+t[r].h)>n&&(n=e);return n}function u(t){return{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:Boolean(t.moved),static:Boolean(t.static),isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,isBounded:t.isBounded}}var l=n(1416);function g(t,e){return t.i!==e.i&&(!(t.x+t.w<=e.x)&&(!(t.x>=e.x+e.w)&&(!(t.y+t.h<=e.y)&&!(t.y>=e.y+e.h))))}function f(t,e,n){for(var r=B(t),i=E(t,e),o=Array(t.length),a=0,A=i.length;a<A;a++){var s=u(i[a]);s.static||(s=I(r,s,e,n,i),r.push(s)),o[t.indexOf(i[a])]=s,s.moved=!1}return o}e.fastRGLPropsEqual=l;var h={x:"w",y:"h"};function d(t,e,n,r){var i=h[r];e[r]+=1;for(var o=t.map((function(t){return t.i})).indexOf(e.i)+1;o<t.length;o++){var a=t[o];if(!a.static){if(a.y>e.y+e.h)break;g(e,a)&&d(t,a,n+e[i],r)}}e[r]=n}function I(t,e,n,r,i){var o,a="horizontal"===n;if("vertical"===n)for(e.y=Math.min(c(t),e.y);e.y>0&&!y(t,e);)e.y--;else if(a)for(e.y=Math.min(c(t),e.y);e.x>0&&!y(t,e);)e.x--;for(;o=y(t,e);)a?d(i,e,o.x+o.w,"x"):d(i,e,o.y+o.h,"y"),a&&e.x+e.w>r&&(e.x=r-e.w,e.y++);return e}function p(t,e){for(var n=B(t),r=0,i=t.length;r<i;r++){var o=t[r];if(o.x+o.w>e.cols&&(o.x=e.cols-o.w),o.x<0&&(o.x=0,o.w=e.cols),o.static)for(;y(n,o);)o.y++;else n.push(o)}return t}function C(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n].i===e)return t[n]}function y(t,e){for(var n=0,r=t.length;n<r;n++)if(g(t[n],e))return t[n]}function v(t,e){return t.filter((function(t){return g(t,e)}))}function B(t){return t.filter((function(t){return t.static}))}function m(t,e,n,r,i,o,a,A){if(e.static&&!0!==e.isDraggable)return t;if(e.y===r&&e.x===n)return t;S("Moving element ".concat(e.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(e.x,",").concat(e.y,"]"));var s=e.x,c=e.y;"number"===typeof n&&(e.x=n),"number"===typeof r&&(e.y=r),e.moved=!0;var u=E(t,a);("vertical"===a&&"number"===typeof r?c>=r:"horizontal"===a&&"number"===typeof n&&s>=n)&&(u=u.reverse());var l=v(u,e);if(o&&l.length)return S("Collision prevented on ".concat(e.i,", reverting.")),e.x=s,e.y=c,e.moved=!1,t;for(var g=0,f=l.length;g<f;g++){var h=l[g];S("Resolving collision between ".concat(e.i," at [").concat(e.x,",").concat(e.y,"] and ").concat(h.i," at [").concat(h.x,",").concat(h.y,"]")),h.moved||(t=h.static?b(t,h,e,i,a,A):b(t,e,h,i,a,A))}return t}function b(t,e,n,r,i,o){var a="horizontal"===i,A="horizontal"!==i,s=e.static;if(r){r=!1;var c={x:a?Math.max(e.x-n.w,0):n.x,y:A?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"};if(!y(t,c))return S("Doing reverse collision on ".concat(n.i," up to [").concat(c.x,",").concat(c.y,"].")),m(t,n,a?c.x:void 0,A?c.y:void 0,r,s,i,o)}return m(t,n,a?n.x+1:void 0,A?n.y+1:void 0,r,s,i,o)}function E(t,e){return"horizontal"===e?F(t):Q(t)}function Q(t){return t.slice(0).sort((function(t,e){return t.y>e.y||t.y===e.y&&t.x>e.x?1:t.y===e.y&&t.x===e.x?0:-1}))}function F(t){return t.slice(0).sort((function(t,e){return t.x>e.x||t.x===e.x&&t.y>e.y?1:-1}))}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Layout",n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(var r=0,i=t.length;r<i;r++){for(var o=t[r],a=0;a<n.length;a++)if("number"!==typeof o[n[a]])throw new Error("ReactGridLayout: "+e+"["+r+"]."+n[a]+" must be a number!");if(o.i&&"string"!==typeof o.i)throw new Error("ReactGridLayout: "+e+"["+r+"].i must be a string!");if(void 0!==o.static&&"boolean"!==typeof o.static)throw new Error("ReactGridLayout: "+e+"["+r+"].static must be a boolean!")}}function S(){}e.noop=function(){}},function(t,e,n){"use strict";var r=n(13),i=n.n(r),o=n(30),a=n(52),A=n(149),s=n(150),c=n(107),u=n(704),l=n(528),g=i.a.mark(f);function f(t){var e,n,r,o,a,A,s,c=arguments;return i.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e=c.length>1&&void 0!==c[1]?c[1]:{},n=e.chunkSize,r=void 0===n?262144:n,o=0,a=new TextEncoder;case 4:if(!(o<t.length)){i.next=12;break}return A=Math.min(t.length-o,r),s=t.slice(o,o+A),o+=A,i.next=10,a.encode(s);case 10:i.next=4;break;case 12:case"end":return i.stop()}}),g)}var h=i.a.mark(d);function d(t){var e,n,r,o,a,A,s,c=arguments;return i.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e=c.length>1&&void 0!==c[1]?c[1]:{},n=e.chunkSize,r=void 0===n?262144:n,o=0;case 3:if(!(o<t.byteLength)){i.next=14;break}return a=Math.min(t.byteLength-o,r),A=new ArrayBuffer(a),s=new Uint8Array(t,o,a),new Uint8Array(A).set(s),o+=a,i.next=12,A;case 12:i.next=3;break;case 14:case"end":return i.stop()}}),h)}function I(t){this.wrapped=t}function p(t){return new I(t)}function C(t){var e,n;function r(e,n){try{var o=t[e](n),a=o.value,A=a instanceof I;Promise.resolve(A?a.wrapped:a).then((function(t){A?r("return"===e?"return":"next",t):i(o.done?"return":"normal",t)}),(function(t){r("throw",t)}))}catch(s){i("throw",s)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,i){return new Promise((function(o,a){var A={key:t,arg:i,resolve:o,reject:a,next:null};n?n=n.next=A:(e=n=A,r(t,i))}))},"function"!==typeof t.return&&(this.return=void 0)}function y(t){return function(){return new C(t.apply(this,arguments))}}"function"===typeof Symbol&&Symbol.asyncIterator&&(C.prototype[Symbol.asyncIterator]=function(){return this}),C.prototype.next=function(t){return this._invoke("next",t)},C.prototype.throw=function(t){return this._invoke("throw",t)},C.prototype.return=function(t){return this._invoke("return",t)};function v(t){return B.apply(this,arguments)}function B(){return(B=y(i.a.mark((function t(e){var n,r,o,a,A,s=arguments;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=s.length>1&&void 0!==s[1]?s[1]:{},r=n.chunkSize||1048576,o=0;case 3:if(!(o<e.size)){t.next=13;break}return a=o+r,t.next=7,p(m(e,o,a));case 7:return A=t.sent,o=a,t.next=11,A;case 11:t.next=3;break;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t,e,n){return b.apply(this,arguments)}function b(){return(b=Object(o.a)(i.a.mark((function t(e,n,r){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t,i){var o=e.slice(n,r),a=new FileReader;a.onload=function(e){return t(e.target&&e.target.result)},a.onerror=function(t){return i(t)},a.readAsArrayBuffer(o)}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var E=n(211),Q=n(190),F=n(238);function w(t){if(Q.b||Q.d>=10){if("function"===typeof t[Symbol.asyncIterator])return function(t){return S.apply(this,arguments)}(t);if("function"===typeof t.getIterator)return t.getIterator()}return Q.b?function(t){return R.apply(this,arguments)}(t):function(t){return U.apply(this,arguments)}(t)}function S(){return(S=y(i.a.mark((function t(e){var n,r,o,a,A,s,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!0,r=!1,t.prev=2,a=Object(E.a)(e);case 4:return t.next=6,p(a.next());case 6:return A=t.sent,n=A.done,t.next=10,p(A.value);case 10:if(s=t.sent,n){t.next=18;break}return c=s,t.next=15,Object(F.d)(c);case 15:n=!0,t.next=4;break;case 18:t.next=24;break;case 20:t.prev=20,t.t0=t.catch(2),r=!0,o=t.t0;case 24:if(t.prev=24,t.prev=25,n||null==a.return){t.next=29;break}return t.next=29,p(a.return());case 29:if(t.prev=29,!r){t.next=32;break}throw o;case 32:return t.finish(29);case 33:return t.finish(24);case 34:case"end":return t.stop()}}),t,null,[[2,20,24,34],[25,,29,33]])})))).apply(this,arguments)}function R(){return(R=y(i.a.mark((function t(e){var n,r,o,a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getReader(),t.prev=1;case 2:return t.next=5,p(n.read());case 5:if(r=t.sent,o=r.done,a=r.value,!o){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,Object(F.d)(a);case 12:t.next=2;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(1),n.releaseLock();case 19:case"end":return t.stop()}}),t,null,[[1,16]])})))).apply(this,arguments)}function U(){return(U=y(i.a.mark((function t(e){var n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p(e);case 2:e=t.sent;case 3:if(null===(n=e.read())){t.next=9;break}return t.next=8,Object(F.d)(n);case 8:return t.abrupt("continue",3);case 9:if(!e._readableState.ended){t.next=11;break}return t.abrupt("return");case 11:return t.next=13,p(x(e));case 13:t.next=3;break;case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){return k.apply(this,arguments)}function k(){return(k=Object(o.a)(i.a.mark((function t(e){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.once("readable",t)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof t?f(t,e):t instanceof ArrayBuffer?d(t,e):Object(a.b)(t)?v(t,e):Object(a.h)(t)?w(t):Object(a.i)(t)?w(t.body):Object(c.a)(!1)}var N=n(184),D="Cannot convert supplied data type";function G(t,e){if(e.text&&"string"===typeof t)return t;if(t instanceof ArrayBuffer){var n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)||Object(a.c)(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);var r=t.buffer,i=t.byteLength||t.length;return 0===t.byteOffset&&i===r.byteLength||(r=r.slice(t.byteOffset,t.byteOffset+i)),r}throw new Error(D)}function _(t,e){return M.apply(this,arguments)}function M(){return(M=Object(o.a)(i.a.mark((function t(e,n){var r,o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!==typeof e&&!r){t.next=3;break}return t.abrupt("return",G(e,n));case 3:if(!Object(a.b)(e)){t.next=7;break}return t.next=6,Object(N.b)(e);case 6:e=t.sent;case 7:if(!Object(a.i)(e)){t.next=21;break}return o=e,t.next=11,Object(N.a)(o);case 11:if(!n.binary){t.next=17;break}return t.next=14,o.arrayBuffer();case 14:t.t0=t.sent,t.next=20;break;case 17:return t.next=19,o.text();case 19:t.t0=t.sent;case 20:return t.abrupt("return",t.t0);case 21:if(Object(a.h)(e)&&(e=O(e)),!Object(a.d)(e)&&!Object(a.a)(e)){t.next=24;break}return t.abrupt("return",Object(l.a)(e));case 24:throw new Error(D);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=n(23),j=n(1);function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function V(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){Object(j.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return n||(t=V({fetch:Object(s.a)(e||{},t)},t),Array.isArray(t.loaders)||(t.loaders=null),t)}function P(t,e){if(!e&&t&&!Array.isArray(t))return t;var n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){var r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[].concat(Object(T.a)(n),Object(T.a)(r)):r}return n&&n.length?n:null}var W=n(705),J=n(363);function H(t,e,n,r){if(!W.a.isSupported())return!1;var i=n&&n[t.id];return!!("local"===n.worker&&i&&i.localWorkerUrl||n.worker&&i&&i.workerUrl)&&(!t.useWorker||t.useWorker(n))}function Y(t,e,n,r){var i=(n||{}).worker,o=n&&n[t.id]||{},a="local"===i?o.localWorkerUrl:o.workerUrl,A="url(".concat(a,")"),s=t.name,c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};t.maxConcurrency&&(e.maxConcurrency=t.maxConcurrency);t.onDebug&&(e.onDebug=t.onDebug);X||(X=new W.a({onMessage:z}));return X.setProps(e),X}(n);n=JSON.parse(JSON.stringify(n));var u="2.3.0"!==t.version?"(core version ".concat("2.3.0",")"):"";return c.process(A,"".concat(s,"-worker@").concat(t.version).concat(u),{arraybuffer:Object(F.d)(e),options:n,source:"loaders.gl@".concat("2.3.0"),type:"parse"})}var X=null;function z(t){return K.apply(this,arguments)}function K(){return(K=Object(o.a)(i.a.mark((function t(e){var n,r,o,a,A;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.worker,r=e.data,o=e.resolve,a=e.reject,t.t0=r.type,t.next="done"===t.t0?4:"parse"===t.t0?6:"error"===t.t0?17:19;break;case 4:return o(r.result),t.abrupt("break",19);case 6:return t.prev=6,t.next=9,pt(r.arraybuffer,r.options,r.url);case 9:A=t.sent,n.postMessage({type:"parse-done",id:r.id,result:A},Object(J.a)(A)),t.next=16;break;case 13:t.prev=13,t.t1=t.catch(6),n.postMessage({type:"parse-error",id:r.id,message:t.t1.message});case 16:return t.abrupt("break",19);case 17:return a(r.message),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,null,[[6,13]])})))).apply(this,arguments)}var q=n(165),$=n(27),tt=n(476);function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){Object(j.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return it(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return it(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ot=/\.([^.]+)$/;function at(t){return At.apply(this,arguments)}function At(){return(At=Object(o.a)(i.a.mark((function t(e){var n,r,o,A,s=arguments;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:[],r=s.length>2&&void 0!==s[2]?s[2]:{},o=s.length>3&&void 0!==s[3]?s[3]:{},!(A=st(e,n,nt(nt({},r),{},{nothrow:!0}),o))){t.next=6;break}return t.abrupt("return",A);case 6:if(!Object(a.b)(e)){t.next=11;break}return t.next=9,m(e,0,10);case 9:e=t.sent,A=st(e,n,r,o);case 11:if(A||r.nothrow){t.next=13;break}throw new Error(ct(e));case 13:return t.abrupt("return",A);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function st(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e&&!Array.isArray(e))return Object(A.b)(e);ut(e=[].concat(Object(T.a)(e||[]),Object(T.a)(Object(tt.a)())));var i=Object(q.b)(t),o=i.url,a=i.type,s=lt(e,o||r.url);if(!(s=(s=s||gt(e,a))||ft(e,t))&&!n.nothrow)throw new Error(ct(t));return s}function ct(t){var e=Object(q.b)(t),n=e.url,r=e.type,i="No valid loader found";return t&&(i+=' data: "'.concat(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return It(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var n=0;return It(t,n,e)}return""}(t),'", contentType: "').concat(r,'"')),n&&(i+=" url: ".concat(n)),i}function ut(t){var e,n=rt(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;Object(A.b)(r)}}catch(i){n.e(i)}finally{n.f()}}function lt(t,e){var n=e&&e.match(ot),r=n&&n[1];return r&&function(t,e){e=e.toLowerCase();var n,r=rt(t);try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=rt(o.extensions);try{for(a.s();!(i=a.n()).done;){if(i.value.toLowerCase()===e)return o}}catch(A){a.e(A)}finally{a.f()}}}catch(A){r.e(A)}finally{r.f()}return null}(t,r)}function gt(t,e){var n,r=rt(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}}catch(o){r.e(o)}finally{r.f()}return null}function ft(t,e){if(!e)return null;var n,r=rt(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("string"===typeof e){if(ht(e,i))return i}else if(ArrayBuffer.isView(e)){if(dt(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(dt(e,0,i))return i}}}catch(o){r.e(o)}finally{r.f()}return null}function ht(t,e){return e.testText&&e.testText(t)}function dt(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some((function(r){return function(t,e,n,r){if(r instanceof ArrayBuffer)return Object(F.a)(r,t,r.byteLength);switch(Object($.a)(r)){case"function":return r(t,n);case"string":var i=It(t,e,r.length);return r===i;default:return!1}}(t,e,n,r)}))}function It(t,e,n){if(t.byteLength<e+n)return"";for(var r=new DataView(t),i="",o=0;o<n;o++)i+=String.fromCharCode(r.getUint8(e+o));return i}function pt(t,e,n,r){return Ct.apply(this,arguments)}function Ct(){return(Ct=Object(o.a)(i.a.mark((function t(e,n,r,o){var a,u,l,g;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object(c.a)(!o||"string"!==typeof o,"parse no longer accepts final url"),!n||Array.isArray(n)||Object(A.a)(n)||(o=r,r=n,n=null),t.next=4,e;case 4:return e=t.sent,r=r||{},a=Object(q.b)(e),u=a.url,l=P(n,o),t.next=10,at(e,l,r);case 10:if(g=t.sent){t.next=13;break}return t.abrupt("return",null);case 13:return r=Object(s.c)(r,g,l,u),o=Z({url:u,parse:pt,loaders:l},r,o),t.next=17,yt(g,e,r,o);case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function yt(t,e,n,r){return vt.apply(this,arguments)}function vt(){return(vt=Object(o.a)(i.a.mark((function t(e,n,r,o){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object(u.a)(e),t.next=3,_(n,e);case 3:if(n=t.sent,!e.parseTextSync||"string"!==typeof n){t.next=7;break}return r.dataType="text",t.abrupt("return",e.parseTextSync(n,r,o,e));case 7:if(!H(e,0,r)){t.next=11;break}return t.next=10,Y(e,n,r);case 10:return t.abrupt("return",t.sent);case 11:if(!e.parseText||"string"!==typeof n){t.next=15;break}return t.next=14,e.parseText(n,r,o,e);case 14:return t.abrupt("return",t.sent);case 15:if(!e.parse){t.next=19;break}return t.next=18,e.parse(n,r,o,e);case 18:return t.abrupt("return",t.sent);case 19:return Object(c.a)(!e.parseSync),t.abrupt("return",Object(c.a)(!1));case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bt(t,e,n){return mt.apply(this,arguments)}function mt(){return(mt=Object(o.a)(i.a.mark((function t(e,n,r){var o,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||Object(A.a)(n)||(r=n,n=null),o=Object(s.a)(r||{}),c=e,"string"!==typeof e){t.next=9;break}return t.next=6,o(e);case 6:c=t.sent,t.next=10;break;case 9:e=null;case 10:if(!Object(a.b)(e)){t.next=15;break}return t.next=13,o(e);case 13:c=t.sent,e=null;case 15:return t.next=17,pt(c,n,r);case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n.d(e,"a",(function(){return Bt}))},function(t,e,n){"use strict";var r=n(13),i=n.n(r),o=n(30);function a(t,e){if(!t)throw new Error(e)}var A=n(244),s=A.a._parseImageNode,c="undefined"!==typeof Image,u="undefined"!==typeof ImageBitmap,l=Boolean(s),g=!!A.b||l;var f=n(27);function h(t){var e=I(t);if(!e)throw new Error("Not an image");return e}function d(t){switch(h(t)){case"data":return t;case"image":case"imagebitmap":var e=document.createElement("canvas"),n=e.getContext("2d");if(n)return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:return a(!1)}}function I(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===Object(f.a)(t)&&t.data&&t.width&&t.height?"data":null}var p=/^data:image\/svg\+xml/,C=/\.svg((\?|#).*)?$/;function y(t){return t&&(p.test(t)||C.test(t))}function v(t,e){if(y(e)){var n=(new TextDecoder).decode(t);return"data:image/svg+xml;base64,".concat(btoa(n))}return B(t,e)}function B(t,e){if(y(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function m(t,e,n){return b.apply(this,arguments)}function b(){return(b=Object(o.a)(i.a.mark((function t(e,n,r){var o,a,A;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=v(e,r),a=self.URL||self.webkitURL,A="string"!==typeof o&&a.createObjectURL(o),t.prev=3,t.next=6,E(A||o,n);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,A&&a.revokeObjectURL(A),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[3,,7,10]])})))).apply(this,arguments)}function E(t,e){return Q.apply(this,arguments)}function Q(){return(Q=Object(o.a)(i.a.mark((function t(e,n){var r;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=new Image).src=e,!(n.image&&n.image.decode&&r.decode)){t.next=6;break}return t.next=5,r.decode();case 5:return t.abrupt("return",r);case 6:return t.next=8,new Promise((function(t,n){try{r.onload=function(){return t(r)},r.onerror=function(t){return n(new Error("Could not load image ".concat(e,": ").concat(t)))}}catch(i){n(i)}}));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var F={},w=!0;function S(t,e,n){return R.apply(this,arguments)}function R(){return(R=Object(o.a)(i.a.mark((function t(e,n,r){var o,a,A;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!y(r)){t.next=7;break}return t.next=3,m(e,n,r);case 3:a=t.sent,o=a,t.next=8;break;case 7:o=B(e,r);case 8:return A=n&&n.imagebitmap,t.next=11,U(o,A);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function U(t){return x.apply(this,arguments)}function x(){return(x=Object(o.a)(i.a.mark((function t(e){var n,r=arguments;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!k(n=r.length>1&&void 0!==r[1]?r[1]:null)&&w||(n=null),!n){t.next=13;break}return t.prev=3,t.next=6,createImageBitmap(e,n);case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0),w=!1;case 13:return t.next=15,createImageBitmap(e);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,null,[[3,9]])})))).apply(this,arguments)}function k(t){for(var e in t||F)return!1;return!0}var O=n(228);function N(t,e){var n=(Object(O.a)(t)||{}).mimeType,r=A.a._parseImageNode;return a(r),r(t,n,e)}function D(){return(D=Object(o.a)(i.a.mark((function t(e,n,r){var o,A,s,c,u;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=n||{}).image||{},A=o.type||"auto",s=(r||{}).url,c=G(A),t.t0=c,t.next="imagebitmap"===t.t0?8:"image"===t.t0?12:"data"===t.t0?16:20;break;case 8:return t.next=10,S(e,n,s);case 10:return u=t.sent,t.abrupt("break",21);case 12:return t.next=14,m(e,n,s);case 14:return u=t.sent,t.abrupt("break",21);case 16:return t.next=18,N(e,n);case 18:return u=t.sent,t.abrupt("break",21);case 20:a(!1);case 21:return"data"===A&&(u=d(u)),t.abrupt("return",u);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function G(t){switch(t){case"auto":case"data":return function(){if(u)return"imagebitmap";if(c)return"image";if(g)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return u||c||g;case"imagebitmap":return u;case"image":return c;case"data":return g;case"html":return c;case"ndarray":return g;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}var _={id:"image",name:"Images",version:"2.3.0",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return D.apply(this,arguments)},tests:[function(t){return Boolean(Object(O.a)(new DataView(t)))}],options:{image:{type:"auto",decode:!0}}};e.a=_},function(t,e,n){"use strict";var r,i=n(3),o=n(2),a=n(8),A=n(54),s=n(6),c=n(34),u=n(7),l=n(82),g=n(102),f=n(133),h=n(1),d=n(19),I=n(186),p=n(47),C=(r={},Object(h.a)(r,5126,O.bind(null,"uniform1fv",E,1,N)),Object(h.a)(r,35664,O.bind(null,"uniform2fv",E,2,N)),Object(h.a)(r,35665,O.bind(null,"uniform3fv",E,3,N)),Object(h.a)(r,35666,O.bind(null,"uniform4fv",E,4,N)),Object(h.a)(r,5124,O.bind(null,"uniform1iv",Q,1,N)),Object(h.a)(r,35667,O.bind(null,"uniform2iv",Q,2,N)),Object(h.a)(r,35668,O.bind(null,"uniform3iv",Q,3,N)),Object(h.a)(r,35669,O.bind(null,"uniform4iv",Q,4,N)),Object(h.a)(r,35670,O.bind(null,"uniform1iv",Q,1,N)),Object(h.a)(r,35671,O.bind(null,"uniform2iv",Q,2,N)),Object(h.a)(r,35672,O.bind(null,"uniform3iv",Q,3,N)),Object(h.a)(r,35673,O.bind(null,"uniform4iv",Q,4,N)),Object(h.a)(r,35674,O.bind(null,"uniformMatrix2fv",E,4,D)),Object(h.a)(r,35675,O.bind(null,"uniformMatrix3fv",E,9,D)),Object(h.a)(r,35676,O.bind(null,"uniformMatrix4fv",E,16,D)),Object(h.a)(r,35678,k),Object(h.a)(r,35680,k),Object(h.a)(r,5125,O.bind(null,"uniform1uiv",F,1,N)),Object(h.a)(r,36294,O.bind(null,"uniform2uiv",F,2,N)),Object(h.a)(r,36295,O.bind(null,"uniform3uiv",F,3,N)),Object(h.a)(r,36296,O.bind(null,"uniform4uiv",F,4,N)),Object(h.a)(r,35685,O.bind(null,"uniformMatrix2x3fv",E,6,D)),Object(h.a)(r,35686,O.bind(null,"uniformMatrix2x4fv",E,8,D)),Object(h.a)(r,35687,O.bind(null,"uniformMatrix3x2fv",E,6,D)),Object(h.a)(r,35688,O.bind(null,"uniformMatrix3x4fv",E,12,D)),Object(h.a)(r,35689,O.bind(null,"uniformMatrix4x2fv",E,8,D)),Object(h.a)(r,35690,O.bind(null,"uniformMatrix4x3fv",E,12,D)),Object(h.a)(r,35679,k),Object(h.a)(r,35682,k),Object(h.a)(r,36289,k),Object(h.a)(r,36292,k),Object(h.a)(r,36293,k),Object(h.a)(r,36298,k),Object(h.a)(r,36299,k),Object(h.a)(r,36300,k),Object(h.a)(r,36303,k),Object(h.a)(r,36306,k),Object(h.a)(r,36307,k),Object(h.a)(r,36308,k),Object(h.a)(r,36311,k),r),y={},v={},B={},m=[0];function b(t,e,n,r){1===e&&"boolean"===typeof t&&(t=t?1:0),Number.isFinite(t)&&(m[0]=t,t=m);var i=t.length;if(i%e&&d.h.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof n)return t;var o=r[i];o||(o=new n(i),r[i]=o);for(var a=0;a<i;a++)o[a]=t[a];return o}function E(t,e){return b(t,e,Float32Array,y)}function Q(t,e){return b(t,e,Int32Array,v)}function F(t,e){return b(t,e,Uint32Array,B)}function w(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};var e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function S(t,e,n){var r=C[n.type];if(!r)throw new Error("Unknown GLSL uniform type ".concat(n.type));return r().bind(null,t,e)}function R(t,e,n){for(var r in t){var i=t[r];if((!n||Boolean(n[r]))&&!U(i))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(r),i),new Error("".concat(e," Bad uniform ").concat(r))}return!0}function U(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;for(var e=Math.min(t.length,16),n=0;n<e;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof g.a||(t instanceof I.a||t instanceof f.a&&Boolean(t.texture))))}function x(t,e,n){if(Array.isArray(n)||ArrayBuffer.isView(n))if(t[e])for(var r=t[e],i=0,o=n.length;i<o;++i)r[i]=n[i];else t[e]=n.slice();else t[e]=n}function k(){var t=null;return function(e,n,r){var i=t!==r;return i&&(e.uniform1i(n,r),t=r),i}}function O(t,e,n,r){var i=null,o=null;return function(a,A,s){var c=e(s,n),u=c.length,l=!1;if(null===i)i=new Float32Array(u),o=u,l=!0;else{Object(p.a)(o===u,"Uniform length cannot change.");for(var g=0;g<u;++g)if(c[g]!==i[g]){l=!0;break}}return l&&(r(a,t,A,c),i.set(c)),l}}function N(t,e,n,r){t[e](n,r)}function D(t,e,n,r){t[e](n,!1,r)}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,r=t.match(n);return r?r[1]:e}function _(t,e,n,r){for(var i=t.split(/\r?\n/),o={},a={},A=r||G(e)||"(unnamed)",s="".concat(function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(n)," shader ").concat(A),c=0;c<i.length;c++){var u=i[c];if(!(u.length<=1)){var l=u.split(":"),g=l[0],f=parseInt(l[2],10);if(isNaN(f))throw new Error("GLSL compilation error in ".concat(s,": ").concat(t));"WARNING"!==g?o[f]=u:a[f]=u}}var h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",r=t.split(/\r?\n/),i=String(r.length+e-1).length;return r.map((function(t,r){var o=r+e,a=String(o).length;return T(o,i-a)+n+t}))}(e);return{shaderName:s,errors:M(o,h),warnings:M(a,h)}}function M(t,e){for(var n="",r=0;r<e.length;r++){var i=e[r];if((t[r+3]||t[r+2]||t[r+1])&&(n+="".concat(i,"\n"),t[r+1])){var o=t[r+1],a=o.split(":",3),A=a[0],s=parseInt(a[1],10)||0,c=o.substring(a.join(":").length+1).trim();n+=T("^^^ ".concat(A,": ").concat(c,"\n\n"),s)}}return n}function T(t,e){for(var n="",r=0;r<e;++r)n+=" ";return"".concat(n).concat(t)}var j=n(127),L=n(197),V=function(t){function e(t,n){var r;Object(i.a)(this,e),Object(j.b)(t),Object(p.a)("string"===typeof n.source,"Shader: GLSL source code must be a JavaScript string");var o=G(n.source,null)||n.id||Object(L.c)("unnamed ".concat(e.getTypeName(n.shaderType)));return(r=Object(a.a)(this,Object(s.a)(e).call(this,t,{id:o}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(u.a)(e,t),Object(o.a)(e,null,[{key:"getTypeName",value:function(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Object(p.a)(!1),"unknown"}}}]),Object(o.a)(e,[{key:"initialize",value:function(t){var e=t.source,n=G(e,null);n&&(this.id=Object(L.c)(n)),this._compile(e)}},{key:"getParameter",value:function(t){return this.gl.getShaderParameter(this.handle,t)}},{key:"toString",value:function(){return"".concat(e.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return G(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var t=this.gl.getExtension("WEBGL.debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);var e=this.getParameter(35713);if(!e){var n=this.gl.getShaderInfoLog(this.handle),r=_(n,this.source,this.shaderType,this.id),i=r.shaderName,o=r.errors,a=r.warnings;throw d.h.error("GLSL compilation errors in ".concat(i,"\n").concat(o))(),d.h.warn("GLSL compilation warnings in ".concat(i,"\n").concat(a))(),new Error("GLSL compilation errors in ".concat(i))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),e}(l.a),Z=function(t){function e(t,n){return Object(i.a)(this,e),"string"===typeof n&&(n={source:n}),Object(a.a)(this,Object(s.a)(e).call(this,t,Object.assign({},n,{shaderType:35633})))}return Object(u.a)(e,t),Object(o.a)(e,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),e}(V),P=function(t){function e(t,n){return Object(i.a)(this,e),"string"===typeof n&&(n={source:n}),Object(a.a)(this,Object(s.a)(e).call(this,t,Object.assign({},n,{shaderType:35632})))}return Object(u.a)(e,t),Object(o.a)(e,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),e}(V),W=n(115),J=n(148),H=function(){function t(e){Object(i.a)(this,t),this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}return Object(o.a)(t,[{key:"getAttributeInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}},{key:"getAttributeLocation",value:function(t){var e=this.getAttributeInfo(t);return e?e.location:-1}},{key:"getAttributeAccessor",value:function(t){var e=this.getAttributeInfo(t);return e?e.accessor:null}},{key:"getVaryingInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}},{key:"getVaryingIndex",value:function(t){var e=this.getVaryingInfo();return e?e.location:-1}},{key:"getVaryingAccessor",value:function(t){var e=this.getVaryingInfo();return e?e.accessor:null}},{key:"_readAttributesFromProgram",value:function(t){for(var e=t.gl,n=e.getProgramParameter(t.handle,35721),r=0;r<n;r++){var i=e.getActiveAttrib(t.handle,r),o=i.name,a=i.type,A=i.size,s=e.getAttribLocation(t.handle,o);s>=0&&this._addAttribute(s,o,a,A)}this.attributeInfos.sort((function(t,e){return t.location-e.location}))}},{key:"_readVaryingsFromProgram",value:function(t){var e=t.gl;if(Object(d.g)(e)){for(var n=e.getProgramParameter(t.handle,35971),r=0;r<n;r++){var i=e.getTransformFeedbackVarying(t.handle,r),o=i.name,a=i.type,A=i.size;this._addVarying(r,o,a,A)}this.varyingInfos.sort((function(t,e){return t.location-e.location}))}}},{key:"_addAttribute",value:function(t,e,n,r){var i=Object(J.a)(n),o={type:i.type,size:r*i.components};this._inferProperties(t,e,o);var a={location:t,name:e,accessor:new W.a(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}},{key:"_inferProperties",value:function(t,e,n){/instance/i.test(e)&&(n.divisor=1)}},{key:"_addVarying",value:function(t,e,n,r){var i=Object(J.a)(n),o=i.type,a=i.components,A={location:t,name:e,accessor:new W.a({type:o,size:r*a})};this.varyingInfos.push(A),this.varyingInfosByName[A.name]=A}}]),t}(),Y=n(168);n.d(e,"a",(function(){return z}));var X=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"],z=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,e),(n=Object(a.a)(this,Object(s.a)(e).call(this,t,r))).stubRemovedMethods("Program","v6.0",X),n._isCached=!1,n.initialize(r),Object.seal(Object(A.a)(n)),n._setId(r.id),n}return Object(u.a)(e,t),Object(o.a)(e,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hash,n=t.vs,r=t.fs,i=t.varyings,o=t.bufferMode,a=void 0===o?35981:o;return this.hash=e||"",this.vs="string"===typeof n?new Z(this.gl,{id:"".concat(t.id,"-vs"),source:n}):n,this.fs="string"===typeof r?new P(this.gl,{id:"".concat(t.id,"-fs"),source:r}):r,Object(p.a)(this.vs instanceof Z),Object(p.a)(this.fs instanceof P),this.uniforms={},this._textureUniforms={},this._texturesRenderable=!0,i&&i.length>0&&(Object(j.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new H(this),this.setProps(t)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(c.a)(Object(s.a)(e.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}},{key:"draw",value:function(t){var e=this,n=t.logPriority,r=t.drawMode,i=void 0===r?4:r,o=t.vertexCount,a=t.offset,A=void 0===a?0:a,s=t.start,c=t.end,u=t.isIndexed,l=void 0!==u&&u,g=t.indexType,f=void 0===g?5123:g,h=t.instanceCount,I=void 0===h?0:h,C=t.isInstanced,y=void 0===C?I>0:C,v=t.vertexArray,B=void 0===v?null:v,m=t.transformFeedback,b=t.framebuffer,E=t.parameters,Q=void 0===E?{}:E,F=t.uniforms,w=t.samplers;if((F||w)&&(d.h.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(F||{})),d.h.priority>=n){var S=b?b.id:"default",R="mode=".concat(Object(Y.a)(this.gl,i)," verts=").concat(o," ")+"instances=".concat(I," indexType=").concat(Object(Y.a)(this.gl,f)," ")+"isInstanced=".concat(y," isIndexed=").concat(l," ")+"Framebuffer=".concat(S);d.h.log(n,R)()}return Object(p.a)(B),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===o||y&&0===I)&&(B.bindForDraw(o,I,(function(){if(void 0!==b&&(Q=Object.assign({},Q,{framebuffer:b})),m){var t=Object(J.c)(i);m.begin(t)}e._bindTextures(),Object(d.l)(e.gl,Q,(function(){l&&y?e.gl.drawElementsInstanced(i,o,f,A,I):l&&Object(d.g)(e.gl)&&!isNaN(s)&&!isNaN(c)?e.gl.drawRangeElements(i,s,c,o,f,A):l?e.gl.drawElements(i,o,f,A):y?e.gl.drawArraysInstanced(i,A,o,I):e.gl.drawArrays(i,A,o)})),m&&m.end()})),!0)}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in d.h.priority>=2&&R(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle),t){var n=t[e],r=this._uniformSetters[e];if(r){var i=n,o=!1;if(i instanceof f.a&&(i=i.texture),i instanceof g.a)if(o=this.uniforms[e]!==n){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);var a=i,A=r.textureIndex;a.bind(A),i=A,a.loaded||(this._texturesRenderable=!1),this._textureUniforms[e]=a}else i=r.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(r(i)||o)&&x(this.uniforms,e,n)}}return this}},{key:"_areTexturesRenderable",value:function(){if(this._texturesRenderable)return!0;for(var t in this._texturesRenderable=!0,this._textureUniforms){var e=this._textureUniforms[t];this._texturesRenderable=this._texturesRenderable&&e.loaded}return this._texturesRenderable}},{key:"_bindTextures",value:function(){for(var t in this._textureUniforms){var e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(t){var e=this.gl.getAttachedShaders(t),n={},r=!0,i=!1,o=void 0;try{for(var a,A=e[Symbol.iterator]();!(r=(a=A.next()).done);r=!0){var s=a.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new Z({handle:s});break;case 35632:n.fs=new P({handle:s})}}}catch(c){i=!0,o=c}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}},{key:"_getParameter",value:function(t){return this.gl.getProgramParameter(this.handle,t)}},{key:"_setId",value:function(t){if(!t){var e=this._getName();this.id=Object(L.c)(e)}}},{key:"_getName",value:function(){var t=this.vs.getName()||this.fs.getName();return t=(t=t.replace(/shader/i,""))?"".concat(t,"-program"):"program"}},{key:"_compileAndLink",value:function(){var t=this.gl;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),d.h.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),d.h.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||d.h.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var t=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var e=0;e<this._uniformCount;e++){var n=this.gl.getActiveUniform(this.handle,e),r=w(n.name),i=r.name,o=(r.isArray,t.getUniformLocation(this.handle,i));if(this._uniformSetters[i]=S(t,o,n),n.size>1)for(var a=0;a<n.size;a++)o=t.getUniformLocation(this.handle,"".concat(i,"[").concat(a,"]")),this._uniformSetters["".concat(i,"[").concat(a,"]")]=S(t,o,n)}this._textureIndexCounter=0}},{key:"getActiveUniforms",value:function(t,e){return this.gl.getActiveUniforms(this.handle,t,e)}},{key:"getUniformBlockIndex",value:function(t){return this.gl.getUniformBlockIndex(this.handle,t)}},{key:"getActiveUniformBlockParameter",value:function(t,e){return this.gl.getActiveUniformBlockParameter(this.handle,t,e)}},{key:"uniformBlockBinding",value:function(t,e){this.gl.uniformBlockBinding(this.handle,t,e)}}]),e}(l.a)},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(17),a=n(300),A="void main() {gl_FragColor = vec4(0);}",s="out vec4 transform_output;\nvoid main() {\n  transform_output = vec4(0);\n}",c="#version 300 es\n".concat(s);function u(t,e){e=Array.isArray(e)?e:[e];var n=t.replace(/^\s+/,"").split(/\s+/),r=Object(o.a)(n,3),i=r[0],a=r[1],A=r[2];return e.includes(i)&&a&&A?{qualifier:i,type:a,name:A.split(";")[0]}:null}function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?100:e,r=t.input,i=t.inputType,o=t.output;if(!r)return 300===n?c:n>300?"#version ".concat(n,"\n").concat(s):A;var a=f(r,i);return n>=300?"#version ".concat(n," ").concat(300===n?"es":"","\nin ").concat(i," ").concat(r,";\nout vec4 ").concat(o,";\nvoid main() {\n  ").concat(o," = ").concat(a,";\n}"):"varying ".concat(i," ").concat(r,";\nvoid main() {\n  gl_FragColor = ").concat(a,";\n}")}function g(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(a.a)(!1),null}}function f(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:return Object(a.a)(!1),null}}var h=n(19),d=n(76),I=n(924),p=n(47),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t),this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return Object(i.a)(t,[{key:"setupResources",value:function(t){var e=!0,n=!1,r=void 0;try{for(var i,o=this.bindings[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;this._setupTransformFeedback(a,t)}}catch(A){n=!0,r=A}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"updateModelProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.varyings;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}},{key:"getDrawOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceBuffers,r=e.transformFeedback,i=Object.assign({},n,t.attributes);return{attributes:i,transformFeedback:r}}},{key:"swap",value:function(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}},{key:"getBuffer",value:function(t){var e=this.bindings[this.currentIndex].feedbackBuffers,n=t?e[t]:null;return n?n instanceof d.a?n:n.buffer:null}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.varyingName,n=this.getBuffer(e);return n?n.getData():null}},{key:"delete",value:function(){for(var t in this.resources)this.resources[t].delete()}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Object(p.a)(Object(h.g)(this.gl))}},{key:"_getFeedbackBuffers",value:function(t){var e=t.sourceBuffers,n=void 0===e?{}:e,r={};if(this.bindings[this.currentIndex]&&Object.assign(r,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(var i in this.feedbackMap){var o=this.feedbackMap[i];i in n&&(r[o]=i)}for(var a in Object.assign(r,t.feedbackBuffers),r){var A=r[a];if("string"===typeof A){var s=n[A],c=s.byteLength,u=s.usage,l=s.accessor;r[a]=this._createNewBuffer(a,{byteLength:c,usage:u,accessor:l})}}return r}},{key:"_setupBuffers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.sourceBuffers,n=void 0===e?null:e;Object.assign(this.feedbackMap,t.feedbackMap);var r=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:n,feedbackBuffers:r})}},{key:"_setupTransformFeedback",value:function(t,e){var n=e.model.program;t.transformFeedback=new I.a(this.gl,{program:n,buffers:t.feedbackBuffers})}},{key:"_updateBindings",value:function(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){var e=this._swapBuffers(this.bindings[this.currentIndex]),n=e.sourceBuffers,r=e.feedbackBuffers,i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceBuffers:n,feedbackBuffers:r})}}},{key:"_updateBinding",value:function(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}},{key:"_swapBuffers",value:function(t){if(!this.feedbackMap)return null;var e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(var r in this.feedbackMap){var i=this.feedbackMap[r];e[r]=t.feedbackBuffers[i],n[i]=t.sourceBuffers[r],Object(p.a)(n[i]instanceof d.a)}return{sourceBuffers:e,feedbackBuffers:n}}},{key:"_createNewBuffer",value:function(t,e){var n=new d.a(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}}]),t}(),y=n(1),v=n(358),B=n(218),m=n(133),b=n(473);function E(t){var e=100,n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}return e}var Q,F=n(302),w={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n  return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n  float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n  float xIndex = transform_elementID - (yIndex * texSize[0]);\n  return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n  vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n  vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n  vec2 coord = indices / size + pixelSizeHalf;\n  return coord;\n}\nvec2 transform_getPos(vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n  return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec4 textureColor = texture2D(texSampler, texCoord);\n  return textureColor;\n}\n",fs:null};function S(t){var e=t.vs,n=t.sourceTextureMap,r=t.targetTextureVarying,i=t.targetTexture,o=Object.keys(n).length,A=null,s={},c=e,l={};if(o>0||r){var g=c.split("\n"),f=g.slice();if(g.forEach((function(t,e,i){if(o>0){var c=function(t,e){var n={},r=function(t){return u(t,["attribute","in"])}(t);if(!r)return null;var i=r.type,o=r.name;if(o&&e[o]){var A="// ".concat(t," => Replaced by Transform with a sampler"),s=function(t){var e="".concat("transform_uSampler_").concat(t),n="".concat("transform_uSize_").concat(t),r="  uniform sampler2D ".concat(e,";\n  uniform vec2 ").concat(n,";");return{samplerName:e,sizeName:n,uniformDeclerations:r}}(o),c=s.samplerName,l=s.sizeName,g=s.uniformDeclerations,f=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(a.a)(!1),null}}(i),h="  ".concat(i," ").concat(o," = transform_getInput(").concat(c,", ").concat(l,").").concat(f,";\n");return n[c]=o,{updatedLine:A,inject:{"vs:#decl":g,"vs:#main-start":h},samplerTextureMap:n}}return null}(t,n);if(c){var g=c.updatedLine,h=c.inject;f[e]=g,l=Object(F.b)([l,h]),Object.assign(s,c.samplerTextureMap),o--}}r&&!A&&(A=function(t,e){var n=u(t,["varying","out"]);if(!n)return null;return n.name===e?n.type:null}(t,r))})),r){Object(p.a)(i);var h="".concat("transform_uSize_").concat(r),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":"     vec2 ".concat("transform_position"," = transform_getPos(").concat(h,");\n     gl_Position = vec4(").concat("transform_position",", 0, 1.);\n")};l=Object(F.b)([l,d])}c=f.join("\n")}return{vs:c,targetTextureType:A,inject:l,samplerTextureMap:s}}function R(t){var e,n,r=t.sourceTextureMap,i=t.targetTextureVarying,o=t.targetTexture,a={};for(var A in i&&(e=o.width,n=o.height,a["".concat("transform_uSize_").concat(i)]=[e,n]),r){var s=r[A];e=s.width,n=s.height,a["".concat("transform_uSize_").concat(A)]=[e,n]}return a}var U=(Q={},Object(y.a)(Q,10241,9728),Object(y.a)(Q,10240,9728),Object(y.a)(Q,10242,33071),Object(y.a)(Q,10243,33071),Q),x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t),this.gl=e,this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return Object(i.a)(t,[{key:"updateModelProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._processVertexShader(t);return Object.assign({},t,e)}},{key:"getDrawOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceBuffers,r=e.sourceTextures,i=e.framebuffer,o=e.targetTexture,a=Object.assign({},n,t.attributes),A=Object.assign({},t.uniforms),s=Object.assign({},t.parameters),c=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){for(var u in a.transform_elementID=this.elementIDBuffer,this.samplerTextureMap){var l=this.samplerTextureMap[u];A[u]=r[l]}this._setSourceTextureParameters();var g=R({sourceTextureMap:r,targetTextureVarying:this.targetTextureVarying,targetTexture:o});Object.assign(A,g)}return this.hasTargetTexture&&(c=!1,s.viewport=[0,0,i.width,i.height]),{attributes:a,framebuffer:i,uniforms:A,discard:c,parameters:s}}},{key:"swap",value:function(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}},{key:"getTargetTexture",value:function(){return this.bindings[this.currentIndex].targetTexture}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.packed,n=void 0!==e&&e,r=this.bindings[this.currentIndex].framebuffer,i=Object(v.c)(r);if(!n)return i;for(var o=i.constructor,a=g(this.targetTextureType),A=new o(i.length*a/4),s=0,c=0;c<i.length;c+=4)for(var u=0;u<a;u++)A[s++]=i[c+u];return A}},{key:"getFramebuffer",value:function(){return this.bindings[this.currentIndex].framebuffer}},{key:"delete",value:function(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t._targetTextureVarying,n=t._swapTexture;this._swapTexture=n,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}},{key:"_createTargetTexture",value:function(t){var e=t.sourceTextures,n=t.textureOrReference;if(n instanceof B.a)return n;var r=e[n];return r?(this._targetRefTexName=n,this._createNewTexture(r)):null}},{key:"_setupTextures",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.sourceBuffers,n=t._sourceTextures,r=void 0===n?{}:n,i=t._targetTexture,o=this._createTargetTexture({sourceTextures:r,textureOrReference:i});this.hasSourceTextures=this.hasSourceTextures||r&&Object.keys(r).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:r,targetTexture:o}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}},{key:"_updateElementIDBuffer",value:function(t){if(!("number"!==typeof t||this.elementCount>=t)){var e=new Float32Array(t);e.forEach((function(t,e,n){n[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new d.a(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}}},{key:"_updateBindings",value:function(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){var e=this._swapTextures(this.bindings[this.currentIndex]),n=e.sourceTextures,r=e.targetTexture,i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceTextures:n,targetTexture:r})}}},{key:"_updateBinding",value:function(t,e){var n=e.sourceBuffers,r=e.sourceTextures,i=e.targetTexture;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,r),Object.assign(t.sourceBuffers,n),i){t.targetTexture=i;var o=i.width,a=i.height,A=t.framebuffer;A?(A.update({attachments:Object(y.a)({},36064,i),resizeAttachments:!1}),A.resize({width:o,height:a})):t.framebuffer=new m.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer"),width:o,height:a,attachments:Object(y.a)({},36064,i)})}return t}},{key:"_setSourceTextureParameters",value:function(){var t=this.currentIndex,e=this.bindings[t].sourceTextures;for(var n in e)e[n].setParameters(U)}},{key:"_swapTextures",value:function(t){if(!this._swapTexture)return null;var e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}},{key:"_createNewTexture",value:function(t){var e,n=Object(b.a)(t,{parameters:(e={},Object(y.a)(e,10241,9728),Object(y.a)(e,10240,9728),Object(y.a)(e,10242,33071),Object(y.a)(e,10243,33071),e),pixelStore:Object(y.a)({},37440,!1)});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}},{key:"_processVertexShader",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceTextures,r=e.targetTexture,i=S({vs:t.vs,sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r}),o=i.vs,a=i.uniforms,A=i.targetTextureType,s=i.inject,c=i.samplerTextureMap,u=Object(F.b)([t.inject||{},s]);this.targetTextureType=A,this.samplerTextureMap=c;var g=t._fs||l({version:E(o),input:this.targetTextureVarying,inputType:A,output:"transform_output"}),f=this.hasSourceTextures||this.targetTextureVarying?[w].concat(t.modules||[]):t.modules;return{vs:o,fs:g,modules:f,uniforms:a,inject:u}}}]),t}(),k=n(197),O=n(379);n.d(e,"a",(function(){return N}));var N=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,t),this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(n),Object.seal(this)}return Object(i.a)(t,null,[{key:"isSupported",value:function(t){return Object(h.g)(t)}}]),Object(i.a)(t,[{key:"delete",value:function(){var t=this.model,e=this.bufferTransform,n=this.textureTransform;t&&t.delete(),e&&e.delete(),n&&n.delete()}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.clearRenderTarget,n=void 0===e||e,r=this._updateDrawOptions(t);n&&r.framebuffer&&r.framebuffer.clear({color:!0}),this.model.transform(r)}},{key:"swap",value:function(){var t=!1,e=[this.bufferTransform,this.textureTransform].filter(Boolean),n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var A=o.value;t=t||A.swap()}}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}Object(p.a)(t,"Nothing to swap")}},{key:"getBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[this.bufferTransform,this.textureTransform].filter(Boolean),n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var A=o.value,s=A.getData(t);if(s)return s}}catch(c){r=!0,i=c}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}},{key:"getFramebuffer",value:function(){return this.textureTransform&&this.textureTransform.getFramebuffer()}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);var e=[this.bufferTransform,this.textureTransform].filter(Boolean),n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var A=o.value;A.update(t)}}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.gl;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new O.a(e,Object.assign({},t,{fs:t.fs||l({version:E(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}},{key:"_updateModelProps",value:function(t){var e=Object.assign({},t),n=[this.bufferTransform,this.textureTransform].filter(Boolean),r=!0,i=!1,o=void 0;try{for(var a,A=n[Symbol.iterator]();!(r=(a=A.next()).done);r=!0){e=a.value.updateModelProps(e)}}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return e}},{key:"_buildResourceTransforms",value:function(t,e){(function(t){if(!Object(k.a)(t.feedbackBuffers)||!Object(k.a)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new C(t,e)),function(t){if(!Object(k.a)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new x(t,e)),Object(p.a)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}},{key:"_updateDrawOptions",value:function(t){var e=Object.assign({},t),n=[this.bufferTransform,this.textureTransform].filter(Boolean),r=!0,i=!1,o=void 0;try{for(var a,A=n[Symbol.iterator]();!(r=(a=A.next()).done);r=!0){var s=a.value;e=Object.assign(e,s.getDrawOptions(e))}}catch(c){i=!0,o=c}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return e}}]),t}()},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(54),a=n(7),A=n(8),s=n(6),c=n(0),u=n.n(c),l=n(20),g=n.n(l),f=n(711),h=n(169),d=n(23);function I(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var p=n(173),C=n(252);function y(t){return t?"function"===typeof t?Object(c.createElement)(p.a,{},t):Array.isArray(t)?t.map(y):t.type===u.a.Fragment?y(t.props.children):(I(t.type,p.a),t):t}function v(t){var e=t.children,n=t.layers,r=t.views,i=[],o=[],a={};return u.a.Children.forEach(y(e),(function(t){if(t){var e=t.type;if(I(e,C.a)){var n=function(t,e){var n={},r=t.defaultProps||{};for(var i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}(e,t.props);o.push(n)}else i.push(t);if(e!==p.a&&I(e,p.a)&&t.props.id){var r=new e(t.props);a[r.id]=r}}})),Object.keys(a).length>0&&(Array.isArray(r)?r.forEach((function(t){a[t.id]=t})):r&&(a[r.id]=r),r=Object.values(a)),{layers:n=o.length>0?[].concat(o,Object(d.a)(n)):n,children:i,views:r}}var B={position:"absolute",zIndex:-1};function m(t,e){return t?"function"===typeof t?t(e):Array.isArray(t)?t.map((function(t){return m(t,e)})):function(t){var e=t&&t.type,n=e&&e.defaultProps;return n&&n.mapStyle}(t)?(e.style=B,Object(c.cloneElement)(t,e)):function(t){var e=t&&t.type;return e&&e.deckGLViewProps}(t)?Object(c.cloneElement)(t,e):t:t}function b(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Q(t){var e=t.children,n=(t.viewports,t.deck),r=t.ContextProvider,i=(n||{}).viewManager;if(!i||!i.views.length)return[];var o,a={},A=i.views[0].id,s=b(e);try{for(s.s();!(o=s.n()).done;){var u=o.value,l=A,g=u;I(u.type,p.a)&&(l=u.props.id||A,g=u.props.children);var f=i.getViewport(l),h=i.getViewState(l);if(f)g=m(g,{x:f.x,y:f.y,width:f.width,height:f.height,viewport:f,viewState:h}),a[l]||(a[l]={viewport:f,children:[]}),a[l].children.push(g)}}catch(C){s.e(C)}finally{s.f()}return Object.keys(a).map((function(t){var e=a[t],i=e.viewport,o=e.children,A={position:"absolute",left:i.x,top:i.y,width:i.width,height:i.height},s="view-".concat(t),u=c.createElement.apply(void 0,["div",{key:s,id:s,style:A}].concat(Object(d.a)(o)));if(r){var l={viewport:i,container:n.canvas.offsetParent,eventManager:n.eventManager,onViewStateChange:function(e){e.viewId=t,n._onViewStateChange(e)}};return Object(c.createElement)(r,{key:s,value:l},u)}return u}))}var F={mixBlendMode:null};function w(t){var e=t.width,n=t.height,r=t.style,i={position:"absolute",zIndex:0,left:0,top:0,width:e,height:n},o={left:0,top:0};if(r)for(var a in r)a in F?o[a]=r[a]:i[a]=r[a];return{containerStyle:i,canvasStyle:o}}function S(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(s.a)(t);if(e){var i=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(A.a)(this,n)}}n.d(e,"a",(function(){return x}));var R=f.a.getPropTypes(g.a),U=f.a.defaultProps,x=function(t){Object(a.a)(n,t);var e=S(n);function n(t){var i;return Object(r.a)(this,n),(i=e.call(this,t)).viewports=null,i.children=null,i._needsRedraw=null,i._containerRef=u.a.createRef(),i._canvasRef=u.a.createRef(),i.pickObject=i.pickObject.bind(Object(o.a)(i)),i.pickMultipleObjects=i.pickMultipleObjects.bind(Object(o.a)(i)),i.pickObjects=i.pickObjects.bind(Object(o.a)(i)),i._extractJSXLayers=Object(h.a)(v),i._positionChildrenUnderViews=Object(h.a)(Q),i._extractStyles=Object(h.a)(w),i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var t=this.props.Deck||f.a;this.deck=this.deck||new t(Object.assign({},this.props,{parent:this._containerRef.current,canvas:this._canvasRef.current,style:null,width:"100%",height:"100%",_customRender:this._customRender.bind(this)})),this._updateFromProps(this.props)}},{key:"shouldComponentUpdate",value:function(t){this._updateFromProps(t);var e=this.children!==this._parseJSX(t).children,n=this.deck.viewManager&&this.deck.viewManager.needsRedraw();return e&&!n}},{key:"componentDidUpdate",value:function(){this._redrawDeck()}},{key:"componentWillUnmount",value:function(){this.deck.finalize()}},{key:"pickObject",value:function(t){return this.deck.pickObject(t)}},{key:"pickMultipleObjects",value:function(t){return this.deck.pickMultipleObjects(t)}},{key:"pickObjects",value:function(t){return this.deck.pickObjects(t)}},{key:"_redrawDeck",value:function(){this._needsRedraw&&(this.deck._drawLayers(this._needsRedraw),this._needsRedraw=null)}},{key:"_customRender",value:function(t){this._needsRedraw=t,this.deck.viewManager.getViewports()!==this.viewports?this.forceUpdate():this._redrawDeck()}},{key:"_parseJSX",value:function(t){return this._extractJSXLayers({layers:t.layers,views:t.views,children:t.children})}},{key:"_updateFromProps",value:function(t){var e=this._parseJSX(t),n=e.layers,r=e.views,i=Object.assign({},t,{style:null,width:"100%",height:"100%",layers:n,views:r});this.deck.setProps(i)}},{key:"render",value:function(){var t=this.props,e=t.ContextProvider,n=t.width,r=t.height,i=t.style,o=(this.deck||{}).viewManager;this.viewports=o&&o.getViewports(),this.children=this._parseJSX(this.props).children;var a=this._positionChildrenUnderViews({children:this.children,viewports:this.viewports,deck:this.deck,ContextProvider:e}),A=this._extractStyles({width:n,height:r,style:i}),s=A.containerStyle,u=A.canvasStyle,l=Object(c.createElement)("canvas",{key:"canvas",ref:this._canvasRef,style:u});return Object(c.createElement)("div",{id:"deckgl-wrapper",ref:this._containerRef,style:s},[l,a])}}]),n}(u.a.Component);x.propTypes=R,x.defaultProps=U},function(t,e,n){"use strict";var r=n(27),i=n(13),o=n.n(i),a=n(30),A=n(3),s=n(2),c=n(19),u=n(247),l=n(47),g=n(8),f=n(6),h=n(54),d=n(7),I=n(82),p=n(702),C=n(353),y=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(A.a)(this,e),(n=Object(g.a)(this,Object(f.a)(e).call(this,t,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(h.a)(n)),n}return Object(d.a)(e,t),Object(s.a)(e,null,[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(c.g)(t),r=Object(p.c)(t,C.a.TIMER_QUERY),i=n||r,o=!0,a=!1,A=void 0;try{for(var s,u=e[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var g=s.value;switch(g){case"queries":i=i&&n;break;case"timers":i=i&&r;break;default:Object(l.a)(!1)}}}catch(f){a=!0,A=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw A}}return i}}]),Object(s.a)(e,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.conservative,n=void 0!==e&&e;return this.begin(n?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(t){return this._queryPending||(this.target=t,this.gl.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var t=this.gl.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise((function(r,i){requestAnimationFrame((function o(){t.isResultAvailable()?(r(t.getResult()),t._pollingPromise=null):n++>e?(i("Timed out"),t._pollingPromise=null):requestAnimationFrame(o)}))})),this._pollingPromise}},{key:"_createHandle",value:function(){return e.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),e}(I.a);function v(t){return"undefined"!==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var B=n(133),m=n(58);n.d(e,"a",(function(){return Q}));var b=Object(m.isBrowser)()&&"undefined"!==typeof document,E=0,Q=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(A.a)(this,t);var n=e.onCreateContext,r=void 0===n?function(t){return Object(c.a)(t)}:n,i=e.onAddHTML,o=void 0===i?null:i,a=e.onInitialize,s=void 0===a?function(){}:a,l=e.onRender,g=void 0===l?function(){}:l,f=e.onFinalize,h=void 0===f?function(){}:f,d=e.onError,I=e.gl,p=void 0===I?null:I,C=e.glOptions,y=void 0===C?{}:C,v=e.debug,B=void 0!==v&&v,m=e.createFramebuffer,b=void 0!==m&&m,Q=e.autoResizeViewport,F=void 0===Q||Q,w=e.autoResizeDrawingBuffer,S=void 0===w||w,R=e.stats,U=void 0===R?u.a.get("animation-loop-".concat(E++)):R,x=e.useDevicePixels,k=void 0===x||x;"useDevicePixelRatio"in e&&(c.h.deprecated("useDevicePixelRatio","useDevicePixels")(),k=e.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:s,onRender:g,onFinalize:h,onError:d,gl:p,glOptions:y,debug:B,createFramebuffer:b},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=U,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:F,autoResizeDrawingBuffer:S,useDevicePixels:k}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(s.a)(t,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(t){return Object(l.a)("string"===typeof t),this.needsRedraw=this.needsRedraw||t,this}},{key:"setProps",value:function(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;var n=this._getPageLoadPromise().then((function(){return!t._running||t._initialized?null:(t._createWebGLContext(e),t._createFramebuffer(),t._startEventHandling(),t._initializeCallbackData(),t._updateCallbackData(),t._resizeCanvasDrawingBuffer(),t._resizeViewport(),t._gpuTimeQuery=y.isSupported(t.gl,["timers"])?new y(t.gl):null,t._initialized=!0,t.onInitialize(t.animationProps))})).then((function(e){t._running&&(t._addCallbackData(e||{}),!1!==e&&t._startLoop())}));return this.props.onError&&n.catch(this.props.onError),this}},{key:"redraw",value:function(){return this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers(),this}},{key:"stop",value:function(){return this._running&&(this._finalizeCallbackData(),v(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}},{key:"attachTimeline",value:function(t){return this.timeline=t,this.timeline}},{key:"detachTimeline",value:function(){this.timeline=null}},{key:"waitForRender",value:function(){var t=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((function(e){t._resolveNextFrame=e}))),this._nextFramePromise}},{key:"toDataURL",value:function(){var t=Object(a.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setNeedsRedraw("toDataURL"),t.next=3,this.waitForRender();case 3:return t.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"onCreateContext",value:function(){var t;return(t=this.props).onCreateContext.apply(t,arguments)}},{key:"onInitialize",value:function(){var t;return(t=this.props).onInitialize.apply(t,arguments)}},{key:"onRender",value:function(){var t;return(t=this.props).onRender.apply(t,arguments)}},{key:"onFinalize",value:function(){var t;return(t=this.props).onFinalize.apply(t,arguments)}},{key:"getHTMLControlValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(t);return n?Number(n.value):e}},{key:"setViewParameters",value:function(){return c.h.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var t=this;v(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame((function e(){t._running&&(t.redraw(),t._animationFrameId=t._requestAnimationFrame(e))}))}},{key:"_getPageLoadPromise",value:function(){return this._pageLoadPromise||(this._pageLoadPromise=b?new Promise((function(t,e){b&&"complete"===document.readyState?t(document):window.addEventListener("load",(function(){t(document)}))})):Promise.resolve({})),this._pageLoadPromise}},{key:"_setDisplay",value:function(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}},{key:"_requestAnimationFrame",value:function(t){var e;this.display&&this.display.requestAnimationFrame(t)||(e=t,"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60))}},{key:"_renderFrame",value:function(){var t;this.display?(t=this.display)._renderFrame.apply(t,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer())}},{key:"_initializeCallbackData",value:function(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}},{key:"_updateCallbackData",value:function(){var t=this._getSizeAndAspect(),e=t.width,n=t.height,r=t.aspect;e===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}},{key:"_finalizeCallbackData",value:function(){this.onFinalize(this.animationProps)}},{key:"_addCallbackData",value:function(t){"object"===Object(r.a)(t)&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}},{key:"_createWebGLContext",value:function(t){if(this.offScreen=t.canvas&&"undefined"!==typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?Object(c.e)(this.props.gl,t):this.onCreateContext(t),!Object(c.f)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(c.i)(this.gl),this._createInfoDiv()}},{key:"_createInfoDiv",value:function(){if(this.gl.canvas&&this.props.onAddHTML){var t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";var e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);var n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight,n=1,r=this.gl.canvas;return r&&r.clientHeight?n=r.clientWidth/r.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.j)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new B.a(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}},{key:"_beginTimers",value:function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}},{key:"_endTimers",value:function(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}},{key:"_startEventHandling",value:function(){var t=this.gl.canvas;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}},{key:"_onMousemove",value:function(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}},{key:"_onMouseleave",value:function(t){this.animationProps._mousePosition=null}}]),t}()},function(t,e,n){"use strict";var r=n(310),i="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3  lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n    vec3 halfway_direction = normalize(light_direction + view_direction);\n    float lambertian = dot(light_direction, normal_worldspace);\n    float specular = 0.0;\n    if (lambertian > 0.0) {\n      float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n      specular = pow(specular_angle, lighting_uShininess);\n    }\n    lambertian = max(lambertian, 0.0);\n    return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = surfaceColor;\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n    lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = vec3(0, 0, 0);\n  vec3 surfaceColor = vec3(0, 0, 0);\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var o={name:"gouraud-lighting",dependencies:[r.a],vs:i,defines:{LIGHTING_VERTEX:1},getUniforms:c},a={name:"phong-lighting",dependencies:[r.a],fs:i,defines:{LIGHTING_FRAGMENT:1},getUniforms:c},A={};function s(t){var e=t.ambient,n=void 0===e?.35:e,r=t.diffuse,i=void 0===r?.6:r,o=t.shininess,a=void 0===o?32:o,A=t.specularColor;return{lighting_uAmbient:n,lighting_uDiffuse:i,lighting_uShininess:a,lighting_uSpecularColor:(void 0===A?[30,30,30]:A).map((function(t){return t/255}))}}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;if(!("material"in t))return{};var e=t.material;return e?s(e):{lighting_uEnabled:!1}}},function(t,e,n){"use strict";var r=n(245),i=n(467);var o=function(t){"function"===typeof t?t():t&&"function"===typeof t.unsubscribe&&t.unsubscribe()};e.a=function(t){var e,n=new i.a,a=0;return new r.a((function(r){e||(e=t.subscribe(n));var i=n.subscribe(r);return a++,function(){a--,i.unsubscribe(),0===a&&(o(e),e=void 0)}}))}},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(864)),A=n(23),s=n(17),c=n(27),u=(n(262),n(32)),l=n(64),g=n(43),f=n(65);function h(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=this,A=function(){t.apply(a,i)};clearTimeout(e),e=setTimeout(A,n)}return r.clear=function(){clearTimeout(e)},r}var d=n(88),I=n(322),p=n(196),C=n(714),y=n(866),v=n(867),B=n(60),m=n(83),b=n(320),E=n(3),Q=n(2),F=n(321);function w(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function S(t){return parseInt(window.getComputedStyle(t)["padding-right"],10)||0}function R(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,o=[e,n].concat(Object(A.a)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(t.children,(function(t){1===t.nodeType&&-1===o.indexOf(t)&&-1===a.indexOf(t.tagName)&&w(t,i)}))}function U(t,e){var n=-1;return t.some((function(t,r){return!!e(t)&&(n=r,!0)})),n}function x(t,e){var n,r=[],i=[],o=t.container;if(!e.disableScrollLock){if(function(t){var e=Object(d.a)(t);return e.body===t?Object(I.a)(e).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}(o)){var a=Object(F.a)();r.push({value:o.style.paddingRight,key:"padding-right",el:o}),o.style["padding-right"]="".concat(S(o)+a,"px"),n=Object(d.a)(o).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(t){i.push(t.style.paddingRight),t.style.paddingRight="".concat(S(t)+a,"px")}))}var A=o.parentElement,s="HTML"===A.nodeName&&"scroll"===window.getComputedStyle(A)["overflow-y"]?A:o;r.push({value:s.style.overflow,key:"overflow",el:s}),s.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(t,e){i[e]?t.style.paddingRight=i[e]:t.style.removeProperty("padding-right")})),r.forEach((function(t){var e=t.value,n=t.el,r=t.key;e?n.style.setProperty(r,e):n.style.removeProperty(r)}))}}var k=function(){function t(){Object(E.a)(this,t),this.modals=[],this.containers=[]}return Object(Q.a)(t,[{key:"add",value:function(t,e){var n=this.modals.indexOf(t);if(-1!==n)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&w(t.modalRef,!1);var r=function(t){var e=[];return[].forEach.call(t.children,(function(t){t.getAttribute&&"true"===t.getAttribute("aria-hidden")&&e.push(t)})),e}(e);R(e,t.mountNode,t.modalRef,r,!0);var i=U(this.containers,(function(t){return t.container===e}));return-1!==i?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:e,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(t,e){var n=U(this.containers,(function(e){return-1!==e.modals.indexOf(t)})),r=this.containers[n];r.restore||(r.restore=x(r,e))}},{key:"remove",value:function(t){var e=this.modals.indexOf(t);if(-1===e)return e;var n=U(this.containers,(function(e){return-1!==e.modals.indexOf(t)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(t),1),this.modals.splice(e,1),0===r.modals.length)r.restore&&r.restore(),t.modalRef&&w(t.modalRef,!0),R(r.container,t.mountNode,t.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&w(i.modalRef,!1)}return e}},{key:"isTopModal",value:function(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}]),t}();var O=function(t){var e=t.children,n=t.disableAutoFocus,r=void 0!==n&&n,i=t.disableEnforceFocus,a=void 0!==i&&i,A=t.disableRestoreFocus,s=void 0!==A&&A,c=t.getDoc,u=t.isEnabled,l=t.open,g=o.useRef(),h=o.useRef(null),I=o.useRef(null),p=o.useRef(),C=o.useRef(null),y=o.useCallback((function(t){C.current=f.findDOMNode(t)}),[]),v=Object(B.a)(e.ref,y);return o.useMemo((function(){l&&"undefined"!==typeof window&&(p.current=c().activeElement)}),[l]),o.useEffect((function(){if(l){var t=Object(d.a)(C.current);r||!C.current||C.current.contains(t.activeElement)||(C.current.hasAttribute("tabIndex")||C.current.setAttribute("tabIndex",-1),C.current.focus());var e=function(){a||!u()||g.current?g.current=!1:C.current&&!C.current.contains(t.activeElement)&&C.current.focus()},n=function(e){!a&&u()&&9===e.keyCode&&t.activeElement===C.current&&(g.current=!0,e.shiftKey?I.current.focus():h.current.focus())};t.addEventListener("focus",e,!0),t.addEventListener("keydown",n,!0);var i=setInterval((function(){e()}),50);return function(){clearInterval(i),t.removeEventListener("focus",e,!0),t.removeEventListener("keydown",n,!0),s||(p.current&&p.current.focus&&p.current.focus(),p.current=null)}}}),[r,a,s,u,l]),o.createElement(o.Fragment,null,o.createElement("div",{tabIndex:0,ref:h,"data-test":"sentinelStart"}),o.cloneElement(e,{ref:v}),o.createElement("div",{tabIndex:0,ref:I,"data-test":"sentinelEnd"}))},N={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},D=o.forwardRef((function(t,e){var n=t.invisible,a=void 0!==n&&n,A=t.open,s=Object(i.a)(t,["invisible","open"]);return A?o.createElement("div",Object(r.a)({"aria-hidden":!0,ref:e},s,{style:Object(r.a)({},N.root,{},a?N.invisible:{},{},s.style)})):null}));var G=new k,_=o.forwardRef((function(t,e){var n=Object(C.a)(),a=Object(y.a)({name:"MuiModal",props:Object(r.a)({},t),theme:n}),A=a.BackdropComponent,s=void 0===A?D:A,c=a.BackdropProps,u=a.children,l=a.closeAfterTransition,g=void 0!==l&&l,h=a.container,I=a.disableAutoFocus,E=void 0!==I&&I,Q=a.disableBackdropClick,F=void 0!==Q&&Q,S=a.disableEnforceFocus,R=void 0!==S&&S,U=a.disableEscapeKeyDown,x=void 0!==U&&U,k=a.disablePortal,N=void 0!==k&&k,_=a.disableRestoreFocus,M=void 0!==_&&_,T=a.disableScrollLock,j=void 0!==T&&T,L=a.hideBackdrop,V=void 0!==L&&L,Z=a.keepMounted,P=void 0!==Z&&Z,W=a.manager,J=void 0===W?G:W,H=a.onBackdropClick,Y=a.onClose,X=a.onEscapeKeyDown,z=a.onRendered,K=a.open,q=Object(i.a)(a,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),$=o.useState(!0),tt=$[0],et=$[1],nt=o.useRef({}),rt=o.useRef(null),it=o.useRef(null),ot=Object(B.a)(it,e),at=function(t){return!!t.children&&t.children.props.hasOwnProperty("in")}(a),At=function(){return Object(d.a)(rt.current)},st=function(){return nt.current.modalRef=it.current,nt.current.mountNode=rt.current,nt.current},ct=function(){J.mount(st(),{disableScrollLock:j}),it.current.scrollTop=0},ut=Object(m.a)((function(){var t=function(t){return t="function"===typeof t?t():t,f.findDOMNode(t)}(h)||At().body;J.add(st(),t),it.current&&ct()})),lt=o.useCallback((function(){return J.isTopModal(st())}),[J]),gt=Object(m.a)((function(t){rt.current=t,t&&(z&&z(),K&&lt()?ct():w(it.current,!0))})),ft=o.useCallback((function(){J.remove(st())}),[J]);if(o.useEffect((function(){return function(){ft()}}),[ft]),o.useEffect((function(){K?ut():at&&g||ft()}),[K,ft,at,g,ut]),!P&&!K&&(!at||tt))return null;var ht=function(t){return{root:{position:"fixed",zIndex:t.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:b.a}),dt={};return void 0===u.props.tabIndex&&(dt.tabIndex=u.props.tabIndex||"-1"),at&&(dt.onEnter=Object(p.a)((function(){et(!1)}),u.props.onEnter),dt.onExited=Object(p.a)((function(){et(!0),g&&ft()}),u.props.onExited)),o.createElement(v.a,{ref:gt,container:h,disablePortal:N},o.createElement("div",Object(r.a)({ref:ot,onKeyDown:function(t){"Escape"===t.key&&lt()&&(t.stopPropagation(),X&&X(t),!x&&Y&&Y(t,"escapeKeyDown"))},role:"presentation"},q,{style:Object(r.a)({},ht.root,{},!K&&tt?ht.hidden:{},{},q.style)}),V?null:o.createElement(s,Object(r.a)({open:K,onClick:function(t){t.target===t.currentTarget&&(H&&H(t),!F&&Y&&Y(t,"backdropClick"))}},c)),o.createElement(O,{disableEnforceFocus:R,disableAutoFocus:E,disableRestoreFocus:M,getDoc:At,isEnabled:lt,open:K},o.cloneElement(u,dt))))})),M=n(1361),T=n(258),j=n(383);function L(t){return"scale(".concat(t,", ").concat(Math.pow(t,2),")")}var V={entering:{opacity:1,transform:L(1)},entered:{opacity:1,transform:"none"}},Z=o.forwardRef((function(t,e){var n=t.children,a=t.in,A=t.onEnter,s=t.onExit,c=t.style,u=t.timeout,l=void 0===u?"auto":u,g=Object(i.a)(t,["children","in","onEnter","onExit","style","timeout"]),f=o.useRef(),h=o.useRef(),d=Object(B.a)(n.ref,e),I=Object(T.a)();return o.useEffect((function(){return function(){clearTimeout(f.current)}}),[]),o.createElement(M.a,Object(r.a)({appear:!0,in:a,onEnter:function(t,e){Object(j.b)(t);var n,r=Object(j.a)({style:c,timeout:l},{mode:"enter"}),i=r.duration,o=r.delay;"auto"===l?(n=I.transitions.getAutoHeightDuration(t.clientHeight),h.current=n):n=i,t.style.transition=[I.transitions.create("opacity",{duration:n,delay:o}),I.transitions.create("transform",{duration:.666*n,delay:o})].join(","),A&&A(t,e)},onExit:function(t){var e,n=Object(j.a)({style:c,timeout:l},{mode:"exit"}),r=n.duration,i=n.delay;"auto"===l?(e=I.transitions.getAutoHeightDuration(t.clientHeight),h.current=e):e=r,t.style.transition=[I.transitions.create("opacity",{duration:e,delay:i}),I.transitions.create("transform",{duration:.666*e,delay:i||.333*e})].join(","),t.style.opacity="0",t.style.transform=L(.75),s&&s(t)},addEndListener:function(t,e){"auto"===l&&(f.current=setTimeout(e,h.current||0))},timeout:"auto"===l?null:l},g),(function(t,e){return o.cloneElement(n,Object(r.a)({style:Object(r.a)({opacity:0,transform:L(.75),visibility:"exited"!==t||a?void 0:"hidden"},V[t],{},c,{},n.props.style),ref:d},e))}))}));Z.muiSupportAuto=!0;var P=Z,W=n(781);function J(t,e){var n=0;return"number"===typeof e?n=e:"center"===e?n=t.height/2:"bottom"===e&&(n=t.height),n}function H(t,e){var n=0;return"number"===typeof e?n=e:"center"===e?n=t.width/2:"right"===e&&(n=t.width),n}function Y(t){return[t.horizontal,t.vertical].map((function(t){return"number"===typeof t?"".concat(t,"px"):t})).join(" ")}function X(t){return"function"===typeof t?t():t}var z=o.forwardRef((function(t,e){var n=t.action,a=t.anchorEl,A=t.anchorOrigin,s=void 0===A?{vertical:"top",horizontal:"left"}:A,c=t.anchorPosition,l=t.anchorReference,g=void 0===l?"anchorEl":l,C=t.children,y=t.classes,v=t.className,B=t.container,m=t.elevation,b=void 0===m?8:m,E=t.getContentAnchorEl,Q=t.marginThreshold,F=void 0===Q?16:Q,w=t.onEnter,S=t.onEntered,R=t.onEntering,U=t.onExit,x=t.onExited,k=t.onExiting,O=t.open,N=t.PaperProps,D=void 0===N?{}:N,G=t.transformOrigin,M=void 0===G?{vertical:"top",horizontal:"left"}:G,T=t.TransitionComponent,j=void 0===T?P:T,L=t.transitionDuration,V=void 0===L?"auto":L,Z=t.TransitionProps,z=void 0===Z?{}:Z,K=Object(i.a)(t,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),q=o.useRef(),$=o.useCallback((function(t){if("anchorPosition"===g)return c;var e=X(a),n=(e instanceof Object(I.a)(e).Element?e:Object(d.a)(q.current).body).getBoundingClientRect(),r=0===t?s.vertical:"center";return{top:n.top+J(n,r),left:n.left+H(n,s.horizontal)}}),[a,s.horizontal,s.vertical,c,g]),tt=o.useCallback((function(t){var e=0;if(E&&"anchorEl"===g){var n=E(t);if(n&&t.contains(n)){var r=function(t,e){for(var n=e,r=0;n&&n!==t;)r+=(n=n.parentElement).scrollTop;return r}(t,n);e=n.offsetTop+n.clientHeight/2-r||0}0}return e}),[s.vertical,g,E]),et=o.useCallback((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:J(t,M.vertical)+e,horizontal:H(t,M.horizontal)}}),[M.horizontal,M.vertical]),nt=o.useCallback((function(t){var e=tt(t),n={width:t.offsetWidth,height:t.offsetHeight},r=et(n,e);if("none"===g)return{top:null,left:null,transformOrigin:Y(r)};var i=$(e),o=i.top-r.vertical,A=i.left-r.horizontal,s=o+n.height,c=A+n.width,u=Object(I.a)(X(a)),l=u.innerHeight-F,f=u.innerWidth-F;if(o<F){var h=o-F;o-=h,r.vertical+=h}else if(s>l){var d=s-l;o-=d,r.vertical+=d}if(A<F){var p=A-F;A-=p,r.horizontal+=p}else if(c>f){var C=c-f;A-=C,r.horizontal+=C}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(A),"px"),transformOrigin:Y(r)}}),[a,g,$,tt,et,F]),rt=o.useCallback((function(){var t=q.current;if(t){var e=nt(t);null!==e.top&&(t.style.top=e.top),null!==e.left&&(t.style.left=e.left),t.style.transformOrigin=e.transformOrigin}}),[nt]),it=o.useCallback((function(t){q.current=f.findDOMNode(t)}),[]);o.useEffect((function(){O&&rt()})),o.useImperativeHandle(n,(function(){return O?{updatePosition:function(){rt()}}:null}),[O,rt]),o.useEffect((function(){if(O){var t=h((function(){rt()}));return window.addEventListener("resize",t),function(){t.clear(),window.removeEventListener("rezise",t)}}}),[O,rt]);var ot=V;"auto"!==V||j.muiSupportAuto||(ot=void 0);var at=B||(a?Object(d.a)(X(a)).body:void 0);return o.createElement(_,Object(r.a)({container:at,open:O,ref:e,BackdropProps:{invisible:!0},className:Object(u.a)(y.root,v)},K),o.createElement(j,Object(r.a)({appear:!0,in:O,onEnter:w,onEntered:S,onExit:U,onExited:x,onExiting:k,timeout:ot},z,{onEntering:Object(p.a)((function(t,e){R&&R(t,e),rt()}),z.onEntering)}),o.createElement(W.a,Object(r.a)({elevation:b,ref:it},D,{className:Object(u.a)(y.paper,D.className)}),C)))})),K=Object(g.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(z),q=n(903),$=n(106),tt={vertical:"top",horizontal:"right"},et={vertical:"top",horizontal:"left"},nt=o.forwardRef((function(t,e){var n=t.autoFocus,a=void 0===n||n,A=t.children,s=t.classes,c=t.disableAutoFocusItem,l=void 0!==c&&c,g=t.MenuListProps,h=void 0===g?{}:g,d=t.onClose,I=t.onEntering,p=t.open,C=t.PaperProps,y=void 0===C?{}:C,v=t.PopoverClasses,B=t.transitionDuration,m=void 0===B?"auto":B,b=t.variant,E=void 0===b?"selectedMenu":b,Q=Object(i.a)(t,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","variant"]),F=Object(T.a)(),w=a&&!l&&p,S=o.useRef(null),R=o.useRef(null),U=-1;o.Children.map(A,(function(t,e){o.isValidElement(t)&&(t.props.disabled||("menu"!==E&&t.props.selected||-1===U)&&(U=e))}));var x=o.Children.map(A,(function(t,e){return e===U?o.cloneElement(t,{ref:function(e){R.current=f.findDOMNode(e),Object($.a)(t.ref,e)}}):t}));return o.createElement(K,Object(r.a)({getContentAnchorEl:function(){return R.current},classes:v,onClose:d,onEntering:function(t,e){S.current&&S.current.adjustStyleForScrollbar(t,F),I&&I(t,e)},anchorOrigin:"rtl"===F.direction?tt:et,transformOrigin:"rtl"===F.direction?tt:et,PaperProps:Object(r.a)({},y,{classes:Object(r.a)({},y.classes,{root:s.paper})}),open:p,ref:e,transitionDuration:m},Q),o.createElement(q.a,Object(r.a)({onKeyDown:function(t){"Tab"===t.key&&(t.preventDefault(),d&&d(t,"tabKeyDown"))},actions:S,autoFocus:a&&(-1===U||l),autoFocusItem:w,variant:E},h,{className:Object(u.a)(s.list,h.className)}),x))})),rt=Object(g.a)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(nt);function it(t){return null!=t&&!(Array.isArray(t)&&0===t.length)}function ot(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t&&(it(t.value)&&""!==t.value||e&&it(t.defaultValue)&&""!==t.defaultValue)}var at=n(326);function At(t,e){return"object"===Object(c.a)(e)&&null!==e?t===e:String(t)===String(e)}var st=o.forwardRef((function(t,e){var n=t.autoFocus,a=t.autoWidth,c=t.children,g=t.classes,f=t.className,h=t.defaultValue,d=t.disabled,I=t.displayEmpty,p=t.IconComponent,C=t.inputRef,y=t.labelId,v=t.MenuProps,m=void 0===v?{}:v,b=t.multiple,E=t.name,Q=t.onBlur,F=t.onChange,w=t.onClose,S=t.onFocus,R=t.onOpen,U=t.open,x=t.readOnly,k=t.renderValue,O=(t.required,t.SelectDisplayProps),N=void 0===O?{}:O,D=t.tabIndex,G=(t.type,t.value),_=t.variant,M=void 0===_?"standard":_,T=Object(i.a)(t,["autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","required","SelectDisplayProps","tabIndex","type","value","variant"]),j=Object(at.a)({controlled:G,default:h,name:"SelectInput"}),L=Object(s.a)(j,2),V=L[0],Z=L[1],P=o.useRef(null),W=o.useState(null),J=W[0],H=W[1],Y=o.useRef(null!=U).current,X=o.useState(),z=X[0],K=X[1],q=o.useState(!1),$=q[0],tt=q[1],et=Object(B.a)(e,C);o.useImperativeHandle(et,(function(){return{focus:function(){J.focus()},node:P.current,value:V}}),[J,V]),o.useEffect((function(){n&&J&&J.focus()}),[n,J]);var nt,it,st=function(t,e){t?R&&R(e):w&&w(e),Y||(K(a?null:J.clientWidth),tt(t))},ct=function(t){return function(e){var n;if(b||st(!1,e),b){n=Array.isArray(V)?Object(A.a)(V):[];var r=V.indexOf(t.props.value);-1===r?n.push(t.props.value):n.splice(r,1)}else n=t.props.value;Z(n),F&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:n,name:E}}),F(e,t))}},ut=null!==J&&(Y?U:$);delete T["aria-invalid"];var lt=[],gt=!1;(ot({value:V})||I)&&(k?nt=k(V):gt=!0);var ft=o.Children.map(c,(function(t){if(!o.isValidElement(t))return null;var e;if(b){if(!Array.isArray(V))throw new Error("Material-UI: the `value` prop must be an array when using the `Select` component with `multiple`.");(e=V.some((function(e){return At(e,t.props.value)})))&&gt&&lt.push(t.props.children)}else(e=At(V,t.props.value))&&gt&&(it=t.props.children);return e&&!0,o.cloneElement(t,{"aria-selected":e?"true":void 0,onClick:ct(t),onKeyUp:function(e){" "===e.key&&e.preventDefault();var n=t.props.onKeyUp;"function"===typeof n&&n(e)},role:"option",selected:e,value:void 0,"data-value":t.props.value})}));gt&&(nt=b?lt.join(", "):it);var ht,dt=z;!a&&Y&&J&&(dt=J.clientWidth),ht="undefined"!==typeof D?D:d?null:0;var It=N.id||(E?"mui-component-select-".concat(E):void 0);return o.createElement(o.Fragment,null,o.createElement("div",Object(r.a)({className:Object(u.a)(g.root,g.select,g.selectMenu,g[M],f,d&&g.disabled),ref:H,tabIndex:ht,role:"button","aria-expanded":ut?"true":void 0,"aria-labelledby":"".concat(y||""," ").concat(It||""),"aria-haspopup":"listbox",onKeyDown:function(t){if(!x){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(t.key)&&(t.preventDefault(),st(!0,t))}},onMouseDown:d||x?null:function(t){0===t.button&&(t.preventDefault(),J.focus(),st(!0,t))},onBlur:function(t){!ut&&Q&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:V,name:E}}),Q(t))},onFocus:S},N,{id:It}),function(t){return null==t||"string"===typeof t&&!t.trim()}(nt)?o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):nt),o.createElement("input",Object(r.a)({value:Array.isArray(V)?V.join(","):V,name:E,ref:P,type:"hidden",autoFocus:n},T)),o.createElement(p,{className:Object(u.a)(g.icon,g["icon".concat(Object(l.a)(M))],ut&&g.iconOpen)}),o.createElement(rt,Object(r.a)({id:"menu-".concat(E||""),anchorEl:J,open:ut,onClose:function(t){st(!1,t)}},m,{MenuListProps:Object(r.a)({"aria-labelledby":y,role:"listbox",disableListWrap:!0},m.MenuListProps),PaperProps:Object(r.a)({},m.PaperProps,{style:Object(r.a)({minWidth:dt},null!=m.PaperProps?m.PaperProps.style:null)})}),ft))})),ct=n(270),ut=n(306),lt=n(332),gt=Object(lt.a)(o.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),ft=n(402);function ht(t,e){return parseInt(t[e],10)||0}var dt="undefined"!==typeof window?o.useLayoutEffect:o.useEffect,It={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},pt=o.forwardRef((function(t,e){var n=t.onChange,a=t.rows,A=t.rowsMax,s=t.rowsMin,c=void 0===s?1:s,u=t.style,l=t.value,g=Object(i.a)(t,["onChange","rows","rowsMax","rowsMin","style","value"]),f=a||c,d=o.useRef(null!=l).current,I=o.useRef(null),p=Object(B.a)(e,I),C=o.useRef(null),y=o.useRef(0),v=o.useState({}),m=v[0],b=v[1],E=o.useCallback((function(){var e=I.current,n=window.getComputedStyle(e),r=C.current;r.style.width=n.width,r.value=e.value||t.placeholder||"x";var i=n["box-sizing"],o=ht(n,"padding-bottom")+ht(n,"padding-top"),a=ht(n,"border-bottom-width")+ht(n,"border-top-width"),s=r.scrollHeight-o;r.value="x";var c=r.scrollHeight-o,u=s;f&&(u=Math.max(Number(f)*c,u)),A&&(u=Math.min(Number(A)*c,u));var l=(u=Math.max(u,c))+("border-box"===i?o+a:0),g=Math.abs(u-s)<=1;b((function(t){return y.current<20&&(l>0&&Math.abs((t.outerHeightStyle||0)-l)>1||t.overflow!==g)?(y.current+=1,{overflow:g,outerHeightStyle:l}):t}))}),[A,f,t.placeholder]);o.useEffect((function(){var t=h((function(){y.current=0,E()}));return window.addEventListener("resize",t),function(){t.clear(),window.removeEventListener("resize",t)}}),[E]),dt((function(){E()})),o.useEffect((function(){y.current=0}),[l]);return o.createElement(o.Fragment,null,o.createElement("textarea",Object(r.a)({value:l,onChange:function(t){y.current=0,d||E(),n&&n(t)},ref:p,rows:f,style:Object(r.a)({height:m.outerHeightStyle,overflow:m.overflow?"hidden":null},u)},g)),o.createElement("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:C,tabIndex:-1,style:Object(r.a)({},It,{},u)}))})),Ct="undefined"===typeof window?o.useEffect:o.useLayoutEffect,yt=o.forwardRef((function(t,e){var n=t["aria-describedby"],a=t.autoComplete,A=t.autoFocus,s=t.classes,c=t.className,g=(t.color,t.defaultValue),f=t.disabled,h=t.endAdornment,d=(t.error,t.fullWidth),I=void 0!==d&&d,p=t.id,C=t.inputComponent,y=void 0===C?"input":C,v=t.inputProps,m=void 0===v?{}:v,b=t.inputRef,E=(t.margin,t.multiline),Q=void 0!==E&&E,F=t.name,w=t.onBlur,S=t.onChange,R=t.onClick,U=t.onFocus,x=t.onKeyDown,k=t.onKeyUp,O=t.placeholder,N=t.readOnly,D=t.renderSuffix,G=t.rows,_=t.rowsMax,M=t.rowsMin,T=t.startAdornment,j=t.type,L=void 0===j?"text":j,V=t.value,Z=Object(i.a)(t,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),P=null!=m.value?m.value:V,W=o.useRef(null!=P).current,J=o.useRef(),H=o.useCallback((function(t){0}),[]),Y=Object(B.a)(m.ref,H),X=Object(B.a)(b,Y),z=Object(B.a)(J,X),K=o.useState(!1),q=K[0],$=K[1],tt=Object(ft.b)();var et=Object(ct.a)({props:t,muiFormControl:tt,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});et.focused=tt?tt.focused:q,o.useEffect((function(){!tt&&f&&q&&($(!1),w&&w())}),[tt,f,q,w]);var nt=tt&&tt.onFilled,rt=tt&&tt.onEmpty,it=o.useCallback((function(t){ot(t)?nt&&nt():rt&&rt()}),[nt,rt]);Ct((function(){W&&it({value:P})}),[P,it,W]);o.useEffect((function(){it(J.current)}),[]);var at=y,At=Object(r.a)({},m,{ref:z});"string"!==typeof at?At=Object(r.a)({inputRef:z,type:L},At,{ref:null}):Q?!G||_||M?(At=Object(r.a)({rows:G,rowsMax:_},At),at=pt):at="textarea":At=Object(r.a)({type:L},At);return o.useEffect((function(){tt&&tt.setAdornedStart(Boolean(T))}),[tt,T]),o.createElement("div",Object(r.a)({className:Object(u.a)(s.root,s["color".concat(Object(l.a)(et.color||"primary"))],c,et.disabled&&s.disabled,et.error&&s.error,I&&s.fullWidth,et.focused&&s.focused,tt&&s.formControl,Q&&s.multiline,T&&s.adornedStart,h&&s.adornedEnd,"dense"===et.margin&&s.marginDense),onClick:function(t){J.current&&t.currentTarget===t.target&&J.current.focus(),R&&R(t)},ref:e},Z),T,o.createElement(ft.a.Provider,{value:null},o.createElement(at,Object(r.a)({"aria-invalid":et.error,"aria-describedby":n,autoComplete:a,autoFocus:A,defaultValue:g,disabled:et.disabled,id:p,onAnimationStart:function(t){it("mui-auto-fill-cancel"===t.animationName?J.current:{value:"x"})},name:F,placeholder:O,readOnly:N,required:et.required,rows:G,value:P,onKeyDown:x,onKeyUp:k},At,{className:Object(u.a)(s.input,m.className,et.disabled&&s.disabled,Q&&s.inputMultiline,et.hiddenLabel&&s.inputHiddenLabel,T&&s.inputAdornedStart,h&&s.inputAdornedEnd,"search"===L&&s.inputTypeSearch,"dense"===et.margin&&s.inputMarginDense),onBlur:function(t){w&&w(t),m.onBlur&&m.onBlur(t),tt&&tt.onBlur?tt.onBlur(t):$(!1)},onChange:function(t){if(!W){var e=t.target||J.current;if(null==e)throw new TypeError("Material-UI: Expected valid input target. Did you use a custom `inputComponent` and forget to forward refs? See https://material-ui.com/r/input-component-ref-interface for more info.");it({value:e.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];m.onChange&&m.onChange.apply(m,[t].concat(r)),S&&S.apply(void 0,[t].concat(r))},onFocus:function(t){et.disabled?t.stopPropagation():(U&&U(t),m.onFocus&&m.onFocus(t),tt&&tt.onFocus?tt.onFocus(t):$(!0))}}))),h,D?D(Object(r.a)({},et,{startAdornment:T})):null)})),vt=Object(g.a)((function(t){var e="light"===t.palette.type,n={color:"currentColor",opacity:e?.42:.5,transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},i={opacity:"0 !important"},o={opacity:e?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{from:{}},"@keyframes mui-auto-fill-cancel":{from:{}}},root:Object(r.a)({},t.typography.body1,{color:t.palette.text.primary,lineHeight:"1.1875em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:t.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1875em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}}),{name:"MuiInputBase"})(yt),Bt=o.forwardRef((function(t,e){var n=t.disableUnderline,a=t.classes,A=t.fullWidth,s=void 0!==A&&A,c=t.inputComponent,l=void 0===c?"input":c,g=t.multiline,f=void 0!==g&&g,h=t.type,d=void 0===h?"text":h,I=Object(i.a)(t,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(vt,Object(r.a)({classes:Object(r.a)({},a,{root:Object(u.a)(a.root,!n&&a.underline),underline:null}),fullWidth:s,inputComponent:l,multiline:f,ref:e,type:d},I))}));Bt.muiName="Input";var mt=Object(g.a)((function(t){var e="light"===t.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:t.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(t.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:t.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(e),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(t.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(e)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(Bt),bt=o.forwardRef((function(t,e){var n=t.classes,a=t.className,A=t.disabled,s=t.IconComponent,c=t.inputRef,g=t.variant,f=void 0===g?"standard":g,h=Object(i.a)(t,["classes","className","disabled","IconComponent","inputRef","variant"]);return o.createElement(o.Fragment,null,o.createElement("select",Object(r.a)({className:Object(u.a)(n.root,n.select,n[f],a,A&&n.disabled),disabled:A,ref:c||e},h)),t.multiple?null:o.createElement(s,{className:Object(u.a)(n.icon,n["icon".concat(Object(l.a)(f))])}))})),Et=function(t){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===t.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:t.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:t.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",color:t.palette.action.active,pointerEvents:"none"},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7}}},Qt=o.createElement(mt,null),Ft=o.forwardRef((function(t,e){var n=t.children,a=t.classes,A=t.IconComponent,s=void 0===A?gt:A,c=t.input,u=void 0===c?Qt:c,l=t.inputProps,g=(t.variant,Object(i.a)(t,["children","classes","IconComponent","input","inputProps","variant"])),f=Object(ut.a)(),h=Object(ct.a)({props:t,muiFormControl:f,states:["variant"]});return o.cloneElement(u,Object(r.a)({inputComponent:bt,inputProps:Object(r.a)({children:n,classes:a,IconComponent:s,variant:h.variant,type:void 0},l,{},u?u.props.inputProps:{}),ref:e},g))}));Ft.muiName="Select";Object(g.a)(Et,{name:"MuiNativeSelect"})(Ft);var wt=o.forwardRef((function(t,e){var n=t.disableUnderline,a=t.classes,A=t.fullWidth,s=void 0!==A&&A,c=t.inputComponent,l=void 0===c?"input":c,g=t.multiline,f=void 0!==g&&g,h=t.type,d=void 0===h?"text":h,I=Object(i.a)(t,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(vt,Object(r.a)({classes:Object(r.a)({},a,{root:Object(u.a)(a.root,!n&&a.underline),underline:null}),fullWidth:s,inputComponent:l,multiline:f,ref:e,type:d},I))}));wt.muiName="Input";var St=Object(g.a)((function(t){var e="light"===t.palette.type,n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:t.shape.borderRadius,borderTopRightRadius:t.shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:e?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:t.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(t.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:t.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(t.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"dark"===t.palette.type?"0 0 0 100px #266798 inset":null,WebkitTextFillColor:"dark"===t.palette.type?"#fff":null,borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(wt),Rt=n(1),Ut=o.forwardRef((function(t,e){t.children;var n=t.classes,a=t.className,A=t.label,s=t.labelWidth,c=t.notched,g=t.style,f=Object(i.a)(t,["children","classes","className","label","labelWidth","notched","style"]),h="rtl"===Object(T.a)().direction?"right":"left";if(void 0!==A)return o.createElement("fieldset",Object(r.a)({"aria-hidden":!0,className:Object(u.a)(n.root,a),ref:e,style:g},f),o.createElement("legend",{className:Object(u.a)(n.legendLabelled,c&&n.legendNotched)},A?o.createElement("span",null,A):o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})));var d=s>0?.75*s+8:.01;return o.createElement("fieldset",Object(r.a)({"aria-hidden":!0,style:Object(r.a)(Object(Rt.a)({},"padding".concat(Object(l.a)(h)),8),g),className:Object(u.a)(n.root,a),ref:e},f),o.createElement("legend",{className:n.legend,style:{width:c?d:.01}},o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})))})),xt=Object(g.a)((function(t){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:0,paddingLeft:8,pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(Ut),kt=o.forwardRef((function(t,e){var n=t.classes,a=t.fullWidth,A=void 0!==a&&a,s=t.inputComponent,c=void 0===s?"input":s,l=t.label,g=t.labelWidth,f=void 0===g?0:g,h=t.multiline,d=void 0!==h&&h,I=t.notched,p=t.type,C=void 0===p?"text":p,y=Object(i.a)(t,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return o.createElement(vt,Object(r.a)({renderSuffix:function(t){return o.createElement(xt,{className:n.notchedOutline,label:l,labelWidth:f,notched:"undefined"!==typeof I?I:Boolean(t.startAdornment||t.filled||t.focused)})},classes:Object(r.a)({},n,{root:Object(u.a)(n.root,n.underline),notchedOutline:null}),fullWidth:A,inputComponent:c,multiline:d,ref:e,type:C},y))}));kt.muiName="Input";var Ot=Object(g.a)((function(t){var e="light"===t.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:t.shape.borderRadius,"&:hover $notchedOutline":{borderColor:t.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:e}},"&$focused $notchedOutline":{borderColor:t.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:t.palette.error.main},"&$disabled $notchedOutline":{borderColor:t.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:t.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:e},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"dark"===t.palette.type?"0 0 0 100px #266798 inset":null,WebkitTextFillColor:"dark"===t.palette.type?"#fff":null,borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(kt),Nt=Et,Dt=o.createElement(mt,null),Gt=o.createElement(St,null),_t=o.forwardRef((function t(e,n){var A=e.autoWidth,s=void 0!==A&&A,c=e.children,u=e.classes,l=e.displayEmpty,g=void 0!==l&&l,f=e.IconComponent,h=void 0===f?gt:f,d=e.id,I=e.input,p=e.inputProps,C=e.label,y=e.labelId,v=e.labelWidth,B=void 0===v?0:v,m=e.MenuProps,b=e.multiple,E=void 0!==b&&b,Q=e.native,F=void 0!==Q&&Q,w=e.onClose,S=e.onOpen,R=e.open,U=e.renderValue,x=e.SelectDisplayProps,k=e.variant,O=void 0===k?"standard":k,N=Object(i.a)(e,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),D=F?bt:st,G=Object(ut.a)(),_=Object(ct.a)({props:e,muiFormControl:G,states:["variant"]}).variant||O,M=I||{standard:Dt,outlined:o.createElement(Ot,{label:C,labelWidth:B}),filled:Gt}[_];return o.cloneElement(M,Object(r.a)({inputComponent:D,inputProps:Object(r.a)({children:c,IconComponent:h,variant:_,type:void 0,multiple:E},F?{id:d}:{autoWidth:s,displayEmpty:g,labelId:y,MenuProps:m,onClose:w,onOpen:S,open:R,renderValue:U,SelectDisplayProps:Object(r.a)({id:d},x)},{},p,{classes:p?Object(a.a)({baseClasses:u,newClasses:p.classes,Component:t}):u},I?I.props.inputProps:{}),ref:n},N))}));_t.muiName="Select";e.a=Object(g.a)(Nt,{name:"MuiSelect"})(_t)},function(t,e,n){"use strict";function r(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,A,s,c,u,l,g,f=t._root,h={data:r},d=t._x0,I=t._y0,p=t._x1,C=t._y1;if(!f)return t._root=h,t;for(;f.length;)if((c=e>=(o=(d+p)/2))?d=o:p=o,(u=n>=(a=(I+C)/2))?I=a:C=a,i=f,!(f=f[l=u<<1|c]))return i[l]=h,t;if(A=+t._x.call(null,f.data),s=+t._y.call(null,f.data),e===A&&n===s)return h.next=f,i?i[l]=h:t._root=h,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(d+p)/2))?d=o:p=o,(u=n>=(a=(I+C)/2))?I=a:C=a}while((l=u<<1|c)===(g=(s>=a)<<1|A>=o));return i[g]=f,i[l]=h,t}var i=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function o(t){return t[0]}function a(t){return t[1]}function A(t,e,n){var r=new s(null==e?o:e,null==n?a:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function s(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function c(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}n.d(e,"a",(function(){return A}));var u=A.prototype=s.prototype;u.copy=function(){var t,e,n=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=c(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=c(e));return n},u.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return r(this.cover(e,n),e,n,t)},u.addAll=function(t){var e,n,i,o,a=t.length,A=new Array(a),s=new Array(a),c=1/0,u=1/0,l=-1/0,g=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(A[n]=i,s[n]=o,i<c&&(c=i),i>l&&(l=i),o<u&&(u=o),o>g&&(g=o));if(c>l||u>g)return this;for(this.cover(c,u).cover(l,g),n=0;n<a;++n)r(this,A[n],s[n],t[n]);return this},u.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,A,s=i-n,c=this._root;n>t||t>=i||r>e||e>=o;)switch(A=(e<r)<<1|t<n,(a=new Array(4))[A]=c,c=a,s*=2,A){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},u.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},u.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},u.find=function(t,e,n){var r,o,a,A,s,c,u,l=this._x0,g=this._y0,f=this._x1,h=this._y1,d=[],I=this._root;for(I&&d.push(new i(I,l,g,f,h)),null==n?n=1/0:(l=t-n,g=e-n,f=t+n,h=e+n,n*=n);c=d.pop();)if(!(!(I=c.node)||(o=c.x0)>f||(a=c.y0)>h||(A=c.x1)<l||(s=c.y1)<g))if(I.length){var p=(o+A)/2,C=(a+s)/2;d.push(new i(I[3],p,C,A,s),new i(I[2],o,C,p,s),new i(I[1],p,a,A,C),new i(I[0],o,a,p,C)),(u=(e>=C)<<1|t>=p)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-u],d[d.length-1-u]=c)}else{var y=t-+this._x.call(null,I.data),v=e-+this._y.call(null,I.data),B=y*y+v*v;if(B<n){var m=Math.sqrt(n=B);l=t-m,g=e-m,f=t+m,h=e+m,r=I.data}}return r},u.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,A,s,c,u,l,g,f=this._root,h=this._x0,d=this._y0,I=this._x1,p=this._y1;if(!f)return this;if(f.length)for(;;){if((c=o>=(A=(h+I)/2))?h=A:I=A,(u=a>=(s=(d+p)/2))?d=s:p=s,e=f,!(f=f[l=u<<1|c]))return this;if(!f.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,g=l)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[g]=f:this._root=f),this):(this._root=i,this)},u.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},u.root=function(){return this._root},u.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},u.visit=function(t){var e,n,r,o,a,A,s=[],c=this._root;for(c&&s.push(new i(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,r=e.x0,o=e.y0,a=e.x1,A=e.y1)&&c.length){var u=(r+a)/2,l=(o+A)/2;(n=c[3])&&s.push(new i(n,u,l,a,A)),(n=c[2])&&s.push(new i(n,r,l,u,A)),(n=c[1])&&s.push(new i(n,u,o,a,l)),(n=c[0])&&s.push(new i(n,r,o,u,l))}return this},u.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var o=e.node;if(o.length){var a,A=e.x0,s=e.y0,c=e.x1,u=e.y1,l=(A+c)/2,g=(s+u)/2;(a=o[0])&&n.push(new i(a,A,s,l,g)),(a=o[1])&&n.push(new i(a,l,s,c,g)),(a=o[2])&&n.push(new i(a,A,g,l,u)),(a=o[3])&&n.push(new i(a,l,g,c,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},u.x=function(t){return arguments.length?(this._x=t,this):this._x},u.y=function(t){return arguments.length?(this._y=t,this):this._y}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(796),i=n(797),o=n(733),a=n(732),A=n(109),s=n(137),c=n(69),u=n(798);function l(t,e){var n=A.getCoords(e),r=A.getCoords(t),i=r[0],o=r[r.length-1],a=t.geometry.coordinates;return u(n[0],i)?a.unshift(n[1]):u(n[0],o)?a.push(n[1]):u(n[1],i)?a.unshift(n[0]):u(n[1],o)&&a.push(n[0]),t}e.default=function(t,e,n){if(void 0===n&&(n={}),n=n||{},!c.isObject(n))throw new Error("options is invalid");var g,f=n.tolerance||0,h=[],d=r.default(),I=i.default(t);return d.load(I),s.segmentEach(e,(function(t){var e=!1;s.featureEach(d.search(t),(function(n){if(!1===e){var r=A.getCoords(t).sort(),i=A.getCoords(n).sort();u(r,i)||(0===f?a.default(r[0],n)&&a.default(r[1],n):o.default(n,r[0]).properties.dist<=f&&o.default(n,r[1]).properties.dist<=f)?(e=!0,g=g?l(g,t):t):(0===f?a.default(i[0],t)&&a.default(i[1],t):o.default(t,i[0]).properties.dist<=f&&o.default(t,i[1]).properties.dist<=f)&&(g=g?l(g,n):n)}})),!1===e&&g&&(h.push(g),g=void 0)})),g&&h.push(g),c.featureCollection(h)}},function(t,e,n){"use strict";t.exports=i,t.exports.default=i;var r=n(972);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){A(t,0,t.children.length,e,t)}function A(t,e,n,r,i){i||(i=I(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=e;a<n;a++)o=t.children[a],s(i,t.leaf?r(o):o);return i}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function l(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function g(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function h(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function I(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(t,e,n,i,o){for(var a,A=[e,n];A.length;)(n=A.pop())-(e=A.pop())<=i||(a=e+Math.ceil((n-e)/i/2)*i,r(t,a,e,n,o),A.push(e,a,a,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!d(t,e))return n;for(var i,o,a,A,s=[];e;){for(i=0,o=e.children.length;i<o;i++)a=e.children[i],d(t,A=e.leaf?r(a):a)&&(e.leaf?n.push(a):h(t,A)?this._all(a,n):s.push(a));e=s.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!d(t,e))return!1;for(var r,i,o,a,A=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],d(t,a=e.leaf?n(o):o)){if(e.leaf||h(t,a))return!0;A.push(o)}e=A.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=I([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,a,A=this.data,s=this.toBBox(t),c=[],u=[];A||c.length;){if(A||(A=c.pop(),r=c[c.length-1],n=u.pop(),a=!0),A.leaf&&-1!==(i=o(t,A.children,e)))return A.children.splice(i,1),c.push(A),this._condense(c),this;a||A.leaf||!h(A,s)?r?(n++,A=r.children[n],a=!1):A=null:(c.push(A),u.push(n),n=0,r=A,A=A.children[0])}return this},toBBox:function(t){return t},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,A=this._maxEntries;if(o<=A)return a(i=I(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(A)),A=Math.ceil(o/Math.pow(A,r-1))),(i=I([])).leaf=!1,i.height=r;var s,c,u,l,g=Math.ceil(o/A),f=g*Math.ceil(Math.sqrt(A));for(p(t,e,n,f,this.compareMinX),s=e;s<=n;s+=f)for(p(t,s,u=Math.min(s+f-1,n),g,this.compareMinY),c=s;c<=u;c+=g)l=Math.min(c+g-1,u),i.children.push(this._build(t,c,l,r-1));return a(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,a,A,s,c,u,g,f,h;r.push(e),!e.leaf&&r.length-1!==n;){for(u=g=1/0,i=0,o=e.children.length;i<o;i++)s=l(a=e.children[i]),f=t,h=a,(c=(Math.max(h.maxX,f.maxX)-Math.min(h.minX,f.minX))*(Math.max(h.maxY,f.maxY)-Math.min(h.minY,f.minY))-s)<g?(g=c,u=s<u?s:u,A=a):c===g&&s<u&&(u=s,A=a);e=A||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],a=this._chooseSubtree(i,this.data,e,o);for(a.children.push(t),s(a,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),A=I(n.children.splice(o,n.children.length-o));A.height=n.height,A.leaf=n.leaf,a(n,this.toBBox),a(A,this.toBBox),e?t[e-1].children.push(A):this._splitRoot(n,A)},_splitRoot:function(t,e){this.data=I([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,a,s,c,u,g;for(c=u=1/0,r=e;r<=n-e;r++)a=f(i=A(t,0,r,this.toBBox),o=A(t,r,n,this.toBBox)),s=l(i)+l(o),a<c?(c=a,g=r,u=s<u?s:u):a===c&&s<u&&(u=s,g=r);return g},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,a=this.toBBox,c=A(t,0,e,a),u=A(t,n-e,n,a),l=g(c)+g(u);for(i=e;i<n-e;i++)o=t.children[i],s(c,t.leaf?a(o):o),l+=g(c);for(i=n-e-1;i>=e;i--)o=t.children[i],s(u,t.leaf?a(o):o),l+=g(u);return l},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)s(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():a(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function e(t,e){return t<e?-1:t>e?1:0}return function(n,r,i,o,a){!function e(n,r,i,o,a){for(;o>i;){if(o-i>600){var A=o-i+1,s=r-i+1,c=Math.log(A),u=.5*Math.exp(2*c/3),l=.5*Math.sqrt(c*u*(A-u)/A)*(s-A/2<0?-1:1),g=Math.max(i,Math.floor(r-s*u/A+l)),f=Math.min(o,Math.floor(r+(A-s)*u/A+l));e(n,r,g,f,a)}var h=n[r],d=i,I=o;for(t(n,i,r),a(n[o],h)>0&&t(n,i,o);d<I;){for(t(n,d,I),d++,I--;a(n[d],h)<0;)d++;for(;a(n[I],h)>0;)I--}0===a(n[i],h)?t(n,i,I):(I++,t(n,I,o)),I<=r&&(i=I+1),r<=I&&(o=I-1)}}(n,r,i||0,o||n.length-1,a||e)}}()},function(t,e,n){"use strict";var r;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=n(800),A=Object.prototype.propertyIsEnumerable,s=!A.call({toString:null},"toString"),c=A.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(t){var e=t.constructor;return e&&e.prototype===t},g={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"===typeof window)return!1;for(var t in window)try{if(!g["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"===typeof window[t])try{l(window[t])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(t){var e=null!==t&&"object"===typeof t,n="[object Function]"===o.call(t),r=a(t),A=e&&"[object String]"===o.call(t),g=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=c&&n;if(A&&t.length>0&&!i.call(t,0))for(var d=0;d<t.length;++d)g.push(String(d));if(r&&t.length>0)for(var I=0;I<t.length;++I)g.push(String(I));else for(var p in t)h&&"prototype"===p||!i.call(t,p)||g.push(String(p));if(s)for(var C=function(t){if("undefined"===typeof window||!f)return l(t);try{return l(t)}catch(e){return!1}}(t),y=0;y<u.length;++y)C&&"constructor"===u[y]||!i.call(t,u[y])||g.push(u[y]);return g}}t.exports=r},function(t,e,n){"use strict";var r="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,i=Object.prototype.toString,o=function(t){return!(r&&t&&"object"===typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i.call(t)},a=function(t){return!!o(t)||null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Array]"!==i.call(t)&&"[object Function]"===i.call(t.callee)},A=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=A?o:a},function(t,e,n){"use strict";var r=function(t){return t!==t};t.exports=function(t,e){return 0===t&&0===e?1/t===1/e:t===e||!(!r(t)||!r(e))}},function(t,e,n){"use strict";var r=n(977),i=RegExp.prototype.exec,o=Object.getOwnPropertyDescriptor,a=Object.prototype.toString,A="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;t.exports=function(t){if(!t||"object"!==typeof t)return!1;if(!A)return"[object RegExp]"===a.call(t);var e=o(t,"lastIndex");return!(!e||!r(e,"value"))&&function(t){try{var e=t.lastIndex;return t.lastIndex=0,i.call(t),!0}catch(n){return!1}finally{t.lastIndex=e}}(t)}},function(t,e,n){"use strict";var r=n(734);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!==typeof e||"[object Function]"!==o.call(e))throw new TypeError(r+e);for(var n,a=i.call(arguments,1),A=function(){if(this instanceof n){var r=e.apply(this,a.concat(i.call(arguments)));return Object(r)===r?r:this}return e.apply(t,a.concat(i.call(arguments)))},s=Math.max(0,e.length-a.length),c=[],u=0;u<s;u++)c.push("$"+u);if(n=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(A),e.prototype){var l=function(){};l.prototype=e.prototype,n.prototype=new l,l.prototype=null}return n}},function(t,e,n){"use strict";var r=n(735),i=n(980),o=n(801),a=n(802),A=n(984),s=i(o);r(s,{getPolyfill:a,implementation:o,shim:A}),t.exports=s},function(t,e,n){"use strict";var r=n(734),i=n(981)("%Function%"),o=i.apply,a=i.call;t.exports=function(){return r.apply(a,arguments)},t.exports.apply=function(){return r.apply(o,arguments)}},function(t,e,n){"use strict";var r=TypeError,i=Object.getOwnPropertyDescriptor;if(i)try{i({},"")}catch(p){i=null}var o=function(){throw new r},a=i?function(){try{return arguments.callee,o}catch(t){try{return i(arguments,"callee").get}catch(e){return o}}}():o,A=n(982)(),s=Object.getPrototypeOf||function(t){return t.__proto__},c=void 0,u="undefined"===typeof Uint8Array?void 0:s(Uint8Array),l={"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"===typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":A?s([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":c&&A&&Symbol.asyncIterator?c[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"===typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"===typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"===typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"===typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"===typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"===typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"===typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"===typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"===typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"===typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"===typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"===typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"===typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?s(s([][Symbol.iterator]())):void 0,"%JSON%":"object"===typeof JSON?JSON:void 0,"%JSONParse%":"object"===typeof JSON?JSON.parse:void 0,"%Map%":"undefined"===typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&A?s((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"===typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"===typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"===typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"===typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"===typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"===typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"===typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"===typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"===typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&A?s((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"===typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"===typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":A?s(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":A?Symbol:void 0,"%SymbolPrototype%":A?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":u,"%TypedArrayPrototype%":u?u.prototype:void 0,"%TypeError%":r,"%TypeErrorPrototype%":r.prototype,"%Uint8Array%":"undefined"===typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"===typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"===typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"===typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"===typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"===typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"===typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"===typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"===typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"===typeof WeakSet?void 0:WeakSet.prototype},g=n(734).call(Function.call,String.prototype.replace),f=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,h=/\\(\\)?/g,d=function(t){var e=[];return g(t,f,(function(t,n,r,i){e[e.length]=r?g(i,h,"$1"):n||t})),e},I=function(t,e){if(!(t in l))throw new SyntaxError("intrinsic "+t+" does not exist!");if("undefined"===typeof l[t]&&!e)throw new r("intrinsic "+t+" exists, but is not available. Please file an issue!");return l[t]};t.exports=function(t,e){if("string"!==typeof t||0===t.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof e)throw new TypeError('"allowMissing" argument must be a boolean');for(var n=d(t),o=I("%"+(n.length>0?n[0]:"")+"%",e),a=1;a<n.length;a+=1)if(null!=o)if(i&&a+1>=n.length){var A=i(o,n[a]);if(!e&&!(n[a]in o))throw new r("base intrinsic for "+t+" exists, but the property is not available.");o=A?A.get||A.value:o[n[a]]}else o=o[n[a]];return o}},function(t,e,n){"use strict";(function(e){var r=e.Symbol,i=n(983);t.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}}).call(this,n(56))},function(t,e,n){"use strict";t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"===typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(t,e,n){"use strict";var r=n(735).supportsDescriptors,i=n(802),o=Object.getOwnPropertyDescriptor,a=Object.defineProperty,A=TypeError,s=Object.getPrototypeOf,c=/a/;t.exports=function(){if(!r||!s)throw new A("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=s(c),n=o(e,"flags");return n&&n.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},function(t,e,n){"use strict";var r=Date.prototype.getDay,i=Object.prototype.toString,o="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;t.exports=function(t){return"object"===typeof t&&null!==t&&(o?function(t){try{return r.call(t),!0}catch(e){return!1}}(t):"[object Date]"===i.call(t))}},function(t,e,n){var r=n(798),i=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:A};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function a(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function A(t,e){return r(t,e,{strict:!0})}i.prototype.compare=function(t,e){if(t.type!==e.type||!a(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=o(t),i=o(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},i.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(t,e,n,r){if(!a(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],o[0])||(o=this.fixStartIndex(o,i))){var A=this.compareCoord(i[n],o[n]);return this.direction||A?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},i.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},i.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},i.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},i.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},i.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},i.prototype.removePseudo=function(t){return t},t.exports=i},function(t,e,n){"use strict";n.r(e);var r=n(460),i=n(461),o=n.n(i),a=n(69),A=n(109),s=n(137);function c(t){switch(t.type){case"Polygon":return o()(t)>1?t:null;case"MultiPolygon":var e=[];if(Object(s.flattenEach)(t,(function(t){o()(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}e.default=function(t,e){var n=Object(A.getGeom)(t),i=Object(A.getGeom)(e),o=t.properties||{};if(n=c(n),i=c(i),!n)return null;if(!i)return Object(a.feature)(n,o);var s=r.diff(n.coordinates,i.coordinates);return 0===s.length?null:1===s.length?Object(a.polygon)(s[0],o):Object(a.multiPolygon)(s,o)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r(this,t),o(this,"geoJson",void 0),o(this,"style",void 0),o(this,"original",void 0),o(this,"metadata",void 0),this.geoJson=e,this.style=n,this.original=i,this.metadata=a}var e,n,a;return e=t,(n=[{key:"getCoords",value:function(){return this.geoJson.geometry.coordinates}}])&&i(e.prototype,n),a&&i(e,a),t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(736),i=A(n(512)),o=n(548),a=A(n(746));function A(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(d,t);var e,n,i,A,s=(e=d,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function d(t){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),e=s.call(this,t),n=l(e),i=void 0,(r="deckCache")in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,e.deckCache=new a.default(t.getData,(function(e){return t.toNebulaFeature(e)})),e.enablePicking=!0,e}return n=d,(i=[{key:"render",value:function(t){t.nebula;var e=[0,0,0,255],n=this.deckCache,i=n.objects,a=n.updateTrigger;return new r.JunctionScatterplotLayer({id:"junctions-".concat(this.id),data:i,opacity:1,fp64:!1,pickable:!0,getPosition:function(t){return t.geoJson.geometry.coordinates},getFillColor:function(t){return(0,o.toDeckColor)(t.style.fillColor)||e},getStrokeColor:function(t){return(0,o.toDeckColor)(t.style.outlineColor)||(0,o.toDeckColor)(t.style.fillColor)||e},getRadius:function(t){return t.style.pointRadiusMeters+t.style.outlineRadiusMeters||1},getInnerRadius:function(t){return t.style.pointRadiusMeters||.5},parameters:{depthTest:!1,blend:!1},updateTriggers:{all:a},nebulaLayer:this})}}])&&c(n.prototype,i),A&&c(n,A),d}(i.default);e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_ARROWS=e.DEFAULT_ARROWS=e.ArrowStyles=void 0;e.ArrowStyles={NONE:0,FORWARD:1,BACKWARD:2,BOTH:3};e.DEFAULT_ARROWS=1;e.MAX_ARROWS=3},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(460),i=n(109),o=n(69);e.default=function(t,e,n){void 0===n&&(n={});var a=i.getGeom(t).coordinates,A=i.getGeom(e).coordinates,s=r.union(a,A);return 0===s.length?null:1===s.length?o.polygon(s[0],n.properties):o.multiPolygon(s,n.properties)}},function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var i=n(69),o=n(109),a=r(n(460));e.default=function t(e,n,r){void 0===r&&(r={});var A=o.getGeom(e),s=o.getGeom(n);if("Polygon"===A.type&&"Polygon"===s.type){var c=a.intersection(A.coordinates,s.coordinates);if(null===c||0===c.length)return null;if(1===c.length){var u=c[0][0][0],l=c[0][0][c[0][0].length-1];return u[0]===l[0]&&u[1]===l[1]?i.polygon(c[0],r.properties):null}return i.multiPolygon(c,r.properties)}if("MultiPolygon"===A.type){for(var g=[],f=0,h=A.coordinates;f<h.length;f++){var d=h[f],I=t(o.getGeom(i.polygon(d)),s);if(I){var p=o.getGeom(I);if("Polygon"===p.type)g.push(p.coordinates);else{if("MultiPolygon"!==p.type)throw new Error("intersection is invalid");g=g.concat(p.coordinates)}}}return 0===g.length?null:1===g.length?i.polygon(g[0],r.properties):i.multiPolygon(g,r.properties)}if("MultiPolygon"===s.type)return t(s,A);throw new Error("poly1 and poly2 must be either polygons or multiPolygons")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69),i=n(109);e.default=function(t,e,n){void 0===n&&(n={});var o=i.getCoord(t),a=i.getCoord(e);a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0;var A=function(t,e,n){var i=n=void 0===n?r.earthRadius:Number(n),o=t[1]*Math.PI/180,a=e[1]*Math.PI/180,A=a-o,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var c=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),u=Math.abs(c)>1e-11?A/c:Math.cos(o);return Math.sqrt(A*A+u*u*s*s)*i}(o,a);return r.convertLength(A,"meters",n.units)}},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function A(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.DuplicateMode=void 0;var l=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(f,t);var e,n,r,l,g=(e=f,function(){var t,n=c(e);if(s()){var r=c(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return A(this,t)});function f(){return i(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"handleStartDragging",value:function(t,e){a(c(f.prototype),"handleStartDragging",this).call(this,t,e),this._geometryBeforeTranslate&&e.onEdit(this.getAddManyFeaturesAction(this._geometryBeforeTranslate,e.data))}},{key:"updateCursor",value:function(t){this._isTranslatable?t.onUpdateCursor("copy"):t.onUpdateCursor(null)}}])&&o(n.prototype,r),l&&o(n,l),f}(n(739).TranslateMode);e.DuplicateMode=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendLineStringMode=void 0;var r=n(155),i=n(330);function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var g=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(f,t);var e,n,r,o,g=(e=f,function(){var t,n=u(e);if(c()){var r=u(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function f(){return a(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"getSingleSelectedLineString",value:function(t){var e=this.getSelectedGeometry(t);return e&&"LineString"===e.type?e:null}},{key:"handleClick",value:function(t,e){var n=e.selectedIndexes,r=this.getSingleSelectedLineString(e);if(r){var o=[r.coordinates.length],a=e.modeConfig;a&&a.drawAtFront&&(o=[0]);var A=n[0],s=new i.ImmutableFeatureCollection(e.data).addPosition(A,o,t.mapCoords).getObject();e.onEdit({updatedData:s,editType:"addPosition",editContext:{featureIndexes:[A],positionIndexes:o,position:t.mapCoords}})}else console.warn("ExtendLineStringMode only supported for single LineString selection")}},{key:"getGuides",value:function(t){var e={type:"FeatureCollection",features:[]},n=this.getSingleSelectedLineString(t);if(!n)return e;var r=t.lastPointerMoveEvent&&t.lastPointerMoveEvent.mapCoords,i=null,o=t.modeConfig;return i=o&&o.drawAtFront?n.coordinates[0]:n.coordinates[n.coordinates.length-1],e.features.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[i,r]}}),e}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell")}}])&&A(n.prototype,r),o&&A(n,o),f}(r.GeoJsonEditMode);e.ExtendLineStringMode=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SplitPolygonMode=void 0;var r=I(n(517)),i=I(n(806)),o=I(n(750)),a=I(n(546)),A=n(69),s=I(n(268)),c=I(n(207)),u=I(n(455)),l=I(n(740)),g=I(n(733)),f=n(230),h=n(155),d=n(330);function I(t){return t&&t.__esModule?t:{default:t}}function p(t){return(p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||v(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||v(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){if(t){if("string"===typeof t)return B(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function E(t,e){return!e||"object"!==p(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Q(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function F(t){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var S=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e)}(v,t);var e,n,h,I,p=(e=v,function(){var t,n=F(e);if(Q()){var r=F(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return E(this,t)});function v(){return m(this,v),p.apply(this,arguments)}return n=v,(h=[{key:"calculateMapCoords",value:function(t,e,n){var r=n.modeConfig;if(!r||!r.lock90Degree||!t.length)return e;if(1===t.length){var i=t[0],o=this.getSelectedGeometry(n),a=(0,l.default)(o),h="FeatureCollection"===a.type?a.features:[a],d=Number.MAX_SAFE_INTEGER,I=null;if(h.forEach((function(t){var e=(0,g.default)(t,i),n=(0,c.default)(e,i);d>n&&(d=n,I=e)})),I){var p=(0,s.default)(i,I),C=(0,c.default)(i,e,{units:"meters"});return(0,u.default)(i,C,p,{units:"meters"}).geometry.coordinates}return e}var v=t[t.length-1],B=y((0,f.generatePointsParallelToLinePoints)(t[t.length-2],v,e),1)[0];return(0,g.default)((0,A.lineString)([v,B]),e).geometry.coordinates}},{key:"getGuides",value:function(t){var e=this.getClickSequence(),n={type:"FeatureCollection",features:[]};if(0===e.length||!t.lastPointerMoveEvent)return n;var r=t.lastPointerMoveEvent.mapCoords;return n.features.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[].concat(C(e),[this.calculateMapCoords(e,r,t)])}}),n}},{key:"handleClick",value:function(t,e){var n=this.getTentativeGuide(e),i=this.getSelectedGeometry(e);if(i){var o=this.getClickSequence();n&&"LineString"===n.geometry.type?o.push(n.geometry.coordinates[n.geometry.coordinates.length-1]):this.addClickSequence(t);var A={type:"Point",coordinates:o[o.length-1]},s=(0,r.default)(A,i);if(o.length>1&&n&&!s){if(this.resetClickSequence(),0===(0,a.default)(n,i).features.length)return;var c=this.splitPolygon(n,e);c&&e.onEdit(c)}}else console.warn("A polygon must be selected for splitting")}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell")}},{key:"splitPolygon",value:function(t,e){var n=this.getSelectedGeometry(e),r=e.selectedIndexes[0],a=e.modeConfig||{},A=a.gap,s=void 0===A?.1:A,c=a.units,u=void 0===c?"centimeters":c;0===s&&(s=.1,u="centimeters");var l=(0,o.default)(t,s,{units:u}),g=(0,i.default)(n,l);if(!g)return console.warn("Canceling edit. Split Polygon erased"),null;var f=g.geometry,h=f.type,I=f.coordinates,p=[];return p="Polygon"===h?I.map((function(t){return[t]})):I.reduce((function(t,e){return e.forEach((function(e){t.push([e])})),t}),[]),{updatedData:new d.ImmutableFeatureCollection(e.data).replaceGeometry(r,{type:"MultiPolygon",coordinates:p}).getObject(),editType:"split",editContext:{featureIndexes:[r]}}}}])&&b(n.prototype,h),I&&b(n,I),v}(h.GeoJsonEditMode);e.SplitPolygonMode=S},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtrudeMode=void 0;var r,i=(r=n(268))&&r.__esModule?r:{default:r},o=n(230),a=n(738),A=n(330);function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?I(t):e}function I(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function C(t){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var B=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(l,t);var e,n,r,a,s=(e=l,function(){var t,n=C(e);if(p()){var r=C(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d(this,t)});function l(){var t;f(this,l);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return v(I(t=s.call.apply(s,[this].concat(n))),"isPointAdded",!1),t}return n=l,(r=[{key:"handleDragging",value:function(t,e){var n=(0,o.getPickedEditHandle)(t.pointerDownPicks);if(n){var r=n.properties.featureIndex,i=n.properties.positionIndexes,a=this.coordinatesSize(i,r,e.data);i=this.isPointAdded?this.nextPositionIndexes(i,a):i;var s=this.getPointForPositionIndexes(this.prevPositionIndexes(i,a),r,e.data),c=this.getPointForPositionIndexes(i,r,e.data);if(s&&c){var l=u((0,o.generatePointsParallelToLinePoints)(s,c,t.mapCoords),2),g=l[0],f=l[1],h=new A.ImmutableFeatureCollection(e.data).replacePosition(r,this.prevPositionIndexes(i,a),f).replacePosition(r,i,g).getObject();e.onEdit({updatedData:h,editType:"extruding",editContext:{featureIndexes:[r],positionIndexes:this.nextPositionIndexes(i,a),position:g}}),t.cancelPan()}}}},{key:"handleStartDragging",value:function(t,e){var n=e.selectedIndexes,r=(0,o.getPickedIntermediateEditHandle)(t.picks);if(n.length&&r){var i=r.properties,a=i.positionIndexes,s=i.featureIndex,c=this.coordinatesSize(a,s,e.data),u=this.getPointForPositionIndexes(this.prevPositionIndexes(a,c),s,e.data),l=this.getPointForPositionIndexes(a,s,e.data);if(u&&l){var g=new A.ImmutableFeatureCollection(e.data);this.isOrthogonal(a,s,c,e.data)||(g=g.addPosition(s,a,l)),this.isOrthogonal(this.prevPositionIndexes(a,c),s,c,e.data)||(g=g.addPosition(s,a,u),this.isPointAdded=!0),e.onEdit({updatedData:g.getObject(),editType:"startExtruding",editContext:{featureIndexes:[s],positionIndexes:a,position:u}})}}}},{key:"handleStopDragging",value:function(t,e){var n=e.selectedIndexes,r=(0,o.getPickedEditHandle)(t.pointerDownPicks);if(n.length&&r){var i=r.properties.featureIndex,a=r.properties.positionIndexes,s=this.coordinatesSize(a,i,e.data);a=this.isPointAdded?this.nextPositionIndexes(a,s):a;var c=this.getPointForPositionIndexes(this.prevPositionIndexes(a,s),i,e.data),l=this.getPointForPositionIndexes(a,i,e.data);if(c&&l){var g=u((0,o.generatePointsParallelToLinePoints)(c,l,t.mapCoords),2),f=g[0],h=g[1],d=new A.ImmutableFeatureCollection(e.data).replacePosition(i,this.prevPositionIndexes(a,s),h).replacePosition(i,a,f).getObject();e.onEdit({updatedData:d,editType:"extruded",editContext:{featureIndexes:[i],positionIndexes:a,position:f}})}}this.isPointAdded=!1}},{key:"coordinatesSize",value:function(t,e,n){var r=n.features,i=0;if(Array.isArray(t)){var o=r[e].geometry.coordinates;if(3===t.length){var a=u(t,2),A=a[0],s=a[1];o.length&&o[A].length&&(i=o[A][s].length)}else{var c=u(t,1)[0];o.length&&o[c].length&&(i=o[c].length)}}return i}},{key:"getBearing",value:function(t,e){var n=(0,i.default)(t,e);return n<0?Math.floor(360+n):Math.floor(n)}},{key:"isOrthogonal",value:function(t,e,n,r){if(!Array.isArray(t))return!1;t[t.length-1]===n-1&&(t[t.length-1]=0);var i=this.getPointForPositionIndexes(this.prevPositionIndexes(t,n),e,r),o=this.getPointForPositionIndexes(this.nextPositionIndexes(t,n),e,r),a=this.getPointForPositionIndexes(t,e,r),A=this.getBearing(a,i),s=this.getBearing(a,o);return[89,90,91,269,270,271].includes(Math.abs(A-s))}},{key:"nextPositionIndexes",value:function(t,e){if(!Array.isArray(t))return[];var n=c(t);return n.length&&(n[n.length-1]=n[n.length-1]===e-1?0:n[n.length-1]+1),n}},{key:"prevPositionIndexes",value:function(t,e){if(!Array.isArray(t))return[];var n=c(t);return n.length&&(n[n.length-1]=0===n[n.length-1]?e-2:n[n.length-1]-1),n}},{key:"getPointForPositionIndexes",value:function(t,e,n){var r,i=n.features;if(Array.isArray(t)){var o=i[e].geometry.coordinates;if(3===t.length){var a=u(t,3),A=a[0],s=a[1],c=a[2];o.length&&o[A].length&&(r=o[A][s][c])}else{var l=u(t,2),g=l[0],f=l[1];o.length&&o[g].length&&(r=o[g][f])}}return r}}])&&h(n.prototype,r),a&&h(n,a),l}(a.ModifyMode);e.ExtrudeMode=B},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ElevationMode=void 0;var r=n(230);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function A(t,e,n){return(A="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function s(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t){var e=t.pointerDownScreenCoords,n=t.screenCoords;return 10*(e[1]-n[1])}var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(d,t);var e,n,i,f,h=(e=d,function(){var t,n=u(e);if(c()){var r=u(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function d(){return o(this,d),h.apply(this,arguments)}return n=d,f=[{key:"calculateElevationChangeWithViewport",value:function(t,e){var n=e.pointerDownScreenCoords,r=e.screenCoords;return 156543.03392*Math.cos(t.latitude*Math.PI/180)/Math.pow(2,t.zoom)*(n[1]-r[1])/2}}],(i=[{key:"makeElevatedEvent",value:function(t,e,n){var r=n.modeConfig||{},i=r.minElevation,o=void 0===i?0:i,a=r.maxElevation,A=void 0===a?2e4:a,s=r.calculateElevationChange,c=void 0===s?g:s;if(!t.pointerDownScreenCoords)return t;var u=3===e.length?e[2]:0;return u+=c({pointerDownScreenCoords:t.pointerDownScreenCoords,screenCoords:t.screenCoords}),u=Math.min(u,A),u=Math.max(u,o),Object.assign({},t,{mapCoords:[e[0],e[1],u]})}},{key:"handlePointerMove",value:function(t,e){var n=(0,r.getPickedEditHandle)(t.pointerDownPicks),i=n?n.geometry.coordinates:t.mapCoords;A(u(d.prototype),"handlePointerMove",this).call(this,this.makeElevatedEvent(t,i,e),e)}},{key:"handleStopDragging",value:function(t,e){var n=(0,r.getPickedEditHandle)(t.picks),i=n?n.geometry.coordinates:t.mapCoords;A(u(d.prototype),"handleStopDragging",this).call(this,this.makeElevatedEvent(t,i,e),e)}},{key:"getCursor",value:function(t){var e=A(u(d.prototype),"getCursor",this).call(this,t);return"cell"===e&&(e="ns-resize"),e}}])&&a(n.prototype,i),f&&a(n,f),d}(n(738).ModifyMode);e.ElevationMode=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransformMode=void 0;var r=n(69),i=n(739),o=n(809),a=n(810);function A(t){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return(l="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function g(t,e){return!e||"object"!==A(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var I=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(C,t);var e,n,A,I,p=(e=C,function(){var t,n=h(e);if(f()){var r=h(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return g(this,t)});function C(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,C),p.call(this,[new i.TranslateMode,new o.ScaleMode,new a.RotateMode])}return n=C,(A=[{key:"handlePointerMove",value:function(t,e){var n=null;l(h(C.prototype),"handlePointerMove",this).call(this,t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{onUpdateCursor:function(t){n=t||n}})),e.onUpdateCursor(n)}},{key:"handleStartDragging",value:function(t,e){var n=null,r=null,a=[];this._modes.forEach((function(t){t instanceof i.TranslateMode?r=t:(t instanceof o.ScaleMode&&(n=t),a.push(t))})),n instanceof o.ScaleMode&&!n.isEditHandleSelected()&&a.push(r),a.filter(Boolean).forEach((function(n){return n.handleStartDragging(t,e)}))}},{key:"getGuides",value:function(t){var e=l(h(C.prototype),"getGuides",this).call(this,t),n=(this._modes||[]).find((function(t){return t instanceof a.RotateMode}));if(n instanceof a.RotateMode){var i=e.features.filter((function(t){var e=t.properties||{},r=e.editHandleType,i=[e.mode];return n.getIsRotating()&&i.push(r),!i.includes("scale")}));e=(0,r.featureCollection)(i)}return e}}])&&u(n.prototype,A),I&&u(n,I),C}(n(811).CompositeMode);e.TransformMode=I},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function A(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.DrawPointMode=void 0;var l=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(f,t);var e,n,r,l,g=(e=f,function(){var t,n=c(e);if(s()){var r=c(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return A(this,t)});function f(){return i(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"createTentativeFeature",value:function(t){var e=t.lastPointerMoveEvent;return{type:"Feature",properties:{guideType:"tentative"},geometry:{type:"Point",coordinates:(e?[e.mapCoords]:[])[0]}}}},{key:"handleClick",value:function(t,e){var n={type:"Point",coordinates:t.mapCoords};e.onEdit(this.getAddFeatureAction(n,e.data))}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell"),a(c(f.prototype),"handlePointerMove",this).call(this,t,e)}}])&&o(n.prototype,r),l&&o(n,l),f}(n(155).GeoJsonEditMode);e.DrawPointMode=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawLineStringMode=void 0;var r=n(230);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(h,t);var e,n,i,a,f=(e=h,function(){var t,n=l(e);if(u()){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return c(this,t)});function h(){return A(this,h),f.apply(this,arguments)}return n=h,(i=[{key:"handleClick",value:function(t,e){var n=t.picks,i=(0,r.getPickedEditHandle)(n),a=!1;i||(this.addClickSequence(t),a=!0);var A=this.getClickSequence();if(A.length>1&&i&&Array.isArray(i.properties.positionIndexes)&&i.properties.positionIndexes[0]===A.length-1){var s={type:"LineString",coordinates:o(A)};this.resetClickSequence();var c=this.getAddFeatureAction(s,e.data);c&&e.onEdit(c)}else a&&e.onEdit({updatedData:e.data,editType:"addTentativePosition",editContext:{position:t.mapCoords}})}},{key:"handleKeyUp",value:function(t,e){if("Enter"===t.key){var n=this.getClickSequence();if(n.length>1){var r={type:"LineString",coordinates:o(n)};this.resetClickSequence();var i=this.getAddFeatureAction(r,e.data);i&&e.onEdit(i)}}}},{key:"getGuides",value:function(t){var e,n,r=t.lastPointerMoveEvent,i=this.getClickSequence(),a=r?[r.mapCoords]:[],A={type:"FeatureCollection",features:[]};i.length>0&&(n={type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[].concat(o(i),a)}}),n&&A.features.push(n);var s=i.map((function(t,e){return{type:"Feature",properties:{guideType:"editHandle",editHandleType:"existing",featureIndex:-1,positionIndexes:[e]},geometry:{type:"Point",coordinates:t}}}));return(e=A.features).push.apply(e,o(s)),A}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell")}}])&&s(n.prototype,i),a&&s(n,a),h}(n(155).GeoJsonEditMode);e.DrawLineStringMode=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawRectangleMode=void 0;var r,i=(r=n(511))&&r.__esModule?r:{default:r};function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var g=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(f,t);var e,n,r,o,g=(e=f,function(){var t,n=u(e);if(c()){var r=u(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function f(){return a(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"getTwoClickPolygon",value:function(t,e,n){var r=(0,i.default)([t[0],t[1],e[0],e[1]]);return r.properties=r.properties||{},r.properties.shape="Rectangle",r}}])&&A(n.prototype,r),o&&A(n,o),f}(n(547).TwoClickPolygonMode);e.DrawRectangleMode=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawCircleByDiameterMode=void 0;var r=a(n(812)),i=a(n(207)),o=n(155);function a(t){return t&&t.__esModule?t:{default:t}}function A(t){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==A(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var h=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(d,t);var e,n,a,A,h=(e=d,function(){var t,n=g(e);if(l()){var r=g(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function d(){return s(this,d),h.apply(this,arguments)}return n=d,(a=[{key:"getTwoClickPolygon",value:function(t,e,n){var a=(n||{}).steps,A=void 0===a?64:a,s={steps:A};A<4&&(console.warn("Minimum steps to draw a circle is 4 "),s.steps=4);var c=(0,o.getIntermediatePosition)(t,e),u=Math.max((0,i.default)(t,c),.001),l=(0,r.default)(c,u,s);return l.properties=l.properties||{},l.properties.shape="Circle",l}}])&&c(n.prototype,a),A&&c(n,A),d}(n(547).TwoClickPolygonMode);e.DrawCircleByDiameterMode=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawCircleFromCenterMode=void 0;var r=o(n(812)),i=o(n(207));function o(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(h,t);var e,n,o,a,f=(e=h,function(){var t,n=l(e);if(u()){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return c(this,t)});function h(){return A(this,h),f.apply(this,arguments)}return n=h,(o=[{key:"getTwoClickPolygon",value:function(t,e,n){var o=(n||{}).steps,a=void 0===o?64:o,A={steps:a};a<4&&(console.warn("Minimum steps to draw a circle is 4 "),A.steps=4);var s=Math.max((0,i.default)(t,e),.001),c=(0,r.default)(t,s,A);return c.properties=c.properties||{},c.properties.shape="Circle",c}}])&&s(n.prototype,o),a&&s(n,a),h}(n(547).TwoClickPolygonMode);e.DrawCircleFromCenterMode=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawEllipseByBoundingBoxMode=void 0;var r=s(n(511)),i=s(n(207)),o=s(n(831)),a=n(69),A=n(155);function s(t){return t&&t.__esModule?t:{default:t}}function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e){return!e||"object"!==c(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var I=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(p,t);var e,n,s,c,I=(e=p,function(){var t,n=h(e);if(f()){var r=h(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return g(this,t)});function p(){return u(this,p),I.apply(this,arguments)}return n=p,(s=[{key:"getTwoClickPolygon",value:function(t,e,n){var s=Math.min(t[0],e[0]),c=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),l=Math.max(t[1],e[1]),g=(0,r.default)([s,c,u,l]).geometry.coordinates[0],f=(0,A.getIntermediatePosition)(t,e),h=Math.max((0,i.default)((0,a.point)(g[0]),(0,a.point)(g[1])),.001),d=Math.max((0,i.default)((0,a.point)(g[0]),(0,a.point)(g[3])),.001);return(0,o.default)(f,h,d)}}])&&l(n.prototype,s),c&&l(n,c),p}(n(547).TwoClickPolygonMode);e.DrawEllipseByBoundingBoxMode=I},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawEllipseUsingThreePointsMode=void 0;var r=s(n(207)),i=s(n(831)),o=s(n(268)),a=n(69),A=n(155);function s(t){return t&&t.__esModule?t:{default:t}}function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e){return!e||"object"!==c(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var I=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(p,t);var e,n,s,c,I=(e=p,function(){var t,n=h(e);if(f()){var r=h(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return g(this,t)});function p(){return u(this,p),I.apply(this,arguments)}return n=p,(s=[{key:"getThreeClickPolygon",value:function(t,e,n,s){var c=(0,A.getIntermediatePosition)(t,e),u=Math.max((0,r.default)(c,(0,a.point)(n)),.001),l=Math.max((0,r.default)(t,e),.001)/2,g={angle:(0,o.default)(t,e)};return(0,i.default)(c,u,l,g)}}])&&l(n.prototype,s),c&&l(n,c),p}(n(813).ThreeClickPolygonMode);e.DrawEllipseUsingThreePointsMode=I},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawRectangleUsingThreePointsMode=void 0;var r=n(230);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(h,t);var e,n,i,a,f=(e=h,function(){var t,n=l(e);if(u()){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return c(this,t)});function h(){return A(this,h),f.apply(this,arguments)}return n=h,(i=[{key:"getThreeClickPolygon",value:function(t,e,n,i){var a=o((0,r.generatePointsParallelToLinePoints)(t,e,n),2);return{type:"Feature",properties:{shape:"Rectangle"},geometry:{type:"Polygon",coordinates:[[t,e,a[0],a[1],t]]}}}}])&&s(n.prototype,i),a&&s(n,a),h}(n(813).ThreeClickPolygonMode);e.DrawRectangleUsingThreePointsMode=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Draw90DegreePolygonMode=void 0;var r=c(n(455)),i=c(n(268)),o=c(n(546)),a=c(n(207)),A=n(69),s=n(230);function c(t){return t&&t.__esModule?t:{default:t}}function u(t){return(u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||f(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){if(t){if("string"===typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return(p="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=v(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function C(t,e){return!e||"object"!==u(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function y(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function B(t,e){return(B=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var m=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&B(t,e)}(h,t);var e,n,c,u,f=(e=h,function(){var t,n=v(e);if(y()){var r=v(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return C(this,t)});function h(){return d(this,h),f.apply(this,arguments)}return n=h,(c=[{key:"createTentativeFeature",value:function(t){var e,n=this.getClickSequence(),r=t.lastPointerMoveEvent.mapCoords;if(1===n.length)e=r;else{var i=n[n.length-2],o=n[n.length-1];e=g((0,s.generatePointsParallelToLinePoints)(i,o,r),1)[0]}return n.length<3?{type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[].concat(l(n),[e])}}:{type:"Feature",properties:{guideType:"tentative"},geometry:{type:"Polygon",coordinates:[[].concat(l(n),[e,n[0]])]}}}},{key:"getGuides",value:function(t){var e={type:"FeatureCollection",features:[]};if(0===this.getClickSequence().length||!t.lastPointerMoveEvent)return e;var n=this.createTentativeFeature(t);return e.features.push(n),e.features=e.features.concat((0,s.getEditHandlesForGeometry)(n.geometry,-1)),e.features=e.features.slice(0,-1),e}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell"),p(v(h.prototype),"handlePointerMove",this).call(this,t,e)}},{key:"handleClick",value:function(t,e){var n=t.picks,r=this.getTentativeGuide(e);this.addClickSequence(t);var i=this.getClickSequence();if(r){if(3===i.length&&"LineString"===r.geometry.type){var o=r.geometry;i[i.length-1]=o.coordinates[o.coordinates.length-1]}else if(i.length>3&&"Polygon"===r.geometry.type){var a=r.geometry;i[i.length-1]=a.coordinates[0][a.coordinates[0].length-2];var A=(0,s.getPickedEditHandle)(n);if(A&&Array.isArray(A.properties.positionIndexes)&&(0===A.properties.positionIndexes[1]||A.properties.positionIndexes[1]===a.coordinates[0].length-3)){var c={type:"Polygon",coordinates:this.finalizedCoordinates(l(a.coordinates[0]))};this.resetClickSequence();var u=this.getAddFeatureOrBooleanPolygonAction(c,e);u&&e.onEdit(u)}}var g={screenCoords:[-1,-1],mapCoords:t.mapCoords,picks:[],pointerDownPicks:null,pointerDownScreenCoords:null,pointerDownMapCoords:null,cancelPan:function(){},sourceEvent:null};this.handlePointerMove(g,e)}}},{key:"finalizedCoordinates",value:function(t){var e=[[].concat(l(t.slice(0,-2)),[t[0]])],n=this.getIntermediatePoint(l(t));if(n)e=[[].concat(l(t.slice(0,-2)),[n,t[0]])];else{var r=l(t);r.splice(-3,1),(n=this.getIntermediatePoint(l(r)))&&(e=[[].concat(l(t.slice(0,-3)),[n,t[0]])])}return e}},{key:"getIntermediatePoint",value:function(t){var e;if(t.length>4){var n=l(t),s=n[0],c=n[1],u=(0,i.default)(s,c),g=t[t.length-3],f=t[t.length-4],h=(0,i.default)(g,f),d={first:[],second:[]};[1,2,3].forEach((function(t){var e=u+90*t;d.first.push(e>180?e-360:e);var n=h+90*t;d.second.push(n>180?n-360:n)}));var I=(0,a.default)((0,A.point)(s),(0,A.point)(g));[0,1,2].forEach((function(t){var n=(0,A.lineString)([s,(0,r.default)(s,I,d.first[t]).geometry.coordinates]);[0,1,2].forEach((function(t){var i=(0,A.lineString)([g,(0,r.default)(g,I,d.second[t]).geometry.coordinates]),a=(0,o.default)(n,i);a&&a.features.length&&(e=a.features[0].geometry.coordinates)}))}))}return e}}])&&I(n.prototype,c),u&&I(n,u),h}(n(155).GeoJsonEditMode);e.Draw90DegreePolygonMode=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawPolygonByDraggingMode=void 0;var r,i=(r=n(1010))&&r.__esModule?r:{default:r},o=n(230);function a(t){return(a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?g(t):e}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(p,t);var e,n,r,a,s=(e=p,function(){var t,n=h(e);if(f()){var r=h(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return l(this,t)});function p(){var t;c(this,p);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return I(g(t=s.call.apply(s,[this].concat(n))),"handleDraggingThrottled",null),t}return n=p,(r=[{key:"handleClick",value:function(t,e){}},{key:"handleStartDragging",value:function(t,e){t.cancelPan(),e.modeConfig&&e.modeConfig.throttleMs?this.handleDraggingThrottled=(0,i.default)(this.handleDraggingAux,e.modeConfig.throttleMs):this.handleDraggingThrottled=this.handleDraggingAux}},{key:"handleStopDragging",value:function(t,e){this.addClickSequence(t);var n=this.getClickSequence();if(this.handleDraggingThrottled&&this.handleDraggingThrottled.cancel&&this.handleDraggingThrottled.cancel(),n.length>2){var r={type:"Polygon",coordinates:[[].concat(A(n),[n[0]])]};this.resetClickSequence();var i=this.getAddFeatureOrBooleanPolygonAction(r,e);i&&e.onEdit(i)}}},{key:"handleDraggingAux",value:function(t,e){var n=t.picks;(0,o.getPickedEditHandle)(n)||this.addClickSequence(t)}},{key:"handleDragging",value:function(t,e){this.handleDraggingThrottled&&this.handleDraggingThrottled(t,e)}}])&&u(n.prototype,r),a&&u(n,a),p}(n(741).DrawPolygonMode);e.DrawPolygonByDraggingMode=p},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,A="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,c=A||s||Function("return this")(),u=Object.prototype.toString,l=Math.max,g=Math.min,f=function(){return c.Date.now()};function h(t,e,n){var r,i,o,a,A,s,c=0,u=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function C(e){var n=r,o=i;return r=i=void 0,c=e,a=t.apply(o,n)}function y(t){return c=t,A=setTimeout(B,e),u?C(t):a}function v(t){var n=t-s;return void 0===s||n>=e||n<0||h&&t-c>=o}function B(){var t=f();if(v(t))return m(t);A=setTimeout(B,function(t){var n=e-(t-s);return h?g(n,o-(t-c)):n}(t))}function m(t){return A=void 0,p&&r?C(t):(r=i=void 0,a)}function b(){var t=f(),n=v(t);if(r=arguments,i=this,s=t,n){if(void 0===A)return y(s);if(h)return A=setTimeout(B,e),C(s)}return void 0===A&&(A=setTimeout(B,e)),a}return e=I(e)||0,d(n)&&(u=!!n.leading,o=(h="maxWait"in n)?l(I(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==A&&clearTimeout(A),c=0,r=s=i=A=void 0},b.flush=function(){return void 0===A?a:m(f())},b}function d(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function I(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==u.call(t)}(t))return NaN;if(d(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=d(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var A=i.test(t);return A||o.test(t)?a(t.slice(2),A?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return d(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),h(t,e,{leading:r,maxWait:e,trailing:i})}}).call(this,n(56))},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ViewMode=void 0;var c=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e,n=(e=r,function(){var t,n=A(e);if(a()){var r=A(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return o(this,t)});function r(){return i(this,r),n.apply(this,arguments)}return r}(n(155).GeoJsonEditMode);e.ViewMode=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureDistanceMode=void 0;var r=a(n(207)),i=a(n(742)),o=n(155);function a(t){return t&&t.__esModule?t:{default:t}}function A(t){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==A(e)&&"function"!==typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=[],p=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(p,t);var e,n,o,a,A=(e=p,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function p(){var t;s(this,p);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return d(l(t=A.call.apply(A,[this].concat(n))),"startingPoint",null),d(l(t),"endingPoint",null),d(l(t),"endingPointLocked",!1),d(l(t),"_getTooltips",(0,i.default)((function(t){var e=t.modeConfig,n=t.startingPoint,i=t.endingPoint,o=I;if(n&&i){var a,A=e||{},s=A.formatTooltip,c=A.turfOptions,u=A.measurementCallback,l=c&&c.units||"kilometers",g=(0,r.default)(n,i,c);a=s?s(g):"".concat(parseFloat(g).toFixed(2)," ").concat(l),u&&u(g),o=[{position:i.geometry.coordinates,text:a}]}return o}))),t}return n=p,(o=[{key:"_setEndingPoint",value:function(t){this.endingPoint={type:"Feature",properties:{guideType:"editHandle",editHandleType:"existing",featureIndex:-1,positionIndexes:[]},geometry:{type:"Point",coordinates:t}}}},{key:"handleClick",value:function(t,e){!this.startingPoint||this.endingPointLocked?(this.startingPoint={type:"Feature",properties:{guideType:"editHandle",editHandleType:"existing",featureIndex:-1,positionIndexes:[]},geometry:{type:"Point",coordinates:t.mapCoords}},this.endingPoint=null,this.endingPointLocked=!1):this.startingPoint&&(this._setEndingPoint(t.mapCoords),this.endingPointLocked=!0)}},{key:"handlePointerMove",value:function(t,e){this.startingPoint&&!this.endingPointLocked&&this._setEndingPoint(t.mapCoords),e.onUpdateCursor("cell")}},{key:"getGuides",value:function(t){var e={type:"FeatureCollection",features:[]},n=e.features;return this.startingPoint&&n.push(this.startingPoint),this.endingPoint&&n.push(this.endingPoint),this.startingPoint&&this.endingPoint&&n.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[this.startingPoint.geometry.coordinates,this.endingPoint.geometry.coordinates]}}),e}},{key:"getTooltips",value:function(t){return this._getTooltips({modeConfig:t.modeConfig,startingPoint:this.startingPoint,endingPoint:this.endingPoint})}}])&&c(n.prototype,o),a&&c(n,a),p}(o.GeoJsonEditMode);e.MeasureDistanceMode=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureAreaMode=void 0;var r=a(n(461)),i=a(n(394)),o=n(741);function a(t){return t&&t.__esModule?t:{default:t}}function A(t){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e,n){return(g="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function f(t,e){return!e||"object"!==A(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function I(t,e){return(I=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var p=[],C=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&I(t,e)}(C,t);var e,n,o,a,A=(e=C,function(){var t,n=d(e);if(h()){var r=d(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return f(this,t)});function C(){return u(this,C),A.apply(this,arguments)}return n=C,(o=[{key:"handleClick",value:function(t,e){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{onEdit:function(){}});g(d(C.prototype),"handleClick",this).call(this,t,n)}},{key:"getTooltips",value:function(t){var e=this.getTentativeGuide(t);if(e&&"Polygon"===e.geometry.type){var n,o=t.modeConfig||{},a=o.formatTooltip,A=o.measurementCallback,s=(0,i.default)(e),c=(0,r.default)(e);return n=a?a(c):"".concat(parseFloat(c).toFixed(2)," ").concat("sq. m"),A&&A(c),[{position:s.geometry.coordinates,text:n}]}return p}}])&&l(n.prototype,o),a&&l(n,a),C}(o.DrawPolygonMode);e.MeasureAreaMode=C},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureAngleMode=void 0;var r=A(n(268)),i=A(n(1015)),o=A(n(742)),a=n(155);function A(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y=[],v=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(u,t);var e,n,a,A,s=(e=u,function(){var t,n=I(e);if(d()){var r=I(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return f(this,t)});function u(){var t;l(this,u);for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return C(h(t=s.call.apply(s,[this].concat(n))),"_getTooltips",(0,o.default)((function(t){var e=t.modeConfig,n=t.vertex,o=t.point1,a=t.point2,A=y;if(n&&o&&a){var s,c=e||{},u=c.formatTooltip,l=c.measurementCallback,g=(0,r.default)(n,o),f=(0,r.default)(n,a),h=Math.abs(g-f);h>180&&(h=360-h),s=u?u(h):"".concat(parseFloat(h).toFixed(2)," ").concat("deg"),l&&l(h),A=[{position:(0,i.default)({type:"FeatureCollection",features:[o,a].map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:t}}}))}).geometry.coordinates,text:s}]}return A}))),t}return n=u,(a=[{key:"handleClick",value:function(t,e){this.getClickSequence().length>=3&&this.resetClickSequence(),this.addClickSequence(t)}},{key:"handlePointerMove",value:function(t,e){e.onUpdateCursor("cell")}},{key:"getPoints",value:function(t){var e=this.getClickSequence(),n=c(e);return e.length<3&&t.lastPointerMoveEvent&&n.push(t.lastPointerMoveEvent.mapCoords),n}},{key:"getGuides",value:function(t){var e={type:"FeatureCollection",features:[]},n=e.features,r=this.getPoints(t);return r.length>2?n.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[r[1],r[0],r[2]]}}):r.length>1&&n.push({type:"Feature",properties:{guideType:"tentative"},geometry:{type:"LineString",coordinates:[r[1],r[0]]}}),e}},{key:"getTooltips",value:function(t){var e=this.getPoints(t);return this._getTooltips({modeConfig:t.modeConfig,vertex:e[0],point1:e[1],point2:e[2]})}}])&&g(n.prototype,a),A&&g(n,A),u}(a.GeoJsonEditMode);e.MeasureAngleMode=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(390),i=n(69);e.default=function(t,e){void 0===e&&(e={});var n=r.default(t),o=(n[0]+n[2])/2,a=(n[1]+n[3])/2;return i.point([o,a],e.properties,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SnappableMode=void 0;var r=n(230);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function(t){if(Array.isArray(t))return A(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"===typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==i(e)&&"function"!==typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(p,t);var e,n,i,A,I=(e=p,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function p(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),d(l(e=I.call(this)),"_handler",void 0),e._handler=t,e}return n=p,(i=[{key:"_getSnappedMouseEvent",value:function(t,e,n){return Object.assign(t,{mapCoords:n.geometry.coordinates,pointerDownMapCoords:e&&e.geometry.coordinates})}},{key:"_getPickedSnapTarget",value:function(t){return(0,r.getPickedEditHandles)(t).find((function(t){return"snap-target"===t.properties.editHandleType}))}},{key:"_getPickedSnapSource",value:function(t){return(0,r.getPickedSnapSourceEditHandle)(t)}},{key:"_getUpdatedSnapSourceHandle",value:function(t,e){var n=t.properties,r=n.featureIndex,i=n.positionIndexes;if(!Array.isArray(i))return t;var o=e.features[r];return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{geometry:{type:"Point",coordinates:i.reduce((function(t,e){return t[e]}),o.geometry.coordinates)}})}},{key:"_getSnapTargets",value:function(t){var e=(t.modeConfig||{}).additionalSnapTargets;return e=e||[],[].concat(o(t.data.features),o(e))}},{key:"_getSnapTargetHandles",value:function(t){for(var e=[],n=this._getSnapTargets(t),i=0;i<n.length;i++)if(!t.selectedIndexes.includes(i)){var a=n[i].geometry;e.push.apply(e,o((0,r.getEditHandlesForGeometry)(a,i,"snap-target")))}return e}},{key:"getGuides",value:function(t){var e=t.modeConfig,n=t.lastPointerMoveEvent,i=(e||{}).enableSnapping,A={type:"FeatureCollection",features:o(this._handler.getGuides(t).features)};if(!i)return A;var s,c=n&&this._getPickedSnapSource(n.pointerDownPicks);if(c)return(s=A.features).push.apply(s,o(this._getSnapTargetHandles(t)).concat([this._getUpdatedSnapSourceHandle(c,t.data)])),A;var u,l=t.data.features,g=function(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=a(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,A=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){A=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(A)throw i}}}}(t.selectedIndexes);try{for(g.s();!(u=g.n()).done;){var f=u.value;if(f<l.length){var h,d=l[f].geometry;(h=A.features).push.apply(h,o((0,r.getEditHandlesForGeometry)(d,f,"snap-source")))}}}catch(I){g.e(I)}finally{g.f()}return A}},{key:"_getSnapAwareEvent",value:function(t,e){var n=this._getPickedSnapSource(e.lastPointerMoveEvent.pointerDownPicks),r=this._getPickedSnapTarget(t.picks);return n&&r?this._getSnappedMouseEvent(t,n,r):t}},{key:"handleStartDragging",value:function(t,e){this._handler.handleStartDragging(t,e)}},{key:"handleStopDragging",value:function(t,e){this._handler.handleStopDragging(this._getSnapAwareEvent(t,e),e)}},{key:"handleDragging",value:function(t,e){this._handler.handleDragging(this._getSnapAwareEvent(t,e),e)}},{key:"handlePointerMove",value:function(t,e){this._handler.handlePointerMove(this._getSnapAwareEvent(t,e),e)}}])&&c(n.prototype,i),A&&c(n,A),p}(n(155).GeoJsonEditMode);e.SnappableMode=I},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(710),i=n(376),o=n(232),a=s(n(737)),A=s(n(814));function s(t){return t&&t.__esModule?t:{default:t}}function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e,n){return(h="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function d(t,e){return!e||"object"!==c(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function I(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t,e){return(C=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){B(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function B(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m=i.ViewMode,b={type:"FeatureCollection",features:[]},E=v({mode:m},a.default.defaultProps,{data:[],selectedIndexes:[],filled:!1,stroked:!0,lineWidthScale:1,lineWidthMinPixels:1,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineWidthUnits:"pixels",getHexagons:function(t){return t.hexIds},getEditedCluster:function(t,e){return e?v({},e,{hexIds:t}):{hexIds:t}},resolution:9}),Q=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)}(c,t);var e,n,i,A,s=(e=c,function(){var t,n=p(e);if(I()){var r=p(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d(this,t)});function c(){return g(this,c),s.apply(this,arguments)}return n=c,(i=[{key:"initializeState",value:function(){h(p(c.prototype),"initializeState",this).call(this),this.setState({tentativeHexagonIDs:[]})}},{key:"getDerivedHexagonIDs",value:function(t){return(0,o.polyfill)(t,this.props.resolution,!0)}},{key:"getDerivedHexagonID",value:function(t){return(0,o.geoToH3)(t[1],t[0],this.props.resolution)}},{key:"renderLayers",value:function(){var t=this;return[new a.default(this.getSubLayerProps({id:"editable-geojson",mode:this.props.mode,data:b,selectedFeatureIndexes:[],onEdit:function(e){var n=e.editType,r=e.editContext;switch(n){case"updateTentativeFeature":if("Polygon"===r.feature.geometry.type){var i=r.feature.geometry.coordinates,o=t.getDerivedHexagonIDs(i);t.setState({tentativeHexagonIDs:o})}else if("Point"===r.feature.geometry.type){var a=r.feature.geometry.coordinates,A=t.getDerivedHexagonID(a);t.setState({tentativeHexagonIDs:[A]})}break;case"addFeature":var s=u(t.props.data),c=t.props.modeConfig;if(c&&c.booleanOperation)if(1!==t.props.selectedIndexes.length)console.warn("booleanOperation only supported for single cluster selection");else{var l,g=new Set(t.getSelectedHexIDs()),f=new Set(t.state.tentativeHexagonIDs);switch(c.booleanOperation){case"union":default:l=u(new Set([].concat(u(g),u(f))));break;case"intersection":l=u(g).filter((function(t){return f.has(t)}));break;case"difference":l=u(g).filter((function(t){return!f.has(t)}))}var h=t.props.selectedIndexes[0],d=t.props.data[h];s[h]=t.props.getEditedCluster(l,d)}else s.push(t.props.getEditedCluster(t.state.tentativeHexagonIDs,null));t.setState({tentativeHexagonIDs:[]}),t.props.onEdit({updatedData:s})}}})),new r.H3ClusterLayer(this.getSubLayerProps({id:"hexagons",data:this.props.data,getHexagons:this.props.getHexagons})),new r.H3ClusterLayer(this.getSubLayerProps({id:"tentative-hexagons",data:[{hexIds:this.state.tentativeHexagonIDs}],getHexagons:function(t){return t.hexIds}}))]}},{key:"getSelectedHexIDs",value:function(){var t=this,e=[];return this.props.selectedIndexes.forEach((function(n){var r=t.props.data[n],i=t.props.getHexagons(r);e=e.concat(i)})),e}},{key:"getCursor",value:function(t){var e=t.isDragging,n=this.state.cursor;return n||(n=e?"grabbing":"grab"),n}}])&&f(n.prototype,i),A&&f(n,A),c}(A.default);e.default=Q,B(Q,"layerName","EditableH3ClusterLayer"),B(Q,"defaultProps",E)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SELECTION_TYPE=void 0;var r,i=n(59),o=n(142),a=n(69),A=l(n(750)),s=l(n(1019)),c=n(376),u=l(n(737));function l(t){return t&&t.__esModule?t:{default:t}}function g(t){return(g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){Q(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"===typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function B(t,e){return!e||"object"!==g(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function m(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F={NONE:null,RECTANGLE:"rectangle",POLYGON:"polygon"};e.SELECTION_TYPE=F;var w=(Q(r={},F.RECTANGLE,c.DrawRectangleMode),Q(r,F.POLYGON,c.DrawPolygonMode),r),S=Q({},F.RECTANGLE,{dragToDraw:!0}),R={selectionType:F.RECTANGLE,layerIds:[],onSelect:function(){}},U={type:"FeatureCollection",features:[]},x=["lineWidthScale","lineWidthMinPixels","lineWidthMaxPixels","lineWidthUnits","lineJointRounded","lineMiterLimit","pointRadiusScale","pointRadiusMinPixels","pointRadiusMaxPixels","lineDashJustified","getLineColor","getFillColor","getRadius","getLineWidth","getLineDashArray","getTentativeLineDashArray","getTentativeLineColor","getTentativeFillColor","getTentativeLineWidth"],k=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E(t,e)}(g,t);var e,n,r,i,l=(e=g,function(){var t,n=b(e);if(m()){var r=b(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return B(this,t)});function g(){return y(this,g),l.apply(this,arguments)}return n=g,(r=[{key:"_selectRectangleObjects",value:function(t){var e=this.props,n=e.layerIds,r=e.onSelect,i=I(this.context.viewport.project(t[0][0]),2),o=i[0],a=i[1],A=I(this.context.viewport.project(t[0][2]),2),s=A[0],c=A[1];r({pickingInfos:this.context.deck.pickObjects({x:Math.min(o,s),y:Math.min(a,c),width:Math.abs(s-o),height:Math.abs(c-a),layerIds:n})})}},{key:"_selectPolygonObjects",value:function(t){var e,n=this,r=this.props,i=r.layerIds,o=r.onSelect,c=t[0].map((function(t){return n.context.viewport.project(t)})),u=c.map((function(t){return t[0]})),l=c.map((function(t){return t[1]})),g=Math.min.apply(Math,d(u)),f=Math.min.apply(Math,d(l)),h=Math.max.apply(Math,d(u)),I=Math.max.apply(Math,d(l)),p=(0,a.polygon)(t),C=(0,A.default)(p,50);try{e=(0,s.default)(C,p)}catch(v){return void console.log("turfDifference() error",v)}this.setState({pendingPolygonSelection:{bigPolygon:e}});var y="".concat(this.props.id,"-").concat("selection-blocker");setTimeout((function(){var t=n.context.deck.pickObjects({x:g,y:f,width:h-g,height:I-f,layerIds:[y].concat(d(i))});o({pickingInfos:t.filter((function(t){return t.layer.id!==n.props.id}))})}),250)}},{key:"renderLayers",value:function(){var t=this,e=this.state.pendingPolygonSelection,n=w[this.props.selectionType]||c.ViewMode,r=S[this.props.selectionType],i={};x.forEach((function(e){void 0!==t.props[e]&&(i[e]=t.props[e])}));var a=[new u.default(this.getSubLayerProps(h({id:"selection-geojson",pickable:!0,mode:n,modeConfig:r,selectedFeatureIndexes:[],data:U,onEdit:function(e){var n=e.updatedData;if("addFeature"===e.editType){var r=n.features[0].geometry.coordinates;t.props.selectionType===F.RECTANGLE?t._selectRectangleObjects(r):t.props.selectionType===F.POLYGON&&t._selectPolygonObjects(r)}}},i)))];if(e){var A=e.bigPolygon;a.push(new o.PolygonLayer(this.getSubLayerProps({id:"selection-blocker",pickable:!0,stroked:!1,opacity:1,data:[A],getLineColor:function(t){return[0,0,0,1]},getFillColor:function(t){return[0,0,0,1]},getPolygon:function(t){return t.geometry.coordinates}})))}return a}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags,n=e.stateChanged,r=e.propsOrDataChanged;return n||r}}])&&v(n.prototype,r),i&&v(n,i),g}(i.CompositeLayer);e.default=k,Q(k,"layerName","SelectionLayer"),Q(k,"defaultProps",R)},function(t,e,n){"use strict";function r(t){return t&&"object"===typeof t&&"default"in t?t.default:t}var i=r(n(460)),o=r(n(461)),a=n(69),A=n(109),s=n(137);function c(t){switch(t.type){case"Polygon":return o(t)>1?t:null;case"MultiPolygon":var e=[];if(s.flattenEach(t,(function(t){o(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}t.exports=function(t,e){var n=A.getGeom(t),r=A.getGeom(e),o=t.properties||{};if(n=c(n),r=c(r),!n)return null;if(!r)return a.feature(n,o);var s=i.diff(n.coordinates,r.coordinates);return 0===s.length?null:1===s.length?a.polygon(s[0],o):a.multiPolygon(s,o)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(59),i=n(142);function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(f,t);var e,n,r,o,g=(e=f,function(){var t,n=u(e);if(c()){var r=u(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function f(){return a(this,f),g.apply(this,arguments)}return n=f,(r=[{key:"renderLayers",value:function(){return[new i.ScatterplotLayer(Object.assign({},this.props,{id:"".concat(this.props.id,"-ScatterplotLayer"),data:this.props.data})),new i.LineLayer(Object.assign({},this.props,{id:"".concat(this.props.id,"-LineLayer"),data:this.props.data,pickable:!1,getSourcePosition:function(t){var e=t.position;return[e[0],e[1],0]},getTargetPosition:function(t){var e=t.position;return[e[0],e[1],e[2]||0]},getColor:[150,150,150,200],getStrokeWidth:3}))]}}])&&A(n.prototype,r),o&&A(n,o),f}(r.CompositeLayer);e.default=f,g(f,"layerName","ElevatedEditHandleLayer"),g(f,"defaultProps",{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={outlineEnabled:!1,outlineRenderShadowmap:!1,outlineShadowmap:null};var i={name:"outline",vs:"attribute float instanceZLevel;\nvarying float outline_vzLevel;\nvarying vec4 outline_vPosition;\n\n// Set the z level for the outline shadowmap rendering\nvoid outline_setZLevel(float zLevel) {\n  outline_vzLevel = zLevel;\n}\n\n// Store an adjusted position for texture2DProj\nvoid outline_setUV(vec4 position) {\n  // mat4(\n  //   0.5, 0.0, 0.0, 0.0,\n  //   0.0, 0.5, 0.0, 0.0,\n  //   0.0, 0.0, 0.5, 0.0,\n  //   0.5, 0.5, 0.5, 1.0\n  // ) * position;\n  outline_vPosition = vec4(position.xyz * 0.5 + position.w * 0.5, position.w);\n}\n",fs:"uniform bool outline_uEnabled;\nuniform bool outline_uRenderOutlines;\nuniform sampler2D outline_uShadowmap;\n\nvarying float outline_vzLevel;\n// varying vec2 outline_vUV;\nvarying vec4 outline_vPosition;\n\nconst float OUTLINE_Z_LEVEL_ERROR = 0.01;\n\n// Return a darker color in shadowmap\nvec4 outline_filterShadowColor(vec4 color) {\n  return vec4(outline_vzLevel / 255., outline_vzLevel / 255., outline_vzLevel / 255., 1.);\n}\n\n// Return a darker color if in shadowmap\nvec4 outline_filterDarkenColor(vec4 color) {\n  if (outline_uEnabled) {\n    float maxZLevel;\n    if (outline_vPosition.q > 0.0) {\n      maxZLevel = texture2DProj(outline_uShadowmap, outline_vPosition).r * 255.;\n    } else {\n      discard;\n    }\n    if (maxZLevel < outline_vzLevel + OUTLINE_Z_LEVEL_ERROR) {\n      vec4(color.rgb * 0.5, color.a);\n    } else {\n      discard;\n    }\n  }\n  return color;\n}\n\n// if enabled and rendering outlines - Render depth to shadowmap\n// if enabled and rendering colors - Return a darker color if in shadowmap\n// if disabled, just return color\nvec4 outline_filterColor(vec4 color) {\n  if (outline_uEnabled) {\n    return outline_uRenderOutlines ?\n      outline_filterShadowColor(color) :\n      outline_filterDarkenColor(color);\n  }\n  return color;\n}\n",getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,e=t.outlineEnabled,n=t.outlineRenderShadowmap,i=t.outlineShadowmap,o={};return void 0!==e&&(o.outline_uEnabled=e),void 0!==n&&(o.outline_uRenderOutlines=n),void 0!==i&&(o.outline_uShadowmap=i),o}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(59),i=n(142),o=n(745),a=u(n(819)),A=u(n(1023)),s=u(n(1024)),c=n(1025);function u(t){return t&&t.__esModule?t:{default:t}}function l(t){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function I(t,e){return!e||"object"!==l(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function C(t){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var B=o.SimpleMeshLayer,m={mesh:new A.default({headSize:.2,tailWidth:.05})},b=Object.assign({},a.default.defaultProps,{MarkerLayer:B,markerLayerProps:m,sizeScale:100,fp64:!1,hightlightIndex:-1,highlightPoint:null,getPath:function(t){return t.path},getColor:function(t){return t.color},getMarkerColor:function(t){return[0,0,0,255]},getDirection:function(t){return t.direction},getMarkerPercentages:function(t,e){return e.lineLength>.1?[.25,.5,.75]:[.5]}}),E=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(f,t);var e,n,o,u,l=(e=f,function(){var t,n=C(e);if(p()){var r=C(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return I(this,t)});function f(){return h(this,f),l.apply(this,arguments)}return n=f,(o=[{key:"initializeState",value:function(){this.state={markers:[],mesh:new A.default({headSize:.2,tailWidth:.05}),closestPoint:null}}},{key:"projectFlat",value:function(t,e,n,i){if(n===r.COORDINATE_SYSTEM.METER_OFFSETS){var o=g(e.metersToLngLatDelta(t),2),a=o[0],A=o[1],s=g(i,2),c=s[0],u=s[1];return e.projectFlat([c+a,A+u])}if(n===r.COORDINATE_SYSTEM.LNGLAT_OFFSETS){var l=g(t,2),f=l[0],h=l[1],d=g(i,2),I=d[0],p=d[1];return e.projectFlat([I+f,h+p])}return e.projectFlat(t)}},{key:"updateState",value:function(t){var e=this,n=t.props,r=t.oldProps,i=t.changeFlags;if(i.dataChanged||i.updateTriggersChanged){var o=this.props,a=o.data,A=o.getPath,c=o.getDirection,u=o.getMarkerColor,l=o.getMarkerPercentages,g=o.coordinateSystem,f=o.coordinateOrigin,h=this.context.viewport;this.state.markers=(0,s.default)({data:a,getPath:A,getDirection:c,getColor:u,getMarkerPercentages:l,projectFlat:function(t){return e.projectFlat(t,h,g,f)}}),this._recalculateClosestPoint()}i.propsChanged&&n.point!==r.point&&this._recalculateClosestPoint()}},{key:"_recalculateClosestPoint",value:function(){var t=this.props,e=t.highlightPoint,n=t.highlightIndex;if(e&&n>=0){var r=this.props.data[n],i=this.props.getPath(r),o=(0,c.getClosestPointOnPolyline)({points:i,p:e}).point;this.state.closestPoints=[{position:o}]}else this.state.closestPoints=[]}},{key:"getPickingInfo",value:function(t){var e=t.info;return Object.assign(e,{object:e.object&&e.object.path||e.object})}},{key:"renderLayers",value:function(){return[new a.default(this.props,this.getSubLayerProps({id:"paths",data:this.props.data})),new this.props.MarkerLayer(this.getSubLayerProps(Object.assign({},this.props.markerLayerProps,{id:"markers",data:this.state.markers,getOrientation:function(t){return[0,-t.angle,0]},getColor:function(t){return t.color},sizeScale:this.props.sizeScale,fp64:this.props.fp64,pickable:!1,parameters:{blend:!1,depthTest:!1}}))),this.state.closestPoints&&new i.ScatterplotLayer({id:"".concat(this.props.id,"-highlight"),data:this.state.closestPoints,fp64:this.props.fp64})]}}])&&d(n.prototype,o),u&&d(n,u),f}(r.CompositeLayer);e.default=E,v(E,"layerName","PathMarkerLayer"),v(E,"defaultProps",b)},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e,n=(e=r,function(){var t,n=A(e);if(a()){var r=A(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return o(this,t)});function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,r),n.call(this,Object.assign({},t,{attributes:u(t)}))}return r}(n(57).Geometry);function u(t){for(var e=t.length,n=void 0===e?1:e,r=t.headSize,i=void 0===r?.2:r,o=t.tailWidth,a=void 0===o?.05:o,A=t.tailStart,s=void 0===A?.05:A,c=[.5,1,0,.5-i/2,1-i,0,.5+i/2,1-i,0,.5-a/2,s,0,.5+a/2,1-i,0,.5+a/2,s,0,.5-a/2,s,0,.5-a/2,1-i,0,.5+a/2,1-i,0],u=new Array(c.length),l=0;l<c.length/3;l++){var g=3*l;u[g+0]=(c[g+0]-.5)*n,u[g+1]=(c[g+1]-.5)*n,u[g+2]=0}return{positions:new Float32Array(u),normals:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),texCoords:new Float32Array(c)}}e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,n=t.data,o=t.getPath,u=void 0===o?function(t){return t.path}:o,l=t.getDirection,g=void 0===l?function(t){return t.direction}:l,f=t.getColor,h=void 0===f?function(t){return A}:f,d=t.getMarkerPercentages,I=void 0===d?function(t){return[.5]}:d,p=t.projectFlat,C=[],y=i(n);try{for(y.s();!(e=y.n()).done;){var v,B=e.value,m=u(B),b=g(B)||s,E=h(B),Q=m.map((function(t){return new r.Vector2(t)})),F=Q.slice(0).reverse(),w=a(Q),S=i(I(B,{lineLength:w}));try{for(S.s();!(v=S.n()).done;){var R=v.value;if(b.forward){var U=c({path:Q,percentage:R,lineLength:w,color:E,object:B,projectFlat:p});C.push(U)}if(b.backward){var x=c({path:F,percentage:R,lineLength:w,color:E,object:B,projectFlat:p});C.push(x)}}}catch(k){S.e(k)}finally{S.f()}}}catch(k){y.e(k)}finally{y.f()}return C};var r=n(140);function i(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"===typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,A=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){A=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(A)throw i}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].distance(t[n+1]);return e}var A=[0,0,0,255],s={forward:!0,backward:!1};function c(t){var e=t.path,n=t.percentage,i=t.lineLength,o=t.color,a=t.object,A=t.projectFlat,s=i*n,c=0,u=0,l=0;for(l=0;l<e.length-1&&!((c+=e[l].distance(e[l+1]))>s);l++)u=c;var g=s-u,f=e[l+1].clone().subtract(e[l]).normalize().clone().multiply(new r.Vector2(g,g)).add(e[l]),h=180*-new r.Vector2(A(e[l+1])).subtract(A(e[l])).verticalAngle()/Math.PI;return{position:[f.x,f.y,0],angle:h,color:o,object:a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getClosestPointOnLine=i,e.getClosestPointOnPolyline=function(t){var e=t.p,n=t.points;e=new r.Vector3(e);for(var o=null,a=1/0,A=-1,s=0;s<n.length-1;++s){var c=n[s],u=n[s+1],l=i({p:e,p1:c,p2:u}),g=e.distanceSquared(l);g<a&&(a=g,o=l,A=s)}return{point:o,index:A,p1:n[A],p2:n[A+1],distanceSquared:a,distance:Math.sqrt(a)}};var r=n(140);function i(t){var e=t.p,n=t.p1,i=t.p2,o=t.clampToLine,a=void 0===o||o,A=new r.Vector3(i).subtract(n),s=new r.Vector3(e).subtract(n),c=A.dot(s);return a&&(c=(0,r.clamp)(c,0,1)),A.lerp(c)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(59),i=n(142);function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){h(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(h,t);var e,n,r,o,a=(e=h,function(){var t,n=g(e);if(l()){var r=g(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function h(){return s(this,h),a.apply(this,arguments)}return n=h,(r=[{key:"renderLayers",value:function(){var t=this.props,e=t.id,n=t.getFillColor,r=t.getStrokeColor,o=t.getInnerRadius,a=t.updateTriggers;return[new i.ScatterplotLayer(A({},this.props,{id:"".concat(e,"-full"),data:this.props.data,getLineColor:r,updateTriggers:A({},a,{getStrokeColor:a.getStrokeColor})})),new i.ScatterplotLayer(A({},this.props,{id:"".concat(e,"-inner"),data:this.props.data,getFillColor:n,getRadius:o,pickable:!1,updateTriggers:A({},a,{getFillColor:a.getFillColor,getRadius:a.getInnerRadius})}))]}}])&&c(n.prototype,r),o&&c(n,o),h}(r.CompositeLayer);e.default=d,h(d,"layerName","JunctionScatterplotLayer"),h(d,"defaultProps",A({},i.ScatterplotLayer.defaultProps,{getFillColor:function(t){return[0,0,0,255]},getStrokeColor:function(t){return[255,255,255,255]},getInnerRadius:function(t){return 1}}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toDeckColor=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[255,0,0,255];if(!Array.isArray(t))return e;return[255*t[0],255*t[1],255*t[2],255*t[3]]},e.recursivelyTraverseNestedArrays=function t(e,n,r){if(!Array.isArray(e[0]))return!0;for(var i=0;i<e.length;i++)if(t(e[i],[].concat(function(t){if(Array.isArray(t))return l(t)}(o=n)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(o)||u(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[i]),r)){r(e,n);break}var o;return!1},e.generatePointsParallelToLinePoints=function(t,e,n){var A={type:"LineString",coordinates:[t,e]},s=(0,a.point)(n),c=(0,o.default)(s,A),u=(0,i.default)(t,e),l=(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])<0?u-90:u-270,g=(0,r.default)(e,c,l),f=(0,r.default)(t,c,l);return[g.geometry.coordinates,f.geometry.coordinates]},e.distance2d=g,e.mix=f,e.nearestPointOnProjectedLine=function(t,e,n){var r=new A.default(n),i=t.geometry.coordinates.map((function(t){var e=c(t,3),n=e[0],i=e[1],o=e[2],a=void 0===o?0:o;return r.project([n,i,a])})),o=c(r.project(e.geometry.coordinates),2),a=o[0],s=o[1],u=1/0,l={};i.forEach((function(t,e){var n=c(t,2),r=n[0],o=n[1];if(0!==e){var A=c(i[e-1],2),g=A[0],f=A[1],h=f-o,d=r-g,I=g*o-r*f,p=h*h+d*d,C=Math.abs(h*a+d*s+I)/Math.sqrt(p);C<u&&(u=C,l={index:e,x0:(d*(d*a-h*s)-h*I)/p,y0:(h*(-d*a+h*s)-d*I)/p})}}));var h=l,d=h.index,I=h.x0,p=h.y0,C=c(i[d-1],3),y=C[0],v=C[1],B=C[2],m=void 0===B?0:B,b=c(i[d],3),E=b[0],Q=b[1],F=b[2],w=void 0===F?0:F,S=g(y,v,E,Q),R=g(y,v,I,p),U=f(m,w,R/S);return{type:"Feature",geometry:{type:"Point",coordinates:r.unproject([I,p,U])},properties:{dist:u,index:d-1}}};var r=s(n(455)),i=s(n(268)),o=s(n(807)),a=n(69),A=s(n(808));function s(t){return t&&t.__esModule?t:{default:t}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||u(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){if(t){if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function g(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function f(t,e,n){return e*n+t*(1-n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(142),i=A(n(512)),o=n(548),a=A(n(746));function A(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(d,t);var e,n,i,A,s=(e=d,function(){var t,n=f(e);if(g()){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u(this,t)});function d(t){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),e=s.call(this,t),n=l(e),i=void 0,(r="deckCache")in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,e.deckCache=new a.default(t.getData,(function(e){return t.toNebulaFeature(e)})),e}return n=d,(i=[{key:"render",value:function(t){var e=t.nebula,n=[0,0,0,255],i=this.deckCache,a=i.objects,A=i.updateTrigger,s=e.props.viewport.zoom;return new r.TextLayer({id:"texts-".concat(this.id),data:a,opacity:1,fp64:!1,pickable:!1,getText:function(t){return t.style.text},getPosition:function(t){return t.geoJson.geometry.coordinates},getColor:function(t){return(0,o.toDeckColor)(t.style.fillColor)||n},sizeScale:1/Math.pow(2,20-s),updateTriggers:{all:A},nebulaLayer:this})}}])&&c(n.prototype,i),A&&c(n,A),d}(i.default);e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(736),o=n(46),a=n(803),A=u(n(512)),s=n(548),c=u(n(746));function u(t){return t&&t.__esModule?t:{default:t}}function l(t){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e){return!e||"object"!==l(e)&&"function"!==typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y=(C(r={},a.ArrowStyles.NONE,{forward:!1,backward:!1}),C(r,a.ArrowStyles.FORWARD,{forward:!0,backward:!1}),C(r,a.ArrowStyles.BACKWARD,{forward:!1,backward:!0}),C(r,a.ArrowStyles.BOTH,{forward:!0,backward:!0}),r),v=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(l,t);var e,n,r,A,u=(e=l,function(){var t,n=I(e);if(d()){var r=I(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return f(this,t)});function l(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),C(h(e=u.call(this,t)),"deckCache",void 0),C(h(e),"noBlend",void 0),C(h(e),"highlightColor",void 0),C(h(e),"arrowSize",void 0),C(h(e),"rounded",void 0),C(h(e),"dashed",void 0),C(h(e),"markerLayerProps",void 0),e.deckCache=new c.default(t.getData,(function(e){return t.toNebulaFeature(e)})),e.enableSelection=!0;var n=t.enablePicking,r=void 0===n||n,i=t.noBlend,o=void 0!==i&&i,a=t.rounded,A=void 0===a||a,s=t.dashed,g=void 0!==s&&s,f=t.markerLayerProps,d=void 0===f?null:f;return Object.assign(h(e),{enablePicking:r,noBlend:o,rounded:A,dashed:g,markerLayerProps:d}),e}return n=l,(r=[{key:"getMouseOverSegment",value:function(){return null}},{key:"_calcMarkerPercentages",value:function(t){var e=t.style.arrowPercentages;return e||((t.style.arrowStyle||a.DEFAULT_STYLE.arrowStyle)===a.ArrowStyles.NONE?[]:[[.5],[.33,.66],[.25,.5,.75]][Math.min(t.style.arrowCount||a.DEFAULT_STYLE.arrowCount,a.MAX_ARROWS)-1])}},{key:"_getHighlightedObjectIndex",value:function(t){var e=t.nebula.deckglMouseOverInfo;if(e){var n=e.originalLayer,r=e.index;if(n===this)return r}return-1}},{key:"render",value:function(t){var e=t.nebula,n=[0,0,0,255],r=this.deckCache,a=r.objects,A=r.updateTrigger;return new i.PathMarkerLayer({id:"segments-".concat(this.id),data:a,opacity:1,fp64:!1,rounded:this.rounded,pickable:!0,sizeScale:this.arrowSize||6,parameters:{depthTest:!1,blend:!this.noBlend,blendEquation:o.MAX},getPath:function(t){return t.geoJson.geometry.coordinates},getColor:function(t){return(0,s.toDeckColor)(t.style.lineColor,n)},getWidth:function(t){return t.style.lineWidthMeters||1},getZLevel:function(t){return 255*t.style.zLevel},getDirection:function(t){return y[t.style.arrowStyle]},getMarkerColor:function(t){return(0,s.toDeckColor)(t.style.arrowColor,n)},getMarkerPercentages:this._calcMarkerPercentages,updateTriggers:{all:A},highlightedObjectIndex:this._getHighlightedObjectIndex({nebula:e}),highlightColor:(0,s.toDeckColor)(this.highlightColor),dashJustified:this.dashed,getDashArray:this.dashed?function(t){return t.style.dashArray}:null,markerLayerProps:this.markerLayerProps||i.PathMarkerLayer.defaultProps.markerLayerProps,nebulaLayer:this})}}])&&g(n.prototype,r),A&&g(n,A),l}(A.default);e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(250),i=c(n(1031)),o=n(59),a=c(n(804)),A=c(n(805)),s=c(n(512));function c(t){return t&&t.__esModule?t:{default:t}}function u(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,"props",void 0),f(this,"deckgl",void 0),f(this,"mainContainer",void 0),f(this,"deckglMouseOverInfo",void 0),f(this,"_deckDrawer",void 0),f(this,"_mouseWasDown",void 0),f(this,"wmViewport",void 0),f(this,"queryObjectEvents",new r.EventEmitter),f(this,"forceUpdate",void 0),f(this,"inited",void 0),f(this,"_onMouseEvent",(function(t){if(e._isNebulaEvent(t)){"mousedown"===t.type&&(e._mouseWasDown=!0);var n=e.mainContainer?e.mainContainer.getBoundingClientRect():{},r=n.top,i=void 0===r?0:r,o=n.left,a=void 0===o?0:o,A=new Proxy(t,{get:function(t,e){if("offsetX"===e)return t.pageX-a;if("offsetY"===e)return t.pageY-i;if("type"===e)return t.type.replace("pointer","mouse");var n=t[e];return"function"===typeof n?n.bind(t):n}});e._handleDeckGLEvent(A)}}))}var e,n,c;return e=t,(n=[{key:"init",value:function(t){var e=this;this.props=t,this.wmViewport=new o.WebMercatorViewport(this.props.viewport),["click","mousemove","mouseup","mousedown"].forEach((function(t){return i.default.addEventListener(t,e._onMouseEvent,!0)}))}},{key:"detach",value:function(){var t=this;["click","mousemove","mouseup","mousedown"].forEach((function(e){return i.default.removeEventListener(e,t._onMouseEvent,!0)}))}},{key:"updateProps",value:function(t){this.props=t;var e=this.props.viewport;this.wmViewport=new o.WebMercatorViewport(e)}},{key:"log",value:function(t){var e=this.props.logger;e&&e.info&&e.info("Nebula: "+t)}},{key:"updateAllDeckObjects",value:function(){this.getAllLayers().forEach((function(t){t&&t.deckCache&&t.deckCache.updateAllDeckObjects()})),this.forceUpdate()}},{key:"updateDeckObjectsByIds",value:function(t){this.getAllLayers().forEach((function(e){e&&e.deckCache&&e.deckCache.updateDeckObjectsByIds(t)})),this.forceUpdate()}},{key:"rerenderLayers",value:function(){this.updateAllDeckObjects()}},{key:"_isNebulaEvent",value:function(t){var e=t.buttons,n=t.target,r=t.type,i=this.props.viewport;if(this._mouseWasDown&&"mouseup"===r)return this._mouseWasDown=!1,!0;if("mousemove"===r&&e>0)return!0;if(!n.getBoundingClientRect)return!1;var o=n.getBoundingClientRect();return Math.round(o.width)===Math.round(i.width)&&Math.round(o.height)===Math.round(i.height)}},{key:"getMouseGroundPosition",value:function(t){return this.wmViewport.unproject([t.offsetX,t.offsetY])}},{key:"unprojectMousePosition",value:function(t){return this.wmViewport.unproject(t)}},{key:"_handleDeckGLEvent",value:function(t){var e=this.deckgl,n=this.props,r=n.onMapMouseEvent,o=n.selectionType,s=n.eventFilter,c=!0,u="auto";if(t&&e&&o){this._deckDrawer||(this._deckDrawer=new a.default(this));var l=this.getMouseGroundPosition(t);if(s&&!s(l,t))return;this._deckDrawer.handleEvent(t,l,o).redraw&&this.forceUpdate()}else{if(t&&e&&(!t.buttons||"mousemove"!==t.type)){var g=e.props.layers.filter((function(t){return t&&t.props&&t.props.nebulaLayer&&t.props.nebulaLayer.enablePicking})).map((function(t){return t.id})),f=e.pickObject({x:t.offsetX,y:t.offsetY,radius:5,layerIds:g});if(this.queryObjectEvents.emit("pick",{event:t,pickingInfo:f}),f){c=!1;var h=f.index,d=f.lngLat;if(s&&!s(d,t))return;var I=f.layer,p=f.object;I&&I.props&&I.props.nebulaLayer&&I.props.nebulaLayer.eventHandler&&I.props.nebulaLayer.eventHandler(t,f);var C=p.original||I.props.nebulaLayer&&I.props.nebulaLayer.deckCache&&I.props.nebulaLayer.deckCache.originals[h];if(C){this.deckglMouseOverInfo={originalLayer:I.props.nebulaLayer,index:h};var y=new A.default(t,{data:C,metadata:p.metadata,groundPoint:d,nebula:this});I.props.nebulaLayer.emit(t.type,y),this.forceUpdate()}u="pointer"}}if(i.default.documentElement&&(i.default.documentElement.style.cursor=u),c){this.deckglMouseOverInfo=null;var v=this.getMouseGroundPosition(t);if(s&&!s(v,t))return;var B=new A.default(t,{groundPoint:v,nebula:this});this.getAllLayers().filter((function(t){return t&&t.usesMapEvents})).forEach((function(t){return t.emit("mapMouseEvent",B)})),this.getAllLayers().filter((function(t){return t&&t.props&&t.props.nebulaLayer&&t.props.nebulaLayer.mapMouseEvent})).forEach((function(t){return t.props.nebulaLayer.mapMouseEvent(B,t)})),r&&r(t,v)}}}},{key:"getExtraDeckLayers",value:function(){var t=[];return this._deckDrawer&&t.push.apply(t,u(this._deckDrawer.render())),t}},{key:"renderDeckLayers",value:function(){var t=this;return this.getAllLayers().map((function(e){return e instanceof s.default?e.render({nebula:t}):e})).filter(Boolean)}},{key:"getAllLayers",value:function(){var t=[];return this.props.layers.filter(Boolean).forEach((function(e){t.push(e),e instanceof s.default&&t.push.apply(t,u(e.helperLayers))})),t.filter(Boolean)}},{key:"getRenderedLayers",value:function(){return[].concat(u(this.renderDeckLayers()),u(this.getExtraDeckLayers()))}},{key:"updateAndGetRenderedLayers",value:function(t,e,n){return this.inited?(this.updateProps({layers:t,viewport:e}),this.forceUpdate=function(){return n.forceUpdate()}):(this.inited=!0,this.init({layers:t,viewport:e}),this.forceUpdate=function(){return n.forceUpdate()},this.updateAllDeckObjects()),this.getRenderedLayers()}},{key:"setDeck",value:function(t){t&&(this.deckgl=t)}},{key:"setMainContainer",value:function(t){t&&(this.mainContainer=t)}}])&&g(e.prototype,n),c&&g(e,c),t}();e.default=h},function(t,e,n){(function(e){var r,i="undefined"!==typeof e?e:"undefined"!==typeof window?window:{},o=n(1032);"undefined"!==typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=r}).call(this,n(56))},function(t,e){},function(t,e,n){"use strict";var r=n(685);t.exports=function(t){r.copy(t,this)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r="",i=!0===t.schema.$async,o=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),a=t.self._getId(t.schema);if(t.opts.strictKeywords){var A=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(A){var s="unknown keyword: "+A;if("log"!==t.opts.strictKeywords)throw new Error(s);t.logger.warn(s)}}if(t.isTop&&(r+=" var validate = ",i&&(t.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(t.opts.sourceCode||t.opts.processCode)&&(r+=" /*# sourceURL="+a+" */ ")),"boolean"==typeof t.schema||!o&&!t.schema.$ref){var c=t.level,u=t.dataLevel,l=t.schema["false schema"],g=t.schemaPath+t.util.getProperty("false schema"),f=t.errSchemaPath+"/false schema",h=!t.opts.allErrors,d="data"+(u||""),I="valid"+c;if(!1===t.schema){t.isTop?h=!0:r+=" var "+I+" = false; ",(K=K||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(f)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'boolean schema is false' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ";var p=r;r=K.pop(),!t.compositeRule&&h?t.async?r+=" throw new ValidationError(["+p+"]); ":r+=" validate.errors = ["+p+"]; return false; ":r+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t.isTop?r+=i?" return data; ":" validate.errors = null; return true; ":r+=" var "+I+" = true; ";return t.isTop&&(r+=" }; return validate; "),r}if(t.isTop){var C=t.isTop;c=t.level=0,u=t.dataLevel=0,d="data";if(t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[void 0],void 0!==t.schema.default&&t.opts.useDefaults&&t.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==t.opts.strictDefaults)throw new Error(y);t.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0;     ",r+=" if (rootData === undefined) rootData = data; "}else{c=t.level,d="data"+((u=t.dataLevel)||"");if(a&&(t.baseId=t.resolve.url(t.baseId,a)),i&&!t.async)throw new Error("async schema in sync schema");r+=" var errs_"+c+" = errors;"}I="valid"+c,h=!t.opts.allErrors;var v="",B="",m=t.schema.type,b=Array.isArray(m);if(m&&t.opts.nullable&&!0===t.schema.nullable&&(b?-1==m.indexOf("null")&&(m=m.concat("null")):"null"!=m&&(m=[m,"null"],b=!0)),b&&1==m.length&&(m=m[0],b=!1),t.schema.$ref&&o){if("fail"==t.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');!0!==t.opts.extendRefs&&(o=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(r+=" "+t.RULES.all.$comment.code(t,"$comment")),m){if(t.opts.coerceTypes)var E=t.util.coerceToTypes(t.opts.coerceTypes,m);var Q=t.RULES.types[m];if(E||b||!0===Q||Q&&!q(Q)){g=t.schemaPath+".type",f=t.errSchemaPath+"/type",g=t.schemaPath+".type",f=t.errSchemaPath+"/type";var F=b?"checkDataTypes":"checkDataType";if(r+=" if ("+t.util[F](m,d,!0)+") { ",E){var w="dataType"+c,S="coerced"+c;r+=" var "+w+" = typeof "+d+"; ","array"==t.opts.coerceTypes&&(r+=" if ("+w+" == 'object' && Array.isArray("+d+")) "+w+" = 'array'; "),r+=" var "+S+" = undefined; ";var R="",U=E;if(U)for(var x,k=-1,O=U.length-1;k<O;)x=U[k+=1],k&&(r+=" if ("+S+" === undefined) { ",R+="}"),"array"==t.opts.coerceTypes&&"array"!=x&&(r+=" if ("+w+" == 'array' && "+d+".length == 1) { "+S+" = "+d+" = "+d+"[0]; "+w+" = typeof "+d+";  } "),"string"==x?r+=" if ("+w+" == 'number' || "+w+" == 'boolean') "+S+" = '' + "+d+"; else if ("+d+" === null) "+S+" = ''; ":"number"==x||"integer"==x?(r+=" if ("+w+" == 'boolean' || "+d+" === null || ("+w+" == 'string' && "+d+" && "+d+" == +"+d+" ","integer"==x&&(r+=" && !("+d+" % 1)"),r+=")) "+S+" = +"+d+"; "):"boolean"==x?r+=" if ("+d+" === 'false' || "+d+" === 0 || "+d+" === null) "+S+" = false; else if ("+d+" === 'true' || "+d+" === 1) "+S+" = true; ":"null"==x?r+=" if ("+d+" === '' || "+d+" === 0 || "+d+" === false) "+S+" = null; ":"array"==t.opts.coerceTypes&&"array"==x&&(r+=" if ("+w+" == 'string' || "+w+" == 'number' || "+w+" == 'boolean' || "+d+" == null) "+S+" = ["+d+"]; ");r+=" "+R+" if ("+S+" === undefined) {   ",(K=K||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(f)+" , params: { type: '",r+=b?""+m.join(","):""+m,r+="' } ",!1!==t.opts.messages&&(r+=" , message: 'should be ",r+=b?""+m.join(","):""+m,r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ";p=r;r=K.pop(),!t.compositeRule&&h?t.async?r+=" throw new ValidationError(["+p+"]); ":r+=" validate.errors = ["+p+"]; return false; ":r+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else {  ";var N=u?"data"+(u-1||""):"parentData";r+=" "+d+" = "+S+"; ",u||(r+="if ("+N+" !== undefined)"),r+=" "+N+"["+(u?t.dataPathArr[u]:"parentDataProperty")+"] = "+S+"; } "}else{(K=K||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(f)+" , params: { type: '",r+=b?""+m.join(","):""+m,r+="' } ",!1!==t.opts.messages&&(r+=" , message: 'should be ",r+=b?""+m.join(","):""+m,r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ";p=r;r=K.pop(),!t.compositeRule&&h?t.async?r+=" throw new ValidationError(["+p+"]); ":r+=" validate.errors = ["+p+"]; return false; ":r+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(t.schema.$ref&&!o)r+=" "+t.RULES.all.$ref.code(t,"$ref")+" ",h&&(r+=" } if (errors === ",r+=C?"0":"errs_"+c,r+=") { ",B+="}");else{var D=t.RULES;if(D)for(var G=-1,_=D.length-1;G<_;)if(q(Q=D[G+=1])){if(Q.type&&(r+=" if ("+t.util.checkDataType(Q.type,d)+") { "),t.opts.useDefaults)if("object"==Q.type&&t.schema.properties){l=t.schema.properties;var M=Object.keys(l);if(M)for(var T,j=-1,L=M.length-1;j<L;){if(void 0!==(P=l[T=M[j+=1]]).default){var V=d+t.util.getProperty(T);if(t.compositeRule){if(t.opts.strictDefaults){y="default is ignored for: "+V;if("log"!==t.opts.strictDefaults)throw new Error(y);t.logger.warn(y)}}else r+=" if ("+V+" === undefined ","empty"==t.opts.useDefaults&&(r+=" || "+V+" === null || "+V+" === '' "),r+=" ) "+V+" = ","shared"==t.opts.useDefaults?r+=" "+t.useDefault(P.default)+" ":r+=" "+JSON.stringify(P.default)+" ",r+="; "}}}else if("array"==Q.type&&Array.isArray(t.schema.items)){var Z=t.schema.items;if(Z){k=-1;for(var P,W=Z.length-1;k<W;)if(void 0!==(P=Z[k+=1]).default){V=d+"["+k+"]";if(t.compositeRule){if(t.opts.strictDefaults){y="default is ignored for: "+V;if("log"!==t.opts.strictDefaults)throw new Error(y);t.logger.warn(y)}}else r+=" if ("+V+" === undefined ","empty"==t.opts.useDefaults&&(r+=" || "+V+" === null || "+V+" === '' "),r+=" ) "+V+" = ","shared"==t.opts.useDefaults?r+=" "+t.useDefault(P.default)+" ":r+=" "+JSON.stringify(P.default)+" ",r+="; "}}}var J=Q.rules;if(J)for(var H,Y=-1,X=J.length-1;Y<X;)if($(H=J[Y+=1])){var z=H.code(t,H.keyword,Q.type);z&&(r+=" "+z+" ",h&&(v+="}"))}if(h&&(r+=" "+v+" ",v=""),Q.type&&(r+=" } ",m&&m===Q.type&&!E)){r+=" else { ";var K;g=t.schemaPath+".type",f=t.errSchemaPath+"/type";(K=K||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(f)+" , params: { type: '",r+=b?""+m.join(","):""+m,r+="' } ",!1!==t.opts.messages&&(r+=" , message: 'should be ",r+=b?""+m.join(","):""+m,r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ";p=r;r=K.pop(),!t.compositeRule&&h?t.async?r+=" throw new ValidationError(["+p+"]); ":r+=" validate.errors = ["+p+"]; return false; ":r+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}h&&(r+=" if (errors === ",r+=C?"0":"errs_"+c,r+=") { ",B+="}")}}function q(t){for(var e=t.rules,n=0;n<e.length;n++)if($(e[n]))return!0}function $(e){return void 0!==t.schema[e.keyword]||e.implements&&function(e){for(var n=e.implements,r=0;r<n.length;r++)if(void 0!==t.schema[n[r]])return!0}(e)}return h&&(r+=" "+B+" "),C?(i?(r+=" if (errors === 0) return data;           ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0;       "),r+=" }; return validate;"):r+=" var "+I+" = errors === errs_"+c+";",r=t.util.cleanUpCode(r),C&&(r=t.util.finalCleanUpCode(r,i)),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A;var f="maximum"==e,h=f?"exclusiveMaximum":"exclusiveMinimum",d=t.schema[h],I=t.opts.$data&&d&&d.$data,p=f?"<":">",C=f?">":"<",y=void 0;if(I){var v=t.util.getData(d.$data,a,t.dataPathArr),B="exclusive"+o,m="exclType"+o,b="exclIsNumber"+o,E="' + "+(w="op"+o)+" + '";i+=" var schemaExcl"+o+" = "+v+"; ",i+=" var "+B+"; var "+m+" = typeof "+(v="schemaExcl"+o)+"; if ("+m+" != 'boolean' && "+m+" != 'undefined' && "+m+" != 'number') { ";var Q;y=h;(Q=Q||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: {} ",!1!==t.opts.messages&&(i+=" , message: '"+h+" should be boolean' "),t.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var F=i;i=Q.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+m+" == 'number' ? ( ("+B+" = "+r+" === undefined || "+v+" "+p+"= "+r+") ? "+l+" "+C+"= "+v+" : "+l+" "+C+" "+r+" ) : ( ("+B+" = "+v+" === true) ? "+l+" "+C+"= "+r+" : "+l+" "+C+" "+r+" ) || "+l+" !== "+l+") { var op"+o+" = "+B+" ? '"+p+"' : '"+p+"='; ",void 0===A&&(y=h,c=t.errSchemaPath+"/"+h,r=v,g=I)}else{E=p;if((b="number"==typeof d)&&g){var w="'"+E+"'";i+=" if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" ( "+r+" === undefined || "+d+" "+p+"= "+r+" ? "+l+" "+C+"= "+d+" : "+l+" "+C+" "+r+" ) || "+l+" !== "+l+") { "}else{b&&void 0===A?(B=!0,y=h,c=t.errSchemaPath+"/"+h,r=d,C+="="):(b&&(r=Math[f?"min":"max"](d,A)),d===(!b||r)?(B=!0,y=h,c=t.errSchemaPath+"/"+h,C+="="):(B=!1,E+="="));w="'"+E+"'";i+=" if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+l+" "+C+" "+r+" || "+l+" !== "+l+") { "}}y=y||e,(Q=Q||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { comparison: "+w+", limit: "+r+", exclusive: "+B+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be "+E+" ",i+=g?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";F=i;return i=Q.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { "),i}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A,i+="if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+l+".length "+("maxItems"==e?">":"<")+" "+r+") { ";var f=e,h=h||[];h.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==e?"more":"fewer",i+=" than ",i+=g?"' + "+r+" + '":""+A,i+=" items' "),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var d=i;return i=h.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",u&&(i+=" else { "),i}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A;var f="maxLength"==e?">":"<";i+="if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),!1===t.opts.unicode?i+=" "+l+".length ":i+=" ucs2length("+l+") ",i+=" "+f+" "+r+") { ";var h=e,d=d||[];d.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(h||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==e?"longer":"shorter",i+=" than ",i+=g?"' + "+r+" + '":""+A,i+=" characters' "),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var I=i;return i=d.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+I+"]); ":i+=" validate.errors = ["+I+"]; return false; ":i+=" var err = "+I+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",u&&(i+=" else { "),i}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A,i+="if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" Object.keys("+l+").length "+("maxProperties"==e?">":"<")+" "+r+") { ";var f=e,h=h||[];h.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==e?"more":"fewer",i+=" than ",i+=g?"' + "+r+" + '":""+A,i+=" properties' "),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var d=i;return i=h.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",u&&(i+=" else { "),i}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(t,e,n){var r=n(507),i=n(1179);t.exports=function t(e,n,o,a,A){var s=-1,c=e.length;for(o||(o=i),A||(A=[]);++s<c;){var u=e[s];n>0&&o(u)?n>1?t(u,n-1,o,a,A):r(A,u):a||(A[A.length]=u)}return A}},function(t,e,n){var r=n(1042),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,A=i(o.length-e,0),s=Array(A);++a<A;)s[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(s),r(t,this,c)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(1044),i=n(1046)(r);t.exports=i},function(t,e,n){var r=n(1045),i=n(872),o=n(709),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(1181);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(1191);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(515)&&!n(748)((function(){return 7!=Object.defineProperty(n(1051)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(688),i=n(513).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(537),i=n(689),o=n(1193)(!1),a=n(876)("IE_PROTO");t.exports=function(t,e){var n,A=i(t),s=0,c=[];for(n in A)n!=a&&r(A,n)&&c.push(n);for(;e.length>s;)r(A,n=e[s++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(1054);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports={default:n(1196),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var r=a(n(1198)),i=a(n(1210)),o="function"===typeof i.default&&"symbol"===typeof r.default?function(t){return typeof t}:function(t){return t&&"function"===typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":typeof t};function a(t){return t&&t.__esModule?t:{default:t}}e.default="function"===typeof i.default&&"symbol"===o(r.default)?function(t){return"undefined"===typeof t?"undefined":o(t)}:function(t){return t&&"function"===typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":"undefined"===typeof t?"undefined":o(t)}},function(t,e,n){"use strict";var r=n(770),i=n(686),o=n(1058),a=n(687),A=n(881),s=n(1202),c=n(883),u=n(1205),l=n(690)("iterator"),g=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(t,e,n,h,d,I,p){s(n,e,h);var C,y,v,B=function(t){if(!g&&t in Q)return Q[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},m=e+" Iterator",b="values"==d,E=!1,Q=t.prototype,F=Q[l]||Q["@@iterator"]||d&&Q[d],w=F||B(d),S=d?b?B("entries"):w:void 0,R="Array"==e&&Q.entries||F;if(R&&(v=u(R.call(new t)))!==Object.prototype&&v.next&&(c(v,m,!0),r||"function"==typeof v[l]||a(v,l,f)),b&&F&&"values"!==F.name&&(E=!0,w=function(){return F.call(this)}),r&&!p||!g&&!E&&Q[l]||a(Q,l,w),A[e]=w,A[m]=f,d)if(C={values:b?w:B("values"),keys:I?w:B("keys"),entries:S},p)for(y in C)y in Q||o(Q,y,C[y]);else i(i.P+i.F*(g||E),e,C);return C}},function(t,e,n){t.exports=n(687)},function(t,e,n){var r=n(1052),i=n(878).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){var r=n(772),i=n(768),o=n(689),a=n(873),A=n(537),s=n(1050),c=Object.getOwnPropertyDescriptor;e.f=n(515)?c:function(t,e){if(t=o(t),e=a(e,!0),s)try{return c(t,e)}catch(n){}if(A(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(1062),i=n(410);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(1231)();t.exports=r},function(t,e,n){var r=n(709);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e,n){var r=n(229),i=n(887),o=n(193),a=Function.prototype,A=Object.prototype,s=a.toString,c=A.hasOwnProperty,u=s.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==u}},function(t,e,n){var r=n(192);t.exports=function(t){return t===t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(1068),i=n(773);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(200),i=n(888),o=n(1238),a=n(1241);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},function(t,e,n){var r=n(1061),i=n(1250)(r);t.exports=i},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e,n){var r=n(889),i=n(329),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){(function(t){var r=n(131),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,A=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=A?A(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(130)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e,n){var r=n(507),i=n(887),o=n(508),a=n(532),A=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=A},function(t,e,n){var r=n(890);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(1266),i=n(887),o=n(510);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},function(t,e,n){var r=n(889),i=n(329);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorWrap=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),a=c(o),A=c(n(269)),s=c(n(391));function c(t){return t&&t.__esModule?t:{default:t}}var u=e.ColorWrap=function(t){var e=function(e){function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.handleChange=function(t,n){if(s.default.simpleCheckForValidColor(t)){var r=s.default.toState(t,t.h||e.state.oldHue);e.setState(r),e.props.onChangeComplete&&e.debounce(e.props.onChangeComplete,r,n),e.props.onChange&&e.props.onChange(r,n)}},e.handleSwatchHover=function(t,n){if(s.default.simpleCheckForValidColor(t)){var r=s.default.toState(t,t.h||e.state.oldHue);e.props.onSwatchHover&&e.props.onSwatchHover(r,n)}},e.state=r({},s.default.toState(t.color,0)),e.debounce=(0,A.default)((function(t,e,n){t(e,n)}),100),e}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,e),i(n,[{key:"render",value:function(){var e={};return this.props.onSwatchHover&&(e.onSwatchHover=this.handleSwatchHover),a.default.createElement(t,r({},this.props,this.state,{onChange:this.handleChange},e))}}],[{key:"getDerivedStateFromProps",value:function(t,e){return r({},s.default.toState(t.color,e.oldHue))}}]),n}(o.PureComponent||o.Component);return e.propTypes=r({},t.propTypes),e.defaultProps=r({},t.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),e};e.default=u},function(t,e,n){"use strict";n.r(e),n.d(e,"red",(function(){return r})),n.d(e,"pink",(function(){return i})),n.d(e,"purple",(function(){return o})),n.d(e,"deepPurple",(function(){return a})),n.d(e,"indigo",(function(){return A})),n.d(e,"blue",(function(){return s})),n.d(e,"lightBlue",(function(){return c})),n.d(e,"cyan",(function(){return u})),n.d(e,"teal",(function(){return l})),n.d(e,"green",(function(){return g})),n.d(e,"lightGreen",(function(){return f})),n.d(e,"lime",(function(){return h})),n.d(e,"yellow",(function(){return d})),n.d(e,"amber",(function(){return I})),n.d(e,"orange",(function(){return p})),n.d(e,"deepOrange",(function(){return C})),n.d(e,"brown",(function(){return y})),n.d(e,"grey",(function(){return v})),n.d(e,"blueGrey",(function(){return B})),n.d(e,"darkText",(function(){return m})),n.d(e,"lightText",(function(){return b})),n.d(e,"darkIcons",(function(){return E})),n.d(e,"lightIcons",(function(){return Q})),n.d(e,"white",(function(){return F})),n.d(e,"black",(function(){return w}));var r={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},i={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},o={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},a={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},A={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},s={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},c={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},u={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},l={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},g={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},f={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},h={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},d={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},I={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},p={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},C={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},y={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},v={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},B={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},m={primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",dividers:"rgba(0, 0, 0, 0.12)"},b={primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",dividers:"rgba(255, 255, 255, 0.12)"},E={active:"rgba(0, 0, 0, 0.54)",inactive:"rgba(0, 0, 0, 0.38)"},Q={active:"rgba(255, 255, 255, 1)",inactive:"rgba(255, 255, 255, 0.5)"},F="#ffffff",w="#000000";e.default={red:r,pink:i,purple:o,deepPurple:a,indigo:A,blue:s,lightBlue:c,cyan:u,teal:l,green:g,lightGreen:f,lime:h,yellow:d,amber:I,orange:p,deepOrange:C,brown:y,grey:v,blueGrey:B,darkText:m,lightText:b,darkIcons:E,lightIcons:Q,white:F,black:w}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return 0!==r(t,e,n)}},function(t,e,n){var r=n(895),i=n(1081),o=n(777),a=n(898),A=n(897),s=n(899);t.exports=function(t,e,n,c){switch(e){case"===":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t===n;case"!==":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return r(t,n,c);case"!=":return i(t,n,c);case">":return o(t,n,c);case">=":return a(t,n,c);case"<":return A(t,n,c);case"<=":return s(t,n,c);default:throw new TypeError("Invalid operator: ".concat(e))}}},function(t,e,n){var r=n(502);t.exports=function(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=r(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o,a=!0,A=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(A)throw o}}}}},function(t){t.exports=JSON.parse('{"a":"5.13.0"}')},function(t,e,n){"use strict";n.r(e);var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),i=new Uint8Array(16);function o(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}for(var a=[],A=0;A<256;++A)a[A]=(A+256).toString(16).substr(1);var s,c,u=function(t,e){var n=e||0,r=a;return[r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]]].join("")},l=0,g=0;var f=function(t,e,n){var r=e&&n||0,i=e||[],a=(t=t||{}).node||s,A=void 0!==t.clockseq?t.clockseq:c;if(null==a||null==A){var f=t.random||(t.rng||o)();null==a&&(a=s=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==A&&(A=c=16383&(f[6]<<8|f[7]))}var h=void 0!==t.msecs?t.msecs:(new Date).getTime(),d=void 0!==t.nsecs?t.nsecs:g+1,I=h-l+(d-g)/1e4;if(I<0&&void 0===t.clockseq&&(A=A+1&16383),(I<0||h>l)&&void 0===t.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=h,g=d,c=A;var p=(1e4*(268435455&(h+=122192928e5))+d)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var C=h/4294967296*1e4&268435455;i[r++]=C>>>8&255,i[r++]=255&C,i[r++]=C>>>24&15|16,i[r++]=C>>>16&255,i[r++]=A>>>8|128,i[r++]=255&A;for(var y=0;y<6;++y)i[r+y]=a[y];return e||u(i)};var h=function(t,e,n){var r=function(t,r,i,o){var a=i&&o||0;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(t)),"string"==typeof r&&(r=function(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,(function(t){e.push(parseInt(t,16))})),e}(r)),!Array.isArray(t))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var A=n(r.concat(t));if(A[6]=15&A[6]|e,A[8]=63&A[8]|128,i)for(var s=0;s<16;++s)i[a+s]=A[s];return i||u(A)};try{r.name=t}catch(i){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r};function d(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function I(t,e,n,r,i,o){return d((a=d(d(e,t),d(r,o)))<<(A=i)|a>>>32-A,n);var a,A}function p(t,e,n,r,i,o,a){return I(e&n|~e&r,t,e,i,o,a)}function C(t,e,n,r,i,o,a){return I(e&r|n&~r,t,e,i,o,a)}function y(t,e,n,r,i,o,a){return I(e^n^r,t,e,i,o,a)}function v(t,e,n,r,i,o,a){return I(n^(e|~r),t,e,i,o,a)}var B=h("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}return function(t){var e,n,r,i=[],o=32*t.length;for(e=0;e<o;e+=8)n=t[e>>5]>>>e%32&255,r=parseInt("0123456789abcdef".charAt(n>>>4&15)+"0123456789abcdef".charAt(15&n),16),i.push(r);return i}(function(t,e){var n,r,i,o,a;t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var A=1732584193,s=-271733879,c=-1732584194,u=271733878;for(n=0;n<t.length;n+=16)r=A,i=s,o=c,a=u,A=p(A,s,c,u,t[n],7,-680876936),u=p(u,A,s,c,t[n+1],12,-389564586),c=p(c,u,A,s,t[n+2],17,606105819),s=p(s,c,u,A,t[n+3],22,-1044525330),A=p(A,s,c,u,t[n+4],7,-176418897),u=p(u,A,s,c,t[n+5],12,1200080426),c=p(c,u,A,s,t[n+6],17,-1473231341),s=p(s,c,u,A,t[n+7],22,-45705983),A=p(A,s,c,u,t[n+8],7,1770035416),u=p(u,A,s,c,t[n+9],12,-1958414417),c=p(c,u,A,s,t[n+10],17,-42063),s=p(s,c,u,A,t[n+11],22,-1990404162),A=p(A,s,c,u,t[n+12],7,1804603682),u=p(u,A,s,c,t[n+13],12,-40341101),c=p(c,u,A,s,t[n+14],17,-1502002290),s=p(s,c,u,A,t[n+15],22,1236535329),A=C(A,s,c,u,t[n+1],5,-165796510),u=C(u,A,s,c,t[n+6],9,-1069501632),c=C(c,u,A,s,t[n+11],14,643717713),s=C(s,c,u,A,t[n],20,-373897302),A=C(A,s,c,u,t[n+5],5,-701558691),u=C(u,A,s,c,t[n+10],9,38016083),c=C(c,u,A,s,t[n+15],14,-660478335),s=C(s,c,u,A,t[n+4],20,-405537848),A=C(A,s,c,u,t[n+9],5,568446438),u=C(u,A,s,c,t[n+14],9,-1019803690),c=C(c,u,A,s,t[n+3],14,-187363961),s=C(s,c,u,A,t[n+8],20,1163531501),A=C(A,s,c,u,t[n+13],5,-1444681467),u=C(u,A,s,c,t[n+2],9,-51403784),c=C(c,u,A,s,t[n+7],14,1735328473),s=C(s,c,u,A,t[n+12],20,-1926607734),A=y(A,s,c,u,t[n+5],4,-378558),u=y(u,A,s,c,t[n+8],11,-2022574463),c=y(c,u,A,s,t[n+11],16,1839030562),s=y(s,c,u,A,t[n+14],23,-35309556),A=y(A,s,c,u,t[n+1],4,-1530992060),u=y(u,A,s,c,t[n+4],11,1272893353),c=y(c,u,A,s,t[n+7],16,-155497632),s=y(s,c,u,A,t[n+10],23,-1094730640),A=y(A,s,c,u,t[n+13],4,681279174),u=y(u,A,s,c,t[n],11,-358537222),c=y(c,u,A,s,t[n+3],16,-722521979),s=y(s,c,u,A,t[n+6],23,76029189),A=y(A,s,c,u,t[n+9],4,-640364487),u=y(u,A,s,c,t[n+12],11,-421815835),c=y(c,u,A,s,t[n+15],16,530742520),s=y(s,c,u,A,t[n+2],23,-995338651),A=v(A,s,c,u,t[n],6,-198630844),u=v(u,A,s,c,t[n+7],10,1126891415),c=v(c,u,A,s,t[n+14],15,-1416354905),s=v(s,c,u,A,t[n+5],21,-57434055),A=v(A,s,c,u,t[n+12],6,1700485571),u=v(u,A,s,c,t[n+3],10,-1894986606),c=v(c,u,A,s,t[n+10],15,-1051523),s=v(s,c,u,A,t[n+1],21,-2054922799),A=v(A,s,c,u,t[n+8],6,1873313359),u=v(u,A,s,c,t[n+15],10,-30611744),c=v(c,u,A,s,t[n+6],15,-1560198380),s=v(s,c,u,A,t[n+13],21,1309151649),A=v(A,s,c,u,t[n+4],6,-145523070),u=v(u,A,s,c,t[n+11],10,-1120210379),c=v(c,u,A,s,t[n+2],15,718787259),s=v(s,c,u,A,t[n+9],21,-343485551),A=d(A,r),s=d(s,i),c=d(c,o),u=d(u,a);return[A,s,c,u]}(function(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t[e/8])<<e%32;return n}(t),8*t.length))}));var m=function(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var a=0;a<16;++a)e[r+a]=i[a];return e||u(i)};function b(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function E(t,e){return t<<e|t>>>32-e}var Q=h("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=r.charCodeAt(i)}t.push(128);var o=t.length/4+2,a=Math.ceil(o/16),A=new Array(a);for(i=0;i<a;i++){A[i]=new Array(16);for(var s=0;s<16;s++)A[i][s]=t[64*i+4*s]<<24|t[64*i+4*s+1]<<16|t[64*i+4*s+2]<<8|t[64*i+4*s+3]}for(A[a-1][14]=8*(t.length-1)/Math.pow(2,32),A[a-1][14]=Math.floor(A[a-1][14]),A[a-1][15]=8*(t.length-1)&4294967295,i=0;i<a;i++){for(var c=new Array(80),u=0;u<16;u++)c[u]=A[i][u];for(u=16;u<80;u++)c[u]=E(c[u-3]^c[u-8]^c[u-14]^c[u-16],1);var l=n[0],g=n[1],f=n[2],h=n[3],d=n[4];for(u=0;u<80;u++){var I=Math.floor(u/20),p=E(l,5)+b(I,g,f,h)+d+e[I]+c[u]>>>0;d=h,h=f,f=E(g,30)>>>0,g=l,l=p}n[0]=n[0]+l>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+f>>>0,n[3]=n[3]+h>>>0,n[4]=n[4]+d>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));n.d(e,"v1",(function(){return f})),n.d(e,"v3",(function(){return B})),n.d(e,"v4",(function(){return m})),n.d(e,"v5",(function(){return Q}))},function(t,e,n){"use strict";n.r(e);var r=n(314);var i=function(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=function(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(t),o=0,a=1;a<i.length;)n=r||i[0],o+=((r=i[a])[0]-n[0])*(r[1]+n[1]),a++;return o>0};function o(t,e){if(!A(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&s(n),r&&c(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function a(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function A(t){return!!t&&t.constructor===Object}function s(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!a(t))throw new Error("bbox must only contain numbers")}))}function c(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function u(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function l(t,e){var n,r,i,o,a,A,s,c,u,l,g=0,f="FeatureCollection"===t.type,h="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(A=f?t.features[n].geometry:h?t.geometry:t,c=f?t.features[n].properties:h?t.properties:{},u=f?t.features[n].bbox:h?t.bbox:void 0,l=f?t.features[n].id:h?t.id:void 0,a=(s=!!A&&"GeometryCollection"===A.type)?A.geometries.length:1,i=0;i<a;i++)if(null!==(o=s?A.geometries[i]:A))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,g,c,u,l))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],g,c,u,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,g,c,u,l))return!1;g++}}function g(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function f(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return l(t,(function(t){f(t,e)})),t;case"LineString":return h(g(t),e),t;case"Polygon":return d(g(t),e),t;case"MultiLineString":return g(t).forEach((function(t){h(t,e)})),t;case"MultiPolygon":return g(t).forEach((function(t){d(t,e)})),t;case"Point":case"MultiPoint":return t}}function h(t,e){i(t)===e&&t.reverse()}function d(t,e){i(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)i(t[n])===e&&t[n].reverse()}e.default=function(t,e){if(!A(e=e||{}))throw new Error("options is invalid");var n=e.reverse||!1,i=e.mutate||!1;if(!t)throw new Error("<geojson> is required");if("boolean"!==typeof n)throw new Error("<reverse> must be a boolean");if("boolean"!==typeof i)throw new Error("<mutate> must be a boolean");!1===i&&(t=Object(r.a)(t));var a=[];switch(t.type){case"GeometryCollection":return l(t,(function(t){f(t,n)})),t;case"FeatureCollection":return u(t,(function(t){u(f(t,n),(function(t){a.push(t)}))})),o(a)}return f(t,n)}},function(t,e,n){"use strict";n.r(e);var r=n(314);function i(t,e,n){if(!A(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&s(r),i&&c(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function o(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!a(t[0])||!a(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function a(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function A(t){return!!t&&t.constructor===Object}function s(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!a(t))throw new Error("bbox must only contain numbers")}))}function c(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function u(t,e,n){if(null!==t)for(var r,i,o,a,A,s,c,l,g=0,f=0,h=t.type,d="FeatureCollection"===h,I="Feature"===h,p=d?t.features.length:1,C=0;C<p;C++){A=(l=!!(c=d?t.features[C].geometry:I?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<A;y++){var v=0,B=0;if(null!==(a=l?c.geometries[y]:c)){s=a.coordinates;var m=a.type;switch(g=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(s,f,C,v,B))return!1;f++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<s.length;r++){if(!1===e(s[r],f,C,v,B))return!1;f++,"MultiPoint"===m&&v++}"LineString"===m&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<s.length;r++){for(i=0;i<s[r].length-g;i++){if(!1===e(s[r][i],f,C,v,B))return!1;f++}"MultiLineString"===m&&v++,"Polygon"===m&&B++}"Polygon"===m&&v++;break;case"MultiPolygon":for(r=0;r<s.length;r++){for("MultiPolygon"===m&&(B=0),i=0;i<s[r].length;i++){for(o=0;o<s[r][i].length-g;o++){if(!1===e(s[r][i][o],f,C,v,B))return!1;f++}B++}v++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===u(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function l(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}var g=function(t){var e=[1/0,1/0,-1/0,-1/0];return u(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e};var f=function(t,e){if(!A(e=e||{}))throw new Error("options is invalid");var n=e.properties;if(!t)throw new Error("geojson is required");var r=g(t);return o([(r[0]+r[2])/2,(r[1]+r[3])/2],n)};var h=function(t,e){var n=0,r=0,i=0;return u(t,(function(t){n+=t[0],r+=t[1],i++}),!0),o([n/i,r/i],e)},d=n(553),I=n(554),p=n(333);function C(t,e,n){var r="Point"===function(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}(t);return n=function(t,e){void 0!==e&&null!==e||(e="centroid");if(Array.isArray(e)||"object"===typeof e)return function(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e);var n=t.bbox?t.bbox:g(t),r=n[0],i=n[1],a=n[2],A=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return o([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return o([a,i]);case"nw":case"northwest":case"westnorth":case"topleft":return o([r,A]);case"ne":case"northeast":case"eastnorth":case"topright":return o([a,A]);case"center":return f(t);case void 0:case null:case"centroid":return h(t);default:throw new Error("invalid origin")}}(t,n),1===e||r||u(t,(function(t){var r=Object(I.a)(n,t),i=Object(d.a)(n,t),o=r*e,a=function(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Object(p.a)(n,o,i));t[0]=a[0],t[1]=a[1],3===t.length&&(t[2]*=e)})),t}e.default=function(t,e,n){if(!A(n=n||{}))throw new Error("options is invalid");var i=n.origin,o=n.mutate;if(!t)throw new Error("geojson required");if("number"!==typeof e||0===e)throw new Error("invalid factor");var a=Array.isArray(i)||"object"===typeof i;return!0!==o&&(t=Object(r.a)(t)),"FeatureCollection"!==t.type||a?C(t,e,i):(l(t,(function(n,r){t.features[r]=C(n,e,i)})),t)}},function(t,e,n){"use strict";n.r(e);function r(t){return!!t&&t.constructor===Object}function i(t,e,n){if(null!==t)for(var r,o,a,A,s,c,u,l,g=0,f=0,h=t.type,d="FeatureCollection"===h,I="Feature"===h,p=d?t.features.length:1,C=0;C<p;C++){s=(l=!!(u=d?t.features[C].geometry:I?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var v=0,B=0;if(null!==(A=l?u.geometries[y]:u)){c=A.coordinates;var m=A.type;switch(g=!n||"Polygon"!==m&&"MultiPolygon"!==m?0:1,m){case null:break;case"Point":if(!1===e(c,f,C,v,B))return!1;f++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===e(c[r],f,C,v,B))return!1;f++,"MultiPoint"===m&&v++}"LineString"===m&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-g;o++){if(!1===e(c[r][o],f,C,v,B))return!1;f++}"MultiLineString"===m&&v++,"Polygon"===m&&B++}"Polygon"===m&&v++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for("MultiPolygon"===m&&(B=0),o=0;o<c[r].length;o++){for(a=0;a<c[r][o].length-g;a++){if(!1===e(c[r][o][a],f,C,v,B))return!1;f++}B++}v++}break;case"GeometryCollection":for(r=0;r<A.geometries.length;r++)if(!1===i(A.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var o=n(314),a=n(333);e.default=function(t,e,n,A){if(!r(A=A||{}))throw new Error("options is invalid");var s=A.units,c=A.zTranslation,u=A.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(c&&"number"!==typeof c&&isNaN(c))throw new Error("zTranslation is not a number");if(c=void 0!==c?c:0,0===e&&0===c)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==u&&void 0!==u||(t=Object(o.a)(t)),i(t,(function(t){var r=function(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Object(a.a)(t,e,n,{units:s}));t[0]=r[0],t[1]=r[1],c&&3===t.length&&(t[2]+=c)})),t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(18),i=n(12),o=n(0),a=n.n(o),A=n(63),s=n(158),c=n(201),u=n(908);function l(t){var e=t.coordinationScopes,n=t.removeGridComponent,o=t.theme,l=Object(A.d)(s.b.status,e),g=Object(i.a)(l,1)[0],f=g.cellHighlight,h=g.geneHighlight,d=g.moleculeHighlight,I=Object(A.p)(),p=[].concat(Object(r.a)(f?["Hovered cell ".concat(f)]:[]),Object(r.a)(h?["Hovered gene ".concat(h)]:[]),Object(r.a)(d?["Hovered gene ".concat(d)]:[])).join("; ");return a.a.createElement(c.a,{title:"Status",theme:o,removeGridComponent:n,isScroll:!0,isReady:!0},a.a.createElement(u.a,{warn:I,info:p}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(12),i=n(0),o=n.n(i),a=n(92),A=n(141),s=n(156),c=n(63),u=n(158),l=n(201),g=n(910),f=["expression-matrix"];function h(t){var e=t.coordinationScopes,n=t.removeGridComponent,h=t.variablesLabelOverride,d=void 0===h?"gene":h,I=t.variablesPluralLabelOverride,p=void 0===I?"".concat(d,"s"):I,C=t.theme,y=Object(c.h)(),v=Object(c.d)(u.b.genes,e),B=Object(r.a)(v,2),m=B[0],b=m.dataset,E=m.geneSelection,Q=m.geneFilter,F=m.cellColorEncoding,w=B[1],S=w.setGeneSelection,R=w.setGeneFilter,U=w.setGeneHighlight,x=w.setCellColorEncoding,k=Object(A.d)(),O=Object(r.a)(k,3),N=O[0],D=O[1],G=O[2],_=Object(A.c)(f),M=Object(r.a)(_,3),T=M[0],j=M[1],L=M[2];Object(i.useEffect)((function(){G(),L()}),[y,b]);var V=Object(s.d)(y,b,j,D,!0),Z=Object(r.a)(V,1)[0],P=Z?Z.cols:[],W=P.length;return o.a.createElement(l.a,{title:"Expression Levels",info:"".concat(W," ").concat(Object(a.d)(d,p,W)),theme:C,isScroll:!0,removeGridComponent:n,isReady:T,urls:N},o.a.createElement(g.a,{hasColorEncoding:"geneSelection"===F,geneList:P,geneSelection:E,geneFilter:Q,setGeneSelection:function(t){S(t),x("geneSelection")},setGeneFilter:R,setGeneHighlight:U}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var r=n(26),i=n(16),o=n(18),a=n(12),A=n(0),s=n.n(A),c=n(84),u=n.n(c),l=n(558),g=n(63),f=n(158),h=n(911),d=n(201),I=n(121),p=n(116),C=n(384),y=n(85),v=n(141),B=n(75),m=n(156),b=["cells","cell-sets"];function E(t){var e=t.coordinationScopes,n=t.removeGridComponent,c=t.initializeSelection,E=void 0===c||c,Q=t.initializeColor,F=void 0===Q||Q,w=t.theme,S=Object(g.h)(),R=Object(g.n)(),U=Object(g.d)(f.b.cellSets,e),x=Object(a.a)(U,2),k=x[0],O=k.dataset,N=k.cellSetSelection,D=k.cellSetColor,G=k.additionalCellSets,_=k.cellColorEncoding,M=x[1],T=M.setCellSetSelection,j=M.setCellColorEncoding,L=M.setCellSetColor,V=M.setAdditionalCellSets,Z=Object(v.d)(),P=Object(a.a)(Z,3),W=P[0],J=P[1],H=P[2],Y=Object(v.c)(b),X=Object(a.a)(Y,3),z=X[0],K=X[1],q=X[2],$=Object(A.useState)({}),tt=Object(a.a)($,2),et=tt[0],nt=tt[1],rt=Object(A.useState)({}),it=Object(a.a)(rt,2),ot=it[0],at=it[1],At=Object(A.useState)([]),st=Object(a.a)(At,2),ct=st[0],ut=st[1];Object(A.useEffect)((function(){H(),q(),nt({}),at({}),ut([])}),[S,O]);var lt=Object(m.b)(S,O,K,J,!0),gt=Object(a.a)(lt,1)[0],ft=Object(m.a)(S,O,K,J,!0,(function(t){if(t&&t.tree.length>=1){var e=t.tree[0].name,n=t.tree[0].children.map((function(t){return[e,t.name]}));nt((function(t){return Object(i.a)({},O,[].concat(Object(o.a)(t[O]||[]),Object(o.a)(n)))}));var r=Object(I.c)(t,D);at((function(t){return Object(i.a)({},O,[].concat(Object(o.a)(t[O]||[]),Object(o.a)(r)))}))}else nt((function(t){return Object(i.a)({},O,t[O]||[])})),at((function(t){return Object(i.a)({},O,t[O]||[])}))})),ht=Object(a.a)(ft,1)[0];Object(A.useEffect)((function(){z&&E&&et[O]&&!N&&T(et[O])}),[O,et,z,N,T,E]),Object(A.useEffect)((function(){z&&F&&ot[O]&&!D&&L(ot[O])}),[O,ot,z,L,F,D]),Object(A.useEffect)((function(){if(G){var t;try{t=Object(C.f)(G,y.h)}catch(e){return void R(e.message)}V(t)}}),[G,V,R]);var dt=Object(A.useMemo)((function(){return gt?Object.keys(gt):[]}),[gt]);function It(){j("cellSetSelection")}var pt=Object(A.useMemo)((function(){return Object(B.n)(ht,G)}),[ht,G]),Ct=Object(A.useMemo)((function(){return N&&N.length>0&&pt&&pt.tree.length>0?Object(I.p)(pt,N):null}),[N,pt]);return s.a.createElement(d.a,{title:"Cell Sets",isScroll:!0,removeGridComponent:n,urls:W,theme:w,isReady:z},s.a.createElement(h.a,{setColor:D,sets:ht,additionalSets:G,levelSelection:Ct,setSelection:N,setExpansion:ct,hasColorEncoding:"cellSetSelection"===_,draggable:!0,datatype:y.h,onError:R,onCheckNode:function(t,e){var n=Array.isArray(t)?t:t.split(p.a);t&&(T(e?[].concat(Object(o.a)(N),[n]):N.filter((function(t){return!u()(t,n)}))),It())},onExpandNode:function(t,e,n){ut(n?function(t){return[].concat(Object(o.a)(t),[e.split(p.a)])}:function(t){return t.filter((function(t){return!u()(t,e.split(p.a))}))})},onDropNode:function(t,e,n,i){var a=t.split(p.a),A=Object(I.l)(G,a);if(A.children||i){var s=0===a.length-1,c=e.split(p.a),l=Object(I.l)(G,c);if(!s||!i||l.children){var g,f,h;s?h=G.tree.findIndex((function(t){return t.name===A.name})):(f=a.slice(0,-1),h=(g=Object(I.l)(G,f)).children.findIndex((function(t){return t.name===A.name})));var d=l.name;if(!(!s&&i?g.children.find((function(t){return t!==l&&t.name===d})):i?G.tree.find((function(t){return t!==l&&t.name===d})):A.children.find((function(t){return t!==l&&t.name===d})))){var C=Object(r.a)({},G,{tree:G.tree.map((function(t){return Object(I.a)(t,[],c)})).filter(Boolean)});h=s?C.tree.findIndex((function(t){return t.name===A.name})):g.children.findIndex((function(t){return t.name===A.name}));var y=[];if(i&&s)if(-1===n)C.tree.unshift(l),V(C),y=[l.name],T([y]);else{var v=h+(n>h?1:0),B=Array.from(C.tree);B.splice(v,0,l),C.tree=B,V(C),y=[l.name],T([y])}else{var m,b,E=[];if(i){if(!s)if(b=function(t){return u()(t,f)},-1===n)m=function(t){return Object(I.f)(t,l)};else{var Q=h+(n>h?1:0);m=function(t){return Object(I.e)(t,l,Q)}}}else m=function(t){return Object(I.d)(t,l)},b=function(t){return u()(t,a)};C.tree=C.tree.map((function(t){return Object(I.i)(t,(function(t,e){return b(e)}),(function(t){return m(t)}),E)})),V(C),y=[].concat(Object(o.a)(E[0]),[l.name]),T([y])}var F=D.filter((function(t){return Object(p.f)(c,t.path)})).map((function(t){return Object(r.a)({},t,{path:u()(t.path,c)?y:y.concat(t.path.slice(c.length))})})),w=D.filter((function(t){return!Object(p.f)(c,t.path)}));w.push.apply(w,Object(o.a)(F)),L(w)}}}},onCheckLevel:function(t,e){var n=pt.tree.find((function(e){return e.name===t}));if(n){var r=Object(I.g)(n,e,[],!0);T(r),It()}},onNodeSetColor:function(t,e){var n=null===D||void 0===D?void 0:D.find((function(e){return u()(e.path,t)}));L([].concat(n?Object(o.a)(D.filter((function(e){return!u()(e.path,t)}))):Object(o.a)(D||[]),[{path:t,color:e}]))},onNodeSetName:function(t,e){var n=Object(o.a)(t);n.pop(),n.push(e);var i=Object(r.a)({},G,{tree:G.tree.map((function(n){return function n(i,a){return u()([].concat(Object(o.a)(a),[i.name]),t)?Object(r.a)({},i,{name:e}):i.children?Object(r.a)({},i,{children:i.children.map((function(t){return n(t,[].concat(Object(o.a)(a),[i.name]))}))}):i}(n,[])}))}),a=D.map((function(e){return{path:Object(p.h)(t,e.path,n),color:e.color}})),A=N.map((function(e){return Object(p.h)(t,e,n)})),s=ct.map((function(e){return Object(p.h)(t,e,n)}));V(i),L(a),T(A),ut(s)},onNodeCheckNewName:function(t,e){var n=Object(o.a)(t);return n.pop(),n.push(e),!u()(t,n)&&Object(I.l)(G,n)},onNodeRemove:function(t){var e=Object(r.a)({},G,{tree:G.tree.map((function(e){return Object(I.a)(e,[],t)})).filter(Boolean)}),n=D.filter((function(e){return!Object(p.f)(t,e.path)})),i=N.filter((function(e){return!Object(p.f)(t,e)})),o=ct.filter((function(e){return!Object(p.f)(t,e)}));V(e),L(n),T(i),ut(o)},onNodeView:function(t){var e=[];!function t(n,r){ct.find((function(t){return u()(r,t)}))&&n.children?n.children.forEach((function(e){t(e,[].concat(Object(o.a)(r),[e.name]))})):e.push(r)}(Object(I.l)(pt,t),t),T(e),It()},onImportTree:function(t){if(!Object(I.u)(pt,t)){V(Object(r.a)({},G||Object(I.m)(y.h),{tree:[].concat(Object(o.a)(G?G.tree:[]),Object(o.a)(t.tree))}));var e=Object(I.c)(t,D);L([].concat(Object(o.a)(D),Object(o.a)(e)))}},onCreateLevelZeroNode:function(){var t=Object(B.m)(null===G||void 0===G?void 0:G.tree,"My hierarchy ");V(Object(r.a)({},G||Object(I.m)(y.h),{tree:[].concat(Object(o.a)(G?G.tree:[]),[{name:t,children:[]}])}))},onExportLevelZeroNodeJSON:function(t){var e=Object(I.j)(pt,t,y.h,D),n=e.treeToExport,r=e.nodeName;Object(C.a)(Object(C.b)(n),"".concat(r,"_").concat(l.name,"-").concat(y.h,"-hierarchy.").concat(y.a))},onExportLevelZeroNodeTabular:function(t){var e=Object(I.j)(pt,t,y.h,D),n=e.treeToExport,r=e.nodeName;Object(C.a)(Object(C.c)(n),"".concat(r,"_").concat(l.name,"-").concat(y.h,"-hierarchy.").concat(y.b))},onExportSetJSON:function(t){var e=Object(I.k)(pt,t),n=e.setToExport,r=e.nodeName;Object(C.a)(Object(C.b)(n),"".concat(r,"_").concat(l.name,"-").concat(y.h,"-set.").concat(y.a),y.a)},onUnion:function(){var t=Object(I.t)(pt,N);Object(B.o)(t,G,D,T,V,L,j,"Union ")},onIntersection:function(){var t=Object(I.q)(pt,N);Object(B.o)(t,G,D,T,V,L,j,"Intersection ")},onComplement:function(){var t=Object(I.o)(pt,N,dt);Object(B.o)(t,G,D,T,V,L,j,"Complement ")},hasCheckedSetsToUnion:(null===N||void 0===N?void 0:N.length)>1,hasCheckedSetsToIntersect:(null===N||void 0===N?void 0:N.length)>1,hasCheckedSetsToComplement:(null===N||void 0===N?void 0:N.length)>0}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(12),i=n(0),o=n.n(i),a=n(201),A=n(63),s=n(158),c=n(141),u=n(75),l=n(156),g=n(121),f=n(909),h=["cell-sets"];function d(t){var e=t.coordinationScopes,n=t.removeGridComponent,d=t.theme,I=Object(A.h)(),p=Object(A.d)(s.b.cellSetSizes,e),C=Object(r.a)(p,1)[0],y=C.dataset,v=C.cellSetSelection,B=C.cellSetColor,m=C.additionalCellSets,b=Object(c.b)(),E=Object(r.a)(b,3),Q=E[0],F=E[1],w=E[2],S=Object(c.d)(),R=Object(r.a)(S,3),U=R[0],x=R[1],k=R[2],O=Object(c.c)(h),N=Object(r.a)(O,3),D=N[0],G=N[1],_=N[2];Object(i.useEffect)((function(){k(),_()}),[I,y]);var M=Object(l.a)(I,y,G,x,!0),T=Object(r.a)(M,1)[0],j=Object(i.useMemo)((function(){return Object(u.n)(T,m)}),[T,m]),L=Object(i.useMemo)((function(){return j&&v?Object(g.s)(j,v,B):[]}),[j,v,B]);return o.a.createElement(a.a,{title:"Cell Set Sizes",removeGridComponent:n,urls:U,theme:d,isReady:D},o.a.createElement("div",{ref:w,className:"vega-container"},o.a.createElement(f.a,{data:L,theme:d,width:Q,height:F})))}},function(t,e,n){"use strict";var r=n(5),i=n.n(r),o=n(18),a=n(26),A=n(21),s=n(12),c=n(0),u=n.n(c),l=n(792),g=n(201),f=n(912),h=n(789),d=n(387),I=n(788),p=n.n(I),C=n(902),y=n(234),v=Object(d.a)((function(){return{addButton:{marginTop:"10px",marginBottom:"10px",fontWeight:400}}}));function B(){return u.a.createElement(u.a.Fragment,null,u.a.createElement(p.a,null),"Add Image Layer")}var m=function(t){var e=t.imageOptions,n=t.handleImageAdd,r=Object(c.useReducer)((function(t){return!t}),!1),i=Object(s.a)(r,2),o=i[0],a=i[1],A=v();return e?u.a.createElement(y.b,{open:o,toggle:a,buttonIcon:u.a.createElement(B,null),buttonClassName:A.addButton},e.map((function(t,e){return u.a.createElement(C.a,{dense:!0,key:t.name,onClick:function(){return function(t){a(),n(t)}(e)}},u.a.createElement("span",null,t.name))}))):null},b=n(141),E=n(156),Q=n(63),F=n(158),w=n(267),S=n(120),R=["raster"];e.a=function(t){var e=t.coordinationScopes,n=t.removeGridComponent,r=t.theme,d=Object(Q.h)(),I=Object(Q.d)(F.b.layerController,e),p=Object(s.a)(I,2),C=p[0],y=C.dataset,v=C.spatialLayers,B=p[1].setSpatialLayers,U=Object(b.c)(R),x=Object(s.a)(U,3),k=x[0],O=x[1],N=x[2];Object(c.useEffect)((function(){N()}),[d,y]);var D=Object(E.h)(d,y,O,(function(){}),!1),G=Object(s.a)(D,3),_=(G[0],G[1]),M=G[2],T=function(){var t=Object(A.a)(i.a.mark((function t(e){var n,r,A,s,c,u,l;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=_[e],t.next=3,Object(w.a)(s);case 3:c=t.sent,u=Object(a.a)({type:"raster",index:e,modelMatrix:null===(n=M[e])||void 0===n||null===(r=n.metadata)||void 0===r||null===(A=r.transform)||void 0===A?void 0:A.matrix},S.f,{channels:c}),l=[].concat(Object(o.a)(v),[u]),B(l);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function j(t,e){var n=Object(o.a)(v);n[e]=t,B(n)}return u.a.createElement(g.a,{title:"Spatial Layers",isScroll:!0,removeGridComponent:n,theme:r,isReady:k},u.a.createElement("div",{className:"layer-controller-container"},v&&v.map((function(t,e){if("cells"===t.type)return u.a.createElement(h.a,{key:"".concat(y,"-cells"),label:"Cell Segmentations",layer:t,handleLayerChange:function(t){return j(t,e)}});if("molecules"===t.type)return u.a.createElement(h.a,{key:"".concat(y,"-molecules"),label:"Molecules",layer:t,handleLayerChange:function(t){return j(t,e)}});if("raster"===t.type){var n=t.index,i=_[n],a=M[n];return i&&a?u.a.createElement(l.a,{key:"".concat(y,"-raster-").concat(n,"-").concat(e),item:!0,style:{marginTop:"10px"}},u.a.createElement(f.a,{name:a.name,layer:t,loader:i,theme:r,handleLayerChange:function(t){return j(t,e)},handleLayerRemove:function(){return function(t){var e=Object(o.a)(v);e.splice(t,1),B(e)}(e)}})):null}return null})),u.a.createElement(l.a,{item:!0},u.a.createElement(m,{imageOptions:M,handleImageAdd:T}))))}},function(t,e,n){t.exports=function(){return n(1135)('!function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="./",e(e.s=23)}([function(t,n,e){var r=e(6)();t.exports=r},function(t,n){t.exports=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}},function(t,n,e){var r=e(22),o=e(5);t.exports=function(t,n,e){return void 0===e&&(e=n,n=void 0),void 0!==e&&(e=(e=o(e))===e?e:0),void 0!==n&&(n=(n=o(n))===n?n:0),r(o(t),n,e)}},function(t,n,e){var r=e(4),o=e(15),i=e(16),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},function(t,n,e){var r=e(12).Symbol;t.exports=r},function(t,n,e){var r=e(1),o=e(20),i=/^\\s+|\\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(r(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=r(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var e=c.test(t);return e||f.test(t)?l(t.slice(2),e?2:8):u.test(t)?NaN:+t}},function(t,n,e){var r=e(7),o=e(8),i=e(19);t.exports=function(t){return function(n,e,u){return u&&"number"!=typeof u&&o(n,e,u)&&(e=u=void 0),n=i(n),void 0===e?(e=n,n=0):e=i(e),u=void 0===u?n<e?1:-1:i(u),r(n,e,u,t)}}},function(t,n){var e=Math.ceil,r=Math.max;t.exports=function(t,n,o,i){for(var u=-1,c=r(e((n-t)/(o||1)),0),f=Array(c);c--;)f[i?c:++u]=t,t+=o;return f}},function(t,n,e){var r=e(9),o=e(10),i=e(18),u=e(1);t.exports=function(t,n,e){if(!u(e))return!1;var c=typeof n;return!!("number"==c?o(e)&&i(n,e.length):"string"==c&&n in e)&&r(e[n],t)}},function(t,n){t.exports=function(t,n){return t===n||t!==t&&n!==n}},function(t,n,e){var r=e(11),o=e(17);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,n,e){var r=e(3),o=e(1);t.exports=function(t){if(!o(t))return!1;var n=r(t);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}},function(t,n,e){var r=e(13),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,n,e){(function(n){var e="object"==typeof n&&n&&n.Object===Object&&n;t.exports=e}).call(this,e(14))},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(r){"object"===typeof window&&(e=window)}t.exports=e},function(t,n,e){var r=e(4),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,c=r?r.toStringTag:void 0;t.exports=function(t){var n=i.call(t,c),e=t[c];try{t[c]=void 0;var r=!0}catch(f){}var o=u.call(t);return r&&(n?t[c]=e:delete t[c]),o}},function(t,n){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},function(t,n){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,n){var e=/^(?:0|[1-9]\\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},function(t,n,e){var r=e(5);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}},function(t,n,e){var r=e(3),o=e(21);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,n){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,n){t.exports=function(t,n,e){return t===t&&(void 0!==e&&(t=t<=e?t:e),void 0!==n&&(t=t>=n?t:n)),t}},function(t,n,e){"use strict";e.r(n);var r=e(0),o=e.n(r);e(2);function i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var u,c=9728,f=10240,l=10241,a=10242,s=10243,p=33071;i(u={},l,c),i(u,f,c),i(u,a,p),i(u,s,p);function v(t,n){var e,r,i,u=n.tileSize,c=n.tileI,f=n.tileJ,l=n.numCells,a=n.numGenes,s=n.cellOrdering,p=n.cells,v=new Uint8Array(u*u),d=o()(u);return d.forEach((function(n){(r=f*u+n)<l&&(i=p.indexOf(s[r]))>=-1&&d.forEach((function(r){e=t[i*a+(c*u+r)],v[(u-r-1)*u+n]=e}))})),v}function d(t,n){var e,r,i,u,c=n.tileSize,f=n.tileI,l=n.tileJ,a=n.numCells,s=n.numGenes,p=n.cellOrdering,v=n.cells,d=new Uint8Array(c*c),b=o()(c);return b.forEach((function(n){(r=f*c+n)<a&&(u=v.indexOf(p[r]))>=-1&&b.forEach((function(r){e=(i=l*c+r)<s?t[u*s+i]:0,d[(c-n-1)*c+r]=e}))})),d}if("undefined"!==typeof self){const t={getTiles:function({curr:t,xTiles:n,yTiles:e,tileSize:r,cellOrdering:i,rows:u,cols:c,data:f,transpose:l}){const a=new Uint8Array(f),s=c.length,p=i.length,b=l?v:d;return[{tiles:o()(e).map(t=>o()(n).map(n=>b(a,{tileSize:r,tileI:t,tileJ:n,numCells:p,numGenes:s,cellOrdering:i,cells:u}))),buffer:f,curr:t},[f]]}};self.addEventListener("message",n=>{try{const[e,r]=n.data,[o,i]=t[e](r);self.postMessage(o,i)}catch(e){console.warn(e)}})}}]);\n//# sourceMappingURL=8b8b00e723ab0fcc7e0d.worker.js.map',null)}},function(t,e,n){(function(t){(function(e){"use strict";function n(){}function r(){r.init.call(this)}function i(t){return void 0===t._maxListeners?r.defaultMaxListeners:t._maxListeners}function o(t,e,n){if(e)t.call(n);else for(var r=t.length,i=f(t,r),o=0;o<r;++o)i[o].call(n)}function a(t,e,n,r){if(e)t.call(n,r);else for(var i=t.length,o=f(t,i),a=0;a<i;++a)o[a].call(n,r)}function A(t,e,n,r,i){if(e)t.call(n,r,i);else for(var o=t.length,a=f(t,o),A=0;A<o;++A)a[A].call(n,r,i)}function s(t,e,n,r,i,o){if(e)t.call(n,r,i,o);else for(var a=t.length,A=f(t,a),s=0;s<a;++s)A[s].call(n,r,i,o)}function c(t,e,n,r){if(e)t.apply(n,r);else for(var i=t.length,o=f(t,i),a=0;a<i;++a)o[a].apply(n,r)}function u(t,e,r,o){var a,A,s,c;if("function"!==typeof r)throw new TypeError('"listener" argument must be a function');if((A=t._events)?(A.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),A=t._events),s=A[e]):(A=t._events=new n,t._eventsCount=0),s){if("function"===typeof s?s=A[e]=o?[r,s]:[s,r]:o?s.unshift(r):s.push(r),!s.warned&&(a=i(t))&&a>0&&s.length>a){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,c=u,"function"===typeof console.warn?console.warn(c):console.log(c)}}else s=A[e]=r,++t._eventsCount;return t}function l(t,e,n){var r=!1;function i(){t.removeListener(e,i),r||(r=!0,n.apply(t,arguments))}return i.listener=n,i}function g(t){var e=this._events;if(e){var n=e[t];if("function"===typeof n)return 1;if(n)return n.length}return 0}function f(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}n.prototype=Object.create(null),r.EventEmitter=r,r.usingDomains=!1,r.prototype.domain=void 0,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.init=function(){this.domain=null,r.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new n,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(t){if("number"!==typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},r.prototype.getMaxListeners=function(){return i(this)},r.prototype.emit=function(t){var e,n,r,i,u,l,g,f="error"===t;if(l=this._events)f=f&&null==l.error;else if(!f)return!1;if(g=this.domain,f){if(e=arguments[1],!g){if(e instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=g,e.domainThrown=!1,g.emit("error",e),!1}if(!(n=l[t]))return!1;var d="function"===typeof n;switch(r=arguments.length){case 1:o(n,d,this);break;case 2:a(n,d,this,arguments[1]);break;case 3:A(n,d,this,arguments[1],arguments[2]);break;case 4:s(n,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),u=1;u<r;u++)i[u-1]=arguments[u];c(n,d,this,i)}return!0},r.prototype.addListener=function(t,e){return u(this,t,e,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(t,e){return u(this,t,e,!0)},r.prototype.once=function(t,e){if("function"!==typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,l(this,t,e)),this},r.prototype.prependOnceListener=function(t,e){if("function"!==typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,l(this,t,e)),this},r.prototype.removeListener=function(t,e){var r,i,o,a,A;if("function"!==typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener&&r.listener===e)0===--this._eventsCount?this._events=new n:(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!==typeof r){for(o=-1,a=r.length;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){A=r[a].listener,o=a;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0===--this._eventsCount)return this._events=new n,this;delete i[t]}else!function(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}(r,o);i.removeListener&&this.emit("removeListener",t,A||e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new n,this._eventsCount=0):r[t]&&(0===--this._eventsCount?this._events=new n:delete r[t]),this;if(0===arguments.length){for(var i,o=Object.keys(r),a=0;a<o.length;++a)"removeListener"!==(i=o[a])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new n,this._eventsCount=0,this}if("function"===typeof(e=r[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},r.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"===typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[]},r.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},r.prototype.listenerCount=g,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var h="undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},d=[],I=[],p="undefined"!==typeof Uint8Array?Uint8Array:Array,C=!1;function y(){C=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e<n;++e)d[e]=t[e],I[t.charCodeAt(e)]=e;I["-".charCodeAt(0)]=62,I["_".charCodeAt(0)]=63}function v(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(d[(i=r)>>18&63]+d[i>>12&63]+d[i>>6&63]+d[63&i]);return o.join("")}function B(t){var e;C||y();for(var n=t.length,r=n%3,i="",o=[],a=0,A=n-r;a<A;a+=16383)o.push(v(t,a,a+16383>A?A:a+16383));return 1===r?(e=t[n-1],i+=d[e>>2],i+=d[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=d[e>>10],i+=d[e>>4&63],i+=d[e<<2&63],i+="="),o.push(i),o.join("")}function m(t,e,n,r,i){var o,a,A=8*i-r-1,s=(1<<A)-1,c=s>>1,u=-7,l=n?i-1:0,g=n?-1:1,f=t[e+l];for(l+=g,o=f&(1<<-u)-1,f>>=-u,u+=A;u>0;o=256*o+t[e+l],l+=g,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+t[e+l],l+=g,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function b(t,e,n,r,i,o){var a,A,s,c=8*o-i-1,u=(1<<c)-1,l=u>>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(A=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+l>=1?g/s:g*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=u?(A=0,a=u):a+l>=1?(A=(e*s-1)*Math.pow(2,i),a+=l):(A=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&A,f+=h,A/=256,i-=8);for(a=a<<i|A,c+=i;c>0;t[n+f]=255&a,f+=h,a/=256,c-=8);t[n+f-h]|=128*d}var E={}.toString,Q=Array.isArray||function(t){return"[object Array]"==E.call(t)};function F(){return S.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(t,e){if(F()<e)throw new RangeError("Invalid typed array length");return S.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=S.prototype:(null===t&&(t=new S(e)),t.length=e),t}function S(t,e,n){if(!S.TYPED_ARRAY_SUPPORT&&!(this instanceof S))return new S(t,e,n);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return x(this,t)}return R(this,t,e,n)}function R(t,e,n,r){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),S.TYPED_ARRAY_SUPPORT?(t=e).__proto__=S.prototype:t=k(t,e),t}(t,e,n,r):"string"===typeof e?function(t,e,n){if("string"===typeof n&&""!==n||(n="utf8"),!S.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|D(e,n),i=(t=w(t,r)).write(e,n);return i!==r&&(t=t.slice(0,i)),t}(t,e,n):function(t,e){if(N(e)){var n=0|O(e.length);return 0===(t=w(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||(r=e.length)!==r?w(t,0):k(t,e);if("Buffer"===e.type&&Q(e.data))return k(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function U(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function x(t,e){if(U(e),t=w(t,e<0?0:0|O(e)),!S.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function k(t,e){var n=e.length<0?0:0|O(e.length);t=w(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function O(t){if(t>=F())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F().toString(16)+" bytes");return 0|t}function N(t){return!(null==t||!t._isBuffer)}function D(t,e){if(N(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return at(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return At(t).length;default:if(r)return at(t).length;e=(""+e).toLowerCase(),r=!0}}function G(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,e,n);case"utf8":case"utf-8":return H(this,e,n);case"ascii":return Y(this,e,n);case"latin1":case"binary":return X(this,e,n);case"base64":return J(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function M(t,e,n,r,i){if(0===t.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof e&&(e=S.from(e,r)),N(e))return 0===e.length?-1:T(t,e,n,r,i);if("number"===typeof e)return e&=255,S.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):T(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function T(t,e,n,r,i){var o,a=1,A=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,A/=2,s/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=n;o<A;o++)if(c(t,o)===c(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===s)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+s>A&&(n=A-s),o=n;o>=0;o--){for(var l=!0,g=0;g<s;g++)if(c(t,o+g)!==c(e,g)){l=!1;break}if(l)return o}return-1}function j(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var A=parseInt(e.substr(2*a,2),16);if(isNaN(A))return a;t[n+a]=A}return a}function L(t,e,n,r){return st(at(e,t.length-n),t,n,r)}function V(t,e,n,r){return st(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function Z(t,e,n,r){return V(t,e,n,r)}function P(t,e,n,r){return st(At(e),t,n,r)}function W(t,e,n,r){return st(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function J(t,e,n){return 0===e&&n===t.length?B(t):B(t.slice(e,n))}function H(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,A,s,c=t[i],u=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(u=c);break;case 2:128===(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(u=s);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:o=t[i+1],a=t[i+2],A=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&A)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&A)>65535&&s<1114112&&(u=s)}null===u?(u=65533,l=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}function Y(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function X(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function z(t,e,n){var r,i=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>i)&&(n=i);for(var o="",a=e;a<n;++a)o+=(r=t[a])<16?"0"+r.toString(16):r.toString(16);return o}function K(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function q(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,r,i,o){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function tt(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function et(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function nt(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function rt(t,e,n,r,i){return i||nt(t,0,n,4),b(t,e,n,r,23,4),n+4}function it(t,e,n,r,i){return i||nt(t,0,n,8),b(t,e,n,r,52,8),n+8}S.TYPED_ARRAY_SUPPORT=void 0===h.TYPED_ARRAY_SUPPORT||h.TYPED_ARRAY_SUPPORT,S.poolSize=8192,S._augment=function(t){return t.__proto__=S.prototype,t},S.from=function(t,e,n){return R(null,t,e,n)},S.TYPED_ARRAY_SUPPORT&&(S.prototype.__proto__=Uint8Array.prototype,S.__proto__=Uint8Array),S.alloc=function(t,e,n){return function(t,e,n,r){return U(e),e<=0?w(t,e):void 0!==n?"string"===typeof r?w(t,e).fill(n,r):w(t,e).fill(n):w(t,e)}(null,t,e,n)},S.allocUnsafe=function(t){return x(null,t)},S.allocUnsafeSlow=function(t){return x(null,t)},S.isBuffer=ct,S.compare=function(t,e){if(!N(t)||!N(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},S.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},S.concat=function(t,e){if(!Q(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return S.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=S.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!N(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},S.byteLength=D,S.prototype._isBuffer=!0,S.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},S.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},S.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},S.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?H(this,0,t):G.apply(this,arguments)},S.prototype.equals=function(t){if(!N(t))throw new TypeError("Argument must be a Buffer");return this===t||0===S.compare(this,t)},S.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},S.prototype.compare=function(t,e,n,r,i){if(!N(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),A=Math.min(o,a),s=this.slice(r,i),c=t.slice(e,n),u=0;u<A;++u)if(s[u]!==c[u]){o=s[u],a=c[u];break}return o<a?-1:a<o?1:0},S.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},S.prototype.indexOf=function(t,e,n){return M(this,t,e,n,!0)},S.prototype.lastIndexOf=function(t,e,n){return M(this,t,e,n,!1)},S.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"===typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return j(this,t,e,n);case"utf8":case"utf-8":return L(this,t,e,n);case"ascii":return V(this,t,e,n);case"latin1":case"binary":return Z(this,t,e,n);case"base64":return P(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},S.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),S.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=S.prototype;else{var i=e-t;n=new S(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},S.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},S.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},S.prototype.readUInt8=function(t,e){return e||q(t,1,this.length),this[t]},S.prototype.readUInt16LE=function(t,e){return e||q(t,2,this.length),this[t]|this[t+1]<<8},S.prototype.readUInt16BE=function(t,e){return e||q(t,2,this.length),this[t]<<8|this[t+1]},S.prototype.readUInt32LE=function(t,e){return e||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},S.prototype.readUInt32BE=function(t,e){return e||q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},S.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},S.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},S.prototype.readInt8=function(t,e){return e||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},S.prototype.readInt16LE=function(t,e){e||q(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},S.prototype.readInt16BE=function(t,e){e||q(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},S.prototype.readInt32LE=function(t,e){return e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},S.prototype.readInt32BE=function(t,e){return e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},S.prototype.readFloatLE=function(t,e){return e||q(t,4,this.length),m(this,t,!0,23,4)},S.prototype.readFloatBE=function(t,e){return e||q(t,4,this.length),m(this,t,!1,23,4)},S.prototype.readDoubleLE=function(t,e){return e||q(t,8,this.length),m(this,t,!0,52,8)},S.prototype.readDoubleBE=function(t,e){return e||q(t,8,this.length),m(this,t,!1,52,8)},S.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||$(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},S.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||$(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},S.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,255,0),S.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},S.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):tt(this,t,e,!0),e+2},S.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):tt(this,t,e,!1),e+2},S.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):et(this,t,e,!0),e+4},S.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):et(this,t,e,!1),e+4},S.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);$(this,t,e,n,i-1,-i)}var o=0,a=1,A=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===A&&0!==this[e+o-1]&&(A=1),this[e+o]=(t/a>>0)-A&255;return e+n},S.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);$(this,t,e,n,i-1,-i)}var o=n-1,a=1,A=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===A&&0!==this[e+o+1]&&(A=1),this[e+o]=(t/a>>0)-A&255;return e+n},S.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,127,-128),S.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},S.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):tt(this,t,e,!0),e+2},S.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):tt(this,t,e,!1),e+2},S.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),S.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):et(this,t,e,!0),e+4},S.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):et(this,t,e,!1),e+4},S.prototype.writeFloatLE=function(t,e,n){return rt(this,t,e,!0,n)},S.prototype.writeFloatBE=function(t,e,n){return rt(this,t,e,!1,n)},S.prototype.writeDoubleLE=function(t,e,n){return it(this,t,e,!0,n)},S.prototype.writeDoubleBE=function(t,e,n){return it(this,t,e,!1,n)},S.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!S.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},S.prototype.fill=function(t,e,n,r){if("string"===typeof t){if("string"===typeof e?(r=e,e=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!S.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=N(t)?t:at(new S(t,r).toString()),A=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%A]}return this};var ot=/[^+\/0-9A-Za-z-_]/g;function at(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function At(t){return function(t){var e,n,r,i,o,a;C||y();var A=t.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[A-2]?2:"="===t[A-1]?1:0,a=new p(3*A/4-o),r=o>0?A-4:A;var s=0;for(e=0,n=0;e<r;e+=4,n+=3)i=I[t.charCodeAt(e)]<<18|I[t.charCodeAt(e+1)]<<12|I[t.charCodeAt(e+2)]<<6|I[t.charCodeAt(e+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=I[t.charCodeAt(e)]<<2|I[t.charCodeAt(e+1)]>>4,a[s++]=255&i):1===o&&(i=I[t.charCodeAt(e)]<<10|I[t.charCodeAt(e+1)]<<4|I[t.charCodeAt(e+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(ot,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function st(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function ct(t){return null!=t&&(!!t._isBuffer||ut(t)||function(t){return"function"===typeof t.readFloatLE&&"function"===typeof t.slice&&ut(t.slice(0,0))}(t))}function ut(t){return!!t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function lt(){throw new Error("setTimeout has not been defined")}function gt(){throw new Error("clearTimeout has not been defined")}var ft=lt,ht=gt;function dt(t){if(ft===setTimeout)return setTimeout(t,0);if((ft===lt||!ft)&&setTimeout)return ft=setTimeout,setTimeout(t,0);try{return ft(t,0)}catch(e){try{return ft.call(null,t,0)}catch(e){return ft.call(this,t,0)}}}"function"===typeof h.setTimeout&&(ft=setTimeout),"function"===typeof h.clearTimeout&&(ht=clearTimeout);var It,pt=[],Ct=!1,yt=-1;function vt(){Ct&&It&&(Ct=!1,It.length?pt=It.concat(pt):yt=-1,pt.length&&Bt())}function Bt(){if(!Ct){var t=dt(vt);Ct=!0;for(var e=pt.length;e;){for(It=pt,pt=[];++yt<e;)It&&It[yt].run();yt=-1,e=pt.length}It=null,Ct=!1,function(t){if(ht===clearTimeout)return clearTimeout(t);if((ht===gt||!ht)&&clearTimeout)return ht=clearTimeout,clearTimeout(t);try{ht(t)}catch(e){try{return ht.call(null,t)}catch(e){return ht.call(this,t)}}}(t)}}function mt(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];pt.push(new bt(t,e)),1!==pt.length||Ct||dt(Bt)}function bt(t,e){this.fun=t,this.array=e}function Et(){}bt.prototype.run=function(){this.fun.apply(null,this.array)};var Qt=Et,Ft=Et,wt=Et,St=Et,Rt=Et,Ut=Et,xt=Et,kt=h.performance||{},Ot=kt.now||kt.mozNow||kt.msNow||kt.oNow||kt.webkitNow||function(){return(new Date).getTime()},Nt=new Date,Dt={nextTick:mt,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Qt,addListener:Ft,once:wt,off:St,removeListener:Rt,removeAllListeners:Ut,emit:xt,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*Ot.call(kt),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Nt)/1e3}},Gt="function"===typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},_t=/%[sdj%]/g;function Mt(t){if(!zt(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(Vt(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(t).replace(_t,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}})),a=r[n];n<i;a=r[++n])Xt(a)||!$t(a)?o+=" "+a:o+=" "+Vt(a);return o}function Tt(t,e){if(Kt(h.process))return function(){return Tt(t,e).apply(this,arguments)};var n=!1;return function(){return n||(console.error(e),n=!0),t.apply(this,arguments)}}var jt,Lt={};function Vt(t,e){var n={seen:[],stylize:Pt};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Yt(e)?n.showHidden=e:e&&ie(n,e),Kt(n.showHidden)&&(n.showHidden=!1),Kt(n.depth)&&(n.depth=2),Kt(n.colors)&&(n.colors=!1),Kt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Zt),Wt(n,t,n.depth)}function Zt(t,e){var n=Vt.styles[e];return n?"\x1b["+Vt.colors[n][0]+"m"+t+"\x1b["+Vt.colors[n][1]+"m":t}function Pt(t,e){return t}function Wt(t,e,n){if(t.customInspect&&e&&ne(e.inspect)&&e.inspect!==Vt&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return zt(r)||(r=Wt(t,r,n)),r}var i=function(t,e){if(Kt(e))return t.stylize("undefined","undefined");if(zt(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return"number"===typeof e?t.stylize(""+e,"number"):Yt(e)?t.stylize(""+e,"boolean"):Xt(e)?t.stylize("null","null"):void 0}(t,e);if(i)return i;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),ee(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Jt(e);if(0===o.length){if(ne(e)){var A=e.name?": "+e.name:"";return t.stylize("[Function"+A+"]","special")}if(qt(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(te(e))return t.stylize(Date.prototype.toString.call(e),"date");if(ee(e))return Jt(e)}var s,c,u="",l=!1,g=["{","}"];return s=e,Array.isArray(s)&&(l=!0,g=["[","]"]),ne(e)&&(u=" [Function"+(e.name?": "+e.name:"")+"]"),qt(e)&&(u=" "+RegExp.prototype.toString.call(e)),te(e)&&(u=" "+Date.prototype.toUTCString.call(e)),ee(e)&&(u=" "+Jt(e)),0!==o.length||l&&0!=e.length?n<0?qt(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=l?function(t,e,n,r,i){for(var o=[],a=0,A=e.length;a<A;++a)oe(e,String(a))?o.push(Ht(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Ht(t,e,n,r,i,!0))})),o}(t,e,n,a,o):o.map((function(r){return Ht(t,e,n,a,r,l)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(c,u,g)):g[0]+u+g[1]}function Jt(t){return"["+Error.prototype.toString.call(t)+"]"}function Ht(t,e,n,r,i,o){var a,A,s;if((s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?A=s.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):s.set&&(A=t.stylize("[Setter]","special")),oe(r,i)||(a="["+i+"]"),A||(t.seen.indexOf(s.value)<0?(A=Xt(n)?Wt(t,s.value,null):Wt(t,s.value,n-1)).indexOf("\n")>-1&&(A=o?A.split("\n").map((function(t){return"  "+t})).join("\n").substr(2):"\n"+A.split("\n").map((function(t){return"   "+t})).join("\n")):A=t.stylize("[Circular]","special")),Kt(a)){if(o&&i.match(/^\d+$/))return A;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+A}function Yt(t){return"boolean"===typeof t}function Xt(t){return null===t}function zt(t){return"string"===typeof t}function Kt(t){return void 0===t}function qt(t){return $t(t)&&"[object RegExp]"===re(t)}function $t(t){return"object"===typeof t&&null!==t}function te(t){return $t(t)&&"[object Date]"===re(t)}function ee(t){return $t(t)&&("[object Error]"===re(t)||t instanceof Error)}function ne(t){return"function"===typeof t}function re(t){return Object.prototype.toString.call(t)}function ie(t,e){if(!e||!$t(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function oe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ae(){this.head=null,this.tail=null,this.length=0}Vt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Vt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},ae.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},ae.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},ae.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},ae.prototype.clear=function(){this.head=this.tail=null,this.length=0},ae.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},ae.prototype.concat=function(t){if(0===this.length)return S.alloc(0);if(1===this.length)return this.head.data;for(var e=S.allocUnsafe(t>>>0),n=this.head,r=0;n;)n.data.copy(e,r),r+=n.data.length,n=n.next;return e};var Ae=S.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function se(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!Ae(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=ue;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=le;break;default:return void(this.write=ce)}this.charBuffer=new S(6),this.charReceived=0,this.charLength=0}function ce(t){return t.toString(this.encoding)}function ue(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function le(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}se.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(t=t.slice(n,t.length),!((r=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var r,i=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),i=(e+=t.toString(this.encoding,0,i)).length-1,(r=e.charCodeAt(i))>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},se.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},se.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e},de.ReadableState=he;var ge,fe=(ge="stream",Kt(jt)&&(jt=Dt.env.NODE_DEBUG||""),ge=ge.toUpperCase(),Lt[ge]||(new RegExp("\\b"+ge+"\\b","i").test(jt)?Lt[ge]=function(){var t=Mt.apply(null,arguments);console.error("%s %d: %s",ge,0,t)}:Lt[ge]=function(){}),Lt[ge]);function he(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof Ve&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new ae,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new se(t.encoding),this.encoding=t.encoding)}function de(t){if(!(this instanceof de))return new de(t);this._readableState=new he(t,this),this.readable=!0,t&&"function"===typeof t.read&&(this._read=t.read),r.call(this)}function Ie(t,e,n,r,i){var o=function(t,e){var n=null;return ct(e)||"string"===typeof e||null===e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,Ce(t)}}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var A=new Error("stream.unshift() after end event");t.emit("error",A)}else{var s;!e.decoder||i||r||(n=e.decoder.write(n),s=!e.objectMode&&0===n.length),i||(e.reading=!1),s||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&Ce(t))),function(t,e){e.readingMore||(e.readingMore=!0,mt(ve,t,e))}(t,e)}else i||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(e)}function pe(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function Ce(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(fe("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?mt(ye,t):ye(t))}function ye(t){fe("emit readable"),t.emit("readable"),be(t)}function ve(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(fe("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function Be(t){fe("readable nexttick read 0"),t.read(0)}function me(t,e){e.reading||(fe("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),be(t),e.flowing&&!e.reading&&t.read(0)}function be(t){var e=t._readableState;for(fe("flow",e.flowing);e.flowing&&null!==t.read(););}function Ee(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=S.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,a),0===(t-=a)){a===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e),r}(t,e.buffer,e.decoder),n);var n}function Qe(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,mt(Fe,e,t))}function Fe(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function we(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function Se(){}function Re(t,e,n){this.chunk=t,this.encoding=e,this.callback=n,this.next=null}function Ue(t,e){Object.defineProperty(this,"buffer",{get:Tt((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof Ve&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?mt(i,r):i(r),t._writableState.errorEmitted=!0,t.emit("error",r)}(t,n,r,e,i);else{var o=De(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||Ne(t,n),r?mt(Oe,t,n,o,i):Oe(t,n,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Me(this)}function xe(t){if(!(this instanceof xe)&&!(this instanceof Ve))return new xe(t);this._writableState=new Ue(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev)),r.call(this)}function ke(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Oe(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),_e(t,e)}function Ne(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var a=0;n;)i[a]=n,n=n.next,a+=1;ke(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Me(e)}else{for(;n;){var A=n.chunk,s=n.encoding,c=n.callback;if(ke(t,e,!1,e.objectMode?1:A.length,A,s,c),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function De(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function Ge(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function _e(t,e){var n=De(e);return n&&(0===e.pendingcb?(Ge(t,e),e.finished=!0,t.emit("finish")):Ge(t,e)),n}function Me(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Gt(de,r),de.prototype.push=function(t,e){var n=this._readableState;return n.objectMode||"string"!==typeof t||(e=e||n.defaultEncoding)!==n.encoding&&(t=S.from(t,e),e=""),Ie(this,n,t,e,!1)},de.prototype.unshift=function(t){return Ie(this,this._readableState,t,"",!0)},de.prototype.isPaused=function(){return!1===this._readableState.flowing},de.prototype.setEncoding=function(t){return this._readableState.decoder=new se(t),this._readableState.encoding=t,this},de.prototype.read=function(t){fe("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return fe("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Qe(this):Ce(this),null;if(0===(t=pe(t,e))&&e.ended)return 0===e.length&&Qe(this),null;var r,i=e.needReadable;return fe("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&fe("length less than watermark",i=!0),e.ended||e.reading?fe("reading or ended",i=!1):i&&(fe("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=pe(n,e))),null===(r=t>0?Ee(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Qe(this)),null!==r&&this.emit("data",r),r},de.prototype._read=function(t){this.emit("error",new Error("not implemented"))},de.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,fe("pipe count=%d opts=%j",r.pipesCount,e);var i=e&&!1===e.end?c:a;function o(t){fe("onunpipe"),t===n&&c()}function a(){fe("onend"),t.end()}r.endEmitted?mt(i):n.once("end",i),t.on("unpipe",o);var A=function(t){return function(){var e=t._readableState;fe("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,be(t))}}(n);t.on("drain",A);var s=!1;function c(){fe("cleanup"),t.removeListener("close",f),t.removeListener("finish",h),t.removeListener("drain",A),t.removeListener("error",g),t.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",c),n.removeListener("data",l),s=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||A()}var u=!1;function l(e){fe("ondata"),u=!1,!1!==t.write(e)||u||((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==we(r.pipes,t))&&!s&&(fe("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,u=!0),n.pause())}function g(e){fe("onerror",e),d(),t.removeListener("error",g),0===function(t,e){return t.listeners(e).length}(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",h),d()}function h(){fe("onfinish"),t.removeListener("close",f),d()}function d(){fe("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"===typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",f),t.once("finish",h),t.emit("pipe",n),r.flowing||(fe("pipe resume"),n.resume()),t},de.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=we(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},de.prototype.on=function(t,e){var n=r.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&Ce(this):mt(Be,this))}return n},de.prototype.addListener=de.prototype.on,de.prototype.resume=function(){var t=this._readableState;return t.flowing||(fe("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,mt(me,t,e))}(this,t)),this},de.prototype.pause=function(){return fe("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(fe("pause"),this._readableState.flowing=!1,this.emit("pause")),this},de.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;for(var i in t.on("end",(function(){if(fe("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)})),t.on("data",(function(i){fe("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)&&(r.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(["error","close","destroy","pause","resume"],(function(e){t.on(e,r.emit.bind(r,e))})),r._read=function(e){fe("wrapped _read",e),n&&(n=!1,t.resume())},r},de._fromList=Ee,xe.WritableState=Ue,Gt(xe,r),Ue.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},xe.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},xe.prototype.write=function(t,e,n){var r=this._writableState,i=!1;return"function"===typeof e&&(n=e,e=null),S.isBuffer(t)?e="buffer":e||(e=r.defaultEncoding),"function"!==typeof n&&(n=Se),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),mt(e,n)}(this,n):function(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):S.isBuffer(n)||"string"===typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),mt(r,o),i=!1),i}(this,r,t,n)&&(r.pendingcb++,i=function(t,e,n,r,i){n=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=S.from(e,n)),e}(e,n,r),S.isBuffer(n)&&(r="buffer");var o=e.objectMode?1:n.length;e.length+=o;var a=e.length<e.highWaterMark;if(a||(e.needDrain=!0),e.writing||e.corked){var A=e.lastBufferedRequest;e.lastBufferedRequest=new Re(n,r,i),A?A.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else ke(t,e,!1,o,n,r,i);return a}(this,r,t,e,n)),i},xe.prototype.cork=function(){this._writableState.corked++},xe.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Ne(this,t))},xe.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},xe.prototype._write=function(t,e,n){n(new Error("not implemented"))},xe.prototype._writev=null,xe.prototype.end=function(t,e,n){var r=this._writableState;"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,_e(t,e),n&&(e.finished?mt(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,r,n)},Gt(Ve,de);for(var Te=Object.keys(xe.prototype),je=0;je<Te.length;je++){var Le=Te[je];Ve.prototype[Le]||(Ve.prototype[Le]=xe.prototype[Le])}function Ve(t){if(!(this instanceof Ve))return new Ve(t);de.call(this,t),xe.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Ze)}function Ze(){this.allowHalfOpen||this._writableState.ended||mt(Pe,this)}function Pe(t){t.end()}function We(t){this.afterTransform=function(e,n){return function(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Je(t){if(!(this instanceof Je))return new Je(t);Ve.call(this,t),this._transformState=new We(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"===typeof t.transform&&(this._transform=t.transform),"function"===typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"===typeof this._flush?this._flush((function(t){He(e,t)})):He(e)}))}function He(t,e){if(e)return t.emit("error",e);var n=t._writableState,r=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function Ye(t){if(!(this instanceof Ye))return new Ye(t);Je.call(this,t)}function Xe(){r.call(this)}function ze(t){return(ze="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $e(t,e,n){return e&&qe(t.prototype,e),n&&qe(t,n),t}function tn(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nn(t,e)}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nn(t,e){return(nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function rn(t,e){return!e||"object"!==typeof e&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function on(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Gt(Je,Ve),Je.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ve.prototype.push.call(this,t,e)},Je.prototype._transform=function(t,e,n){throw new Error("Not implemented")},Je.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Je.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},Gt(Ye,Je),Ye.prototype._transform=function(t,e,n){n(null,t)},Gt(Xe,r),Xe.Readable=de,Xe.Writable=xe,Xe.Duplex=Ve,Xe.Transform=Je,Xe.PassThrough=Ye,Xe.Stream=Xe,Xe.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",A),n.on("close",s));var a=!1;function A(){a||(a=!0,t.end())}function s(){a||(a=!0,"function"===typeof t.destroy&&t.destroy())}function c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",A),n.removeListener("close",s),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t};var an="\n",An="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},sn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cn=/^\w*$/,un=/^\./,ln=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gn=/\\(\\)?/g,fn=/^\[object .+?Constructor\]$/,hn="object"==typeof An&&An&&An.Object===Object&&An,dn="object"==typeof self&&self&&self.Object===Object&&self,In=hn||dn||Function("return this")(),pn=Array.prototype,Cn=Function.prototype,yn=Object.prototype,vn=In["__core-js_shared__"],Bn=function(){var t=/[^.]+$/.exec(vn&&vn.keys&&vn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),mn=Cn.toString,bn=yn.hasOwnProperty,En=yn.toString,Qn=RegExp("^"+mn.call(bn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fn=In.Symbol,wn=pn.splice,Sn=Tn(In,"Map"),Rn=Tn(Object,"create"),Un=Fn?Fn.prototype:void 0,xn=Un?Un.toString:void 0;function kn(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function On(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Nn(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Dn(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!==n&&r!==r)return i;return-1}function Gn(t,e){for(var n,r=0,i=(e=function(t,e){if(Zn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Wn(t))||(cn.test(t)||!sn.test(t)||null!=e&&t in Object(e))}(e,t)?[e]:Zn(n=e)?n:jn(n)).length;null!=t&&r<i;)t=t[Ln(e[r++])];return r&&r==i?t:void 0}function _n(t){return!(!Pn(t)||(e=t,Bn&&Bn in e))&&(function(t){var e=Pn(t)?En.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}(t)?Qn:fn).test(function(t){if(null!=t){try{return mn.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t));var e}function Mn(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Tn(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return _n(n)?n:void 0}kn.prototype.clear=function(){this.__data__=Rn?Rn(null):{}},kn.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},kn.prototype.get=function(t){var e=this.__data__;if(Rn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return bn.call(e,t)?e[t]:void 0},kn.prototype.has=function(t){var e=this.__data__;return Rn?void 0!==e[t]:bn.call(e,t)},kn.prototype.set=function(t,e){return this.__data__[t]=Rn&&void 0===e?"__lodash_hash_undefined__":e,this},On.prototype.clear=function(){this.__data__=[]},On.prototype.delete=function(t){var e=this.__data__,n=Dn(e,t);return!(n<0)&&(n==e.length-1?e.pop():wn.call(e,n,1),!0)},On.prototype.get=function(t){var e=this.__data__,n=Dn(e,t);return n<0?void 0:e[n][1]},On.prototype.has=function(t){return Dn(this.__data__,t)>-1},On.prototype.set=function(t,e){var n=this.__data__,r=Dn(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},Nn.prototype.clear=function(){this.__data__={hash:new kn,map:new(Sn||On),string:new kn}},Nn.prototype.delete=function(t){return Mn(this,t).delete(t)},Nn.prototype.get=function(t){return Mn(this,t).get(t)},Nn.prototype.has=function(t){return Mn(this,t).has(t)},Nn.prototype.set=function(t,e){return Mn(this,t).set(t,e),this};var jn=Vn((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Wn(t))return xn?xn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var n=[];return un.test(t)&&n.push(""),t.replace(ln,(function(t,e,r,i){n.push(r?i.replace(gn,"$1"):e||t)})),n}));function Ln(t){if("string"==typeof t||Wn(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Vn(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(Vn.Cache||Nn),n}Vn.Cache=Nn;var Zn=Array.isArray;function Pn(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wn(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==En.call(t)}var Jn=function(t,e,n){var r=null==t?void 0:Gn(t,e);return void 0===r?n:r},Hn=function(t,e){var n=!0;return t.reduce((function(t,r){return null!==r&&void 0!==r||(r=""),n?(n=!1,"".concat(r)):"".concat(t).concat(e).concat(r)}),"")},Yn=function(t,e){try{return t.push.apply(t,on(e)),t}catch(n){return t.concat(e)}},Xn=function(t,e,n){return void 0===t[e]||null===t[e]?n:t[e]},zn=function t(e,n,r){var i=Array.isArray(n)?n:n.split("."),o=i[0],a=i.length>1?t(e[o]||{},i.slice(1),r):r;return Object.assign({},e,function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},o,a))},Kn=Hn,qn=Yn,$n=function(){function t(e){Ke(this,t),this.opts=this.preprocessOpts(e),this.preprocessRow=this.memoizePreprocessRow()}return $e(t,[{key:"preprocessOpts",value:function(t){var e=Object.assign({},t);return e.unwind=Array.isArray(e.unwind)?e.unwind:e.unwind?[e.unwind]:[],e.delimiter=e.delimiter||",",e.flattenSeparator=e.flattenSeparator||".",e.eol=e.eol||an,e.quote="string"===typeof e.quote?t.quote:'"',e.doubleQuote="string"===typeof e.doubleQuote?e.doubleQuote:e.quote+e.quote,e.header=!1!==e.header,e.includeEmptyRows=e.includeEmptyRows||!1,e.withBOM=e.withBOM||!1,e}},{key:"preprocessFieldsInfo",value:function(t){var e=this;return t.map((function(t){if("string"===typeof t)return{label:t,value:t.includes(".")||t.includes("[")?function(n){return Jn(n,t,e.opts.defaultValue)}:function(n){return Xn(n,t,e.opts.defaultValue)},stringify:!0};if("object"===ze(t)){var n="default"in t?t.default:e.opts.defaultValue;if("string"===typeof t.value)return{label:t.label||t.value,value:t.value.includes(".")||t.value.includes("[")?function(e){return Jn(e,t.value,n)}:function(e){return Xn(e,t.value,n)},stringify:void 0===t.stringify||t.stringify};if("function"===typeof t.value){var r=t.label||t.value.name||"",i={label:r,default:n};return{label:r,value:function(e){var r=t.value(e,i);return null===r||void 0===r?n:r},stringify:void 0===t.stringify||t.stringify}}}throw new Error("Invalid field info option. "+JSON.stringify(t))}))}},{key:"getHeader",value:function(){var t=this;return Kn(this.opts.fields.map((function(e){return t.processValue(e.label,!0)})),this.opts.delimiter)}},{key:"memoizePreprocessRow",value:function(){return this.opts.unwind&&this.opts.unwind.length?this.opts.flatten?function(t){var e=this;return this.unwindData(t,this.opts.unwind).map((function(t){return e.flatten(t,e.opts.flattenSeparator)}))}:function(t){return this.unwindData(t,this.opts.unwind)}:this.opts.flatten?function(t){return[this.flatten(t,this.opts.flattenSeparator)]}:function(t){return[t]}}},{key:"preprocessRow",value:function(){}},{key:"processRow",value:function(t){var e=this;if(t){var n=this.opts.fields.map((function(n){return e.processCell(t,n)}));if(this.opts.includeEmptyRows||!n.every((function(t){return void 0===t})))return Kn(n,this.opts.delimiter)}}},{key:"processCell",value:function(t,e){return this.processValue(e.value(t),e.stringify)}},{key:"processValue",value:function(t,e){if(null!==t&&void 0!==t){var n=ze(t);if("boolean"!==n&&"number"!==n&&"string"!==n){if(void 0===(t=JSON.stringify(t)))return;'"'===t[0]&&(t=t.replace(/^"(.+)"$/,"$1"))}return"string"===typeof t&&(t.includes(this.opts.quote)&&(t=t.replace(new RegExp(this.opts.quote,"g"),this.opts.doubleQuote)),t=e?"".concat(this.opts.quote).concat(t).concat(this.opts.quote):t.replace(new RegExp("^".concat(this.opts.doubleQuote)),this.opts.quote).replace(new RegExp("".concat(this.opts.doubleQuote,"$")),this.opts.quote),this.opts.excelStrings&&(t='"="'.concat(t,'""'))),t}}},{key:"flatten",value:function(t,e){return function t(n,r,i){return Object.keys(n).forEach((function(o){var a=n[o],A=i?"".concat(i).concat(e).concat(o):o;"object"===ze(a)&&null!==a&&!Array.isArray(a)&&"[object Function]"!==Object.prototype.toString.call(a.toJSON)&&Object.keys(a).length?t(a,r,A):r[A]=a})),r}(t,{})}},{key:"unwindData",value:function(t,e){var n=this;return e.reduce((function(t,e){return t.map((function(t){var r=Jn(t,e);return Array.isArray(r)?r.length?r.map((function(r,i){var o=n.opts.unwindBlank&&i>0?{}:t;return zn(o,e,r)})):zn(t,e,void 0):t})).reduce(qn,[])}),[t])}}]),t}(),tr=Hn,er=Yn,nr=function(t){function e(t){var n;return Ke(this,e),(n=rn(this,en(e).call(this,t))).opts.fields&&(n.opts.fields=n.preprocessFieldsInfo(n.opts.fields)),n}return tn(e,t),$e(e,[{key:"parse",value:function(t){var e=this.preprocessData(t);this.opts.fields||(this.opts.fields=e.reduce((function(t,e){return Object.keys(e).forEach((function(e){t.includes(e)||t.push(e)})),t}),[]),this.opts.fields=this.preprocessFieldsInfo(this.opts.fields));var n=this.opts.header?this.getHeader():"",r=this.processData(e);return(this.opts.withBOM?"\ufeff":"")+n+(n&&r?this.opts.eol:"")+r}},{key:"preprocessData",value:function(t){var e=this,n=Array.isArray(t)?t:[t];if(!this.opts.fields&&(0===n.length||"object"!==ze(n[0])))throw new Error('Data should not be empty or the "fields" option should be included');return this.opts.unwind&&this.opts.unwind.length||this.opts.flatten?n.map((function(t){return e.preprocessRow(t)})).reduce(er,[]):n}},{key:"processData",value:function(t){var e=this;return tr(t.map((function(t){return e.processRow(t)})).filter((function(t){return t})),this.opts.eol)}}]),e}($n),rr={},ir=rr.LEFT_BRACE=1,or=rr.RIGHT_BRACE=2,ar=rr.LEFT_BRACKET=3,Ar=rr.RIGHT_BRACKET=4,sr=rr.COLON=5,cr=rr.COMMA=6,ur=rr.TRUE=7,lr=rr.FALSE=8,gr=rr.NULL=9,fr=rr.STRING=10,hr=rr.NUMBER=11,dr=rr.START=17,Ir=rr.STOP=18,pr=rr.TRUE1=33,Cr=rr.TRUE2=34,yr=rr.TRUE3=35,vr=rr.FALSE1=49,Br=rr.FALSE2=50,mr=rr.FALSE3=51,br=rr.FALSE4=52,Er=rr.NULL1=65,Qr=rr.NULL2=66,Fr=rr.NULL3=67,wr=rr.NUMBER1=81,Sr=rr.NUMBER3=83,Rr=rr.STRING1=97,Ur=rr.STRING2=98,xr=rr.STRING3=99,kr=rr.STRING4=100,Or=rr.STRING5=101,Nr=rr.STRING6=102,Dr=rr.VALUE=113,Gr=rr.KEY=114,_r=rr.OBJECT=129,Mr=rr.ARRAY=130,Tr="\\".charCodeAt(0),jr="/".charCodeAt(0),Lr="\b".charCodeAt(0),Vr="\f".charCodeAt(0),Zr="\n".charCodeAt(0),Pr="\r".charCodeAt(0),Wr="\t".charCodeAt(0);function Jr(){this.tState=dr,this.value=void 0,this.string=void 0,this.stringBuffer=S.alloc?S.alloc(65536):new S(65536),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=Dr,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new S(2),3:new S(3),4:new S(4)},this.offset=-1}Jr.toknam=function(t){for(var e=Object.keys(rr),n=0,r=e.length;n<r;n++){var i=e[n];if(rr[i]===t)return i}return t&&"0x"+t.toString(16)};var Hr=Jr.prototype;Hr.onError=function(t){throw t},Hr.charError=function(t,e){this.tState=Ir,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(t[e]))+" at position "+e+" in state "+Jr.toknam(this.tState)))},Hr.appendStringChar=function(t){this.stringBufferOffset>=65536&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=t},Hr.appendStringBuf=function(t,e,n){var r=t.length;"number"===typeof e&&(r="number"===typeof n?n<0?t.length-e+n:n-e:t.length-e),r<0&&(r=0),this.stringBufferOffset+r>65536&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),t.copy(this.stringBuffer,this.stringBufferOffset,e,n),this.stringBufferOffset+=r},Hr.write=function(t){var e;"string"===typeof t&&(t=new S(t));for(var n=0,r=t.length;n<r;n++)if(this.tState===dr){if(e=t[n],this.offset++,123===e)this.onToken(ir,"{");else if(125===e)this.onToken(or,"}");else if(91===e)this.onToken(ar,"[");else if(93===e)this.onToken(Ar,"]");else if(58===e)this.onToken(sr,":");else if(44===e)this.onToken(cr,",");else if(116===e)this.tState=pr;else if(102===e)this.tState=vr;else if(110===e)this.tState=Er;else if(34===e)this.string="",this.stringBufferOffset=0,this.tState=Rr;else if(45===e)this.string="-",this.tState=wr;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=Sr;else if(32!==e&&9!==e&&10!==e&&13!==e)return this.charError(t,n)}else if(this.tState===Rr)if(e=t[n],this.bytes_remaining>0){for(var i=0;i<this.bytes_remaining;i++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+i]=t[i];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,n=n+i-1}else if(0===this.bytes_remaining&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+n+" in state "+Jr.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+n>t.length){for(var o=0;o<=t.length-1-n;o++)this.temp_buffs[this.bytes_in_sequence][o]=t[n+o];this.bytes_remaining=n+this.bytes_in_sequence-t.length,n=t.length-1}else this.appendStringBuf(t,n,n+this.bytes_in_sequence),n=n+this.bytes_in_sequence-1}else if(34===e)this.tState=dr,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(fr,this.string),this.offset+=S.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===e)this.tState=Ur;else{if(!(e>=32))return this.charError(t,n);this.appendStringChar(e)}else if(this.tState===Ur)if(34===(e=t[n]))this.appendStringChar(e),this.tState=Rr;else if(92===e)this.appendStringChar(Tr),this.tState=Rr;else if(47===e)this.appendStringChar(jr),this.tState=Rr;else if(98===e)this.appendStringChar(Lr),this.tState=Rr;else if(102===e)this.appendStringChar(Vr),this.tState=Rr;else if(110===e)this.appendStringChar(Zr),this.tState=Rr;else if(114===e)this.appendStringChar(Pr),this.tState=Rr;else if(116===e)this.appendStringChar(Wr),this.tState=Rr;else{if(117!==e)return this.charError(t,n);this.unicode="",this.tState=xr}else if(this.tState===xr||this.tState===kr||this.tState===Or||this.tState===Nr){if(!((e=t[n])>=48&&e<64||e>64&&e<=70||e>96&&e<=102))return this.charError(t,n);if(this.unicode+=String.fromCharCode(e),this.tState++===Nr){var a=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&a>=56320&&a<57344?(this.appendStringBuf(new S(String.fromCharCode(this.highSurrogate,a))),this.highSurrogate=void 0):void 0===this.highSurrogate&&a>=55296&&a<56320?this.highSurrogate=a:(void 0!==this.highSurrogate&&(this.appendStringBuf(new S(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new S(String.fromCharCode(a)))),this.tState=Rr}}else if(this.tState===wr||this.tState===Sr)switch(e=t[n]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=Sr;break;default:this.tState=dr;var A=Number(this.string);if(isNaN(A))return this.charError(t,n);this.string.match(/[0-9]+/)==this.string&&A.toString()!=this.string?this.onToken(fr,this.string):this.onToken(hr,A),this.offset+=this.string.length-1,this.string=void 0,n--}else if(this.tState===pr){if(114!==t[n])return this.charError(t,n);this.tState=Cr}else if(this.tState===Cr){if(117!==t[n])return this.charError(t,n);this.tState=yr}else if(this.tState===yr){if(101!==t[n])return this.charError(t,n);this.tState=dr,this.onToken(ur,!0),this.offset+=3}else if(this.tState===vr){if(97!==t[n])return this.charError(t,n);this.tState=Br}else if(this.tState===Br){if(108!==t[n])return this.charError(t,n);this.tState=mr}else if(this.tState===mr){if(115!==t[n])return this.charError(t,n);this.tState=br}else if(this.tState===br){if(101!==t[n])return this.charError(t,n);this.tState=dr,this.onToken(lr,!1),this.offset+=4}else if(this.tState===Er){if(117!==t[n])return this.charError(t,n);this.tState=Qr}else if(this.tState===Qr){if(108!==t[n])return this.charError(t,n);this.tState=Fr}else if(this.tState===Fr){if(108!==t[n])return this.charError(t,n);this.tState=dr,this.onToken(gr,null),this.offset+=3}},Hr.onToken=function(t,e){},Hr.parseError=function(t,e){this.tState=Ir,this.onError(new Error("Unexpected "+Jr.toknam(t)+(e?"("+JSON.stringify(e)+")":"")+" in state "+Jr.toknam(this.state)))},Hr.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},Hr.pop=function(){var t=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(t),this.mode||(this.state=Dr)},Hr.emit=function(t){this.mode&&(this.state=cr),this.onValue(t)},Hr.onValue=function(t){},Hr.onToken=function(t,e){if(this.state===Dr)if(t===fr||t===hr||t===ur||t===lr||t===gr)this.value&&(this.value[this.key]=e),this.emit(e);else if(t===ir)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=Gr,this.mode=_r;else if(t===ar)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=Mr,this.state=Dr;else if(t===or){if(this.mode!==_r)return this.parseError(t,e);this.pop()}else{if(t!==Ar)return this.parseError(t,e);if(this.mode!==Mr)return this.parseError(t,e);this.pop()}else if(this.state===Gr)if(t===fr)this.key=e,this.state=sr;else{if(t!==or)return this.parseError(t,e);this.pop()}else if(this.state===sr){if(t!==sr)return this.parseError(t,e);this.state=Dr}else{if(this.state!==cr)return this.parseError(t,e);if(t===cr)this.mode===Mr?(this.key++,this.state=Dr):this.mode===_r&&(this.state=Gr);else{if(!(t===Ar&&this.mode===Mr||t===or&&this.mode===_r))return this.parseError(t,e);this.pop()}}},Jr.C=rr;var Yr=Jr,Xr=function(t){function e(t,n){var r;return Ke(this,e),r=rn(this,en(e).call(this,n)),Object.getOwnPropertyNames($n.prototype).forEach((function(t){return r[t]=$n.prototype[t]})),r.opts=r.preprocessOpts(t),r.preprocessRow=r.memoizePreprocessRow(),r._data="",r._hasWritten=!1,r._readableState.objectMode?r.initObjectModeParse():r.opts.ndjson?r.initNDJSONParse():r.initJSONParser(),r.opts.withBOM&&r.push("\ufeff"),r.opts.fields&&(r.opts.fields=r.preprocessFieldsInfo(r.opts.fields),r.pushHeader()),r}return tn(e,t),$e(e,[{key:"initObjectModeParse",value:function(){var t=this;this.parser={write:function(e){t.pushLine(e)},getPendingData:function(){}}}},{key:"initNDJSONParse",value:function(){var t=this;this.parser={_data:"",write:function(e){this._data+=e.toString();var n=this._data.split("\n").map((function(t){return t.trim()})).filter((function(t){return""!==t})),r=!1;n.forEach((function(e,i){try{t.pushLine(JSON.parse(e))}catch(o){i===n.length-1?r=!0:(o.message="Invalid JSON ("+e+")",t.emit("error",o))}})),this._data=r?this._data.slice(this._data.lastIndexOf("\n")):""},getPendingData:function(){return this._data}}}},{key:"initJSONParser",value:function(){var t=this;this.parser=new Yr,this.parser.onValue=function(e){this.stack.length===this.depthToEmit&&t.pushLine(e)},this.parser._onToken=this.parser.onToken,this.parser.onToken=function(e,n){t.parser._onToken(e,n),0!==this.stack.length||t.opts.fields||this.mode===Yr.C.ARRAY||this.mode===Yr.C.OBJECT||this.onError(new Error('Data should not be empty or the "fields" option should be included')),1===this.stack.length&&(void 0===this.depthToEmit&&(this.depthToEmit=this.mode===Yr.C.ARRAY?1:0),0!==this.depthToEmit&&1===this.stack.length&&(this.value=void 0))},this.parser.getPendingData=function(){return this.value},this.parser.onError=function(e){e.message.includes("Unexpected")&&(e.message="Invalid JSON ("+e.message+")"),t.emit("error",e)}}},{key:"_transform",value:function(t,e,n){this.parser.write(t),n()}},{key:"_flush",value:function(t){this.parser.getPendingData()&&t(new Error("Invalid data received from stdin",this.parser.getPendingData())),t()}},{key:"pushHeader",value:function(){if(this.opts.header){var t=this.getHeader();this.emit("header",t),this.push(t),this._hasWritten=!0}}},{key:"pushLine",value:function(t){var e=this,n=this.preprocessRow(t);this._hasWritten||(this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(Object.keys(n[0])),this.pushHeader()),n.forEach((function(t){var n=e.processRow(t,e.opts);void 0!==n&&(e.emit("line",n),e.push(e._hasWritten?e.opts.eol+n:n),e._hasWritten=!0)}))}}]),e}(Xe.Transform),zr=Xe.Transform,Kr=Hn,qr=function(){function t(e,n){Ke(this,t),this.input=new zr(n),this.input._read=function(){},this.transform=new Xr(e,n),this.processor=this.input.pipe(this.transform)}return $e(t,[{key:"fromInput",value:function(t){if(this._input)throw new Error("Async parser already has an input.");return this._input=t,this.input=this._input.pipe(this.processor),this}},{key:"throughTransform",value:function(t){if(this._output)throw new Error("Can't add transforms once an output has been added.");return this.processor=this.processor.pipe(t),this}},{key:"toOutput",value:function(t){if(this._output)throw new Error("Async parser already has an output.");return this._output=t,this.processor=this.processor.pipe(t),this}},{key:"promise",value:function(){var t=this;return new Promise((function(e,n){var r=[];t.processor.on("data",(function(t){return r.push(t.toString())})).on("finish",(function(){return e(Kr(r,""))})).on("error",(function(t){return n(t)}))}))}}]),t}(),$r=Xe.Readable,ti=nr,ei=qr,ni=Xr,ri=function(t,e){return new nr(e).parse(t)},ii=function(t,e,n){try{t instanceof $r||(n=Object.assign({},n,{objectMode:!0}));var r=new qr(e,n),i=r.promise();return Array.isArray(t)?(t.forEach((function(t){return r.input.push(t)})),r.input.push(null)):t instanceof $r?r.fromInput(t):(r.input.push(t),r.input.push(null)),i}catch(o){return Promise.reject(o)}},oi={Parser:ti,AsyncParser:ei,Transform:ni,parse:ri,parseAsync:ii};e.default=oi,e.Parser=ti,e.AsyncParser=ei,e.Transform=ni,e.parse=ri,e.parseAsync=ii,Object.defineProperty(e,"__esModule",{value:!0})})(e)}).call(this,n(56))},function(t,e,n){var r=n(1173),i=n(1174),o=n(1175);t.exports=function(t){return r(t)||i(t)||o()}},function(t,e,n){var r=n(1176),i=n(1177),o=n(1178);t.exports=function(t,e){return r(t)||i(t,e)||o()}},function(t,e,n){var r=n(1040),i=n(822),o=n(1180),a=n(823),A=i((function(t){return o(r(t,1,a,!0))}));t.exports=A},function(t,e,n){var r=n(1187),i=n(1040),o=n(822),a=n(823),A=o((function(t,e){return a(t)?r(t,i(e,1,a,!0)):[]}));t.exports=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomPicker=e.TwitterPicker=e.SwatchesPicker=e.SliderPicker=e.SketchPicker=e.PhotoshopPicker=e.MaterialPicker=e.HuePicker=e.GithubPicker=e.CompactPicker=e.ChromePicker=e.default=e.CirclePicker=e.BlockPicker=e.AlphaPicker=void 0;var r=n(1228);Object.defineProperty(e,"AlphaPicker",{enumerable:!0,get:function(){return C(r).default}});var i=n(1294);Object.defineProperty(e,"BlockPicker",{enumerable:!0,get:function(){return C(i).default}});var o=n(1296);Object.defineProperty(e,"CirclePicker",{enumerable:!0,get:function(){return C(o).default}});var a=n(1298);Object.defineProperty(e,"ChromePicker",{enumerable:!0,get:function(){return C(a).default}});var A=n(1303);Object.defineProperty(e,"CompactPicker",{enumerable:!0,get:function(){return C(A).default}});var s=n(1306);Object.defineProperty(e,"GithubPicker",{enumerable:!0,get:function(){return C(s).default}});var c=n(1308);Object.defineProperty(e,"HuePicker",{enumerable:!0,get:function(){return C(c).default}});var u=n(1310);Object.defineProperty(e,"MaterialPicker",{enumerable:!0,get:function(){return C(u).default}});var l=n(1311);Object.defineProperty(e,"PhotoshopPicker",{enumerable:!0,get:function(){return C(l).default}});var g=n(1317);Object.defineProperty(e,"SketchPicker",{enumerable:!0,get:function(){return C(g).default}});var f=n(1320);Object.defineProperty(e,"SliderPicker",{enumerable:!0,get:function(){return C(f).default}});var h=n(1324);Object.defineProperty(e,"SwatchesPicker",{enumerable:!0,get:function(){return C(h).default}});var d=n(1328);Object.defineProperty(e,"TwitterPicker",{enumerable:!0,get:function(){return C(d).default}});var I=n(1079);Object.defineProperty(e,"CustomPicker",{enumerable:!0,get:function(){return C(I).default}});var p=C(a);function C(t){return t&&t.__esModule?t:{default:t}}e.default=p.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r){function i(e){var r=new o.default(e);n.call(t,r)}if(t.addEventListener){var a=function(){var n=!1;return"object"===typeof r?n=r.capture||!1:"boolean"===typeof r&&(n=r),t.addEventListener(e,i,r||!1),{v:{remove:function(){t.removeEventListener(e,i,n)}}}}();if("object"===typeof a)return a.v}else if(t.attachEvent)return t.attachEvent("on"+e,i),{remove:function(){t.detachEvent("on"+e,i)}}};var r,i=n(1329),o=(r=i)&&r.__esModule?r:{default:r};t.exports=e.default},function(t,e,n){"use strict";(function(t){var n=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,i="undefined"!==typeof t&&t.Math===Math?t:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),o="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],A="undefined"!==typeof MutationObserver,s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function a(){n&&(n=!1,t()),r&&s()}function A(){o(a)}function s(){var t=Date.now();if(n){if(t-i<2)return;r=!0}else n=!0,r=!1,setTimeout(A,e);i=t}return s}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),A?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;a.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),c=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},u=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},l=p(0,0,0,0);function g(t){return parseFloat(t)||0}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+g(t["border-"+n+"-width"])}),0)}function h(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return l;var r=u(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=g(o)}return e}(r),o=i.left+i.right,a=i.top+i.bottom,A=g(r.width),s=g(r.height);if("border-box"===r.boxSizing&&(Math.round(A+o)!==e&&(A-=f(r,"left","right")+o),Math.round(s+a)!==n&&(s-=f(r,"top","bottom")+a)),!function(t){return t===u(t).document.documentElement}(t)){var c=Math.round(A+o)-e,h=Math.round(s+a)-n;1!==Math.abs(c)&&(A-=c),1!==Math.abs(h)&&(s-=h)}return p(i.left,i.top,A,s)}var d="undefined"!==typeof SVGGraphicsElement?function(t){return t instanceof u(t).SVGGraphicsElement}:function(t){return t instanceof u(t).SVGElement&&"function"===typeof t.getBBox};function I(t){return r?d(t)?function(t){var e=t.getBBox();return p(0,0,e.width,e.height)}(t):h(t):l}function p(t,e,n,r){return{x:t,y:e,width:n,height:r}}var C=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=p(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=I(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),y=function(t,e){var n=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return c(a,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),a}(e);c(this,{target:t,contentRect:n})},v=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!==typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof u(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new C(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof u(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new y(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),B="undefined"!==typeof WeakMap?new WeakMap:new n,m=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=s.getInstance(),r=new v(e,n,this);B.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){m.prototype[t]=function(){var e;return(e=B.get(this))[t].apply(e,arguments)}}));var b="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:m;e.a=b}).call(this,n(56))},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}),"Lens");e.default=o},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");e.default=o},function(t,e,n){"use strict";var r=n(99);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(0)),o=(0,r(n(176)).default)(i.default.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");e.default=o},function(t){t.exports=JSON.parse('{"name":"vega-tooltip","version":"0.23.0","description":"A tooltip plugin for Vega-Lite and Vega visualizations.","main":"build/vega-tooltip.js","module":"build/src/index.js","unpkg":"build/vega-tooltip.min.js","jsdelivr":"build/vega-tooltip.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-tooltip.git"},"keywords":["vega-lite","vega","tooltip"],"author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"collaborators":["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-tooltip/issues"},"homepage":"https://github.com/vega/vega-tooltip#readme","scripts":{"prepare":"beemo create-config --silent","tsc:src":"tsc -b tsconfig.src.json","build":"yarn tsc:src && rollup -c","clean":"rm -rf build examples/data && rm -f src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint .","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","postbuild":"terser build/vega-tooltip.js -c -m -o build/vega-tooltip.min.js","prebuild":"mkdir -p build && yarn copy:data && ./build-style.sh","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'browser-sync start -s -f build examples --serveStatic examples\' \'yarn tsc:src -w\' \'rollup -c -w\'","pretest":"./build-style.sh","test":"jest"},"devDependencies":{"@rollup/plugin-commonjs":"11.1.0","@rollup/plugin-json":"^4.0.3","@rollup/plugin-node-resolve":"^7.1.3","@types/jest":"^25.2.1","browser-sync":"^2.26.7","concurrently":"^5.2.0","gh-pages":"^2.2.0","jest":"^26.0.1","node-sass":"^4.14.1","path":"^0.12.7","rollup":"^2.8.2","terser":"^4.6.13","ts-jest":"^25.5.0","typescript":"^3.8.3","vega-datasets":"^1.30.2","vega-lite-dev-config":"^0.10.0","vega-typings":"^0.16.0"},"dependencies":{"vega-util":"^1.13.2"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]},"jest":{"testURL":"http://localhost/","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","<rootDir>/build","src"]}}')},function(t){t.exports=JSON.parse('{"name":"vega-lite","author":"Dominik Moritz, Kanit \\"Ham\\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer","version":"4.13.0","collaborators":["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],"homepage":"https://vega.github.io/vega-lite/","description":"Vega-Lite is a concise high-level language for interactive visualization.","main":"build/vega-lite.js","unpkg":"build/vega-lite.min.js","jsdelivr":"build/vega-lite.min.js","module":"build/src/index","types":"build/src/index.d.ts","bin":{"vl2png":"./bin/vl2png","vl2svg":"./bin/vl2svg","vl2pdf":"./bin/vl2pdf","vl2vg":"./bin/vl2vg"},"directories":{"test":"test"},"scripts":{"changelog":"conventional-changelog -p angular -r 2","build":"yarn build:only","build:only":"yarn tsc:src && rollup -c","postbuild":"terser build/vega-lite.js -cm --source-map content=build/vega-lite.js.map,filename=build/vega-lite.min.js.map -o build/vega-lite.min.js && yarn schema && babel build/vega-lite.js --out-dir build-es5 --config-file ./babel.config.js","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"yarn tsc:site && rollup -c site/rollup.config.js","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh","clean":"find build ! -name \'vega-lite-schema.json\' -type f -delete && rm -rf site/data/* && rm -f examples/compiled/*.png && find site/examples ! -name \'index.md\' ! -name \'data\' -type f -delete","predeploy:site":"yarn presite","deploy:site":"gh-pages -d site","data":"rsync -r node_modules/vega-datasets/data/* site/data","schema":"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/","renameschema":"scripts/rename-schema.sh","presite":"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh","site":"pushd site && bundle exec jekyll serve -I -l && popd","tsc:src":"tsc -b src/tsconfig.src.json","tsc:site":"tsc -b site/tsconfig.site.json","prettierbase":"prettier \'**/*.{md,css,yml}\'","eslintbase":"eslint .","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","test":"jest test/ && yarn lint && yarn schema && jest examples/ && yarn test:runtime","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles jest test-runtime/","test:runtime:generate":"yarn build:only && rm -Rf test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime","watch:build":"yarn build:only && concurrently --kill-others -n Typescript,Rollup \'yarn tsc:src -w\' \'rollup -c -w\'","watch:site":"concurrently --kill-others -n Typescript,Rollup \'yarn tsc:site -w\' \'rollup -c site/rollup.config.js -w\'","watch:test":"jest --watch"},"repository":{"type":"git","url":"https://github.com/vega/vega-lite.git"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-lite/issues"},"devDependencies":{"@babel/cli":"^7.10.1","@babel/core":"^7.10.1","@babel/preset-env":"^7.10.1","@rollup/plugin-commonjs":"12.0.0","@rollup/plugin-json":"^4.0.3","@rollup/plugin-node-resolve":"^8.0.0","@types/chai":"^4.2.11","@types/d3":"^5.7.2","@types/jest":"^25.2.3","@types/mkdirp":"^1.0.0","@types/puppeteer":"^3.0.0","@typescript-eslint/eslint-plugin":"^3.0.2","@typescript-eslint/parser":"^3.0.2","ajv":"^6.12.2","chai":"^4.2.0","cheerio":"^1.0.0-rc.3","codecov":"^3.7.0","concurrently":"^5.2.0","conventional-changelog-cli":"^2.0.34","d3":"^5.16.0","eslint":"^7.1.0","eslint-config-prettier":"^6.11.0","eslint-plugin-jest":"^23.13.2","eslint-plugin-prettier":"^3.1.3","gh-pages":"^2.2.0","highlight.js":"^10.0.3","http-server":"^0.12.3","jest":"^26.0.1","jest-puppeteer":"^4.4.0","mkdirp":"^1.0.4","prettier":"^2.0.5","puppeteer":"^3.1.0","rollup":"^2.11.0","rollup-plugin-sourcemaps":"^0.6.2","rollup-plugin-terser":"^6.1.0","svg2png-many":"^0.0.7","terser":"^4.7.0","ts-jest":"^26.0.0","ts-json-schema-generator":"^0.68.1","typescript":"~3.9.3","vega-cli":"^5.12.1","vega-datasets":"^1.30.2","vega-embed":"^6.8.0","vega-tooltip":"^0.23.0","vega-typings":"^0.17.0","yaml-front-matter":"^4.1.0"},"dependencies":{"@types/clone":"~0.1.30","@types/fast-json-stable-stringify":"^2.0.0","array-flat-polyfill":"^1.0.1","clone":"~2.1.2","fast-deep-equal":"~3.1.1","fast-json-stable-stringify":"~2.1.0","json-stringify-pretty-compact":"~2.0.0","tslib":"~2.0.0","vega-event-selector":"~2.0.3","vega-expression":"~2.6.5","vega-util":"~1.14.0","yargs":"~15.3.1"},"peerDependencies":{"vega":"^5.12.1"},"jest":{"preset":"jest-puppeteer","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["<rootDir>/node_modules","<rootDir>/build","<rootDir>/_site","<rootDir>/src"],"coverageDirectory":"./coverage/","collectCoverage":false}}')},function(t,e,n){(function(e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(s){n=function(){}}try{r=Set}catch(s){r=function(){}}try{i=Promise}catch(s){i=function(){}}function o(a,s,c,u,l){"object"===typeof s&&(c=s.depth,u=s.prototype,l=s.includeNonEnumerable,s=s.circular);var g=[],f=[],h="undefined"!=typeof e;return"undefined"==typeof s&&(s=!0),"undefined"==typeof c&&(c=1/0),function a(c,d){if(null===c)return null;if(0===d)return c;var I,p;if("object"!=typeof c)return c;if(t(c,n))I=new n;else if(t(c,r))I=new r;else if(t(c,i))I=new i((function(t,e){c.then((function(e){t(a(e,d-1))}),(function(t){e(a(t,d-1))}))}));else if(o.__isArray(c))I=[];else if(o.__isRegExp(c))I=new RegExp(c.source,A(c)),c.lastIndex&&(I.lastIndex=c.lastIndex);else if(o.__isDate(c))I=new Date(c.getTime());else{if(h&&e.isBuffer(c))return I=e.allocUnsafe?e.allocUnsafe(c.length):new e(c.length),c.copy(I),I;t(c,Error)?I=Object.create(c):"undefined"==typeof u?(p=Object.getPrototypeOf(c),I=Object.create(p)):(I=Object.create(u),p=u)}if(s){var C=g.indexOf(c);if(-1!=C)return f[C];g.push(c),f.push(I)}for(var y in t(c,n)&&c.forEach((function(t,e){var n=a(e,d-1),r=a(t,d-1);I.set(n,r)})),t(c,r)&&c.forEach((function(t){var e=a(t,d-1);I.add(e)})),c){var v;p&&(v=Object.getOwnPropertyDescriptor(p,y)),v&&null==v.set||(I[y]=a(c[y],d-1))}if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(c);for(y=0;y<B.length;y++){var m=B[y];(!(E=Object.getOwnPropertyDescriptor(c,m))||E.enumerable||l)&&(I[m]=a(c[m],d-1),E.enumerable||Object.defineProperty(I,m,{enumerable:!1}))}}if(l){var b=Object.getOwnPropertyNames(c);for(y=0;y<b.length;y++){var E,Q=b[y];(E=Object.getOwnPropertyDescriptor(c,Q))&&E.enumerable||(I[Q]=a(c[Q],d-1),Object.defineProperty(I,Q,{enumerable:!1}))}}return I}(a,c)}function a(t){return Object.prototype.toString.call(t)}function A(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return o.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},o.__objToStr=a,o.__isDate=function(t){return"object"===typeof t&&"[object Date]"===a(t)},o.__isArray=function(t){return"object"===typeof t&&"[object Array]"===a(t)},o.__isRegExp=function(t){return"object"===typeof t&&"[object RegExp]"===a(t)},o.__getRegExpFlags=A,o}();t.exports&&(t.exports=n)}).call(this,n(96).Buffer)},function(t){t.exports=JSON.parse('{"name":"vega-themes","version":"2.8.3","description":"Themes for stylized Vega and Vega-Lite visualizations.","keywords":["vega","vega-lite","themes","style"],"license":"BSD-3-Clause","author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"contributors":[{"name":"Emily Gu","url":"https://github.com/emilygu"},{"name":"Arvind Satyanarayan","url":"http://arvindsatya.com"},{"name":"Jeffrey Heer","url":"https://idl.cs.washington.edu"},{"name":"Dominik Moritz","url":"https://www.domoritz.de"}],"main":"build/vega-themes.js","module":"build/src/index.js","unpkg":"build/vega-themes.min.js","jsdelivr":"build/vega-themes.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-themes.git"},"scripts":{"prepare":"beemo create-config --silent","clean":"rm -rf build examples/build","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'src/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","prebuild":"mkdir -p build","build":"tsc && rollup -c","postbuild":"terser build/vega-themes.js -cm > build/vega-themes.min.js","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","serve":"browser-sync start -s -f build examples --serveStatic examples","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'yarn serve\' \'tsc -w\' \'rollup -c -w\'"},"devDependencies":{"@rollup/plugin-json":"^4.0.2","browser-sync":"^2.26.7","concurrently":"^5.1.0","gh-pages":"^2.2.0","rollup":"^2.1.0","terser":"^4.6.7","typescript":"^3.8.3","vega":"^5.10.0","vega-lite":"^4.8.1","vega-lite-dev-config":"^0.5.0"},"peerDependencies":{"vega":"*","vega-lite":"*"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]}}')},function(t,e,n){"use strict";var r=n(17),i=n(28),o=n(9),a=n(23),A=n(0),s=(n(20),n(32)),c=n(43),u=n(258),l=n(77),g=n(224),f=n(88),h=n(83),d=n(60),I=n(64),p=n(326);var C=Object(c.a)((function(t){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:Object(o.a)({zIndex:1},t.typography.body2,{fontSize:t.typography.pxToRem(12),lineHeight:1.2,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),top:-34,transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:t.palette.primary.contrastText,transform:"rotate(45deg)"}}}),{name:"PrivateValueLabel"})((function(t){var e=t.children,n=t.classes,r=t.className,i=t.open,o=t.value,a=t.valueLabelDisplay;return"off"===a?e:A.cloneElement(e,{className:Object(s.a)(e.props.className,(i||"on"===a)&&n.open,n.thumb)},A.createElement("span",{className:Object(s.a)(n.offset,r)},A.createElement("span",{className:n.circle},A.createElement("span",{className:n.label},o))))}));function y(t,e){return t-e}function v(t,e,n){return Math.min(Math.max(e,t),n)}function B(t,e){return t.reduce((function(t,n,r){var i=Math.abs(e-n);return null===t||i<t.distance||i===t.distance?{distance:i,index:r}:t}),null).index}function m(t,e){if(void 0!==e.current&&t.changedTouches){for(var n=0;n<t.changedTouches.length;n+=1){var r=t.changedTouches[n];if(r.identifier===e.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:t.clientX,y:t.clientY}}function b(t,e,n){return 100*(t-e)/(n-e)}function E(t,e,n){var r=Math.round((t-n)/e)*e+n;return Number(r.toFixed(function(t){if(Math.abs(t)<1){var e=t.toExponential().split("e-"),n=e[0].split(".")[1];return(n?n.length:0)+parseInt(e[1],10)}var r=t.toString().split(".")[1];return r?r.length:0}(e)))}function Q(t){var e=t.values,n=t.source,r=t.newValue,i=t.index;if(e[i]===r)return n;var o=Object(a.a)(e);return o[i]=r,o}function F(t){var e=t.sliderRef,n=t.activeIndex,r=t.setActive;e.current.contains(document.activeElement)&&Number(document.activeElement.getAttribute("data-index"))===n||e.current.querySelector('[data-index="'.concat(n,'"]')).focus(),r&&r(n)}var w={horizontal:{offset:function(t){return{left:"".concat(t,"%")}},leap:function(t){return{width:"".concat(t,"%")}}},"horizontal-reverse":{offset:function(t){return{right:"".concat(t,"%")}},leap:function(t){return{width:"".concat(t,"%")}}},vertical:{offset:function(t){return{bottom:"".concat(t,"%")}},leap:function(t){return{height:"".concat(t,"%")}}}},S=function(t){return t},R=A.forwardRef((function(t,e){var n=t["aria-label"],c=t["aria-labelledby"],l=t["aria-valuetext"],R=t.classes,U=t.className,x=t.color,k=void 0===x?"primary":x,O=t.component,N=void 0===O?"span":O,D=t.defaultValue,G=t.disabled,_=void 0!==G&&G,M=t.getAriaLabel,T=t.getAriaValueText,j=t.marks,L=void 0!==j&&j,V=t.max,Z=void 0===V?100:V,P=t.min,W=void 0===P?0:P,J=t.name,H=t.onChange,Y=t.onChangeCommitted,X=t.onMouseDown,z=t.orientation,K=void 0===z?"horizontal":z,q=t.scale,$=void 0===q?S:q,tt=t.step,et=void 0===tt?1:tt,nt=t.ThumbComponent,rt=void 0===nt?"span":nt,it=t.track,ot=void 0===it?"normal":it,at=t.value,At=t.ValueLabelComponent,st=void 0===At?C:At,ct=t.valueLabelDisplay,ut=void 0===ct?"off":ct,lt=t.valueLabelFormat,gt=void 0===lt?S:lt,ft=Object(i.a)(t,["aria-label","aria-labelledby","aria-valuetext","classes","className","color","component","defaultValue","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","scale","step","ThumbComponent","track","value","ValueLabelComponent","valueLabelDisplay","valueLabelFormat"]),ht=Object(u.a)(),dt=A.useRef(),It=A.useState(-1),pt=It[0],Ct=It[1],yt=A.useState(-1),vt=yt[0],Bt=yt[1],mt=Object(p.a)({controlled:at,default:D,name:"Slider"}),bt=Object(r.a)(mt,2),Et=bt[0],Qt=bt[1],Ft=Array.isArray(Et),wt=A.useRef(),St=Ft?Object(a.a)(Et).sort(y):[Et];St=St.map((function(t){return v(t,W,Z)}));var Rt=!0===L&&null!==et?Object(a.a)(Array(Math.floor((Z-W)/et)+1)).map((function(t,e){return{value:W+et*e}})):L||[];wt.current={source:Et};var Ut=Object(g.a)(),xt=Ut.isFocusVisible,kt=Ut.onBlurVisible,Ot=Ut.ref,Nt=A.useState(-1),Dt=Nt[0],Gt=Nt[1],_t=A.useRef(),Mt=Object(d.a)(Ot,_t),Tt=Object(d.a)(e,Mt),jt=Object(h.a)((function(t){var e=Number(t.currentTarget.getAttribute("data-index"));xt(t)&&Gt(e),Bt(e)})),Lt=Object(h.a)((function(){-1!==Dt&&(Gt(-1),kt()),Bt(-1)})),Vt=Object(h.a)((function(t){var e=Number(t.currentTarget.getAttribute("data-index"));Bt(e)})),Zt=Object(h.a)((function(){Bt(-1)})),Pt=Object(h.a)((function(t){var e,n=Number(t.currentTarget.getAttribute("data-index")),r=St[n],i=(Z-W)/10,o=Rt.map((function(t){return t.value})),a=o.indexOf(r);switch(t.key){case"Home":e=W;break;case"End":e=Z;break;case"PageUp":et&&(e=r+i);break;case"PageDown":et&&(e=r-i);break;case"ArrowRight":case"ArrowUp":e=et?r+et:o[a+1]||o[o.length-1];break;case"ArrowLeft":case"ArrowDown":e=et?r-et:o[a-1]||o[0];break;default:return}if(t.preventDefault(),et&&(e=E(e,et,W)),e=v(e,W,Z),Ft){var A=e;e=Q({values:St,source:Et,newValue:e,index:n}).sort(y),F({sliderRef:_t,activeIndex:e.indexOf(A)})}Qt(e),Gt(n),H&&H(t,e),Y&&Y(t,e)})),Wt=A.useRef(),Jt=K;"rtl"===ht.direction&&"vertical"!==K&&(Jt+="-reverse");var Ht=function(t){var e,n,r=t.finger,i=t.move,o=void 0!==i&&i,a=t.values,A=t.source,s=_t.current.getBoundingClientRect(),c=s.width,u=s.height,l=s.bottom,g=s.left;if(e=0===Jt.indexOf("vertical")?(l-r.y)/u:(r.x-g)/c,-1!==Jt.indexOf("-reverse")&&(e=1-e),n=function(t,e,n){return(n-e)*t+e}(e,W,Z),et)n=E(n,et,W);else{var f=Rt.map((function(t){return t.value}));n=f[B(f,n)]}n=v(n,W,Z);var h=0;if(Ft){var d=n;h=(n=Q({values:a,source:A,newValue:n,index:h=o?Wt.current:B(a,n)}).sort(y)).indexOf(d),Wt.current=h}return{newValue:n,activeIndex:h}},Yt=Object(h.a)((function(t){var e=m(t,dt);if(e){var n=Ht({finger:e,move:!0,values:St,source:Et}),r=n.newValue,i=n.activeIndex;F({sliderRef:_t,activeIndex:i,setActive:Ct}),Qt(r),H&&H(t,r)}})),Xt=Object(h.a)((function(t){var e=m(t,dt);if(e){var n=Ht({finger:e,values:St,source:Et}).newValue;Ct(-1),"touchend"===t.type&&Bt(-1),Y&&Y(t,n),dt.current=void 0;var r=Object(f.a)(_t.current);r.removeEventListener("mousemove",Yt),r.removeEventListener("mouseup",Xt),r.removeEventListener("touchmove",Yt),r.removeEventListener("touchend",Xt)}})),zt=Object(h.a)((function(t){t.preventDefault();var e=t.changedTouches[0];null!=e&&(dt.current=e.identifier);var n=m(t,dt),r=Ht({finger:n,values:St,source:Et}),i=r.newValue,o=r.activeIndex;F({sliderRef:_t,activeIndex:o,setActive:Ct}),Qt(i),H&&H(t,i);var a=Object(f.a)(_t.current);a.addEventListener("touchmove",Yt),a.addEventListener("touchend",Xt)}));A.useEffect((function(){var t=_t.current;t.addEventListener("touchstart",zt);var e=Object(f.a)(t);return function(){t.removeEventListener("touchstart",zt),e.removeEventListener("mousemove",Yt),e.removeEventListener("mouseup",Xt),e.removeEventListener("touchmove",Yt),e.removeEventListener("touchend",Xt)}}),[Xt,Yt,zt]);var Kt=Object(h.a)((function(t){X&&X(t),t.preventDefault();var e=m(t,dt),n=Ht({finger:e,values:St,source:Et}),r=n.newValue,i=n.activeIndex;F({sliderRef:_t,activeIndex:i,setActive:Ct}),Qt(r),H&&H(t,r);var o=Object(f.a)(_t.current);o.addEventListener("mousemove",Yt),o.addEventListener("mouseup",Xt)})),qt=b(Ft?St[0]:W,W,Z),$t=b(St[St.length-1],W,Z)-qt,te=Object(o.a)({},w[Jt].offset(qt),{},w[Jt].leap($t));return A.createElement(N,Object(o.a)({ref:Tt,className:Object(s.a)(R.root,R["color".concat(Object(I.a)(k))],U,_&&R.disabled,Rt.length>0&&Rt.some((function(t){return t.label}))&&R.marked,!1===ot&&R.trackFalse,"vertical"===K&&R.vertical,"inverted"===ot&&R.trackInverted),onMouseDown:Kt},ft),A.createElement("span",{className:R.rail}),A.createElement("span",{className:R.track,style:te}),A.createElement("input",{value:St.join(","),name:J,type:"hidden"}),Rt.map((function(t){var e,n=b(t.value,W,Z),r=w[Jt].offset(n);return e=!1===ot?-1!==St.indexOf(t.value):"normal"===ot&&(Ft?t.value>=St[0]&&t.value<=St[St.length-1]:t.value<=St[0])||"inverted"===ot&&(Ft?t.value<=St[0]||t.value>=St[St.length-1]:t.value>=St[0]),A.createElement(A.Fragment,{key:t.value},A.createElement("span",{style:r,className:Object(s.a)(R.mark,e&&R.markActive)}),A.createElement("span",{"aria-hidden":!0,style:r,className:Object(s.a)(R.markLabel,e&&R.markLabelActive)},t.label))})),St.map((function(t,e){var r=b(t,W,Z),i=w[Jt].offset(r);return A.createElement(st,{key:e,valueLabelFormat:gt,valueLabelDisplay:ut,className:R.valueLabel,value:"function"===typeof gt?gt($(t),e):gt,index:e,open:vt===e||pt===e||"on"===ut,disabled:_},A.createElement(rt,{className:Object(s.a)(R.thumb,R["thumbColor".concat(Object(I.a)(k))],pt===e&&R.active,_&&R.disabled,Dt===e&&R.focusVisible),tabIndex:_?null:0,role:"slider",style:i,"data-index":e,"aria-label":M?M(e):n,"aria-labelledby":c,"aria-orientation":K,"aria-valuemax":$(Z),"aria-valuemin":$(W),"aria-valuenow":$(t),"aria-valuetext":T?T($(t),e):l,onKeyDown:Pt,onFocus:jt,onBlur:Lt,onMouseOver:Vt,onMouseLeave:Zt}))})))}));e.a=Object(c.a)((function(t){return{root:{height:2,width:"100%",boxSizing:"content-box",padding:"13px 0",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:t.palette.primary.main,WebkitTapHighlightColor:"transparent","&$disabled":{pointerEvents:"none",cursor:"default",color:t.palette.grey[400]},"&$vertical":{width:2,height:"100%",padding:"0 13px"},"@media (pointer: coarse)":{padding:"20px 0","&$vertical":{padding:"0 20px"}}},colorPrimary:{},colorSecondary:{color:t.palette.secondary.main},marked:{marginBottom:20,"&$vertical":{marginBottom:"auto",marginRight:20}},vertical:{},disabled:{},rail:{display:"block",position:"absolute",width:"100%",height:2,borderRadius:1,backgroundColor:"currentColor",opacity:.38,"$vertical &":{height:"100%",width:2}},track:{display:"block",position:"absolute",height:2,borderRadius:1,backgroundColor:"currentColor","$vertical &":{width:2}},trackFalse:{"& $track":{display:"none"}},trackInverted:{"& $track":{backgroundColor:"light"===t.palette.type?Object(l.d)(t.palette.primary.main,.62):Object(l.a)(t.palette.primary.main,.5)},"& $rail":{opacity:1}},thumb:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-5,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow"],{duration:t.transitions.duration.shortest}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",left:-15,top:-15,right:-15,bottom:-15},"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(Object(l.b)(t.palette.primary.main,.16)),"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(Object(l.b)(t.palette.primary.main,.16))},"&$disabled":{width:8,height:8,marginLeft:-4,marginTop:-3,"&:hover":{boxShadow:"none"}},"$vertical &":{marginLeft:-5,marginBottom:-6},"$vertical &$disabled":{marginLeft:-3,marginBottom:-4}},thumbColorPrimary:{},thumbColorSecondary:{"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(Object(l.b)(t.palette.secondary.main,.16))},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(Object(l.b)(t.palette.secondary.main,.16))}},active:{},focusVisible:{},valueLabel:{},mark:{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},markActive:{backgroundColor:t.palette.background.paper,opacity:.8},markLabel:Object(o.a)({},t.typography.body2,{color:t.palette.text.secondary,position:"absolute",top:26,transform:"translateX(-50%)",whiteSpace:"nowrap","$vertical &":{top:"auto",left:26,transform:"translateY(50%)"},"@media (pointer: coarse)":{top:40,"$vertical &":{left:31}}}),markLabelActive:{color:t.palette.text.primary}}}),{name:"MuiSlider"})(R)},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(32)),A=n(43),s=n(483),c=n(77),u=o.forwardRef((function(t,e){var n=t.classes,A=t.className,c=t.component,u=void 0===c?"tr":c,l=t.hover,g=void 0!==l&&l,f=t.selected,h=void 0!==f&&f,d=Object(i.a)(t,["classes","className","component","hover","selected"]),I=o.useContext(s.a);return o.createElement(u,Object(r.a)({ref:e,className:Object(a.a)(n.root,A,I&&{head:n.head,footer:n.footer}[I.variant],g&&n.hover,h&&n.selected)},d))}));e.a=Object(A.a)((function(t){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$hover:hover":{backgroundColor:t.palette.action.hover},"&$selected, &$selected:hover":{backgroundColor:Object(c.b)(t.palette.secondary.main,t.palette.action.selectedOpacity)}},selected:{},hover:{},head:{},footer:{}}}),{name:"MuiTableRow"})(u)},,,,,function(t,e,n){"use strict";n.r(e);var r=n(907);n.d(e,"HeatmapSubscriber",(function(){return r.a}));var i=n(784);n.d(e,"Heatmap",(function(){return i.a}))},function(t,e,n){"use strict";n.r(e);var r=n(905);n.d(e,"SpatialSubscriber",(function(){return r.a}));var i=n(783);n.d(e,"Spatial",(function(){return i.a}))},function(t,e,n){"use strict";n.r(e);var r=n(906);n.d(e,"ScatterplotSubscriber",(function(){return r.a}));var i=n(785);n.d(e,"Scatterplot",(function(){return i.a}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findInArray=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]},e.isFunction=function(t){return"function"===typeof t||"[object Function]"===Object.prototype.toString.call(t)},e.isNum=function(t){return"number"===typeof t&&!isNaN(t)},e.int=function(t){return parseInt(t,10)},e.dontSetMe=function(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#dataset","title":"Vitessce data set","type":"object","definitions":{"components":{"description":"The layout array defines the views, or components, rendered in the grid.","type":"array","items":{"type":"object","additionalProperties":false,"required":["component","x","y"],"properties":{"component":{"type":"string","description":"Specify a component using a name defined in the component registry."},"props":{"type":"object","description":"Extra prop values for the component."},"x":{"type":"integer"},"y":{"type":"integer"},"w":{"type":"integer"},"h":{"type":"integer"},"coordinationScopes":{"type":"object","description":"Component-level coordination scope mappings define which coordination object values a particular component can read and write, for each coordination type.","additionalProperties":false,"required":[],"properties":{"dataset":{"type":"string"},"embeddingType":{"type":"string"},"embeddingZoom":{"type":"string"},"embeddingRotation":{"type":"string"},"embeddingTargetX":{"type":"string"},"embeddingTargetY":{"type":"string"},"embeddingTargetZ":{"type":"string"},"embeddingCellSetPolygonsVisible":{"type":"string"},"embeddingCellSetLabelsVisible":{"type":"string"},"embeddingCellSetLabelSize":{"type":"string"},"embeddingCellRadius":{"type":"string"},"spatialZoom":{"type":"string"},"spatialRotation":{"type":"string"},"spatialTargetX":{"type":"string"},"spatialTargetY":{"type":"string"},"spatialTargetZ":{"type":"string"},"heatmapZoomX":{"type":"string"},"heatmapZoomY":{"type":"string"},"heatmapTargetX":{"type":"string"},"heatmapTargetY":{"type":"string"},"cellFilter":{"type":"string"},"cellHighlight":{"type":"string"},"cellSetSelection":{"type":"string"},"cellSetHighlight":{"type":"string"},"cellSetColor":{"type":"string"},"geneFilter":{"type":"string"},"geneHighlight":{"type":"string"},"geneSelection":{"type":"string"},"geneExpressionColormap":{"type":"string"},"geneExpressionColormapRange":{"type":"string"},"cellColorEncoding":{"type":"string"},"spatialLayers":{"type":"string"},"genomicZoomX":{"type":"string"},"genomicZoomY":{"type":"string"},"genomicTargetX":{"type":"string"},"genomicTargetY":{"type":"string"},"additionalCellSets":{"type":"string"},"moleculeHighlight":{"type":"string"}}}}}},"annDataCellSets":{"type":"array","description":"Array of cell set configuration, following closely the conventions of the tabular schema","items":{"type":"object","additionalProperties":false,"required":["groupName","setName"],"properties":{"groupName":{"type":"string","description":"The display name for the set, like \'Cell Type\' or \'Louvain.\'"},"setName":{"type":"string","description":"The location in the AnnData store for the set, like \'obs/louvain\' or \'obs/celltype.\'"}}}},"annDataCells":{"type":"object","description":"The properties of this object are the configuration for how to layout scatterplots and spatial information","minProperties":1,"additionalProperties":false,"required":[],"properties":{"xy":{"type":"string","description":"The location in the AnnData store of cell centroids, like \'obsm/X_centroids.\'"},"poly":{"type":"string","description":"The location in the AnnData store of cell polygon outlines, like \'obsm/X_polygons.\'"},"factors":{"type":"array","description":"List of locations in the AnnData store of cell sets, like \'obs/louvain\'","items":{"type":"string"}},"mappings":{"patternProperties":{".":{"type":"object","description":"An object containing key-values for mappings like { UMAP: { key: \'obsm/X_umap\', dims: [0, 1] } }.","additionalProperties":false,"required":["key"],"properties":{"key":{"type":"string","description":"Where to look in the AnnData store for this mapping, like \'obsm/X_umap.\'"},"dims":{"type":"array","description":"Which indices of the obsm object to take for a scatterplot, allowing for, for example, different PCs from obsm/X_pca","minItems":2,"maxItems":2,"items":{"type":"number"}}}}}}}},"annDataExpressionMatrix":{"type":"object","description":"The properties of this object are the configuration for how to fetch the cell x genes matrix","additionalProperties":false,"required":["matrix"],"properties":{"matrix":{"type":"string","description":"The location in the AnnData store of the cell x gene matrix, like \'obsm/hvg_subset.\' or \'X\'"},"geneFilter":{"type":"string","description":"The location in the AnnData store of a filter for the genes if using a subset of the data, like \'vae.highly_variable.\' if the matrix comes from \'obsm/hvg_subset.\'"}}},"requestInit":{"type":"object","description":"The properties of this object correspond to the parameters of the JavaScript fetch() function.","additionalProperties":false,"required":[],"properties":{"method":{"type":"string"},"headers":{"type":"object"},"body":{"type":"string"},"mode":{"type":"string"},"credentials":{"type":"string"},"cache":{"type":"string"},"redirect":{"type":"string"},"referrer":{"type":"string"},"integrity":{"type":"string"}}},"rasterLayer":{"description":"The properties of this object are the rendering settings for the raster layer.","additionalProperties":false,"required":["channels","colormap","index","opacity","type"],"properties":{"channels":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["selection"],"properties":{"color":{"type":"array","items":{"type":"number"},"description":"The color to use when rendering this channel under the null colormap."},"selection":{"type":"object","description":"Determines the channel selection, e.g. some Z and time slice."},"slider":{"type":"array","items":{"type":"number"},"description":"Determines the range for color mapping."},"visible":{"type":"boolean","description":"Determines whether this channel of the layer will be rendered in the spatial component."}}}},"colormap":{"oneOf":[{"type":"string","description":"The name of the colormap to use for this layer."},{"type":"null","description":"Use the solid color definitions."}]},"transparentColor":{"oneOf":[{"type":"array","minItems":3,"maxItems":3,"items":{"type":"number","description":"One of R G or B (0 - 255)."},"description":"Determines the color to be set to opacity 0"},{"type":"null","description":"No selection."}]},"index":{"type":"number","description":"The index of the layer among the array of layers available in the image file."},"modelMatrix":{"oneOf":[{"type":"array","minItems":16,"maxItems":16,"description":"transformation matrix for this layer"},{"type":"null","description":"Use no transformation."}]},"opacity":{"type":"number"},"domainType":{"type":"string","enum":["Full","Min/Max"],"description":"Determines the extent of the channel slider input element in the layer controller."},"type":{"type":"string","enum":["raster"]}}},"moleculesLayer":{"description":"The properties of this object are the rendering settings for the molecules layer.","additionalProperties":false,"required":["visible","radius","opacity","type"],"properties":{"visible":{"type":"boolean"},"radius":{"type":"number"},"opacity":{"type":"number"},"type":{"type":"string","enum":["molecules"]}}},"cellsLayer":{"description":"The properties of this object are the rendering settings for the cells layer.","additionalProperties":false,"required":["visible","stroked","radius","opacity","type"],"properties":{"visible":{"type":"boolean"},"stroked":{"type":"boolean"},"radius":{"type":"number"},"opacity":{"type":"number"},"type":{"type":"string","enum":["cells"]}}},"neighborhoodsLayer":{"description":"The properties of this object are the rendering settings for the neighborhoods layer.","additionalProperties":false,"required":["visible","type"],"properties":{"visible":{"type":"boolean"},"type":{"type":"string","enum":["neighborhoods"]}}},"spatialLayers":{"type":"array","description":"Array of Spatial Layers","items":{"oneOf":[{"$ref":"#/definitions/rasterLayer"},{"$ref":"#/definitions/cellsLayer"},{"$ref":"#/definitions/moleculesLayer"},{"$ref":"#/definitions/neighborhoodsLayer"}]}}},"additionalProperties":false,"required":["version","name","datasets","layout","initStrategy"],"properties":{"name":{"type":"string"},"public":{"type":"boolean"},"description":{"type":"string"},"datasets":{"type":"array","description":"The datasets array defines groups of files, where the files within each dataset reference the same entities (cells, genes, cell sets, etc).","items":{"type":"object","additionalProperties":false,"required":["uid","files"],"properties":{"uid":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"files":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type","fileType"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"fileType":{"type":"string"},"url":{"type":"string"},"options":{"oneOf":[{"$ref":"#/definitions/annDataCellSets"},{"$ref":"https://github.com/hubmapconsortium/vitessce/#raster"},{"$ref":"#/definitions/annDataCells"},{"$ref":"#/definitions/annDataExpressionMatrix"}]},"requestInit":{"$ref":"#/definitions/requestInit"}}}}}}},"coordinationSpace":{"type":"object","description":"The coordination space stores the values for each scope of each coordination object.","additionalProperties":false,"required":[],"properties":{"dataset":{"type":"object","patternProperties":{".":{"type":"string"}}},"embeddingZoom":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingRotation":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingTargetX":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingTargetY":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingTargetZ":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingType":{"type":"object","patternProperties":{".":{"type":"string"}}},"embeddingCellSetPolygonsVisible":{"type":"object","patternProperties":{".":{"type":"boolean"}}},"embeddingCellSetLabelsVisible":{"type":"object","patternProperties":{".":{"type":"boolean"}}},"embeddingCellSetLabelSize":{"type":"object","patternProperties":{".":{"type":"number"}}},"embeddingCellRadius":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialZoom":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialRotation":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialTargetX":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialTargetY":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialTargetZ":{"type":"object","patternProperties":{".":{"type":"number"}}},"spatialLayers":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided and auto layer initialization is enabled, layers will be automatically initialized."},{"$ref":"#/definitions/spatialLayers"}]}}},"heatmapZoomX":{"type":"object","patternProperties":{".":{"type":"number"}}},"heatmapZoomY":{"type":"object","patternProperties":{".":{"type":"number"}}},"heatmapTargetX":{"type":"object","patternProperties":{".":{"type":"number"}}},"heatmapTargetY":{"type":"object","patternProperties":{".":{"type":"number"}}},"cellFilter":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no cells will be filtered out initially."},{"type":"array","items":{"type":"string"}}]}}},"cellHighlight":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no cell will be highlighted initially."},{"type":"string"}]}}},"cellSetSelection":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided and auto cell set initialization is enabled, cell set selections will be automatically initialized."},{"type":"array"}]}}},"cellSetHighlight":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no cell sets will be highlighted initially."},{"type":"string"}]}}},"cellSetColor":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, cell set colors will be automatically initialized."},{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","color"],"properties":{"path":{"type":"array","items":{"type":"string"}},"color":{"type":"array","items":{"type":"number"}}}}}]}}},"cellColorEncoding":{"type":"object","patternProperties":{".":{"type":"string"}}},"geneFilter":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no genes will be filtered out initially."},{"type":"array","items":{"type":"string"}}]}}},"geneHighlight":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no genes will be highlighted initially."},{"type":"string"}]}}},"geneSelection":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null"},{"type":"array","items":{"type":"string"}}]}}},"geneExpressionColormap":{"type":"object","patternProperties":{".":{"type":"string"}}},"geneExpressionColormapRange":{"type":"object","patternProperties":{".":{"type":"array","items":{"type":"number"}}}},"genomicZoomX":{"type":"object","patternProperties":{".":{"type":"number"}}},"genomicZoomY":{"type":"object","patternProperties":{".":{"type":"number"}}},"genomicTargetX":{"type":"object","patternProperties":{".":{"type":"number"}}},"genomicTargetY":{"type":"object","patternProperties":{".":{"type":"number"}}},"additionalCellSets":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no cell will be highlighted initially."},{"$ref":"https://github.com/hubmapconsortium/vitessce/#cell-sets"}]}}},"moleculeHighlight":{"type":"object","patternProperties":{".":{"oneOf":[{"type":"null","description":"If null is provided, no molecule will be highlighted initially."},{"type":"string"}]}}}}},"layout":{"$ref":"#/definitions/components"},"initStrategy":{"type":"string","enum":["none","auto"],"description":"The initialization strategy determines how missing coordination objects and coordination scope mappings are initially filled in."},"version":{"type":"string","enum":["1.0.0"],"description":"The schema version for the view config."}}}')},function(t,e,n){"use strict";var r=n(9),i=n(28),o=n(0),a=(n(20),n(32)),A=n(17),s=n(326),c=n(306),u=n(43),l=n(868),g=o.forwardRef((function(t,e){var n=t.autoFocus,u=t.checked,g=t.checkedIcon,f=t.classes,h=t.className,d=t.defaultChecked,I=t.disabled,p=t.icon,C=t.id,y=t.inputProps,v=t.inputRef,B=t.name,m=t.onBlur,b=t.onChange,E=t.onFocus,Q=t.readOnly,F=t.required,w=t.tabIndex,S=t.type,R=t.value,U=Object(i.a)(t,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),x=Object(s.a)({controlled:u,default:Boolean(d),name:"SwitchBase"}),k=Object(A.a)(x,2),O=k[0],N=k[1],D=Object(c.a)(),G=I;D&&"undefined"===typeof G&&(G=D.disabled);var _="checkbox"===S||"radio"===S;return o.createElement(l.a,Object(r.a)({component:"span",className:Object(a.a)(f.root,h,O&&f.checked,G&&f.disabled),disabled:G,tabIndex:null,role:void 0,onFocus:function(t){E&&E(t),D&&D.onFocus&&D.onFocus(t)},onBlur:function(t){m&&m(t),D&&D.onBlur&&D.onBlur(t)},ref:e},U),o.createElement("input",Object(r.a)({autoFocus:n,checked:u,defaultChecked:d,className:f.input,disabled:G,id:_&&C,name:B,onChange:function(t){var e=t.target.checked;N(e),b&&b(t,e)},readOnly:Q,ref:v,required:F,tabIndex:w,type:S,value:R},y)),O?g:p)})),f=Object(u.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(g),h=n(332),d=Object(h.a)(o.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),I=Object(h.a)(o.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),p=n(77),C=Object(h.a)(o.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),y=n(64),v=o.createElement(I,null),B=o.createElement(d,null),m=o.createElement(C,null),b=o.forwardRef((function(t,e){var n=t.checkedIcon,A=void 0===n?v:n,s=t.classes,c=t.color,u=void 0===c?"secondary":c,l=t.icon,g=void 0===l?B:l,h=t.indeterminate,d=void 0!==h&&h,I=t.indeterminateIcon,p=void 0===I?m:I,C=t.inputProps,b=t.size,E=void 0===b?"medium":b,Q=Object(i.a)(t,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]);return o.createElement(f,Object(r.a)({type:"checkbox",classes:{root:Object(a.a)(s.root,s["color".concat(Object(y.a)(u))],d&&s.indeterminate),checked:s.checked,disabled:s.disabled},color:u,inputProps:Object(r.a)({"data-indeterminate":d},C),icon:o.cloneElement(d?p:g,{fontSize:"small"===E?"small":"default"}),checkedIcon:o.cloneElement(d?p:A,{fontSize:"small"===E?"small":"default"}),ref:e},Q))}));e.a=Object(u.a)((function(t){return{root:{color:t.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:t.palette.primary.main,"&:hover":{backgroundColor:Object(p.b)(t.palette.primary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:t.palette.action.disabled}},colorSecondary:{"&$checked":{color:t.palette.secondary.main,"&:hover":{backgroundColor:Object(p.b)(t.palette.secondary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:t.palette.action.disabled}}}}),{name:"MuiCheckbox"})(b)},function(t){t.exports=JSON.parse('{"note":"This file is regenerated by push-demo.sh.","branch":"ilan-gold/v1.1.4","date":"2021-02-11","hash":"c4c86af"}')},,,,,,,,,,,,,function(t,e,n){"use strict";var r=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var n;try{(n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),n=n.getBlob()}catch(i){n=new Blob([t])}return new Worker(r.createObjectURL(n))}catch(i){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(i){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},function(t,e,n){(function(t,n){var r="[object Arguments]",i="[object Map]",o="[object Object]",a="[object Set]",A=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c[r]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c["[object Function]"]=c[i]=c["[object Number]"]=c[o]=c["[object RegExp]"]=c[a]=c["[object String]"]=c["[object WeakMap]"]=!1;var u="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,g=u||l||Function("return this")(),f=e&&!e.nodeType&&e,h=f&&"object"==typeof n&&n&&!n.nodeType&&n,d=h&&h.exports===f,I=d&&u.process,p=function(){try{return I&&I.binding&&I.binding("util")}catch(t){}}(),C=p&&p.isTypedArray;function y(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function v(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function B(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var m,b,E=Array.prototype,Q=Function.prototype,F=Object.prototype,w=g["__core-js_shared__"],S=Q.toString,R=F.hasOwnProperty,U=function(){var t=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),x=F.toString,k=RegExp("^"+S.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=d?g.Buffer:void 0,N=g.Symbol,D=g.Uint8Array,G=F.propertyIsEnumerable,_=E.splice,M=N?N.toStringTag:void 0,T=Object.getOwnPropertySymbols,j=O?O.isBuffer:void 0,L=(m=Object.keys,b=Object,function(t){return m(b(t))}),V=It(g,"DataView"),Z=It(g,"Map"),P=It(g,"Promise"),W=It(g,"Set"),J=It(g,"WeakMap"),H=It(Object,"create"),Y=vt(V),X=vt(Z),z=vt(P),K=vt(W),q=vt(J),$=N?N.prototype:void 0,tt=$?$.valueOf:void 0;function et(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}function ot(t){var e=this.__data__=new nt(t);this.size=e.size}function at(t,e){var n=bt(t),r=!n&&mt(t),i=!n&&!r&&Et(t),o=!n&&!r&&!i&&Rt(t),a=n||r||i||o,A=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=A.length;for(var c in t)!e&&!R.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yt(c,s))||A.push(c);return A}function At(t,e){for(var n=t.length;n--;)if(Bt(t[n][0],e))return n;return-1}function st(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":M&&M in Object(t)?function(t){var e=R.call(t,M),n=t[M];try{t[M]=void 0;var r=!0}catch(o){}var i=x.call(t);r&&(e?t[M]=n:delete t[M]);return i}(t):function(t){return x.call(t)}(t)}function ct(t){return St(t)&&st(t)==r}function ut(t,e,n,A,s){return t===e||(null==t||null==e||!St(t)&&!St(e)?t!==t&&e!==e:function(t,e,n,A,s,c){var u=bt(t),l=bt(e),g=u?"[object Array]":Ct(t),f=l?"[object Array]":Ct(e),h=(g=g==r?o:g)==o,d=(f=f==r?o:f)==o,I=g==f;if(I&&Et(t)){if(!Et(e))return!1;u=!0,h=!1}if(I&&!h)return c||(c=new ot),u||Rt(t)?ft(t,e,n,A,s,c):function(t,e,n,r,o,A,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!A(new D(t),new D(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Bt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case i:var c=v;case a:var u=1&r;if(c||(c=B),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;r|=2,s.set(t,e);var g=ft(c(t),c(e),r,o,A,s);return s.delete(t),g;case"[object Symbol]":if(tt)return tt.call(t)==tt.call(e)}return!1}(t,e,g,n,A,s,c);if(!(1&n)){var p=h&&R.call(t,"__wrapped__"),C=d&&R.call(e,"__wrapped__");if(p||C){var y=p?t.value():t,m=C?e.value():e;return c||(c=new ot),s(y,m,n,A,c)}}if(!I)return!1;return c||(c=new ot),function(t,e,n,r,i,o){var a=1&n,A=ht(t),s=A.length,c=ht(e).length;if(s!=c&&!a)return!1;var u=s;for(;u--;){var l=A[u];if(!(a?l in e:R.call(e,l)))return!1}var g=o.get(t);if(g&&o.get(e))return g==e;var f=!0;o.set(t,e),o.set(e,t);var h=a;for(;++u<s;){l=A[u];var d=t[l],I=e[l];if(r)var p=a?r(I,d,l,e,t,o):r(d,I,l,t,e,o);if(!(void 0===p?d===I||i(d,I,n,r,o):p)){f=!1;break}h||(h="constructor"==l)}if(f&&!h){var C=t.constructor,y=e.constructor;C==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof C&&C instanceof C&&"function"==typeof y&&y instanceof y||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,A,s,c)}(t,e,n,A,ut,s))}function lt(t){return!(!wt(t)||function(t){return!!U&&U in t}(t))&&(Qt(t)?k:A).test(vt(t))}function gt(t){if(!function(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||F;return t===n}(t))return L(t);var e=[];for(var n in Object(t))R.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ft(t,e,n,r,i,o){var a=1&n,A=t.length,s=e.length;if(A!=s&&!(a&&s>A))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var u=-1,l=!0,g=2&n?new it:void 0;for(o.set(t,e),o.set(e,t);++u<A;){var f=t[u],h=e[u];if(r)var d=a?r(h,f,u,e,t,o):r(f,h,u,t,e,o);if(void 0!==d){if(d)continue;l=!1;break}if(g){if(!y(e,(function(t,e){if(a=e,!g.has(a)&&(f===t||i(f,t,n,r,o)))return g.push(e);var a}))){l=!1;break}}else if(f!==h&&!i(f,h,n,r,o)){l=!1;break}}return o.delete(t),o.delete(e),l}function ht(t){return function(t,e,n){var r=e(t);return bt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Ut,pt)}function dt(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function It(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return lt(n)?n:void 0}et.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et.prototype.get=function(t){var e=this.__data__;if(H){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return R.call(e,t)?e[t]:void 0},et.prototype.has=function(t){var e=this.__data__;return H?void 0!==e[t]:R.call(e,t)},et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=H&&void 0===e?"__lodash_hash_undefined__":e,this},nt.prototype.clear=function(){this.__data__=[],this.size=0},nt.prototype.delete=function(t){var e=this.__data__,n=At(e,t);return!(n<0)&&(n==e.length-1?e.pop():_.call(e,n,1),--this.size,!0)},nt.prototype.get=function(t){var e=this.__data__,n=At(e,t);return n<0?void 0:e[n][1]},nt.prototype.has=function(t){return At(this.__data__,t)>-1},nt.prototype.set=function(t,e){var n=this.__data__,r=At(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},rt.prototype.clear=function(){this.size=0,this.__data__={hash:new et,map:new(Z||nt),string:new et}},rt.prototype.delete=function(t){var e=dt(this,t).delete(t);return this.size-=e?1:0,e},rt.prototype.get=function(t){return dt(this,t).get(t)},rt.prototype.has=function(t){return dt(this,t).has(t)},rt.prototype.set=function(t,e){var n=dt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},it.prototype.add=it.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},it.prototype.has=function(t){return this.__data__.has(t)},ot.prototype.clear=function(){this.__data__=new nt,this.size=0},ot.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ot.prototype.get=function(t){return this.__data__.get(t)},ot.prototype.has=function(t){return this.__data__.has(t)},ot.prototype.set=function(t,e){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(t,e),this.size=n.size,this};var pt=T?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}(T(t),(function(e){return G.call(t,e)})))}:function(){return[]},Ct=st;function yt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){if(null!=t){try{return S.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bt(t,e){return t===e||t!==t&&e!==e}(V&&"[object DataView]"!=Ct(new V(new ArrayBuffer(1)))||Z&&Ct(new Z)!=i||P&&"[object Promise]"!=Ct(P.resolve())||W&&Ct(new W)!=a||J&&"[object WeakMap]"!=Ct(new J))&&(Ct=function(t){var e=st(t),n=e==o?t.constructor:void 0,r=n?vt(n):"";if(r)switch(r){case Y:return"[object DataView]";case X:return i;case z:return"[object Promise]";case K:return a;case q:return"[object WeakMap]"}return e});var mt=ct(function(){return arguments}())?ct:function(t){return St(t)&&R.call(t,"callee")&&!G.call(t,"callee")},bt=Array.isArray;var Et=j||function(){return!1};function Qt(t){if(!wt(t))return!1;var e=st(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ft(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function wt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function St(t){return null!=t&&"object"==typeof t}var Rt=C?function(t){return function(e){return t(e)}}(C):function(t){return St(t)&&Ft(t.length)&&!!c[st(t)]};function Ut(t){return null!=(e=t)&&Ft(e.length)&&!Qt(e)?at(t):gt(t);var e}n.exports=function(t,e){return ut(t,e)}}).call(this,n(56),n(130)(t))},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchesSelector=l,e.matchesSelectorAndParentsTo=function(t,e,n){var r=t;do{if(l(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},e.addEvent=function(t,e,n,r){if(!t)return;var i=s({capture:!0},r);t.addEventListener?t.addEventListener(e,n,i):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n},e.removeEvent=function(t,e,n,r){if(!t)return;var i=s({capture:!0},r);t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null},e.outerHeight=function(t){var e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,i.int)(n.borderTopWidth),e+=(0,i.int)(n.borderBottomWidth)},e.outerWidth=function(t){var e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,i.int)(n.borderLeftWidth),e+=(0,i.int)(n.borderRightWidth)},e.innerHeight=function(t){var e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,i.int)(n.paddingTop),e-=(0,i.int)(n.paddingBottom)},e.innerWidth=function(t){var e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,i.int)(n.paddingLeft),e-=(0,i.int)(n.paddingRight)},e.offsetXYFromParent=function(t,e,n){var r=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),i=(t.clientX+e.scrollLeft-r.left)/n,o=(t.clientY+e.scrollTop-r.top)/n;return{x:i,y:o}},e.createCSSTransform=function(t,e){var n=g(t,e,"px");return c({},(0,o.browserPrefixToKey)("transform",o.default),n)},e.createSVGTransform=function(t,e){return g(t,e,"")},e.getTranslation=g,e.getTouch=function(t,e){return t.targetTouches&&(0,i.findInArray)(t.targetTouches,(function(t){return e===t.identifier}))||t.changedTouches&&(0,i.findInArray)(t.changedTouches,(function(t){return e===t.identifier}))},e.getTouchIdentifier=function(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier},e.addUserSelectStyles=function(t){if(!t)return;var e=t.getElementById("react-draggable-style-el");e||((e=t.createElement("style")).type="text/css",e.id="react-draggable-style-el",e.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",e.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",t.getElementsByTagName("head")[0].appendChild(e));t.body&&f(t.body,"react-draggable-transparent-selection")},e.removeUserSelectStyles=function(t){if(!t)return;try{if(t.body&&h(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{var e=(t.defaultView||window).getSelection();e&&"Caret"!==e.type&&e.removeAllRanges()}}catch(n){}},e.addClassName=f,e.removeClassName=h;var i=n(1119),o=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var A=i?Object.getOwnPropertyDescriptor(t,o):null;A&&(A.get||A.set)?Object.defineProperty(n,o,A):n[o]=t[o]}n.default=t,e&&e.set(t,n);return n}(n(1420));function a(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function A(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?A(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u="";function l(t,e){return u||(u=(0,i.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(e){return(0,i.isFunction)(t[e])}))),!!(0,i.isFunction)(t[u])&&t[u](e)}function g(t,e,n){var r=t.x,i=t.y,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(e){var a="".concat("string"===typeof e.x?e.x:e.x+n),A="".concat("string"===typeof e.y?e.y:e.y+n);o="translate(".concat(a,", ").concat(A,")")+o}return o}function f(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function h(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}},function(t,e,n){"use strict";var r=n(870),i=n(685),o=n(871),a=n(497),A=n(1034),s=i.ucs2length,c=n(538),u=o.Validation;function l(t,e,n){var r=f.call(this,t,e,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:t,root:e,baseId:n},{index:r,compiling:!1})}function g(t,e,n){var r=f.call(this,t,e,n);r>=0&&this._compilations.splice(r,1)}function f(t,e,n){for(var r=0;r<this._compilations.length;r++){var i=this._compilations[r];if(i.schema==t&&i.root==e&&i.baseId==n)return r}return-1}function h(t,e){return"var pattern"+t+" = new RegExp("+i.toQuotedString(e[t])+");"}function d(t){return"var default"+t+" = defaults["+t+"];"}function I(t,e){return void 0===e[t]?"":"var refVal"+t+" = refVal["+t+"];"}function p(t){return"var customRule"+t+" = customRules["+t+"];"}function C(t,e){if(!t.length)return"";for(var n="",r=0;r<t.length;r++)n+=e(r,t);return n}t.exports=function t(e,n,f,y){var v=this,B=this._opts,m=[void 0],b={},E=[],Q={},F=[],w={},S=[];n=n||{schema:e,refVal:m,refs:b};var R=l.call(this,e,n,y),U=this._compilations[R.index];if(R.compiling)return U.callValidate=function t(){var e=U.validate,n=e.apply(this,arguments);return t.errors=e.errors,n};var x=this._formats,k=this.RULES;try{var O=D(e,n,f,y);U.validate=O;var N=U.callValidate;return N&&(N.schema=O.schema,N.errors=null,N.refs=O.refs,N.refVal=O.refVal,N.root=O.root,N.$async=O.$async,B.sourceCode&&(N.source=O.source)),O}finally{g.call(this,e,n,y)}function D(e,a,l,g){var f=!a||a&&a.schema==e;if(a.schema!=n.schema)return t.call(v,e,a,l,g);var y,Q=!0===e.$async,w=A({isTop:!0,schema:e,isRoot:f,baseId:g,root:a,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:o.MissingRef,RULES:k,validate:A,util:i,resolve:r,resolveRef:G,usePattern:T,useDefault:j,useCustomRule:L,opts:B,formats:x,logger:v.logger,self:v});w=C(m,I)+C(E,h)+C(F,d)+C(S,p)+w,B.processCode&&(w=B.processCode(w));try{y=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",w)(v,k,x,n,m,F,S,c,s,u),m[0]=y}catch(R){throw v.logger.error("Error compiling schema, function code:",w),R}return y.schema=e,y.errors=null,y.refs=b,y.refVal=m,y.root=f?y:a,Q&&(y.$async=!0),!0===B.sourceCode&&(y.source={code:w,patterns:E,defaults:F}),y}function G(e,i,o){i=r.url(e,i);var a,A,s=b[i];if(void 0!==s)return M(a=m[s],A="refVal["+s+"]");if(!o&&n.refs){var c=n.refs[i];if(void 0!==c)return M(a=n.refVal[c],A=_(i,a))}A=_(i);var u=r.call(v,D,n,i);if(void 0===u){var l=f&&f[i];l&&(u=r.inlineRef(l,B.inlineRefs)?l:t.call(v,l,n,f,e))}if(void 0!==u)return function(t,e){var n=b[t];m[n]=e}(i,u),M(u,A);!function(t){delete b[t]}(i)}function _(t,e){var n=m.length;return m[n]=e,b[t]=n,"refVal"+n}function M(t,e){return"object"==typeof t||"boolean"==typeof t?{code:e,schema:t,inline:!0}:{code:e,$async:t&&!!t.$async}}function T(t){var e=Q[t];return void 0===e&&(e=Q[t]=E.length,E[e]=t),"pattern"+e}function j(t){switch(typeof t){case"boolean":case"number":return""+t;case"string":return i.toQuotedString(t);case"object":if(null===t)return"null";var e=a(t),n=w[e];return void 0===n&&(n=w[e]=F.length,F[n]=t),"default"+n}}function L(t,e,n,r){if(!1!==v._opts.validateSchema){var i=t.definition.dependencies;if(i&&!i.every((function(t){return Object.prototype.hasOwnProperty.call(n,t)})))throw new Error("parent schema must have all required keywords: "+i.join(","));var o=t.definition.validateSchema;if(o)if(!o(e)){var a="keyword schema is invalid: "+v.errorsText(o.errors);if("log"!=v._opts.validateSchema)throw new Error(a);v.logger.error(a)}}var A,s=t.definition.compile,c=t.definition.inline,u=t.definition.macro;if(s)A=s.call(v,e,n,r);else if(u)A=u.call(v,e,n,r),!1!==B.validateSchema&&v.validateSchema(A,!0);else if(c)A=c.call(v,r,t.keyword,e,n);else if(!(A=t.definition.validate))return;if(void 0===A)throw new Error('custom keyword "'+t.keyword+'"failed to compile');var l=S.length;return S[l]=A,{code:"customRule"+l,validate:A}}}},function(t,e,n){!function(t){"use strict";function e(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e.length>1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,i=1;i<r;++i)e[i]=e[i].slice(1,-1);return e[r]=e[r].slice(1),e.join("")}return e[0]}function n(t){return"(?:"+t+")"}function r(t){return void 0===t?"undefined":null===t?"null":Object.prototype.toString.call(t).split(" ").pop().split("]").shift().toLowerCase()}function i(t){return t.toUpperCase()}function o(t){var r=e("[0-9]","[A-Fa-f]"),i=n(n("%[EFef]"+r+"%"+r+r+"%"+r+r)+"|"+n("%[89A-Fa-f]"+r+"%"+r+r)+"|"+n("%"+r+r)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",a=e("[\\:\\/\\?\\#\\[\\]\\@]",o),A=t?"[\\uE000-\\uF8FF]":"[]",s=e("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",t?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=n("[A-Za-z]"+e("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),u=n(n(i+"|"+e(s,o,"[\\:]"))+"*"),l=(n(n("25[0-5]")+"|"+n("2[0-4][0-9]")+"|"+n("1[0-9][0-9]")+"|"+n("[1-9][0-9]")+"|[0-9]"),n(n("25[0-5]")+"|"+n("2[0-4][0-9]")+"|"+n("1[0-9][0-9]")+"|"+n("0?[1-9][0-9]")+"|0?0?[0-9]")),g=n(l+"\\."+l+"\\."+l+"\\."+l),f=n(r+"{1,4}"),h=n(n(f+"\\:"+f)+"|"+g),d=n(n(f+"\\:")+"{6}"+h),I=n("\\:\\:"+n(f+"\\:")+"{5}"+h),p=n(n(f)+"?\\:\\:"+n(f+"\\:")+"{4}"+h),C=n(n(n(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+n(f+"\\:")+"{3}"+h),y=n(n(n(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+n(f+"\\:")+"{2}"+h),v=n(n(n(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+h),B=n(n(n(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+h),m=n(n(n(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),b=n(n(n(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),E=n([d,I,p,C,y,v,B,m,b].join("|")),Q=n(n(s+"|"+i)+"+"),F=(n(E+"\\%25"+Q),n(E+n("\\%25|\\%(?!"+r+"{2})")+Q)),w=n("[vV]"+r+"+\\."+e(s,o,"[\\:]")+"+"),S=n("\\["+n(F+"|"+E+"|"+w)+"\\]"),R=n(n(i+"|"+e(s,o))+"*"),U=n(S+"|"+g+"(?!"+R+")|"+R),x=n("[0-9]*"),k=n(n(u+"@")+"?"+U+n("\\:"+x)+"?"),O=n(i+"|"+e(s,o,"[\\:\\@]")),N=n(O+"*"),D=n(O+"+"),G=n(n(i+"|"+e(s,o,"[\\@]"))+"+"),_=n(n("\\/"+N)+"*"),M=n("\\/"+n(D+_)+"?"),T=n(G+_),j=n(D+_),L="(?!"+O+")",V=(n(_+"|"+M+"|"+T+"|"+j+"|"+L),n(n(O+"|"+e("[\\/\\?]",A))+"*")),Z=n(n(O+"|[\\/\\?]")+"*"),P=n(n("\\/\\/"+k+_)+"|"+M+"|"+j+"|"+L),W=n(c+"\\:"+P+n("\\?"+V)+"?"+n("\\#"+Z)+"?"),J=n(n("\\/\\/"+k+_)+"|"+M+"|"+T+"|"+L),H=n(J+n("\\?"+V)+"?"+n("\\#"+Z)+"?");return n(W+"|"+H),n(c+"\\:"+P+n("\\?"+V)+"?"),n(n("\\/\\/("+n("("+u+")@")+"?("+U+")"+n("\\:("+x+")")+"?)")+"?("+_+"|"+M+"|"+j+"|"+L+")"),n("\\?("+V+")"),n("\\#("+Z+")"),n(n("\\/\\/("+n("("+u+")@")+"?("+U+")"+n("\\:("+x+")")+"?)")+"?("+_+"|"+M+"|"+T+"|"+L+")"),n("\\?("+V+")"),n("\\#("+Z+")"),n(n("\\/\\/("+n("("+u+")@")+"?("+U+")"+n("\\:("+x+")")+"?)")+"?("+_+"|"+M+"|"+j+"|"+L+")"),n("\\?("+V+")"),n("\\#("+Z+")"),n("("+u+")@"),n("\\:("+x+")"),{NOT_SCHEME:new RegExp(e("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",s,o),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",s,o),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",s,o),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",s,o),"g"),NOT_QUERY:new RegExp(e("[^\\%]",s,o,"[\\:\\@\\/\\?]",A),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",s,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",s,o),"g"),UNRESERVED:new RegExp(s,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",s,a),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+g+")$"),IPV6ADDRESS:new RegExp("^\\[?("+E+")"+n(n("\\%25|\\%(?!"+r+"{2})")+"("+Q+")")+"?\\]?$")}}var a=o(!1),A=o(!0),s=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&A.return&&A.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,u=/^xn--/,l=/[^\0-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function I(t){throw new RangeError(f[t])}function p(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);var i=function(t,e){for(var n=[],r=t.length;r--;)n[r]=e(t[r]);return n}((t=t.replace(g,".")).split("."),e).join(".");return r+i}function C(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=t.charCodeAt(n++);56320==(64512&o)?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),n--)}else e.push(i)}return e}var y=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},v=function(t,e,n){var r=0;for(t=n?h(t/700):t>>1,t+=h(t/e);t>455;r+=36)t=h(t/35);return h(r+36*t/(t+38))},B=function(t){var e,n=[],r=t.length,i=0,o=128,a=72,A=t.lastIndexOf("-");A<0&&(A=0);for(var s=0;s<A;++s)t.charCodeAt(s)>=128&&I("not-basic"),n.push(t.charCodeAt(s));for(var u=A>0?A+1:0;u<r;){for(var l=i,g=1,f=36;;f+=36){u>=r&&I("invalid-input");var d=(e=t.charCodeAt(u++))-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36;(d>=36||d>h((c-i)/g))&&I("overflow"),i+=d*g;var p=f<=a?1:f>=a+26?26:f-a;if(d<p)break;var C=36-p;g>h(c/C)&&I("overflow"),g*=C}var y=n.length+1;a=v(i-l,y,0==l),h(i/y)>c-o&&I("overflow"),o+=h(i/y),i%=y,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},m=function(t){var e=[],n=(t=C(t)).length,r=128,i=0,o=72,a=!0,A=!1,s=void 0;try{for(var u,l=t[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var g=u.value;g<128&&e.push(d(g))}}catch(j){A=!0,s=j}finally{try{!a&&l.return&&l.return()}finally{if(A)throw s}}var f=e.length,p=f;for(f&&e.push("-");p<n;){var B=c,m=!0,b=!1,E=void 0;try{for(var Q,F=t[Symbol.iterator]();!(m=(Q=F.next()).done);m=!0){var w=Q.value;w>=r&&w<B&&(B=w)}}catch(j){b=!0,E=j}finally{try{!m&&F.return&&F.return()}finally{if(b)throw E}}var S=p+1;B-r>h((c-i)/S)&&I("overflow"),i+=(B-r)*S,r=B;var R=!0,U=!1,x=void 0;try{for(var k,O=t[Symbol.iterator]();!(R=(k=O.next()).done);R=!0){var N=k.value;if(N<r&&++i>c&&I("overflow"),N==r){for(var D=i,G=36;;G+=36){var _=G<=o?1:G>=o+26?26:G-o;if(D<_)break;var M=D-_,T=36-_;e.push(d(y(_+M%T,0))),D=h(M/T)}e.push(d(y(D,0))),o=v(i,S,p==f),i=0,++p}}}catch(j){U=!0,x=j}finally{try{!R&&O.return&&O.return()}finally{if(U)throw x}}++i,++r}return e.join("")},b=function(t){return p(t,(function(t){return l.test(t)?"xn--"+m(t):t}))},E=function(t){return p(t,(function(t){return u.test(t)?B(t.slice(4).toLowerCase()):t}))},Q={};function F(t){var e=t.charCodeAt(0);return e<16?"%0"+e.toString(16).toUpperCase():e<128?"%"+e.toString(16).toUpperCase():e<2048?"%"+(e>>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function w(t){for(var e="",n=0,r=t.length;n<r;){var i=parseInt(t.substr(n+1,2),16);if(i<128)e+=String.fromCharCode(i),n+=3;else if(i>=194&&i<224){if(r-n>=6){var o=parseInt(t.substr(n+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var a=parseInt(t.substr(n+4,2),16),A=parseInt(t.substr(n+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&A)}else e+=t.substr(n,9);n+=9}else e+=t.substr(n,3),n+=3}return e}function S(t,e){function n(t){var n=w(t);return n.match(e.UNRESERVED)?n:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,n).replace(e.NOT_USERINFO,F).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_HOST,F).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,n).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,F).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,n).replace(e.NOT_QUERY,F).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,n).replace(e.NOT_FRAGMENT,F).replace(e.PCT_ENCODED,i)),t}function R(t){return t.replace(/^0*(.*)/,"$1")||"0"}function U(t,e){var n=t.match(e.IPV4ADDRESS)||[],r=s(n,2)[1];return r?r.split(".").map(R).join("."):t}function x(t,e){var n=t.match(e.IPV6ADDRESS)||[],r=s(n,3),i=r[1],o=r[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),A=s(a,2),c=A[0],u=A[1],l=u?u.split(":").map(R):[],g=c.split(":").map(R),f=e.IPV4ADDRESS.test(g[g.length-1]),h=f?7:8,d=g.length-h,I=Array(h),p=0;p<h;++p)I[p]=l[p]||g[d+p]||"";f&&(I[h-1]=U(I[h-1],e));var C=I.reduce((function(t,e,n){if(!e||"0"===e){var r=t[t.length-1];r&&r.index+r.length===n?r.length++:t.push({index:n,length:1})}return t}),[]).sort((function(t,e){return e.length-t.length}))[0],y=void 0;if(C&&C.length>1){var v=I.slice(0,C.index),B=I.slice(C.index+C.length);y=v.join(":")+"::"+B.join(":")}else y=I.join(":");return o&&(y+="%"+o),y}return t}var k=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,O=void 0==="".match(/(){0}/)[1];function N(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==e.iri?A:a;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(k);if(i){O?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==t.indexOf("@")?i[3]:void 0,n.host=-1!==t.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==t.indexOf("?")?i[7]:void 0,n.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=x(U(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==n.reference&&(n.error=n.error||"URI is not a "+e.reference+" reference.");var o=Q[(e.scheme||n.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)S(n,r);else{if(n.host&&(e.domainHost||o&&o.domainHost))try{n.host=b(n.host.replace(r.PCT_ENCODED,w).toLowerCase())}catch(s){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+s}S(n,a)}o&&o.parse&&o.parse(n,e)}else n.error=n.error||"URI can not be parsed.";return n}function D(t,e){var n=!1!==e.iri?A:a,r=[];return void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host&&r.push(x(U(String(t.host),n),n).replace(n.IPV6ADDRESS,(function(t,e,n){return"["+e+(n?"%25"+n:"")+"]"}))),"number"===typeof t.port&&(r.push(":"),r.push(t.port.toString(10))),r.length?r.join(""):void 0}var G=/^\.\.?\//,_=/^\/\.(\/|$)/,M=/^\/\.\.(\/|$)/,T=/^\/?(?:.|\n)*?(?=\/|$)/;function j(t){for(var e=[];t.length;)if(t.match(G))t=t.replace(G,"");else if(t.match(_))t=t.replace(_,"/");else if(t.match(M))t=t.replace(M,"/"),e.pop();else if("."===t||".."===t)t="";else{var n=t.match(T);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];t=t.slice(r.length),e.push(r)}return e.join("")}function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.iri?A:a,r=[],i=Q[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(n.IPV6ADDRESS.test(t.host));else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?E(t.host):b(t.host.replace(n.PCT_ENCODED,w).toLowerCase())}catch(c){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+c}S(t,n),"suffix"!==e.reference&&t.scheme&&(r.push(t.scheme),r.push(":"));var o=D(t,e);if(void 0!==o&&("suffix"!==e.reference&&r.push("//"),r.push(o),t.path&&"/"!==t.path.charAt(0)&&r.push("/")),void 0!==t.path){var s=t.path;e.absolutePath||i&&i.absolutePath||(s=j(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),r.push(s)}return void 0!==t.query&&(r.push("?"),r.push(t.query)),void 0!==t.fragment&&(r.push("#"),r.push(t.fragment)),r.join("")}function V(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],i={};return r||(t=N(L(t,n),n),e=N(L(e,n),n)),!(n=n||{}).tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=j(e.path||""),i.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=j(e.path||""),i.query=e.query):(e.path?("/"===e.path.charAt(0)?i.path=j(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path:i.path="/"+e.path,i.path=j(i.path)),i.query=e.query):(i.path=t.path,void 0!==e.query?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function Z(t,e){return t&&t.toString().replace(e&&e.iri?A.PCT_ENCODED:a.PCT_ENCODED,w)}var P={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){return t.port!==("https"!==String(t.scheme).toLowerCase()?80:443)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},W={scheme:"https",domainHost:P.domainHost,parse:P.parse,serialize:P.serialize},J={},H="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",X=n(n("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+n("%"+Y+Y)),z=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),K=new RegExp(H,"g"),q=new RegExp(X,"g"),$=new RegExp(e("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',z),"g"),tt=new RegExp(e("[^]",H,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),et=tt;function nt(t){var e=w(t);return e.match(K)?e:t}var rt={scheme:"mailto",parse:function(t,e){var n=t,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},a=n.query.split("&"),A=0,s=a.length;A<s;++A){var c=a[A].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),l=0,g=u.length;l<g;++l)r.push(u[l]);break;case"subject":n.subject=Z(c[1],e);break;case"body":n.body=Z(c[1],e);break;default:i=!0,o[Z(c[0],e)]=Z(c[1],e)}}i&&(n.headers=o)}n.query=void 0;for(var f=0,h=r.length;f<h;++f){var d=r[f].split("@");if(d[0]=Z(d[0]),e.unicodeSupport)d[1]=Z(d[1],e).toLowerCase();else try{d[1]=b(Z(d[1],e).toLowerCase())}catch(I){n.error=n.error||"Email address's domain name can not be converted to ASCII via punycode: "+I}r[f]=d.join("@")}return n},serialize:function(t,e){var n,r=t,o=void 0!==(n=t.to)&&null!==n?n instanceof Array?n:"number"!==typeof n.length||n.split||n.setInterval||n.call?[n]:Array.prototype.slice.call(n):[];if(o){for(var a=0,A=o.length;a<A;++a){var s=String(o[a]),c=s.lastIndexOf("@"),u=s.slice(0,c).replace(q,nt).replace(q,i).replace($,F),l=s.slice(c+1);try{l=e.iri?E(l):b(Z(l,e).toLowerCase())}catch(d){r.error=r.error||"Email address's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+d}o[a]=u+"@"+l}r.path=o.join(",")}var g=t.headers=t.headers||{};t.subject&&(g.subject=t.subject),t.body&&(g.body=t.body);var f=[];for(var h in g)g[h]!==J[h]&&f.push(h.replace(q,nt).replace(q,i).replace(tt,F)+"="+g[h].replace(q,nt).replace(q,i).replace(et,F));return f.length&&(r.query=f.join("&")),r}},it=/^([^\:]+)\:(.*)/,ot={scheme:"urn",parse:function(t,e){var n=t.path&&t.path.match(it),r=t;if(n){var i=e.scheme||r.scheme||"urn",o=n[1].toLowerCase(),a=n[2],A=i+":"+(e.nid||o),s=Q[A];r.nid=o,r.nss=a,r.path=void 0,s&&(r=s.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r},serialize:function(t,e){var n=e.scheme||t.scheme||"urn",r=t.nid,i=n+":"+(e.nid||r),o=Q[i];o&&(t=o.serialize(t,e));var a=t,A=t.nss;return a.path=(r||e.nid)+":"+A,a}},at=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,At={scheme:"urn:uuid",parse:function(t,e){var n=t;return n.uuid=n.nss,n.nss=void 0,e.tolerant||n.uuid&&n.uuid.match(at)||(n.error=n.error||"UUID is not valid."),n},serialize:function(t,e){var n=t;return n.nss=(t.uuid||"").toLowerCase(),n}};Q[P.scheme]=P,Q[W.scheme]=W,Q[rt.scheme]=rt,Q[ot.scheme]=ot,Q[At.scheme]=At,t.SCHEMES=Q,t.pctEncChar=F,t.pctDecChars=w,t.parse=N,t.removeDotSegments=j,t.serialize=L,t.resolveComponents=V,t.resolve=function(t,e,n){var r=function(t,e){var n=t;if(e)for(var r in e)n[r]=e[r];return n}({scheme:"null"},n);return L(V(N(t,r),N(e,r),r,!0),r)},t.normalize=function(t,e){return"string"===typeof t?t=L(N(t,e),e):"object"===r(t)&&(t=N(L(t,e),e)),t},t.equal=function(t,e,n){return"string"===typeof t?t=L(N(t,n),n):"object"===r(t)&&(t=L(t,n)),"string"===typeof e?e=L(N(e,n),n):"object"===r(e)&&(e=L(e,n)),t===e},t.escapeComponent=function(t,e){return t&&t.toString().replace(e&&e.iri?A.ESCAPE:a.ESCAPE,F)},t.unescapeComponent=Z,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";t.exports=function(t){for(var e,n=0,r=t.length,i=0;i<r;)n++,(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<r&&56320==(64512&(e=t.charCodeAt(i)))&&i++;return n}},function(t,e,n){"use strict";var r=t.exports=function(t,e,n){"function"==typeof e&&(n=e,e={}),function t(e,n,i,o,a,A,s,c,u,l){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var g in n(o,a,A,s,c,u,l),o){var f=o[g];if(Array.isArray(f)){if(g in r.arrayKeywords)for(var h=0;h<f.length;h++)t(e,n,i,f[h],a+"/"+g+"/"+h,A,a,g,o,h)}else if(g in r.propsKeywords){if(f&&"object"==typeof f)for(var d in f)t(e,n,i,f[d],a+"/"+g+"/"+d.replace(/~/g,"~0").replace(/\//g,"~1"),A,a,g,o,d)}else(g in r.keywords||e.allKeys&&!(g in r.skipKeywords))&&t(e,n,i,f,a+"/"+g,A,a,g,o)}i(o,a,A,s,c,u,l)}}(e,"function"==typeof(n=e.cb||n)?n:n.pre||function(){},n.post||function(){},t,"",t)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},function(t,e,n){"use strict";var r=t.exports=function(){this._cache={}};r.prototype.put=function(t,e){this._cache[t]=e},r.prototype.get=function(t){return this._cache[t]},r.prototype.del=function(t){delete this._cache[t]},r.prototype.clear=function(){this._cache={}}},function(t,e,n){"use strict";var r=n(685),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,A=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,s=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,l=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,g=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,h=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function d(t){return t="full"==t?"full":"fast",r.copy(d[t])}function I(t){var e=t.match(i);if(!e)return!1;var n=+e[1],r=+e[2],a=+e[3];return r>=1&&r<=12&&a>=1&&a<=(2==r&&function(t){return t%4===0&&(t%100!==0||t%400===0)}(n)?29:o[r])}function p(t,e){var n=t.match(a);if(!n)return!1;var r=n[1],i=n[2],o=n[3],A=n[5];return(r<=23&&i<=59&&o<=59||23==r&&59==i&&60==o)&&(!e||A)}t.exports=d,d.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:A,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:B,uuid:l,"json-pointer":g,"json-pointer-uri-fragment":f,"relative-json-pointer":h},d.full={date:I,time:p,"date-time":function(t){var e=t.split(C);return 2==e.length&&I(e[0])&&p(e[1],!0)},uri:function(t){return y.test(t)&&s.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:A,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:B,uuid:l,"json-pointer":g,"json-pointer-uri-fragment":f,"relative-json-pointer":h};var C=/t|\s/i;var y=/\/|:/;var v=/[^\\]\\Z/;function B(t){if(v.test(t))return!1;try{return new RegExp(t),!0}catch(e){return!1}}},function(t,e,n){"use strict";var r=n(1145),i=n(685).toHash;t.exports=function(){var t=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],e=["type","$comment"];return t.all=i(e),t.types=i(["number","integer","string","array","object","boolean","null"]),t.forEach((function(n){n.rules=n.rules.map((function(n){var i;if("object"==typeof n){var o=Object.keys(n)[0];i=n[o],n=o,i.forEach((function(n){e.push(n),t.all[n]=!0}))}return e.push(n),t.all[n]={keyword:n,code:r[n],implements:i}})),t.all.$comment={keyword:"$comment",code:r.$comment},n.type&&(t.types[n.type]=n)})),t.keywords=i(e.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),t.custom={},t}},function(t,e,n){"use strict";t.exports={$ref:n(1146),allOf:n(1147),anyOf:n(1148),$comment:n(1149),const:n(1150),contains:n(1151),dependencies:n(1152),enum:n(1153),format:n(1154),if:n(1155),items:n(1156),maximum:n(1035),minimum:n(1035),maxItems:n(1036),minItems:n(1036),maxLength:n(1037),minLength:n(1037),maxProperties:n(1038),minProperties:n(1038),multipleOf:n(1157),not:n(1158),oneOf:n(1159),pattern:n(1160),properties:n(1161),propertyNames:n(1162),required:n(1163),uniqueItems:n(1164),validate:n(1034)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o=" ",a=t.level,A=t.dataLevel,s=t.schema[e],c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(A||""),g="valid"+a;if("#"==s||"#/"==s)t.isRoot?(r=t.async,i="validate"):(r=!0===t.root.schema.$async,i="root.refVal[0]");else{var f=t.resolveRef(t.baseId,s,t.isRoot);if(void 0===f){var h=t.MissingRefError.message(t.baseId,s);if("fail"==t.opts.missingRefs){t.logger.error(h),(C=C||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { ref: '"+t.util.escapeQuotes(s)+"' } ",!1!==t.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+t.util.escapeQuotes(s)+"' "),t.opts.verbose&&(o+=" , schema: "+t.util.toQuotedString(s)+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),o+=" } "):o+=" {} ";var d=o;o=C.pop(),!t.compositeRule&&u?t.async?o+=" throw new ValidationError(["+d+"]); ":o+=" validate.errors = ["+d+"]; return false; ":o+=" var err = "+d+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(o+=" if (false) { ")}else{if("ignore"!=t.opts.missingRefs)throw new t.MissingRefError(t.baseId,s,h);t.logger.warn(h),u&&(o+=" if (true) { ")}}else if(f.inline){var I=t.util.copy(t);I.level++;var p="valid"+I.level;I.schema=f.schema,I.schemaPath="",I.errSchemaPath=s,o+=" "+t.validate(I).replace(/validate\.schema/g,f.code)+" ",u&&(o+=" if ("+p+") { ")}else r=!0===f.$async||t.async&&!1!==f.$async,i=f.code}if(i){var C;(C=C||[]).push(o),o="",t.opts.passContext?o+=" "+i+".call(this, ":o+=" "+i+"( ",o+=" "+l+", (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var y=o+=" , "+(A?"data"+(A-1||""):"parentData")+" , "+(A?t.dataPathArr[A]:"parentDataProperty")+", rootData)  ";if(o=C.pop(),r){if(!t.async)throw new Error("async schema referenced by sync schema");u&&(o+=" var "+g+"; "),o+=" try { await "+y+"; ",u&&(o+=" "+g+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(o+=" "+g+" = false; "),o+=" } ",u&&(o+=" if ("+g+") { ")}else o+=" if (!"+y+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",u&&(o+=" else { ")}return o}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.schemaPath+t.util.getProperty(e),a=t.errSchemaPath+"/"+e,A=!t.opts.allErrors,s=t.util.copy(t),c="";s.level++;var u="valid"+s.level,l=s.baseId,g=!0,f=i;if(f)for(var h,d=-1,I=f.length-1;d<I;)h=f[d+=1],(t.opts.strictKeywords?"object"==typeof h&&Object.keys(h).length>0:t.util.schemaHasRules(h,t.RULES.all))&&(g=!1,s.schema=h,s.schemaPath=o+"["+d+"]",s.errSchemaPath=a+"/"+d,r+="  "+t.validate(s)+" ",s.baseId=l,A&&(r+=" if ("+u+") { ",c+="}"));return A&&(r+=g?" if (true) { ":" "+c.slice(0,-1)+" "),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g="errs__"+i,f=t.util.copy(t),h="";f.level++;var d="valid"+f.level;if(a.every((function(e){return t.opts.strictKeywords?"object"==typeof e&&Object.keys(e).length>0:t.util.schemaHasRules(e,t.RULES.all)}))){var I=f.baseId;r+=" var "+g+" = errors; var "+l+" = false;  ";var p=t.compositeRule;t.compositeRule=f.compositeRule=!0;var C=a;if(C)for(var y,v=-1,B=C.length-1;v<B;)y=C[v+=1],f.schema=y,f.schemaPath=A+"["+v+"]",f.errSchemaPath=s+"/"+v,r+="  "+t.validate(f)+" ",f.baseId=I,r+=" "+l+" = "+l+" || "+d+"; if (!"+l+") { ",h+="}";t.compositeRule=f.compositeRule=p,r+=" "+h+" if (!"+l+") {   var err =   ",!1!==t.createErrors?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should match some schema in anyOf' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&c&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else {  errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; } ",t.opts.allErrors&&(r+=" } "),r=t.util.cleanUpCode(r)}else c&&(r+=" if (true) { ");return r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.errSchemaPath+"/"+e,a=(t.opts.allErrors,t.util.toQuotedString(i));return!0===t.opts.$comment?r+=" console.log("+a+");":"function"==typeof t.opts.$comment&&(r+=" self._opts.$comment("+a+", "+t.util.toQuotedString(o)+", validate.root.schema);"),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g=t.opts.$data&&a&&a.$data;g&&(r+=" var schema"+i+" = "+t.util.getData(a.$data,o,t.dataPathArr)+"; "),g||(r+=" var schema"+i+" = validate.schema"+A+";"),r+="var "+l+" = equal("+u+", schema"+i+"); if (!"+l+") {   ";var f=f||[];f.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { allowedValue: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to constant' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var h=r;return r=f.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+h+"]); ":r+=" validate.errors = ["+h+"]; return false; ":r+=" var err = "+h+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",c&&(r+=" else { "),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g="errs__"+i,f=t.util.copy(t);f.level++;var h="valid"+f.level,d="i"+i,I=f.dataLevel=t.dataLevel+1,p="data"+I,C=t.baseId,y=t.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:t.util.schemaHasRules(a,t.RULES.all);if(r+="var "+g+" = errors;var "+l+";",y){var v=t.compositeRule;t.compositeRule=f.compositeRule=!0,f.schema=a,f.schemaPath=A,f.errSchemaPath=s,r+=" var "+h+" = false; for (var "+d+" = 0; "+d+" < "+u+".length; "+d+"++) { ",f.errorPath=t.util.getPathExpr(t.errorPath,d,t.opts.jsonPointers,!0);var B=u+"["+d+"]";f.dataPathArr[I]=d;var m=t.validate(f);f.baseId=C,t.util.varOccurences(m,p)<2?r+=" "+t.util.varReplace(m,p,B)+" ":r+=" var "+p+" = "+B+"; "+m+" ",r+=" if ("+h+") break; }  ",t.compositeRule=f.compositeRule=v,r+="  if (!"+h+") {"}else r+=" if ("+u+".length == 0) {";var b=b||[];b.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should contain a valid item' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var E=r;return r=b.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",y&&(r+="  errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; } "),t.opts.allErrors&&(r+=" } "),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="errs__"+i,g=t.util.copy(t),f="";g.level++;var h="valid"+g.level,d={},I={},p=t.opts.ownProperties;for(B in a){var C=a[B],y=Array.isArray(C)?I:d;y[B]=C}r+="var "+l+" = errors;";var v=t.errorPath;for(var B in r+="var missing"+i+";",I)if((y=I[B]).length){if(r+=" if ( "+u+t.util.getProperty(B)+" !== undefined ",p&&(r+=" && Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(B)+"') "),c){r+=" && ( ";var m=y;if(m)for(var b=-1,E=m.length-1;b<E;){U=m[b+=1],b&&(r+=" || "),r+=" ( ( "+(N=u+(O=t.util.getProperty(U)))+" === undefined ",p&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(U)+"') "),r+=") && (missing"+i+" = "+t.util.toQuotedString(t.opts.jsonPointers?U:O)+") ) "}r+=")) {  ";var Q="missing"+i,F="' + "+Q+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.opts.jsonPointers?t.util.getPathExpr(v,Q,!0):v+" + "+Q);var w=w||[];w.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { property: '"+t.util.escapeQuotes(B)+"', missingProperty: '"+F+"', depsCount: "+y.length+", deps: '"+t.util.escapeQuotes(1==y.length?y[0]:y.join(", "))+"' } ",!1!==t.opts.messages&&(r+=" , message: 'should have ",1==y.length?r+="property "+t.util.escapeQuotes(y[0]):r+="properties "+t.util.escapeQuotes(y.join(", ")),r+=" when property "+t.util.escapeQuotes(B)+" is present' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var S=r;r=w.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var R=y;if(R)for(var U,x=-1,k=R.length-1;x<k;){U=R[x+=1];var O=t.util.getProperty(U),N=(F=t.util.escapeQuotes(U),u+O);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(v,U,t.opts.jsonPointers)),r+=" if ( "+N+" === undefined ",p&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(U)+"') "),r+=") {  var err =   ",!1!==t.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { property: '"+t.util.escapeQuotes(B)+"', missingProperty: '"+F+"', depsCount: "+y.length+", deps: '"+t.util.escapeQuotes(1==y.length?y[0]:y.join(", "))+"' } ",!1!==t.opts.messages&&(r+=" , message: 'should have ",1==y.length?r+="property "+t.util.escapeQuotes(y[0]):r+="properties "+t.util.escapeQuotes(y.join(", ")),r+=" when property "+t.util.escapeQuotes(B)+" is present' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" }   ",c&&(f+="}",r+=" else { ")}t.errorPath=v;var D=g.baseId;for(var B in d){C=d[B];(t.opts.strictKeywords?"object"==typeof C&&Object.keys(C).length>0:t.util.schemaHasRules(C,t.RULES.all))&&(r+=" "+h+" = true; if ( "+u+t.util.getProperty(B)+" !== undefined ",p&&(r+=" && Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(B)+"') "),r+=") { ",g.schema=C,g.schemaPath=A+t.util.getProperty(B),g.errSchemaPath=s+"/"+t.util.escapeFragment(B),r+="  "+t.validate(g)+" ",g.baseId=D,r+=" }  ",c&&(r+=" if ("+h+") { ",f+="}"))}return c&&(r+="   "+f+" if ("+l+" == errors) {"),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g=t.opts.$data&&a&&a.$data;g&&(r+=" var schema"+i+" = "+t.util.getData(a.$data,o,t.dataPathArr)+"; ");var f="i"+i,h="schema"+i;g||(r+=" var "+h+" = validate.schema"+A+";"),r+="var "+l+";",g&&(r+=" if (schema"+i+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+i+")) "+l+" = false; else {"),r+=l+" = false;for (var "+f+"=0; "+f+"<"+h+".length; "+f+"++) if (equal("+u+", "+h+"["+f+"])) { "+l+" = true; break; }",g&&(r+="  }  "),r+=" if (!"+l+") {   ";var d=d||[];d.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { allowedValues: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var I=r;return r=d.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+I+"]); ":r+=" validate.errors = ["+I+"]; return false; ":r+=" var err = "+I+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",c&&(r+=" else { "),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||"");if(!1===t.opts.format)return c&&(r+=" if (true) { "),r;var l,g=t.opts.$data&&a&&a.$data;g?(r+=" var schema"+i+" = "+t.util.getData(a.$data,o,t.dataPathArr)+"; ",l="schema"+i):l=a;var f=t.opts.unknownFormats,h=Array.isArray(f);if(g){r+=" var "+(d="format"+i)+" = formats["+l+"]; var "+(I="isObject"+i)+" = typeof "+d+" == 'object' && !("+d+" instanceof RegExp) && "+d+".validate; var "+(p="formatType"+i)+" = "+I+" && "+d+".type || 'string'; if ("+I+") { ",t.async&&(r+=" var async"+i+" = "+d+".async; "),r+=" "+d+" = "+d+".validate; } if (  ",g&&(r+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),r+=" (","ignore"!=f&&(r+=" ("+l+" && !"+d+" ",h&&(r+=" && self._opts.unknownFormats.indexOf("+l+") == -1 "),r+=") || "),r+=" ("+d+" && "+p+" == '"+n+"' && !(typeof "+d+" == 'function' ? ",t.async?r+=" (async"+i+" ? await "+d+"("+u+") : "+d+"("+u+")) ":r+=" "+d+"("+u+") ",r+=" : "+d+".test("+u+"))))) {"}else{var d;if(!(d=t.formats[a])){if("ignore"==f)return t.logger.warn('unknown format "'+a+'" ignored in schema at path "'+t.errSchemaPath+'"'),c&&(r+=" if (true) { "),r;if(h&&f.indexOf(a)>=0)return c&&(r+=" if (true) { "),r;throw new Error('unknown format "'+a+'" is used in schema at path "'+t.errSchemaPath+'"')}var I,p=(I="object"==typeof d&&!(d instanceof RegExp)&&d.validate)&&d.type||"string";if(I){var C=!0===d.async;d=d.validate}if(p!=n)return c&&(r+=" if (true) { "),r;if(C){if(!t.async)throw new Error("async format in sync schema");r+=" if (!(await "+(y="formats"+t.util.getProperty(a)+".validate")+"("+u+"))) { "}else{r+=" if (! ";var y="formats"+t.util.getProperty(a);I&&(y+=".validate"),r+="function"==typeof d?" "+y+"("+u+") ":" "+y+".test("+u+") ",r+=") { "}}var v=v||[];v.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { format:  ",r+=g?""+l:""+t.util.toQuotedString(a),r+="  } ",!1!==t.opts.messages&&(r+=" , message: 'should match format \"",r+=g?"' + "+l+" + '":""+t.util.escapeQuotes(a),r+="\"' "),t.opts.verbose&&(r+=" , schema:  ",r+=g?"validate.schema"+A:""+t.util.toQuotedString(a),r+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var B=r;return r=v.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+B+"]); ":r+=" validate.errors = ["+B+"]; return false; ":r+=" var err = "+B+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c&&(r+=" else { "),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g="errs__"+i,f=t.util.copy(t);f.level++;var h="valid"+f.level,d=t.schema.then,I=t.schema.else,p=void 0!==d&&(t.opts.strictKeywords?"object"==typeof d&&Object.keys(d).length>0:t.util.schemaHasRules(d,t.RULES.all)),C=void 0!==I&&(t.opts.strictKeywords?"object"==typeof I&&Object.keys(I).length>0:t.util.schemaHasRules(I,t.RULES.all)),y=f.baseId;if(p||C){var v;f.createErrors=!1,f.schema=a,f.schemaPath=A,f.errSchemaPath=s,r+=" var "+g+" = errors; var "+l+" = true;  ";var B=t.compositeRule;t.compositeRule=f.compositeRule=!0,r+="  "+t.validate(f)+" ",f.baseId=y,f.createErrors=!0,r+="  errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; }  ",t.compositeRule=f.compositeRule=B,p?(r+=" if ("+h+") {  ",f.schema=t.schema.then,f.schemaPath=t.schemaPath+".then",f.errSchemaPath=t.errSchemaPath+"/then",r+="  "+t.validate(f)+" ",f.baseId=y,r+=" "+l+" = "+h+"; ",p&&C?r+=" var "+(v="ifClause"+i)+" = 'then'; ":v="'then'",r+=" } ",C&&(r+=" else { ")):r+=" if (!"+h+") { ",C&&(f.schema=t.schema.else,f.schemaPath=t.schemaPath+".else",f.errSchemaPath=t.errSchemaPath+"/else",r+="  "+t.validate(f)+" ",f.baseId=y,r+=" "+l+" = "+h+"; ",p&&C?r+=" var "+(v="ifClause"+i)+" = 'else'; ":v="'else'",r+=" } "),r+=" if (!"+l+") {   var err =   ",!1!==t.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { failingKeyword: "+v+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match \"' + "+v+" + '\" schema' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&c&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" }   ",c&&(r+=" else { "),r=t.util.cleanUpCode(r)}else c&&(r+=" if (true) { ");return r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g="errs__"+i,f=t.util.copy(t),h="";f.level++;var d="valid"+f.level,I="i"+i,p=f.dataLevel=t.dataLevel+1,C="data"+p,y=t.baseId;if(r+="var "+g+" = errors;var "+l+";",Array.isArray(a)){var v=t.schema.additionalItems;if(!1===v){r+=" "+l+" = "+u+".length <= "+a.length+"; ";var B=s;s=t.errSchemaPath+"/additionalItems",r+="  if (!"+l+") {   ";var m=m||[];m.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { limit: "+a.length+" } ",!1!==t.opts.messages&&(r+=" , message: 'should NOT have more than "+a.length+" items' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var b=r;r=m.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+b+"]); ":r+=" validate.errors = ["+b+"]; return false; ":r+=" var err = "+b+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",s=B,c&&(h+="}",r+=" else { ")}var E=a;if(E)for(var Q,F=-1,w=E.length-1;F<w;)if(Q=E[F+=1],t.opts.strictKeywords?"object"==typeof Q&&Object.keys(Q).length>0:t.util.schemaHasRules(Q,t.RULES.all)){r+=" "+d+" = true; if ("+u+".length > "+F+") { ";var S=u+"["+F+"]";f.schema=Q,f.schemaPath=A+"["+F+"]",f.errSchemaPath=s+"/"+F,f.errorPath=t.util.getPathExpr(t.errorPath,F,t.opts.jsonPointers,!0),f.dataPathArr[p]=F;var R=t.validate(f);f.baseId=y,t.util.varOccurences(R,C)<2?r+=" "+t.util.varReplace(R,C,S)+" ":r+=" var "+C+" = "+S+"; "+R+" ",r+=" }  ",c&&(r+=" if ("+d+") { ",h+="}")}if("object"==typeof v&&(t.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:t.util.schemaHasRules(v,t.RULES.all))){f.schema=v,f.schemaPath=t.schemaPath+".additionalItems",f.errSchemaPath=t.errSchemaPath+"/additionalItems",r+=" "+d+" = true; if ("+u+".length > "+a.length+") {  for (var "+I+" = "+a.length+"; "+I+" < "+u+".length; "+I+"++) { ",f.errorPath=t.util.getPathExpr(t.errorPath,I,t.opts.jsonPointers,!0);S=u+"["+I+"]";f.dataPathArr[p]=I;R=t.validate(f);f.baseId=y,t.util.varOccurences(R,C)<2?r+=" "+t.util.varReplace(R,C,S)+" ":r+=" var "+C+" = "+S+"; "+R+" ",c&&(r+=" if (!"+d+") break; "),r+=" } }  ",c&&(r+=" if ("+d+") { ",h+="}")}}else if(t.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:t.util.schemaHasRules(a,t.RULES.all)){f.schema=a,f.schemaPath=A,f.errSchemaPath=s,r+="  for (var "+I+" = 0; "+I+" < "+u+".length; "+I+"++) { ",f.errorPath=t.util.getPathExpr(t.errorPath,I,t.opts.jsonPointers,!0);S=u+"["+I+"]";f.dataPathArr[p]=I;R=t.validate(f);f.baseId=y,t.util.varOccurences(R,C)<2?r+=" "+t.util.varReplace(R,C,S)+" ":r+=" var "+C+" = "+S+"; "+R+" ",c&&(r+=" if (!"+d+") break; "),r+=" }"}return c&&(r+=" "+h+" if ("+g+" == errors) {"),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A,i+="var division"+o+";if (",g&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+o+" = "+l+" / "+r+", ",t.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+t.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",g&&(i+="  )  "),i+=" ) {   ";var f=f||[];f.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { multipleOf: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be multiple of ",i+=g?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var h=i;return i=f.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",u&&(i+=" else { "),i}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="errs__"+i,g=t.util.copy(t);g.level++;var f="valid"+g.level;if(t.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:t.util.schemaHasRules(a,t.RULES.all)){g.schema=a,g.schemaPath=A,g.errSchemaPath=s,r+=" var "+l+" = errors;  ";var h,d=t.compositeRule;t.compositeRule=g.compositeRule=!0,g.createErrors=!1,g.opts.allErrors&&(h=g.opts.allErrors,g.opts.allErrors=!1),r+=" "+t.validate(g)+" ",g.createErrors=!0,h&&(g.opts.allErrors=h),t.compositeRule=g.compositeRule=d,r+=" if ("+f+") {   ";var I=I||[];I.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var p=r;r=I.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+p+"]); ":r+=" validate.errors = ["+p+"]; return false; ":r+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else {  errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",t.opts.allErrors&&(r+=" } ")}else r+="  var err =   ",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(r+=" if (false) { ");return r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g="errs__"+i,f=t.util.copy(t),h="";f.level++;var d="valid"+f.level,I=f.baseId,p="prevValid"+i,C="passingSchemas"+i;r+="var "+g+" = errors , "+p+" = false , "+l+" = false , "+C+" = null; ";var y=t.compositeRule;t.compositeRule=f.compositeRule=!0;var v=a;if(v)for(var B,m=-1,b=v.length-1;m<b;)B=v[m+=1],(t.opts.strictKeywords?"object"==typeof B&&Object.keys(B).length>0:t.util.schemaHasRules(B,t.RULES.all))?(f.schema=B,f.schemaPath=A+"["+m+"]",f.errSchemaPath=s+"/"+m,r+="  "+t.validate(f)+" ",f.baseId=I):r+=" var "+d+" = true; ",m&&(r+=" if ("+d+" && "+p+") { "+l+" = false; "+C+" = ["+C+", "+m+"]; } else { ",h+="}"),r+=" if ("+d+") { "+l+" = "+p+" = true; "+C+" = "+m+"; }";return t.compositeRule=f.compositeRule=y,r+=h+"if (!"+l+") {   var err =   ",!1!==t.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { passingSchemas: "+C+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&c&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else {  errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; }",t.opts.allErrors&&(r+=" } "),r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g=t.opts.$data&&A&&A.$data;g?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A,i+="if ( ",g&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+(g?"(new RegExp("+r+"))":t.usePattern(A))+".test("+l+") ) {   ";var f=f||[];f.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { pattern:  ",i+=g?""+r:""+t.util.toQuotedString(A),i+="  } ",!1!==t.opts.messages&&(i+=" , message: 'should match pattern \"",i+=g?"' + "+r+" + '":""+t.util.escapeQuotes(A),i+="\"' "),t.opts.verbose&&(i+=" , schema:  ",i+=g?"validate.schema"+s:""+t.util.toQuotedString(A),i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var h=i;return i=f.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",u&&(i+=" else { "),i}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="errs__"+i,g=t.util.copy(t),f="";g.level++;var h="valid"+g.level,d="key"+i,I="idx"+i,p=g.dataLevel=t.dataLevel+1,C="data"+p,y="dataProperties"+i,v=Object.keys(a||{}),B=t.schema.patternProperties||{},m=Object.keys(B),b=t.schema.additionalProperties,E=v.length||m.length,Q=!1===b,F="object"==typeof b&&Object.keys(b).length,w=t.opts.removeAdditional,S=Q||F||w,R=t.opts.ownProperties,U=t.baseId,x=t.schema.required;if(x&&(!t.opts.$data||!x.$data)&&x.length<t.opts.loopRequired)var k=t.util.toHash(x);if(r+="var "+l+" = errors;var "+h+" = true;",R&&(r+=" var "+y+" = undefined;"),S){if(r+=R?" "+y+" = "+y+" || Object.keys("+u+"); for (var "+I+"=0; "+I+"<"+y+".length; "+I+"++) { var "+d+" = "+y+"["+I+"]; ":" for (var "+d+" in "+u+") { ",E){if(r+=" var isAdditional"+i+" = !(false ",v.length)if(v.length>8)r+=" || validate.schema"+A+".hasOwnProperty("+d+") ";else{var O=v;if(O)for(var N=-1,D=O.length-1;N<D;)Y=O[N+=1],r+=" || "+d+" == "+t.util.toQuotedString(Y)+" "}if(m.length){var G=m;if(G)for(var _=-1,M=G.length-1;_<M;)it=G[_+=1],r+=" || "+t.usePattern(it)+".test("+d+") "}r+=" ); if (isAdditional"+i+") { "}if("all"==w)r+=" delete "+u+"["+d+"]; ";else{var T=t.errorPath,j="' + "+d+" + '";if(t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(t.errorPath,d,t.opts.jsonPointers)),Q)if(w)r+=" delete "+u+"["+d+"]; ";else{r+=" "+h+" = false; ";var L=s;s=t.errSchemaPath+"/additionalProperties",(et=et||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { additionalProperty: '"+j+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var V=r;r=et.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+V+"]); ":r+=" validate.errors = ["+V+"]; return false; ":r+=" var err = "+V+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=L,c&&(r+=" break; ")}else if(F)if("failing"==w){r+=" var "+l+" = errors;  ";var Z=t.compositeRule;t.compositeRule=g.compositeRule=!0,g.schema=b,g.schemaPath=t.schemaPath+".additionalProperties",g.errSchemaPath=t.errSchemaPath+"/additionalProperties",g.errorPath=t.opts._errorDataPathProperty?t.errorPath:t.util.getPathExpr(t.errorPath,d,t.opts.jsonPointers);var P=u+"["+d+"]";g.dataPathArr[p]=d;var W=t.validate(g);g.baseId=U,t.util.varOccurences(W,C)<2?r+=" "+t.util.varReplace(W,C,P)+" ":r+=" var "+C+" = "+P+"; "+W+" ",r+=" if (!"+h+") { errors = "+l+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+u+"["+d+"]; }  ",t.compositeRule=g.compositeRule=Z}else{g.schema=b,g.schemaPath=t.schemaPath+".additionalProperties",g.errSchemaPath=t.errSchemaPath+"/additionalProperties",g.errorPath=t.opts._errorDataPathProperty?t.errorPath:t.util.getPathExpr(t.errorPath,d,t.opts.jsonPointers);P=u+"["+d+"]";g.dataPathArr[p]=d;W=t.validate(g);g.baseId=U,t.util.varOccurences(W,C)<2?r+=" "+t.util.varReplace(W,C,P)+" ":r+=" var "+C+" = "+P+"; "+W+" ",c&&(r+=" if (!"+h+") break; ")}t.errorPath=T}E&&(r+=" } "),r+=" }  ",c&&(r+=" if ("+h+") { ",f+="}")}var J=t.opts.useDefaults&&!t.compositeRule;if(v.length){var H=v;if(H)for(var Y,X=-1,z=H.length-1;X<z;){var K=a[Y=H[X+=1]];if(t.opts.strictKeywords?"object"==typeof K&&Object.keys(K).length>0:t.util.schemaHasRules(K,t.RULES.all)){var q=t.util.getProperty(Y),$=(P=u+q,J&&void 0!==K.default);g.schema=K,g.schemaPath=A+q,g.errSchemaPath=s+"/"+t.util.escapeFragment(Y),g.errorPath=t.util.getPath(t.errorPath,Y,t.opts.jsonPointers),g.dataPathArr[p]=t.util.toQuotedString(Y);W=t.validate(g);if(g.baseId=U,t.util.varOccurences(W,C)<2){W=t.util.varReplace(W,C,P);var tt=P}else{tt=C;r+=" var "+C+" = "+P+"; "}if($)r+=" "+W+" ";else{if(k&&k[Y]){r+=" if ( "+tt+" === undefined ",R&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(Y)+"') "),r+=") { "+h+" = false; ";T=t.errorPath,L=s;var et,nt=t.util.escapeQuotes(Y);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(T,Y,t.opts.jsonPointers)),s=t.errSchemaPath+"/required",(et=et||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+nt+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+nt+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";V=r;r=et.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+V+"]); ":r+=" validate.errors = ["+V+"]; return false; ":r+=" var err = "+V+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=L,t.errorPath=T,r+=" } else { "}else c?(r+=" if ( "+tt+" === undefined ",R&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(Y)+"') "),r+=") { "+h+" = true; } else { "):(r+=" if ("+tt+" !== undefined ",R&&(r+=" &&   Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(Y)+"') "),r+=" ) { ");r+=" "+W+" } "}}c&&(r+=" if ("+h+") { ",f+="}")}}if(m.length){var rt=m;if(rt)for(var it,ot=-1,at=rt.length-1;ot<at;){K=B[it=rt[ot+=1]];if(t.opts.strictKeywords?"object"==typeof K&&Object.keys(K).length>0:t.util.schemaHasRules(K,t.RULES.all)){g.schema=K,g.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(it),g.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(it),r+=R?" "+y+" = "+y+" || Object.keys("+u+"); for (var "+I+"=0; "+I+"<"+y+".length; "+I+"++) { var "+d+" = "+y+"["+I+"]; ":" for (var "+d+" in "+u+") { ",r+=" if ("+t.usePattern(it)+".test("+d+")) { ",g.errorPath=t.util.getPathExpr(t.errorPath,d,t.opts.jsonPointers);P=u+"["+d+"]";g.dataPathArr[p]=d;W=t.validate(g);g.baseId=U,t.util.varOccurences(W,C)<2?r+=" "+t.util.varReplace(W,C,P)+" ":r+=" var "+C+" = "+P+"; "+W+" ",c&&(r+=" if (!"+h+") break; "),r+=" } ",c&&(r+=" else "+h+" = true; "),r+=" }  ",c&&(r+=" if ("+h+") { ",f+="}")}}}return c&&(r+=" "+f+" if ("+l+" == errors) {"),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="errs__"+i,g=t.util.copy(t);g.level++;var f="valid"+g.level;if(r+="var "+l+" = errors;",t.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:t.util.schemaHasRules(a,t.RULES.all)){g.schema=a,g.schemaPath=A,g.errSchemaPath=s;var h="key"+i,d="idx"+i,I="i"+i,p="' + "+h+" + '",C="data"+(g.dataLevel=t.dataLevel+1),y="dataProperties"+i,v=t.opts.ownProperties,B=t.baseId;v&&(r+=" var "+y+" = undefined; "),r+=v?" "+y+" = "+y+" || Object.keys("+u+"); for (var "+d+"=0; "+d+"<"+y+".length; "+d+"++) { var "+h+" = "+y+"["+d+"]; ":" for (var "+h+" in "+u+") { ",r+=" var startErrs"+i+" = errors; ";var m=h,b=t.compositeRule;t.compositeRule=g.compositeRule=!0;var E=t.validate(g);g.baseId=B,t.util.varOccurences(E,C)<2?r+=" "+t.util.varReplace(E,C,m)+" ":r+=" var "+C+" = "+m+"; "+E+" ",t.compositeRule=g.compositeRule=b,r+=" if (!"+f+") { for (var "+I+"=startErrs"+i+"; "+I+"<errors; "+I+"++) { vErrors["+I+"].propertyName = "+h+"; }   var err =   ",!1!==t.createErrors?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { propertyName: '"+p+"' } ",!1!==t.opts.messages&&(r+=" , message: 'property name \\'"+p+"\\' is invalid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&c&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),c&&(r+=" break; "),r+=" } }"}return c&&(r+="  if ("+l+" == errors) {"),r=t.util.cleanUpCode(r)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,a=t.schema[e],A=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,u="data"+(o||""),l="valid"+i,g=t.opts.$data&&a&&a.$data;g&&(r+=" var schema"+i+" = "+t.util.getData(a.$data,o,t.dataPathArr)+"; ");var f="schema"+i;if(!g)if(a.length<t.opts.loopRequired&&t.schema.properties&&Object.keys(t.schema.properties).length){var h=[],d=a;if(d)for(var I,p=-1,C=d.length-1;p<C;){I=d[p+=1];var y=t.schema.properties[I];y&&(t.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0:t.util.schemaHasRules(y,t.RULES.all))||(h[h.length]=I)}}else h=a;if(g||h.length){var v=t.errorPath,B=g||h.length>=t.opts.loopRequired,m=t.opts.ownProperties;if(c)if(r+=" var missing"+i+"; ",B){g||(r+=" var "+f+" = validate.schema"+A+"; ");var b="' + "+(R="schema"+i+"["+(F="i"+i)+"]")+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(v,R,t.opts.jsonPointers)),r+=" var "+l+" = true; ",g&&(r+=" if (schema"+i+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+i+")) "+l+" = false; else {"),r+=" for (var "+F+" = 0; "+F+" < "+f+".length; "+F+"++) { "+l+" = "+u+"["+f+"["+F+"]] !== undefined ",m&&(r+=" &&   Object.prototype.hasOwnProperty.call("+u+", "+f+"["+F+"]) "),r+="; if (!"+l+") break; } ",g&&(r+="  }  "),r+="  if (!"+l+") {   ",(S=S||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+b+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+b+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var E=r;r=S.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var Q=h;if(Q)for(var F=-1,w=Q.length-1;F<w;){x=Q[F+=1],F&&(r+=" || "),r+=" ( ( "+(D=u+(N=t.util.getProperty(x)))+" === undefined ",m&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(x)+"') "),r+=") && (missing"+i+" = "+t.util.toQuotedString(t.opts.jsonPointers?x:N)+") ) "}r+=") {  ";var S;b="' + "+(R="missing"+i)+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.opts.jsonPointers?t.util.getPathExpr(v,R,!0):v+" + "+R),(S=S||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+b+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+b+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";E=r;r=S.pop(),!t.compositeRule&&c?t.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(B){g||(r+=" var "+f+" = validate.schema"+A+"; ");var R;b="' + "+(R="schema"+i+"["+(F="i"+i)+"]")+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(v,R,t.opts.jsonPointers)),g&&(r+=" if ("+f+" && !Array.isArray("+f+")) {  var err =   ",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+b+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+b+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+f+" !== undefined) { "),r+=" for (var "+F+" = 0; "+F+" < "+f+".length; "+F+"++) { if ("+u+"["+f+"["+F+"]] === undefined ",m&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", "+f+"["+F+"]) "),r+=") {  var err =   ",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+b+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+b+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",g&&(r+="  }  ")}else{var U=h;if(U)for(var x,k=-1,O=U.length-1;k<O;){x=U[k+=1];var N=t.util.getProperty(x),D=(b=t.util.escapeQuotes(x),u+N);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(v,x,t.opts.jsonPointers)),r+=" if ( "+D+" === undefined ",m&&(r+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+t.util.escapeQuotes(x)+"') "),r+=") {  var err =   ",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(s)+" , params: { missingProperty: '"+b+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+b+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}t.errorPath=v}else c&&(r+=" if (true) {");return r}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,a=t.dataLevel,A=t.schema[e],s=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,l="data"+(a||""),g="valid"+o,f=t.opts.$data&&A&&A.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(A.$data,a,t.dataPathArr)+"; ",r="schema"+o):r=A,(A||f)&&!1!==t.opts.uniqueItems){f&&(i+=" var "+g+"; if ("+r+" === false || "+r+" === undefined) "+g+" = true; else if (typeof "+r+" != 'boolean') "+g+" = false; else { "),i+=" var i = "+l+".length , "+g+" = true , j; if (i > 1) { ";var h=t.schema.items&&t.schema.items.type,d=Array.isArray(h);if(!h||"object"==h||"array"==h||d&&(h.indexOf("object")>=0||h.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+g+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+l+"[i]; ";var I="checkDataType"+(d?"s":"");i+=" if ("+t.util[I](h,"item",!0)+") continue; ",d&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+g+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",f&&(i+="  }  "),i+=" if (!"+g+") {   ";var p=p||[];p.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(i+=" , schema:  ",i+=f?"validate.schema"+s:""+A,i+="         , parentSchema: validate.schema"+t.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var C=i;i=p.pop(),!t.compositeRule&&u?t.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { ")}else u&&(i+=" if (true) { ");return i}},function(t,e,n){"use strict";var r=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];t.exports=function(t,e){for(var n=0;n<e.length;n++){t=JSON.parse(JSON.stringify(t));var i,o=e[n].split("/"),a=t;for(i=1;i<o.length;i++)a=a[o[i]];for(i=0;i<r.length;i++){var A=r[i],s=a[A];s&&(a[A]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return t}},function(t,e,n){"use strict";var r=n(871).MissingRef;t.exports=function t(e,n,i){var o=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof n&&(i=n,n=void 0);var a=A(e).then((function(){var t=o._addSchema(e,void 0,n);return t.validate||function t(e){try{return o._compile(e)}catch(a){if(a instanceof r)return i(a);throw a}function i(r){var i=r.missingSchema;if(c(i))throw new Error("Schema "+i+" is loaded but "+r.missingRef+" cannot be resolved");var a=o._loadingSchemas[i];return a||(a=o._loadingSchemas[i]=o._opts.loadSchema(i)).then(s,s),a.then((function(t){if(!c(i))return A(t).then((function(){c(i)||o.addSchema(t,i,void 0,n)}))})).then((function(){return t(e)}));function s(){delete o._loadingSchemas[i]}function c(t){return o._refs[t]||o._schemas[t]}}}(t)}));i&&a.then((function(t){i(null,t)}),i);return a;function A(e){var n=e.$schema;return n&&!o.getSchema(n)?t.call(o,{$ref:n},!0):Promise.resolve()}}},function(t,e,n){"use strict";var r=/^[a-z_$][a-z0-9_$-]*$/i,i=n(1168),o=n(1169);t.exports={add:function(t,e){var n=this.RULES;if(n.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!r.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var o=e.type;if(Array.isArray(o))for(var a=0;a<o.length;a++)s(t,o[a],e);else s(t,o,e);var A=e.metaSchema;A&&(e.$data&&this._opts.$data&&(A={anyOf:[A,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(A,!0))}function s(t,e,r){for(var o,a=0;a<n.length;a++){var A=n[a];if(A.type==e){o=A;break}}o||(o={type:e,rules:[]},n.push(o));var s={keyword:t,definition:r,custom:!0,code:i,implements:r.implements};o.rules.push(s),n.custom[t]=s}return n.keywords[t]=n.all[t]=!0,this},get:function(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1},remove:function(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var n=0;n<e.length;n++)for(var r=e[n].rules,i=0;i<r.length;i++)if(r[i].keyword==t){r.splice(i,1);break}return this},validate:function t(e,n){t.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(o,!0);if(r(e))return!0;if(t.errors=r.errors,n)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o=" ",a=t.level,A=t.dataLevel,s=t.schema[e],c=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,l=!t.opts.allErrors,g="data"+(A||""),f="valid"+a,h="errs__"+a,d=t.opts.$data&&s&&s.$data;d?(o+=" var schema"+a+" = "+t.util.getData(s.$data,A,t.dataPathArr)+"; ",i="schema"+a):i=s;var I,p,C,y,v,B="definition"+a,m=this.definition,b="";if(d&&m.$data){v="keywordValidate"+a;var E=m.validateSchema;o+=" var "+B+" = RULES.custom['"+e+"'].definition; var "+v+" = "+B+".validate;"}else{if(!(y=t.useCustomRule(this,s,t.schema,t)))return;i="validate.schema"+c,v=y.code,I=m.compile,p=m.inline,C=m.macro}var Q=v+".errors",F="i"+a,w="ruleErr"+a,S=m.async;if(S&&!t.async)throw new Error("async keyword in sync schema");if(p||C||(o+=Q+" = null;"),o+="var "+h+" = errors;var "+f+";",d&&m.$data&&(b+="}",o+=" if ("+i+" === undefined) { "+f+" = true; } else { ",E&&(b+="}",o+=" "+f+" = "+B+".validateSchema("+i+"); if ("+f+") { ")),p)m.statements?o+=" "+y.validate+" ":o+=" "+f+" = "+y.validate+"; ";else if(C){var R=t.util.copy(t);b="";R.level++;var U="valid"+R.level;R.schema=y.validate,R.schemaPath="";var x=t.compositeRule;t.compositeRule=R.compositeRule=!0;var k=t.validate(R).replace(/validate\.schema/g,v);t.compositeRule=R.compositeRule=x,o+=" "+k}else{(G=G||[]).push(o),o="",o+="  "+v+".call( ",t.opts.passContext?o+="this":o+="self",I||!1===m.schema?o+=" , "+g+" ":o+=" , "+i+" , "+g+" , validate.schema"+t.schemaPath+" ",o+=" , (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var O=A?"data"+(A-1||""):"parentData",N=A?t.dataPathArr[A]:"parentDataProperty",D=o+=" , "+O+" , "+N+" , rootData )  ";o=G.pop(),!1===m.errors?(o+=" "+f+" = ",S&&(o+="await "),o+=D+"; "):o+=S?" var "+(Q="customErrors"+a)+" = null; try { "+f+" = await "+D+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+Q+" = e.errors; else throw e; } ":" "+Q+" = null; "+f+" = "+D+"; "}if(m.modifying&&(o+=" if ("+O+") "+g+" = "+O+"["+N+"];"),o+=""+b,m.valid)l&&(o+=" if (true) { ");else{var G;o+=" if ( ",void 0===m.valid?(o+=" !",o+=C?""+U:""+f):o+=" "+!m.valid+" ",o+=") { ",r=this.keyword,(G=G||[]).push(o),o="",(G=G||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { keyword: '"+this.keyword+"' } ",!1!==t.opts.messages&&(o+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),t.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+g+" "),o+=" } "):o+=" {} ";var _=o;o=G.pop(),!t.compositeRule&&l?t.async?o+=" throw new ValidationError(["+_+"]); ":o+=" validate.errors = ["+_+"]; return false; ":o+=" var err = "+_+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var M=o;o=G.pop(),p?m.errors?"full"!=m.errors&&(o+="  for (var "+F+"="+h+"; "+F+"<errors; "+F+"++) { var "+w+" = vErrors["+F+"]; if ("+w+".dataPath === undefined) "+w+".dataPath = (dataPath || '') + "+t.errorPath+"; if ("+w+".schemaPath === undefined) { "+w+'.schemaPath = "'+u+'"; } ',t.opts.verbose&&(o+=" "+w+".schema = "+i+"; "+w+".data = "+g+"; "),o+=" } "):!1===m.errors?o+=" "+M+" ":(o+=" if ("+h+" == errors) { "+M+" } else {  for (var "+F+"="+h+"; "+F+"<errors; "+F+"++) { var "+w+" = vErrors["+F+"]; if ("+w+".dataPath === undefined) "+w+".dataPath = (dataPath || '') + "+t.errorPath+"; if ("+w+".schemaPath === undefined) { "+w+'.schemaPath = "'+u+'"; } ',t.opts.verbose&&(o+=" "+w+".schema = "+i+"; "+w+".data = "+g+"; "),o+=" } } "):C?(o+="   var err =   ",!1!==t.createErrors?(o+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { keyword: '"+this.keyword+"' } ",!1!==t.opts.messages&&(o+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),t.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+g+" "),o+=" } "):o+=" {} ",o+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&l&&(t.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; ")):!1===m.errors?o+=" "+M+" ":(o+=" if (Array.isArray("+Q+")) { if (vErrors === null) vErrors = "+Q+"; else vErrors = vErrors.concat("+Q+"); errors = vErrors.length;  for (var "+F+"="+h+"; "+F+"<errors; "+F+"++) { var "+w+" = vErrors["+F+"]; if ("+w+".dataPath === undefined) "+w+".dataPath = (dataPath || '') + "+t.errorPath+";  "+w+'.schemaPath = "'+u+'";  ',t.opts.verbose&&(o+=" "+w+".schema = "+i+"; "+w+".data = "+g+"; "),o+=" } } else { "+M+" } "),o+=" } ",l&&(o+=" else { ")}return o}},function(t,e,n){"use strict";var r=n(1039);t.exports={$id:"https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){var r=n(303),i=n(493),o=n(200),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(504),i=n(1047),o=n(1048),a=n(505),A=n(1185),s=n(506);t.exports=function(t,e,n){var c=-1,u=i,l=t.length,g=!0,f=[],h=f;if(n)g=!1,u=o;else if(l>=200){var d=e?null:A(t);if(d)return s(d);g=!1,u=a,h=new r}else h=e?[]:f;t:for(;++c<l;){var I=t[c],p=e?e(I):I;if(I=n||0!==I?I:0,g&&p===p){for(var C=h.length;C--;)if(h[C]===p)continue t;e&&h.push(p),f.push(I)}else u(h,p,n)||(h!==f&&h.push(p),f.push(I))}return f}},function(t,e,n){var r=n(1182),i=n(1183),o=n(1184);t.exports=function(t,e,n){return e===e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e){t.exports=function(t){return t!==t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(535),i=n(1186),o=n(506),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(504),i=n(1047),o=n(1048),a=n(824),A=n(494),s=n(505);t.exports=function(t,e,n,c){var u=-1,l=i,g=!0,f=t.length,h=[],d=e.length;if(!f)return h;n&&(e=a(e,A(n))),c?(l=o,g=!1):e.length>=200&&(l=s,g=!1,e=new r(e));t:for(;++u<f;){var I=t[u],p=null==n?I:n(I);if(I=c||0!==I?I:0,g&&p===p){for(var C=d;C--;)if(e[C]===p)continue t;h.push(I)}else l(e,p,c)||h.push(I)}return h}},function(t,e,n){t.exports={default:n(1189),__esModule:!0}},function(t,e,n){n(1190),t.exports=n(514).Object.assign},function(t,e,n){var r=n(686);r(r.S+r.F,"Object",{assign:n(1192)})},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(515),i=n(769),o=n(879),a=n(772),A=n(880),s=n(1053),c=Object.assign;t.exports=!c||n(748)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=A(t),c=arguments.length,u=1,l=o.f,g=a.f;c>u;)for(var f,h=s(arguments[u++]),d=l?i(h).concat(l(h)):i(h),I=d.length,p=0;I>p;)f=d[p++],r&&!g.call(h,f)||(n[f]=h[f]);return n}:c},function(t,e,n){var r=n(689),i=n(1194),o=n(1195);t.exports=function(t){return function(e,n,a){var A,s=r(e),c=i(s.length),u=o(a,c);if(t&&n!=n){for(;c>u;)if((A=s[u++])!=A)return!0}else for(;c>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}}},function(t,e,n){var r=n(875),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(875),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){n(1197);var r=n(514).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(686);r(r.S+r.F*!n(515),"Object",{defineProperty:n(536).f})},function(t,e,n){t.exports={default:n(1199),__esModule:!0}},function(t,e,n){n(1200),n(1206),t.exports=n(884).f("iterator")},function(t,e,n){"use strict";var r=n(1201)(!0);n(1057)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(875),i=n(874);t.exports=function(t){return function(e,n){var o,a,A=String(i(e)),s=r(n),c=A.length;return s<0||s>=c?t?"":void 0:(o=A.charCodeAt(s))<55296||o>56319||s+1===c||(a=A.charCodeAt(s+1))<56320||a>57343?t?A.charAt(s):o:t?A.slice(s,s+2):a-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(882),i=n(768),o=n(883),a={};n(687)(a,n(690)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(536),i=n(747),o=n(769);t.exports=n(515)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),A=a.length,s=0;A>s;)r.f(t,n=a[s++],e[n]);return t}},function(t,e,n){var r=n(513).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(537),i=n(880),o=n(876)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){n(1207);for(var r=n(513),i=n(687),o=n(881),a=n(690)("toStringTag"),A="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<A.length;s++){var c=A[s],u=r[c],l=u&&u.prototype;l&&!l[a]&&i(l,a,c),o[c]=o.Array}},function(t,e,n){"use strict";var r=n(1208),i=n(1209),o=n(881),a=n(689);t.exports=n(1057)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(1211),__esModule:!0}},function(t,e,n){n(1212),n(1217),n(1218),n(1219),t.exports=n(514).Symbol},function(t,e,n){"use strict";var r=n(513),i=n(537),o=n(515),a=n(686),A=n(1058),s=n(1213).KEY,c=n(748),u=n(877),l=n(883),g=n(771),f=n(690),h=n(884),d=n(885),I=n(1214),p=n(1215),C=n(747),y=n(688),v=n(880),B=n(689),m=n(873),b=n(768),E=n(882),Q=n(1216),F=n(1060),w=n(879),S=n(536),R=n(769),U=F.f,x=S.f,k=Q.f,O=r.Symbol,N=r.JSON,D=N&&N.stringify,G=f("_hidden"),_=f("toPrimitive"),M={}.propertyIsEnumerable,T=u("symbol-registry"),j=u("symbols"),L=u("op-symbols"),V=Object.prototype,Z="function"==typeof O&&!!w.f,P=r.QObject,W=!P||!P.prototype||!P.prototype.findChild,J=o&&c((function(){return 7!=E(x({},"a",{get:function(){return x(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=U(V,e);r&&delete V[e],x(t,e,n),r&&t!==V&&x(V,e,r)}:x,H=function(t){var e=j[t]=E(O.prototype);return e._k=t,e},Y=Z&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},X=function(t,e,n){return t===V&&X(L,e,n),C(t),e=m(e,!0),C(n),i(j,e)?(n.enumerable?(i(t,G)&&t[G][e]&&(t[G][e]=!1),n=E(n,{enumerable:b(0,!1)})):(i(t,G)||x(t,G,b(1,{})),t[G][e]=!0),J(t,e,n)):x(t,e,n)},z=function(t,e){C(t);for(var n,r=I(e=B(e)),i=0,o=r.length;o>i;)X(t,n=r[i++],e[n]);return t},K=function(t){var e=M.call(this,t=m(t,!0));return!(this===V&&i(j,t)&&!i(L,t))&&(!(e||!i(this,t)||!i(j,t)||i(this,G)&&this[G][t])||e)},q=function(t,e){if(t=B(t),e=m(e,!0),t!==V||!i(j,e)||i(L,e)){var n=U(t,e);return!n||!i(j,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},$=function(t){for(var e,n=k(B(t)),r=[],o=0;n.length>o;)i(j,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===V,r=k(n?L:B(t)),o=[],a=0;r.length>a;)!i(j,e=r[a++])||n&&!i(V,e)||o.push(j[e]);return o};Z||(A((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=g(arguments.length>0?arguments[0]:void 0),e=function e(n){this===V&&e.call(L,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),J(this,t,b(1,n))};return o&&W&&J(V,t,{configurable:!0,set:e}),H(t)}).prototype,"toString",(function(){return this._k})),F.f=q,S.f=X,n(1059).f=Q.f=$,n(772).f=K,w.f=tt,o&&!n(770)&&A(V,"propertyIsEnumerable",K,!0),h.f=function(t){return H(f(t))}),a(a.G+a.W+a.F*!Z,{Symbol:O});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)f(et[nt++]);for(var rt=R(f.store),it=0;rt.length>it;)d(rt[it++]);a(a.S+a.F*!Z,"Symbol",{for:function(t){return i(T,t+="")?T[t]:T[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in T)if(T[e]===t)return e},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!Z,"Object",{create:function(t,e){return void 0===e?E(t):z(E(t),e)},defineProperty:X,defineProperties:z,getOwnPropertyDescriptor:q,getOwnPropertyNames:$,getOwnPropertySymbols:tt});var ot=c((function(){w.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return w.f(v(t))}}),N&&a(a.S+a.F*(!Z||c((function(){var t=O();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(y(e)||void 0!==t)&&!Y(t))return p(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,D.apply(N,r)}}),O.prototype[_]||n(687)(O.prototype,_,O.prototype.valueOf),l(O,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(771)("meta"),i=n(688),o=n(537),a=n(536).f,A=0,s=Object.isExtensible||function(){return!0},c=!n(748)((function(){return s(Object.preventExtensions({}))})),u=function(t){a(t,r,{value:{i:"O"+ ++A,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";u(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;u(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&u(t),t}}},function(t,e,n){var r=n(769),i=n(879),o=n(772);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,A=n(t),s=o.f,c=0;A.length>c;)s.call(t,a=A[c++])&&e.push(a);return e}},function(t,e,n){var r=n(1054);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(689),i=n(1059).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(e){return a.slice()}}(t):i(r(t))}},function(t,e){},function(t,e,n){n(885)("asyncIterator")},function(t,e,n){n(885)("observable")},function(t,e,n){t.exports={default:n(1221),__esModule:!0}},function(t,e,n){n(1222),t.exports=n(514).Object.setPrototypeOf},function(t,e,n){var r=n(686);r(r.S,"Object",{setPrototypeOf:n(1223).set})},function(t,e,n){var r=n(688),i=n(747),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(1049)(Function.call,n(1060).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(i){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){t.exports={default:n(1225),__esModule:!0}},function(t,e,n){n(1226);var r=n(514).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(686);r(r.S,"Object",{create:n(882)})},function(t,e,n){(function(e){(function(){var n,r,i,o,a,A;"undefined"!==typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"undefined"!==typeof e&&null!==e&&e.hrtime?(t.exports=function(){return(n()-a)/1e6},r=e.hrtime,o=(n=function(){var t;return 1e9*(t=r())[0]+t[1]})(),A=1e9*e.uptime(),a=o-A):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,n(68))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlphaPicker=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=s(n(0)),o=s(n(118)),a=n(222),A=s(n(1293));function s(t){return t&&t.__esModule?t:{default:t}}var c=e.AlphaPicker=function(t){var e=t.rgb,n=t.hsl,A=t.width,s=t.height,c=t.onChange,u=t.direction,l=t.style,g=t.renderers,f=t.pointer,h=t.className,d=void 0===h?"":h,I=(0,o.default)({default:{picker:{position:"relative",width:A,height:s},alpha:{radius:"2px",style:l}}});return i.default.createElement("div",{style:I.picker,className:"alpha-picker "+d},i.default.createElement(a.Alpha,r({},I.alpha,{rgb:e,hsl:n,pointer:f,renderers:g,onChange:c,direction:u})))};c.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:A.default},e.default=(0,a.ColorWrap)(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.flattenNames=void 0;var r=A(n(1230)),i=A(n(886)),o=A(n(1064)),a=A(n(516));function A(t){return t&&t.__esModule?t:{default:t}}var s=e.flattenNames=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,a.default)(e,(function(e){Array.isArray(e)?t(e).map((function(t){return n.push(t)})):(0,o.default)(e)?(0,i.default)(e,(function(t,e){!0===t&&n.push(e),n.push(e+"-"+t)})):(0,r.default)(e)&&n.push(e)})),n};e.default=s},function(t,e,n){var r=n(229),i=n(200),o=n(193);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),A=a.length;A--;){var s=a[t?A:++i];if(!1===n(o[s],s,o))break}return e}}},function(t,e,n){var r=n(1233),i=n(1236),o=n(709),a=n(200),A=n(1246);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?a(t)?i(t[0],t[1]):r(t):A(t)}},function(t,e,n){var r=n(1234),i=n(1235),o=n(1066);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(492),i=n(503);t.exports=function(t,e,n,o){var a=n.length,A=a,s=!o;if(null==t)return!A;for(t=Object(t);a--;){var c=n[a];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<A;){var u=(c=n[a])[0],l=t[u],g=c[1];if(s&&c[2]){if(void 0===l&&!(u in t))return!1}else{var f=new r;if(o)var h=o(l,g,u,t,e,f);if(!(void 0===h?i(g,l,3,o,f):h))return!1}}return!0}},function(t,e,n){var r=n(1065),i=n(410);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},function(t,e,n){var r=n(503),i=n(1237),o=n(1243),a=n(888),A=n(1065),s=n(1066),c=n(773);t.exports=function(t,e){return a(t)&&A(e)?s(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},function(t,e,n){var r=n(1067);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(1239),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(1240);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(407);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(1242);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(303),i=n(824),o=n(200),a=n(491),A=r?r.prototype:void 0,s=A?A.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return s?s.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e,n){var r=n(1244),i=n(1245);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(1068),i=n(493),o=n(200),a=n(454),A=n(409),s=n(773);t.exports=function(t,e,n){for(var c=-1,u=(e=r(e,t)).length,l=!1;++c<u;){var g=s(e[c]);if(!(l=null!=t&&n(t,g)))break;t=t[g]}return l||++c!=u?l:!!(u=null==t?0:t.length)&&A(u)&&a(g,u)&&(o(t)||i(t))}},function(t,e,n){var r=n(1247),i=n(1248),o=n(888),a=n(773);t.exports=function(t){return o(t)?r(a(t)):i(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(1067);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(1069),i=n(345);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(345);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,A=Object(n);(e?a--:++a<o)&&!1!==i(A[a],a,A););return n}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeClasses=void 0;var r=a(n(886)),i=a(n(1252)),o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function a(t){return t&&t.__esModule?t:{default:t}}var A=e.mergeClasses=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.default&&(0,i.default)(t.default)||{};return e.map((function(e){var i=t[e];return i&&(0,r.default)(i,(function(t,e){n[e]||(n[e]={}),n[e]=o({},n[e],i[e])})),e})),n};e.default=A},function(t,e,n){var r=n(1253);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(492),i=n(1070),o=n(1071),a=n(1254),A=n(1255),s=n(1072),c=n(1073),u=n(1258),l=n(1259),g=n(530),f=n(1260),h=n(495),d=n(1261),I=n(1262),p=n(1076),C=n(200),y=n(386),v=n(1267),B=n(192),m=n(1269),b=n(410),E={};E["[object Arguments]"]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E["[object Object]"]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E["[object Function]"]=E["[object WeakMap]"]=!1,t.exports=function t(e,n,Q,F,w,S){var R,U=1&n,x=2&n,k=4&n;if(Q&&(R=w?Q(e,F,w,S):Q(e)),void 0!==R)return R;if(!B(e))return e;var O=C(e);if(O){if(R=d(e),!U)return c(e,R)}else{var N=h(e),D="[object Function]"==N||"[object GeneratorFunction]"==N;if(y(e))return s(e,U);if("[object Object]"==N||"[object Arguments]"==N||D&&!w){if(R=x||D?{}:p(e),!U)return x?l(e,A(R,e)):u(e,a(R,e))}else{if(!E[N])return w?e:{};R=I(e,N,U)}}S||(S=new r);var G=S.get(e);if(G)return G;S.set(e,R),m(e)?e.forEach((function(r){R.add(t(r,n,Q,r,e,S))})):v(e)&&e.forEach((function(r,i){R.set(i,t(r,n,Q,i,e,S))}));var _=k?x?f:g:x?keysIn:b,M=O?void 0:_(e);return i(M||e,(function(r,i){M&&(r=e[i=r]),o(R,i,t(r,n,Q,i,e,S))})),R}},function(t,e,n){var r=n(749),i=n(410);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(749),i=n(774);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(192),i=n(510),o=n(1257),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var A in t)("constructor"!=A||!e&&a.call(t,A))&&n.push(A);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(749),i=n(508);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(749),i=n(1074);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(531),i=n(1074),o=n(774);t.exports=function(t){return r(t,o,i)}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(890),i=n(1263),o=n(1264),a=n(1265),A=n(1075);t.exports=function(t,e,n){var s=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new s(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return A(t,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(t);case"[object RegExp]":return o(t);case"[object Set]":return new s;case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(890);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(303),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},function(t,e,n){var r=n(192),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},function(t,e,n){var r=n(1268),i=n(494),o=n(509),a=o&&o.isMap,A=a?i(a):r;t.exports=A},function(t,e,n){var r=n(495),i=n(193);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(1270),i=n(494),o=n(509),a=o&&o.isSet,A=a?i(a):r;t.exports=A},function(t,e,n){var r=n(495),i=n(193);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.autoprefix=void 0;var r,i=n(886),o=(r=i)&&r.__esModule?r:{default:r},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};var A={borderRadius:function(t){return{msBorderRadius:t,MozBorderRadius:t,OBorderRadius:t,WebkitBorderRadius:t,borderRadius:t}},boxShadow:function(t){return{msBoxShadow:t,MozBoxShadow:t,OBoxShadow:t,WebkitBoxShadow:t,boxShadow:t}},userSelect:function(t){return{WebkitTouchCallout:t,KhtmlUserSelect:t,MozUserSelect:t,msUserSelect:t,WebkitUserSelect:t,userSelect:t}},flex:function(t){return{WebkitBoxFlex:t,MozBoxFlex:t,WebkitFlex:t,msFlex:t,flex:t}},flexBasis:function(t){return{WebkitFlexBasis:t,flexBasis:t}},justifyContent:function(t){return{WebkitJustifyContent:t,justifyContent:t}},transition:function(t){return{msTransition:t,MozTransition:t,OTransition:t,WebkitTransition:t,transition:t}},transform:function(t){return{msTransform:t,MozTransform:t,OTransform:t,WebkitTransform:t,transform:t}},absolute:function(t){var e=t&&t.split(" ");return{position:"absolute",top:e&&e[0],right:e&&e[1],bottom:e&&e[2],left:e&&e[3]}},extend:function(t,e){var n=e[t];return n||{extend:t}}},s=e.autoprefix=function(t){var e={};return(0,o.default)(t,(function(t,n){var r={};(0,o.default)(t,(function(t,e){var n=A[e];n?r=a({},r,n(t)):r[e]=t})),e[n]=r})),e};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hover=void 0;var r,i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(0),a=(r=o)&&r.__esModule?r:{default:r};function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=e.hover=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,c;A(this,r);for(var u=arguments.length,l=Array(u),g=0;g<u;g++)l[g]=arguments[g];return o=c=s(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),c.state={hover:!1},c.handleMouseOver=function(){return c.setState({hover:!0})},c.handleMouseOut=function(){return c.setState({hover:!1})},c.render=function(){return a.default.createElement(e,{onMouseOver:c.handleMouseOver,onMouseOut:c.handleMouseOut},a.default.createElement(t,i({},c.props,c.state)))},s(c,o)}return c(r,n),r}(a.default.Component)};e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.active=void 0;var r,i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(0),a=(r=o)&&r.__esModule?r:{default:r};function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=e.active=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,c;A(this,r);for(var u=arguments.length,l=Array(u),g=0;g<u;g++)l[g]=arguments[g];return o=c=s(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),c.state={active:!1},c.handleMouseDown=function(){return c.setState({active:!0})},c.handleMouseUp=function(){return c.setState({active:!1})},c.render=function(){return a.default.createElement(e,{onMouseDown:c.handleMouseDown,onMouseUp:c.handleMouseUp},a.default.createElement(t,i({},c.props,c.state)))},s(c,o)}return c(r,n),r}(a.default.Component)};e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){var n={},r=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n[t]=e};return 0===t&&r("first-child"),t===e-1&&r("last-child"),(0===t||t%2===0)&&r("even"),1===Math.abs(t%2)&&r("odd"),r("nth-child",t),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Alpha=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),a=u(o),A=u(n(118)),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1276)),c=u(n(891));function u(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}var f=e.Alpha=function(t){function e(){var t,n,r;l(this,e);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=g(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),r.handleChange=function(t){var e=s.calculateChange(t,r.props.hsl,r.props.direction,r.props.a,r.container);e&&"function"===typeof r.props.onChange&&r.props.onChange(e,t)},r.handleMouseDown=function(t){r.handleChange(t),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},g(r,n)}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var t=this,e=this.props.rgb,n=(0,A.default)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+e.r+","+e.g+","+e.b+", 0) 0%,\n           rgba("+e.r+","+e.g+","+e.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*e.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+e.r+","+e.g+","+e.b+", 0) 0%,\n           rgba("+e.r+","+e.g+","+e.b+", 1) 100%)"},pointer:{left:0,top:100*e.a+"%"}},overwrite:r({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return a.default.createElement("div",{style:n.alpha},a.default.createElement("div",{style:n.checkboard},a.default.createElement(c.default,{renderers:this.props.renderers})),a.default.createElement("div",{style:n.gradient}),a.default.createElement("div",{style:n.container,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("div",{style:n.pointer},this.props.pointer?a.default.createElement(this.props.pointer,this.props):a.default.createElement("div",{style:n.slider}))))}}]),e}(o.PureComponent||o.Component);e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.calculateChange=function(t,e,n,r,i){var o=i.clientWidth,a=i.clientHeight,A="number"===typeof t.pageX?t.pageX:t.touches[0].pageX,s="number"===typeof t.pageY?t.pageY:t.touches[0].pageY,c=A-(i.getBoundingClientRect().left+window.pageXOffset),u=s-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){var l=void 0;if(l=u<0?0:u>a?1:Math.round(100*u/a)/100,e.a!==l)return{h:e.h,s:e.s,l:e.l,a:l,source:"rgb"}}else{var g=void 0;if(r!==(g=c<0?0:c>o?1:Math.round(100*c/o)/100))return{h:e.h,s:e.s,l:e.l,a:g,source:"rgb"}}return null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={},i=e.render=function(t,e,n,r){if("undefined"===typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var o=i.getContext("2d");return o?(o.fillStyle=t,o.fillRect(0,0,i.width,i.height),o.fillStyle=e,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null};e.get=function(t,e,n,o){var a=t+"-"+e+"-"+n+(o?"-server":"");if(r[a])return r[a];var A=i(t,e,n,o);return r[a]=A,A}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditableInput=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),o=A(i),a=A(n(118));function A(t){return t&&t.__esModule?t:{default:t}}var s=[38,40],c=e.EditableInput=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(t){n.setUpdatedValue(t.target.value,t)},n.handleKeyDown=function(t){var e,r=function(t){return Number(String(t).replace(/%/g,""))}(t.target.value);if(!isNaN(r)&&(e=t.keyCode,s.indexOf(e)>-1)){var i=n.getArrowOffset(),o=38===t.keyCode?r+i:r-i;n.setUpdatedValue(o,t)}},n.handleDrag=function(t){if(n.props.dragLabel){var e=Math.round(n.props.value+t.movementX);e>=0&&e<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(e),t)}},n.handleMouseDown=function(t){n.props.dragLabel&&(t.preventDefault(),n.handleDrag(t),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},n}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"componentDidUpdate",value:function(t,e){this.props.value===this.state.value||t.value===this.props.value&&e.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(t){return function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},this.props.label,t)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(t,e){var n=this.props.label?this.getValueObjectWithLabel(t):t;this.props.onChange&&this.props.onChange(n,e);var r,i=function(t){return String(t).indexOf("%")>-1}(e.target.value);this.setState({value:i?(r=t,r+"%"):t})}},{key:"render",value:function(){var t=this,e=(0,a.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return o.default.createElement("div",{style:e.wrap},o.default.createElement("input",{style:e.input,ref:function(e){return t.input=e},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?o.default.createElement("span",{style:e.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(i.PureComponent||i.Component);e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hue=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),o=s(i),a=s(n(118)),A=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1280));function s(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}var l=e.Hue=function(t){function e(){var t,n,r;c(this,e);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=u(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),r.handleChange=function(t){var e=A.calculateChange(t,r.props.direction,r.props.hsl,r.container);e&&"function"===typeof r.props.onChange&&r.props.onChange(e,t)},r.handleMouseDown=function(t){r.handleChange(t),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},u(r,n)}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var t=this,e=this.props.direction,n=void 0===e?"horizontal":e,r=(0,a.default)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-100*this.props.hsl.h/360+100+"%"}}},{vertical:"vertical"===n});return o.default.createElement("div",{style:r.hue},o.default.createElement("div",{className:"hue-"+n,style:r.container,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},o.default.createElement("style",null,"\n            .hue-horizontal {\n              background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n                33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n              background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n                17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n            }\n\n            .hue-vertical {\n              background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n                #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n              background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n                #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n            }\n          "),o.default.createElement("div",{style:r.pointer},this.props.pointer?o.default.createElement(this.props.pointer,this.props):o.default.createElement("div",{style:r.slider}))))}}]),e}(i.PureComponent||i.Component);e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.calculateChange=function(t,e,n,r){var i=r.clientWidth,o=r.clientHeight,a="number"===typeof t.pageX?t.pageX:t.touches[0].pageX,A="number"===typeof t.pageY?t.pageY:t.touches[0].pageY,s=a-(r.getBoundingClientRect().left+window.pageXOffset),c=A-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===e){var u=void 0;if(c<0)u=359;else if(c>o)u=0;else{u=360*(-100*c/o+100)/100}if(n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"rgb"}}else{var l=void 0;if(s<0)l=0;else if(s>i)l=359;else{l=360*(100*s/i)/100}if(n.h!==l)return{h:l,s:n.s,l:n.l,a:n.a,source:"rgb"}}return null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Raised=void 0;var r=A(n(0)),i=A(n(20)),o=A(n(118)),a=A(n(346));function A(t){return t&&t.__esModule?t:{default:t}}var s=e.Raised=function(t){var e=t.zDepth,n=t.radius,i=t.background,A=t.children,s=t.styles,c=void 0===s?{}:s,u=(0,o.default)((0,a.default)({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+e+"px "+4*e+"px rgba(0,0,0,.24)",borderRadius:n,background:i}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},c),{"zDepth-1":1===e});return r.default.createElement("div",{style:u.wrap},r.default.createElement("div",{style:u.bg}),r.default.createElement("div",{style:u.content},A))};s.propTypes={background:i.default.string,zDepth:i.default.oneOf([0,1,2,3,4,5]),radius:i.default.number,styles:i.default.object},s.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}},e.default=s},function(t,e,n){var r=n(492),i=n(1077),o=n(1062),a=n(1283),A=n(192),s=n(774),c=n(1078);t.exports=function t(e,n,u,l,g){e!==n&&o(n,(function(o,s){if(g||(g=new r),A(o))a(e,n,s,u,t,l,g);else{var f=l?l(c(e,s),o,s+"",e,n,g):void 0;void 0===f&&(f=o),i(e,s,f)}}),s)}},function(t,e,n){var r=n(1077),i=n(1072),o=n(1075),a=n(1073),A=n(1076),s=n(493),c=n(200),u=n(823),l=n(386),g=n(406),f=n(192),h=n(1064),d=n(408),I=n(1078),p=n(1284);t.exports=function(t,e,n,C,y,v,B){var m=I(t,n),b=I(e,n),E=B.get(b);if(E)r(t,n,E);else{var Q=v?v(m,b,n+"",t,e,B):void 0,F=void 0===Q;if(F){var w=c(b),S=!w&&l(b),R=!w&&!S&&d(b);Q=b,w||S||R?c(m)?Q=m:u(m)?Q=a(m):S?(F=!1,Q=i(b,!0)):R?(F=!1,Q=o(b,!0)):Q=[]:h(b)||s(b)?(Q=m,s(m)?Q=p(m):f(m)&&!g(m)||(Q=A(b))):F=!1}F&&(B.set(b,Q),y(Q,b,C,v,B),B.delete(b)),r(t,n,Q)}}},function(t,e,n){var r=n(749),i=n(774);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(822),i=n(731);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,A=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,A&&i(n[0],n[1],A)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Saturation=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),o=c(i),a=c(n(118)),A=c(n(1287)),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1288));function c(t){return t&&t.__esModule?t:{default:t}}var u=e.Saturation=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=function(t){"function"===typeof n.props.onChange&&n.throttle(n.props.onChange,s.calculateChange(t,n.props.hsl,n.container),t)},n.handleMouseDown=function(t){n.handleChange(t),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=(0,A.default)((function(t,e,n){t(e,n)}),50),n}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var t=this,e=this.props.style||{},n=e.color,r=e.white,i=e.black,A=e.pointer,s=e.circle,c=(0,a.default)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-100*this.props.hsv.v+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n            0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:i,pointer:A,circle:s}},{custom:!!this.props.style});return o.default.createElement("div",{style:c.color,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},o.default.createElement("style",null,"\n          .saturation-white {\n            background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n            background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n          }\n          .saturation-black {\n            background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n            background: linear-gradient(to top, #000, rgba(0,0,0,0));\n          }\n        "),o.default.createElement("div",{style:c.white,className:"saturation-white"},o.default.createElement("div",{style:c.black,className:"saturation-black"}),o.default.createElement("div",{style:c.pointer},this.props.pointer?o.default.createElement(this.props.pointer,this.props):o.default.createElement("div",{style:c.circle}))))}}]),e}(i.PureComponent||i.Component);e.default=u},function(t,e,n){var r=n(269),i=n(192);t.exports=function(t,e,n){var o=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:o,maxWait:e,trailing:a})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.calculateChange=function(t,e,n){var r=n.getBoundingClientRect(),i=r.width,o=r.height,a="number"===typeof t.pageX?t.pageX:t.touches[0].pageX,A="number"===typeof t.pageY?t.pageY:t.touches[0].pageY,s=a-(n.getBoundingClientRect().left+window.pageXOffset),c=A-(n.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>i&&(s=i),c<0?c=0:c>o&&(c=o);var u=s/i,l=1-c/o;return{h:e.h,s:u,v:l,a:e.a,source:"rgb"}}},function(t,e,n){t.exports=n(1290)},function(t,e,n){var r=n(1070),i=n(1069),o=n(1063),a=n(200);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Swatch=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=s(n(0)),o=s(n(118)),a=n(1292),A=s(n(891));function s(t){return t&&t.__esModule?t:{default:t}}var c=e.Swatch=function(t){var e=t.color,n=t.style,a=t.onClick,s=void 0===a?function(){}:a,c=t.onHover,u=t.title,l=void 0===u?e:u,g=t.children,f=t.focus,h=t.focusStyle,d=void 0===h?{}:h,I="transparent"===e,p=(0,o.default)({default:{swatch:r({background:e,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,f?d:{})}}),C={};return c&&(C.onMouseOver=function(t){return c(e,t)}),i.default.createElement("div",r({style:p.swatch,onClick:function(t){return s(e,t)},title:l,tabIndex:0,onKeyDown:function(t){return 13===t.keyCode&&s(e,t)}},C),g,I&&i.default.createElement(A.default,{borderRadius:p.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};e.default=(0,a.handleFocus)(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleFocus=void 0;var r,i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(0),A=(r=a)&&r.__esModule?r:{default:r};function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function u(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.handleFocus=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var t,e,n;s(this,r);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return e=n=c(this,(t=r.__proto__||Object.getPrototypeOf(r)).call.apply(t,[this].concat(o))),n.state={focus:!1},n.handleFocus=function(){return n.setState({focus:!0})},n.handleBlur=function(){return n.setState({focus:!1})},c(n,e)}return u(r,n),o(r,[{key:"render",value:function(){return A.default.createElement(e,{onFocus:this.handleFocus,onBlur:this.handleBlur},A.default.createElement(t,i({},this.props,this.state)))}}]),r}(A.default.Component)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlphaPointer=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.AlphaPointer=function(t){var e=t.direction,n=(0,i.default)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===e});return r.default.createElement("div",{style:n.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Block=void 0;var r=u(n(0)),i=u(n(20)),o=u(n(118)),a=u(n(346)),A=u(n(391)),s=n(222),c=u(n(1295));function u(t){return t&&t.__esModule?t:{default:t}}var l=e.Block=function(t){var e=t.onChange,n=t.onSwatchHover,i=t.hex,u=t.colors,l=t.width,g=t.triangle,f=t.styles,h=void 0===f?{}:f,d=t.className,I=void 0===d?"":d,p="transparent"===i,C=function(t,n){A.default.isValidHex(t)&&e({hex:t,source:"hex"},n)},y=(0,o.default)((0,a.default)({default:{card:{width:l,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:i,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:A.default.getContrastingColor(i),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+i+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},h),{"hide-triangle":"hide"===g});return r.default.createElement("div",{style:y.card,className:"block-picker "+I},r.default.createElement("div",{style:y.triangle}),r.default.createElement("div",{style:y.head},p&&r.default.createElement(s.Checkboard,{borderRadius:"6px 6px 0 0"}),r.default.createElement("div",{style:y.label},i)),r.default.createElement("div",{style:y.body},r.default.createElement(c.default,{colors:u,onClick:C,onSwatchHover:n}),r.default.createElement(s.EditableInput,{style:{input:y.input},value:i,onChange:C})))};l.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),colors:i.default.arrayOf(i.default.string),triangle:i.default.oneOf(["top","hide"]),styles:i.default.object},l.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}},e.default=(0,s.ColorWrap)(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlockSwatches=void 0;var r=A(n(0)),i=A(n(118)),o=A(n(516)),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.BlockSwatches=function(t){var e=t.colors,n=t.onClick,A=t.onSwatchHover,s=(0,i.default)({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return r.default.createElement("div",{style:s.swatches},(0,o.default)(e,(function(t){return r.default.createElement(a.Swatch,{key:t,color:t,style:s.swatch,onClick:n,onHover:A,focusStyle:{boxShadow:"0 0 4px "+t}})})),r.default.createElement("div",{style:s.clear}))};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;var r=l(n(0)),i=l(n(20)),o=l(n(118)),a=l(n(516)),A=l(n(346)),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1080)),c=n(222),u=l(n(1297));function l(t){return t&&t.__esModule?t:{default:t}}var g=e.Circle=function(t){var e=t.width,n=t.onChange,i=t.onSwatchHover,s=t.colors,c=t.hex,l=t.circleSize,g=t.styles,f=void 0===g?{}:g,h=t.circleSpacing,d=t.className,I=void 0===d?"":d,p=(0,o.default)((0,A.default)({default:{card:{width:e,display:"flex",flexWrap:"wrap",marginRight:-h,marginBottom:-h}}},f)),C=function(t,e){return n({hex:t,source:"hex"},e)};return r.default.createElement("div",{style:p.card,className:"circle-picker "+I},(0,a.default)(s,(function(t){return r.default.createElement(u.default,{key:t,color:t,onClick:C,onSwatchHover:i,active:c===t.toLowerCase(),circleSize:l,circleSpacing:h})})))};g.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),circleSize:i.default.number,circleSpacing:i.default.number,styles:i.default.object},g.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[s.red[500],s.pink[500],s.purple[500],s.deepPurple[500],s.indigo[500],s.blue[500],s.lightBlue[500],s.cyan[500],s.teal[500],s.green[500],s.lightGreen[500],s.lime[500],s.yellow[500],s.amber[500],s.orange[500],s.deepOrange[500],s.brown[500],s.blueGrey[500]],styles:{}},e.default=(0,c.ColorWrap)(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CircleSwatch=void 0;var r=A(n(0)),i=n(118),o=A(i),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.CircleSwatch=function(t){var e=t.color,n=t.onClick,i=t.onSwatchHover,A=t.hover,s=t.active,c=t.circleSize,u=t.circleSpacing,l=(0,o.default)({default:{swatch:{width:c,height:c,marginRight:u,marginBottom:u,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+c/2+"px "+e,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+e}}},{hover:A,active:s});return r.default.createElement("div",{style:l.swatch},r.default.createElement(a.Swatch,{style:l.Swatch,color:e,onClick:n,onHover:i,focusStyle:{boxShadow:l.Swatch.boxShadow+", 0 0 5px "+e}}))};s.defaultProps={circleSize:28,circleSpacing:14},e.default=(0,i.handleHover)(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Chrome=void 0;var r=l(n(0)),i=l(n(20)),o=l(n(118)),a=l(n(346)),A=n(222),s=l(n(1299)),c=l(n(1301)),u=l(n(1302));function l(t){return t&&t.__esModule?t:{default:t}}var g=e.Chrome=function(t){var e=t.width,n=t.onChange,i=t.disableAlpha,l=t.rgb,g=t.hsl,f=t.hsv,h=t.hex,d=t.renderers,I=t.styles,p=void 0===I?{}:I,C=t.className,y=void 0===C?"":C,v=t.defaultView,B=(0,o.default)((0,a.default)({default:{picker:{width:e,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+l.r+", "+l.g+", "+l.b+", "+l.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},p),{disableAlpha:i});return r.default.createElement("div",{style:B.picker,className:"chrome-picker "+y},r.default.createElement("div",{style:B.saturation},r.default.createElement(A.Saturation,{style:B.Saturation,hsl:g,hsv:f,pointer:u.default,onChange:n})),r.default.createElement("div",{style:B.body},r.default.createElement("div",{style:B.controls,className:"flexbox-fix"},r.default.createElement("div",{style:B.color},r.default.createElement("div",{style:B.swatch},r.default.createElement("div",{style:B.active}),r.default.createElement(A.Checkboard,{renderers:d}))),r.default.createElement("div",{style:B.toggles},r.default.createElement("div",{style:B.hue},r.default.createElement(A.Hue,{style:B.Hue,hsl:g,pointer:c.default,onChange:n})),r.default.createElement("div",{style:B.alpha},r.default.createElement(A.Alpha,{style:B.Alpha,rgb:l,hsl:g,pointer:c.default,renderers:d,onChange:n})))),r.default.createElement(s.default,{rgb:l,hsl:g,hex:h,view:v,onChange:n,disableAlpha:i})))};g.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),disableAlpha:i.default.bool,styles:i.default.object,defaultView:i.default.oneOf(["hex","rgb","hsl"])},g.defaultProps={width:225,disableAlpha:!1,styles:{}},e.default=(0,A.ColorWrap)(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChromeFields=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=c(n(0)),o=c(n(118)),a=c(n(391)),A=n(222),s=c(n(1300));function c(t){return t&&t.__esModule?t:{default:t}}var u=e.ChromeFields=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.toggleViews=function(){"hex"===n.state.view?n.setState({view:"rgb"}):"rgb"===n.state.view?n.setState({view:"hsl"}):"hsl"===n.state.view&&(1===n.props.hsl.a?n.setState({view:"hex"}):n.setState({view:"rgb"}))},n.handleChange=function(t,e){t.hex?a.default.isValidHex(t.hex)&&n.props.onChange({hex:t.hex,source:"hex"},e):t.r||t.g||t.b?n.props.onChange({r:t.r||n.props.rgb.r,g:t.g||n.props.rgb.g,b:t.b||n.props.rgb.b,source:"rgb"},e):t.a?(t.a<0?t.a=0:t.a>1&&(t.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*t.a)/100,source:"rgb"},e)):(t.h||t.s||t.l)&&("string"===typeof t.s&&t.s.includes("%")&&(t.s=t.s.replace("%","")),"string"===typeof t.l&&t.l.includes("%")&&(t.l=t.l.replace("%","")),n.props.onChange({h:t.h||n.props.hsl.h,s:Number(t.s&&t.s||n.props.hsl.s),l:Number(t.l&&t.l||n.props.hsl.l),source:"hsl"},e))},n.showHighlight=function(t){t.currentTarget.style.background="#eee"},n.hideHighlight=function(t){t.currentTarget.style.background="transparent"},1!==t.hsl.a&&"hex"===t.view?n.state={view:"rgb"}:n.state={view:t.view},n}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"render",value:function(){var t=this,e=(0,o.default)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return"hex"===this.state.view?n=i.default.createElement("div",{style:e.fields,className:"flexbox-fix"},i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?n=i.default.createElement("div",{style:e.fields,className:"flexbox-fix"},i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),i.default.createElement("div",{style:e.alpha},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(n=i.default.createElement("div",{style:e.fields,className:"flexbox-fix"},i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),i.default.createElement("div",{style:e.field},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),i.default.createElement("div",{style:e.alpha},i.default.createElement(A.EditableInput,{style:{input:e.input,label:e.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),i.default.createElement("div",{style:e.wrap,className:"flexbox-fix"},n,i.default.createElement("div",{style:e.toggle},i.default.createElement("div",{style:e.icon,onClick:this.toggleViews,ref:function(e){return t.icon=e}},i.default.createElement(s.default,{style:e.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(t,e){return 1!==t.hsl.a&&"hex"===e.view?{view:"rgb"}:null}}]),e}(i.default.Component);u.defaultProps={view:"hex"},e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(0),a=(r=o)&&r.__esModule?r:{default:r};e.default=function(t){var e=t.fill,n=void 0===e?"currentColor":e,r=t.width,o=void 0===r?24:r,A=t.height,s=void 0===A?24:A,c=t.style,u=void 0===c?{}:c,l=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(t,["fill","width","height","style"]);return a.default.createElement("svg",i({viewBox:"0 0 24 24",style:i({fill:n,width:o,height:s},u)},l),a.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChromePointer=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.ChromePointer=function(){var t=(0,i.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return r.default.createElement("div",{style:t.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChromePointerCircle=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.ChromePointerCircle=function(){var t=(0,i.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return r.default.createElement("div",{style:t.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Compact=void 0;var r=g(n(0)),i=g(n(20)),o=g(n(118)),a=g(n(516)),A=g(n(346)),s=g(n(391)),c=n(222),u=g(n(1304)),l=g(n(1305));function g(t){return t&&t.__esModule?t:{default:t}}var f=e.Compact=function(t){var e=t.onChange,n=t.onSwatchHover,i=t.colors,g=t.hex,f=t.rgb,h=t.styles,d=void 0===h?{}:h,I=t.className,p=void 0===I?"":I,C=(0,o.default)((0,A.default)({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},d)),y=function(t,n){t.hex?s.default.isValidHex(t.hex)&&e({hex:t.hex,source:"hex"},n):e(t,n)};return r.default.createElement(c.Raised,{style:C.Compact,styles:d},r.default.createElement("div",{style:C.compact,className:"compact-picker "+p},r.default.createElement("div",null,(0,a.default)(i,(function(t){return r.default.createElement(u.default,{key:t,color:t,active:t.toLowerCase()===g,onClick:y,onSwatchHover:n})})),r.default.createElement("div",{style:C.clear})),r.default.createElement(l.default,{hex:g,rgb:f,onChange:y})))};f.propTypes={colors:i.default.arrayOf(i.default.string),styles:i.default.object},f.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},e.default=(0,c.ColorWrap)(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CompactColor=void 0;var r=A(n(0)),i=A(n(118)),o=A(n(391)),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.CompactColor=function(t){var e=t.color,n=t.onClick,A=void 0===n?function(){}:n,s=t.onSwatchHover,c=t.active,u=(0,i.default)({default:{color:{background:e,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:o.default.getContrastingColor(e),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:c,"color-#FFFFFF":"#FFFFFF"===e,transparent:"transparent"===e});return r.default.createElement(a.Swatch,{style:u.color,color:e,onClick:A,onHover:s,focusStyle:{boxShadow:"0 0 4px "+e}},r.default.createElement("div",{style:u.dot}))};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CompactFields=void 0;var r=a(n(0)),i=a(n(118)),o=n(222);function a(t){return t&&t.__esModule?t:{default:t}}var A=e.CompactFields=function(t){var e=t.hex,n=t.rgb,a=t.onChange,A=(0,i.default)({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:e},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(t,e){t.r||t.g||t.b?a({r:t.r||n.r,g:t.g||n.g,b:t.b||n.b,source:"rgb"},e):a({hex:t.hex,source:"hex"},e)};return r.default.createElement("div",{style:A.fields,className:"flexbox-fix"},r.default.createElement("div",{style:A.active}),r.default.createElement(o.EditableInput,{style:{wrap:A.HEXwrap,input:A.HEXinput,label:A.HEXlabel},label:"hex",value:e,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"r",value:n.r,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"g",value:n.g,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"b",value:n.b,onChange:s}))};e.default=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Github=void 0;var r=u(n(0)),i=u(n(20)),o=u(n(118)),a=u(n(516)),A=u(n(346)),s=n(222),c=u(n(1307));function u(t){return t&&t.__esModule?t:{default:t}}var l=e.Github=function(t){var e=t.width,n=t.colors,i=t.onChange,s=t.onSwatchHover,u=t.triangle,l=t.styles,g=void 0===l?{}:l,f=t.className,h=void 0===f?"":f,d=(0,o.default)((0,A.default)({default:{card:{width:e,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},g),{"hide-triangle":"hide"===u,"top-left-triangle":"top-left"===u,"top-right-triangle":"top-right"===u,"bottom-left-triangle":"bottom-left"===u,"bottom-right-triangle":"bottom-right"===u}),I=function(t,e){return i({hex:t,source:"hex"},e)};return r.default.createElement("div",{style:d.card,className:"github-picker "+h},r.default.createElement("div",{style:d.triangleShadow}),r.default.createElement("div",{style:d.triangle}),(0,a.default)(n,(function(t){return r.default.createElement(c.default,{color:t,key:t,onClick:I,onSwatchHover:s})})))};l.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),colors:i.default.arrayOf(i.default.string),triangle:i.default.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:i.default.object},l.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},e.default=(0,s.ColorWrap)(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GithubSwatch=void 0;var r=A(n(0)),i=n(118),o=A(i),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.GithubSwatch=function(t){var e=t.hover,n=t.color,i=t.onClick,A=t.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},c=(0,o.default)({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:e});return r.default.createElement("div",{style:c.swatch},r.default.createElement(a.Swatch,{color:n,onClick:i,onHover:A,focusStyle:s}))};e.default=(0,i.handleHover)(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HuePicker=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=u(n(0)),o=u(n(20)),a=u(n(118)),A=u(n(346)),s=n(222),c=u(n(1309));function u(t){return t&&t.__esModule?t:{default:t}}var l=e.HuePicker=function(t){var e=t.width,n=t.height,o=t.onChange,c=t.hsl,u=t.direction,l=t.pointer,g=t.styles,f=void 0===g?{}:g,h=t.className,d=void 0===h?"":h,I=(0,a.default)((0,A.default)({default:{picker:{position:"relative",width:e,height:n},hue:{radius:"2px"}}},f));return i.default.createElement("div",{style:I.picker,className:"hue-picker "+d},i.default.createElement(s.Hue,r({},I.hue,{hsl:c,pointer:l,onChange:function(t){return o({a:1,h:t.h,l:.5,s:1})},direction:u})))};l.propTypes={styles:o.default.object},l.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:c.default,styles:{}},e.default=(0,s.ColorWrap)(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SliderPointer=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.SliderPointer=function(t){var e=t.direction,n=(0,i.default)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===e});return r.default.createElement("div",{style:n.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Material=void 0;var r=s(n(0)),i=s(n(118)),o=s(n(346)),a=s(n(391)),A=n(222);function s(t){return t&&t.__esModule?t:{default:t}}var c=e.Material=function(t){var e=t.onChange,n=t.hex,s=t.rgb,c=t.styles,u=void 0===c?{}:c,l=t.className,g=void 0===l?"":l,f=(0,i.default)((0,o.default)({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+n,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},u)),h=function(t,n){t.hex?a.default.isValidHex(t.hex)&&e({hex:t.hex,source:"hex"},n):(t.r||t.g||t.b)&&e({r:t.r||s.r,g:t.g||s.g,b:t.b||s.b,source:"rgb"},n)};return r.default.createElement(A.Raised,{styles:u},r.default.createElement("div",{style:f.material,className:"material-picker "+g},r.default.createElement(A.EditableInput,{style:{wrap:f.HEXwrap,input:f.HEXinput,label:f.HEXlabel},label:"hex",value:n,onChange:h}),r.default.createElement("div",{style:f.split,className:"flexbox-fix"},r.default.createElement("div",{style:f.third},r.default.createElement(A.EditableInput,{style:{wrap:f.RGBwrap,input:f.RGBinput,label:f.RGBlabel},label:"r",value:s.r,onChange:h})),r.default.createElement("div",{style:f.third},r.default.createElement(A.EditableInput,{style:{wrap:f.RGBwrap,input:f.RGBinput,label:f.RGBlabel},label:"g",value:s.g,onChange:h})),r.default.createElement("div",{style:f.third},r.default.createElement(A.EditableInput,{style:{wrap:f.RGBwrap,input:f.RGBinput,label:f.RGBlabel},label:"b",value:s.b,onChange:h})))))};e.default=(0,A.ColorWrap)(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Photoshop=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=h(n(0)),o=h(n(20)),a=h(n(118)),A=h(n(346)),s=n(222),c=h(n(1312)),u=h(n(1313)),l=h(n(1314)),g=h(n(1315)),f=h(n(1316));function h(t){return t&&t.__esModule?t:{default:t}}var d=e.Photoshop=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.state={currentColor:t.hex},n}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"render",value:function(){var t=this.props,e=t.styles,n=void 0===e?{}:e,r=t.className,o=void 0===r?"":r,h=(0,a.default)((0,A.default)({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},n));return i.default.createElement("div",{style:h.picker,className:"photoshop-picker "+o},i.default.createElement("div",{style:h.head},this.props.header),i.default.createElement("div",{style:h.body,className:"flexbox-fix"},i.default.createElement("div",{style:h.saturation},i.default.createElement(s.Saturation,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:u.default,onChange:this.props.onChange})),i.default.createElement("div",{style:h.hue},i.default.createElement(s.Hue,{direction:"vertical",hsl:this.props.hsl,pointer:l.default,onChange:this.props.onChange})),i.default.createElement("div",{style:h.controls},i.default.createElement("div",{style:h.top,className:"flexbox-fix"},i.default.createElement("div",{style:h.previews},i.default.createElement(f.default,{rgb:this.props.rgb,currentColor:this.state.currentColor})),i.default.createElement("div",{style:h.actions},i.default.createElement(g.default,{label:"OK",onClick:this.props.onAccept,active:!0}),i.default.createElement(g.default,{label:"Cancel",onClick:this.props.onCancel}),i.default.createElement(c.default,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),e}(i.default.Component);d.propTypes={header:o.default.string,styles:o.default.object},d.defaultProps={header:"Color Picker",styles:{}},e.default=(0,s.ColorWrap)(d)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoshopPicker=void 0;var r=A(n(0)),i=A(n(118)),o=A(n(391)),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.PhotoshopPicker=function(t){var e=t.onChange,n=t.rgb,A=t.hsv,s=t.hex,c=(0,i.default)({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),u=function(t,r){t["#"]?o.default.isValidHex(t["#"])&&e({hex:t["#"],source:"hex"},r):t.r||t.g||t.b?e({r:t.r||n.r,g:t.g||n.g,b:t.b||n.b,source:"rgb"},r):(t.h||t.s||t.v)&&e({h:t.h||A.h,s:t.s||A.s,v:t.v||A.v,source:"hsv"},r)};return r.default.createElement("div",{style:c.fields},r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"h",value:Math.round(A.h),onChange:u}),r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"s",value:Math.round(100*A.s),onChange:u}),r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"v",value:Math.round(100*A.v),onChange:u}),r.default.createElement("div",{style:c.divider}),r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"r",value:n.r,onChange:u}),r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"g",value:n.g,onChange:u}),r.default.createElement(a.EditableInput,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"b",value:n.b,onChange:u}),r.default.createElement("div",{style:c.divider}),r.default.createElement(a.EditableInput,{style:{wrap:c.HEXwrap,input:c.HEXinput,label:c.HEXlabel},label:"#",value:s.replace("#",""),onChange:u}),r.default.createElement("div",{style:c.fieldSymbols},r.default.createElement("div",{style:c.symbol},"\xb0"),r.default.createElement("div",{style:c.symbol},"%"),r.default.createElement("div",{style:c.symbol},"%")))};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoshopPointerCircle=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.PhotoshopPointerCircle=function(t){var e=t.hsl,n=(0,i.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":e.l>.5});return r.default.createElement("div",{style:n.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoshopPointerCircle=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.PhotoshopPointerCircle=function(){var t=(0,i.default)({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return r.default.createElement("div",{style:t.pointer},r.default.createElement("div",{style:t.left},r.default.createElement("div",{style:t.leftInside})),r.default.createElement("div",{style:t.right},r.default.createElement("div",{style:t.rightInside})))};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoshopButton=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.PhotoshopButton=function(t){var e=t.onClick,n=t.label,o=t.children,a=t.active,A=(0,i.default)({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:a});return r.default.createElement("div",{style:A.button,onClick:e},n||o)};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoshopPreviews=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.PhotoshopPreviews=function(t){var e=t.rgb,n=t.currentColor,o=(0,i.default)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+e.r+","+e.g+", "+e.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return r.default.createElement("div",null,r.default.createElement("div",{style:o.label},"new"),r.default.createElement("div",{style:o.swatches},r.default.createElement("div",{style:o.new}),r.default.createElement("div",{style:o.current})),r.default.createElement("div",{style:o.label},"current"))};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Sketch=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=l(n(0)),o=l(n(20)),a=l(n(118)),A=l(n(346)),s=n(222),c=l(n(1318)),u=l(n(1319));function l(t){return t&&t.__esModule?t:{default:t}}var g=e.Sketch=function(t){var e=t.width,n=t.rgb,o=t.hex,l=t.hsv,g=t.hsl,f=t.onChange,h=t.onSwatchHover,d=t.disableAlpha,I=t.presetColors,p=t.renderers,C=t.styles,y=void 0===C?{}:C,v=t.className,B=void 0===v?"":v,m=(0,a.default)((0,A.default)({default:r({picker:{width:e,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+n.r+","+n.g+","+n.b+","+n.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},y),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},y),{disableAlpha:d});return i.default.createElement("div",{style:m.picker,className:"sketch-picker "+B},i.default.createElement("div",{style:m.saturation},i.default.createElement(s.Saturation,{style:m.Saturation,hsl:g,hsv:l,onChange:f})),i.default.createElement("div",{style:m.controls,className:"flexbox-fix"},i.default.createElement("div",{style:m.sliders},i.default.createElement("div",{style:m.hue},i.default.createElement(s.Hue,{style:m.Hue,hsl:g,onChange:f})),i.default.createElement("div",{style:m.alpha},i.default.createElement(s.Alpha,{style:m.Alpha,rgb:n,hsl:g,renderers:p,onChange:f}))),i.default.createElement("div",{style:m.color},i.default.createElement(s.Checkboard,null),i.default.createElement("div",{style:m.activeColor}))),i.default.createElement(c.default,{rgb:n,hsl:g,hex:o,onChange:f,disableAlpha:d}),i.default.createElement(u.default,{colors:I,onClick:f,onSwatchHover:h}))};g.propTypes={disableAlpha:o.default.bool,width:o.default.oneOfType([o.default.string,o.default.number]),styles:o.default.object},g.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]},e.default=(0,s.ColorWrap)(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SketchFields=void 0;var r=A(n(0)),i=A(n(118)),o=A(n(391)),a=n(222);function A(t){return t&&t.__esModule?t:{default:t}}var s=e.SketchFields=function(t){var e=t.onChange,n=t.rgb,A=t.hsl,s=t.hex,c=t.disableAlpha,u=(0,i.default)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:c}),l=function(t,r){t.hex?o.default.isValidHex(t.hex)&&e({hex:t.hex,source:"hex"},r):t.r||t.g||t.b?e({r:t.r||n.r,g:t.g||n.g,b:t.b||n.b,a:n.a,source:"rgb"},r):t.a&&(t.a<0?t.a=0:t.a>100&&(t.a=100),t.a/=100,e({h:A.h,s:A.s,l:A.l,a:t.a,source:"rgb"},r))};return r.default.createElement("div",{style:u.fields,className:"flexbox-fix"},r.default.createElement("div",{style:u.double},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"hex",value:s.replace("#",""),onChange:l})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"r",value:n.r,onChange:l,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"g",value:n.g,onChange:l,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"b",value:n.b,onChange:l,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.alpha},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"a",value:Math.round(100*n.a),onChange:l,dragLabel:"true",dragMax:"100"})))};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SketchPresetColors=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=s(n(0)),o=s(n(20)),a=s(n(118)),A=n(222);function s(t){return t&&t.__esModule?t:{default:t}}var c=e.SketchPresetColors=function(t){var e=t.colors,n=t.onClick,o=void 0===n?function(){}:n,s=t.onSwatchHover,c=(0,a.default)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!e||!e.length}),u=function(t,e){o({hex:t,source:"hex"},e)};return i.default.createElement("div",{style:c.colors,className:"flexbox-fix"},e.map((function(t){var e="string"===typeof t?{color:t}:t,n=""+e.color+(e.title||"");return i.default.createElement("div",{key:n,style:c.swatchWrap},i.default.createElement(A.Swatch,r({},e,{style:c.swatch,onClick:u,onHover:s,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+e.color}})))})))};c.propTypes={colors:o.default.arrayOf(o.default.oneOfType([o.default.string,o.default.shape({color:o.default.string,title:o.default.string})])).isRequired},e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Slider=void 0;var r=u(n(0)),i=u(n(20)),o=u(n(118)),a=u(n(346)),A=n(222),s=u(n(1321)),c=u(n(1323));function u(t){return t&&t.__esModule?t:{default:t}}var l=e.Slider=function(t){var e=t.hsl,n=t.onChange,i=t.pointer,c=t.styles,u=void 0===c?{}:c,l=t.className,g=void 0===l?"":l,f=(0,o.default)((0,a.default)({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},u));return r.default.createElement("div",{style:f.wrap||{},className:"slider-picker "+g},r.default.createElement("div",{style:f.hue},r.default.createElement(A.Hue,{style:f.Hue,hsl:e,pointer:i,onChange:n})),r.default.createElement("div",{style:f.swatches},r.default.createElement(s.default,{hsl:e,onClick:n})))};l.propTypes={styles:i.default.object},l.defaultProps={pointer:c.default,styles:{}},e.default=(0,A.ColorWrap)(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SliderSwatches=void 0;var r=a(n(0)),i=a(n(118)),o=a(n(1322));function a(t){return t&&t.__esModule?t:{default:t}}var A=e.SliderSwatches=function(t){var e=t.onClick,n=t.hsl,a=(0,i.default)({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}});return r.default.createElement("div",{style:a.swatches},r.default.createElement("div",{style:a.swatch},r.default.createElement(o.default,{hsl:n,offset:".80",active:Math.abs(n.l-.8)<.1&&Math.abs(n.s-.5)<.1,onClick:e,first:!0})),r.default.createElement("div",{style:a.swatch},r.default.createElement(o.default,{hsl:n,offset:".65",active:Math.abs(n.l-.65)<.1&&Math.abs(n.s-.5)<.1,onClick:e})),r.default.createElement("div",{style:a.swatch},r.default.createElement(o.default,{hsl:n,offset:".50",active:Math.abs(n.l-.5)<.1&&Math.abs(n.s-.5)<.1,onClick:e})),r.default.createElement("div",{style:a.swatch},r.default.createElement(o.default,{hsl:n,offset:".35",active:Math.abs(n.l-.35)<.1&&Math.abs(n.s-.5)<.1,onClick:e})),r.default.createElement("div",{style:a.swatch},r.default.createElement(o.default,{hsl:n,offset:".20",active:Math.abs(n.l-.2)<.1&&Math.abs(n.s-.5)<.1,onClick:e,last:!0})),r.default.createElement("div",{style:a.clear}))};e.default=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SliderSwatch=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.SliderSwatch=function(t){var e=t.hsl,n=t.offset,o=t.onClick,a=void 0===o?function(){}:o,A=t.active,s=t.first,c=t.last,u=(0,i.default)({default:{swatch:{height:"12px",background:"hsl("+e.h+", 50%, "+100*n+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:A,first:s,last:c});return r.default.createElement("div",{style:u.swatch,onClick:function(t){return a({h:e.h,s:.5,l:n,source:"hsl"},t)}})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SliderPointer=void 0;var r=o(n(0)),i=o(n(118));function o(t){return t&&t.__esModule?t:{default:t}}var a=e.SliderPointer=function(){var t=(0,i.default)({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return r.default.createElement("div",{style:t.picker})};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Swatches=void 0;var r=g(n(0)),i=g(n(20)),o=g(n(118)),a=g(n(516)),A=g(n(346)),s=g(n(391)),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1080)),u=n(222),l=g(n(1325));function g(t){return t&&t.__esModule?t:{default:t}}var f=e.Swatches=function(t){var e=t.width,n=t.height,i=t.onChange,c=t.onSwatchHover,g=t.colors,f=t.hex,h=t.styles,d=void 0===h?{}:h,I=t.className,p=void 0===I?"":I,C=(0,o.default)((0,A.default)({default:{picker:{width:e,height:n},overflow:{height:n,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},d)),y=function(t,e){s.default.isValidHex(t)&&i({hex:t,source:"hex"},e)};return r.default.createElement("div",{style:C.picker,className:"swatches-picker "+p},r.default.createElement(u.Raised,null,r.default.createElement("div",{style:C.overflow},r.default.createElement("div",{style:C.body},(0,a.default)(g,(function(t){return r.default.createElement(l.default,{key:t.toString(),group:t,active:f,onClick:y,onSwatchHover:c})})),r.default.createElement("div",{style:C.clear})))))};f.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),colors:i.default.arrayOf(i.default.arrayOf(i.default.string)),styles:i.default.object},f.defaultProps={width:320,height:240,colors:[[c.red[900],c.red[700],c.red[500],c.red[300],c.red[100]],[c.pink[900],c.pink[700],c.pink[500],c.pink[300],c.pink[100]],[c.purple[900],c.purple[700],c.purple[500],c.purple[300],c.purple[100]],[c.deepPurple[900],c.deepPurple[700],c.deepPurple[500],c.deepPurple[300],c.deepPurple[100]],[c.indigo[900],c.indigo[700],c.indigo[500],c.indigo[300],c.indigo[100]],[c.blue[900],c.blue[700],c.blue[500],c.blue[300],c.blue[100]],[c.lightBlue[900],c.lightBlue[700],c.lightBlue[500],c.lightBlue[300],c.lightBlue[100]],[c.cyan[900],c.cyan[700],c.cyan[500],c.cyan[300],c.cyan[100]],[c.teal[900],c.teal[700],c.teal[500],c.teal[300],c.teal[100]],["#194D33",c.green[700],c.green[500],c.green[300],c.green[100]],[c.lightGreen[900],c.lightGreen[700],c.lightGreen[500],c.lightGreen[300],c.lightGreen[100]],[c.lime[900],c.lime[700],c.lime[500],c.lime[300],c.lime[100]],[c.yellow[900],c.yellow[700],c.yellow[500],c.yellow[300],c.yellow[100]],[c.amber[900],c.amber[700],c.amber[500],c.amber[300],c.amber[100]],[c.orange[900],c.orange[700],c.orange[500],c.orange[300],c.orange[100]],[c.deepOrange[900],c.deepOrange[700],c.deepOrange[500],c.deepOrange[300],c.deepOrange[100]],[c.brown[900],c.brown[700],c.brown[500],c.brown[300],c.brown[100]],[c.blueGrey[900],c.blueGrey[700],c.blueGrey[500],c.blueGrey[300],c.blueGrey[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}},e.default=(0,u.ColorWrap)(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SwatchesGroup=void 0;var r=A(n(0)),i=A(n(118)),o=A(n(516)),a=A(n(1326));function A(t){return t&&t.__esModule?t:{default:t}}var s=e.SwatchesGroup=function(t){var e=t.onClick,n=t.onSwatchHover,A=t.group,s=t.active,c=(0,i.default)({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return r.default.createElement("div",{style:c.group},(0,o.default)(A,(function(t,i){return r.default.createElement(a.default,{key:t,color:t,active:t.toLowerCase()===s,first:0===i,last:i===A.length-1,onClick:e,onSwatchHover:n})})))};e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SwatchesColor=void 0;var r=s(n(0)),i=s(n(118)),o=s(n(391)),a=n(222),A=s(n(1327));function s(t){return t&&t.__esModule?t:{default:t}}var c=e.SwatchesColor=function(t){var e=t.color,n=t.onClick,s=void 0===n?function(){}:n,c=t.onSwatchHover,u=t.first,l=t.last,g=t.active,f=(0,i.default)({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:e,marginBottom:"1px"},check:{color:o.default.getContrastingColor(e),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:u,last:l,active:g,"color-#FFFFFF":"#FFFFFF"===e,transparent:"transparent"===e});return r.default.createElement(a.Swatch,{color:e,style:f.color,onClick:s,onHover:c,focusStyle:{boxShadow:"0 0 4px "+e}},r.default.createElement("div",{style:f.check},r.default.createElement(A.default,null)))};e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(0),a=(r=o)&&r.__esModule?r:{default:r};e.default=function(t){var e=t.fill,n=void 0===e?"currentColor":e,r=t.width,o=void 0===r?24:r,A=t.height,s=void 0===A?24:A,c=t.style,u=void 0===c?{}:c,l=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(t,["fill","width","height","style"]);return a.default.createElement("svg",i({viewBox:"0 0 24 24",style:i({fill:n,width:o,height:s},u)},l),a.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Twitter=void 0;var r=u(n(0)),i=u(n(20)),o=u(n(118)),a=u(n(516)),A=u(n(346)),s=u(n(391)),c=n(222);function u(t){return t&&t.__esModule?t:{default:t}}var l=e.Twitter=function(t){var e=t.onChange,n=t.onSwatchHover,i=t.hex,u=t.colors,l=t.width,g=t.triangle,f=t.styles,h=void 0===f?{}:f,d=t.className,I=void 0===d?"":d,p=(0,o.default)((0,A.default)({default:{card:{width:l,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},h),{"hide-triangle":"hide"===g,"top-left-triangle":"top-left"===g,"top-right-triangle":"top-right"===g}),C=function(t,n){s.default.isValidHex(t)&&e({hex:t,source:"hex"},n)};return r.default.createElement("div",{style:p.card,className:"twitter-picker "+I},r.default.createElement("div",{style:p.triangleShadow}),r.default.createElement("div",{style:p.triangle}),r.default.createElement("div",{style:p.body},(0,a.default)(u,(function(t,e){return r.default.createElement(c.Swatch,{key:e,color:t,hex:t,style:p.swatch,onClick:C,onHover:n,focusStyle:{boxShadow:"0 0 4px "+t}})})),r.default.createElement("div",{style:p.hash},"#"),r.default.createElement(c.EditableInput,{label:null,style:{input:p.input},value:i.replace("#",""),onChange:C}),r.default.createElement("div",{style:p.clear})))};l.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),triangle:i.default.oneOf(["hide","top-left","top-right"]),colors:i.default.arrayOf(i.default.string),styles:i.default.object},l.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},e.default=(0,c.ColorWrap)(l)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(1330)),o=r(n(1331)),a=["altKey","bubbles","cancelable","ctrlKey","currentTarget","eventPhase","metaKey","shiftKey","target","timeStamp","view","type"];function A(t){return null===t||void 0===t}var s=[{reg:/^key/,props:["char","charCode","key","keyCode","which"],fix:function(t,e){A(t.which)&&(t.which=A(e.charCode)?e.keyCode:e.charCode),void 0===t.metaKey&&(t.metaKey=t.ctrlKey)}},{reg:/^touch/,props:["touches","changedTouches","targetTouches"]},{reg:/^hashchange$/,props:["newURL","oldURL"]},{reg:/^gesturechange$/i,props:["rotation","scale"]},{reg:/^(mousewheel|DOMMouseScroll)$/,props:[],fix:function(t,e){var n=void 0,r=void 0,i=void 0,o=e.wheelDelta,a=e.axis,A=e.wheelDeltaY,s=e.wheelDeltaX,c=e.detail;o&&(i=o/120),c&&(i=0-(c%3===0?c/3:c)),void 0!==a&&(a===t.HORIZONTAL_AXIS?(r=0,n=0-i):a===t.VERTICAL_AXIS&&(n=0,r=i)),void 0!==A&&(r=A/120),void 0!==s&&(n=-1*s/120),n||r||(r=i),void 0!==n&&(t.deltaX=n),void 0!==r&&(t.deltaY=r),void 0!==i&&(t.delta=i)}},{reg:/^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,props:["buttons","clientX","clientY","button","offsetX","relatedTarget","which","fromElement","toElement","offsetY","pageX","pageY","screenX","screenY"],fix:function(t,e){var n=void 0,r=void 0,i=void 0,o=t.target,a=e.button;return o&&A(t.pageX)&&!A(e.clientX)&&(r=(n=o.ownerDocument||document).documentElement,i=n.body,t.pageX=e.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),t.which||void 0===a||(t.which=1&a?1:2&a?3:4&a?2:0),!t.relatedTarget&&t.fromElement&&(t.relatedTarget=t.fromElement===o?t.toElement:t.fromElement),t}}];function c(){return!0}function u(){return!1}function l(t){var e=t.type,n="function"===typeof t.stopPropagation||"boolean"===typeof t.cancelBubble;i.default.call(this),this.nativeEvent=t;var r=u;"defaultPrevented"in t?r=t.defaultPrevented?c:u:"getPreventDefault"in t?r=t.getPreventDefault()?c:u:"returnValue"in t&&(r=!1===t.returnValue?c:u),this.isDefaultPrevented=r;var o=[],A=void 0,l=void 0,g=a.concat();for(s.forEach((function(t){e.match(t.reg)&&(g=g.concat(t.props),t.fix&&o.push(t.fix))})),A=g.length;A;)this[l=g[--A]]=t[l];for(!this.target&&n&&(this.target=t.srcElement||document),this.target&&3===this.target.nodeType&&(this.target=this.target.parentNode),A=o.length;A;)(0,o[--A])(this,t);this.timeStamp=t.timeStamp||Date.now()}var g=i.default.prototype;(0,o.default)(l.prototype,g,{constructor:l,preventDefault:function(){var t=this.nativeEvent;t.preventDefault?t.preventDefault():t.returnValue=!1,g.preventDefault.call(this)},stopPropagation:function(){var t=this.nativeEvent;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,g.stopPropagation.call(this)}}),e.default=l,t.exports=e.default},function(t,e,n){"use strict";function r(){return!1}function i(){return!0}function o(){this.timeStamp=Date.now(),this.target=void 0,this.currentTarget=void 0}Object.defineProperty(e,"__esModule",{value:!0}),o.prototype={isEventObject:1,constructor:o,isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r,preventDefault:function(){this.isDefaultPrevented=i},stopPropagation:function(){this.isPropagationStopped=i},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i,this.stopPropagation()},halt:function(t){t?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}},e.default=o,t.exports=e.default},function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var n,A,s=a(t),c=1;c<arguments.length;c++){for(var u in n=Object(arguments[c]))i.call(n,u)&&(s[u]=n[u]);if(r){A=r(n);for(var l=0;l<A.length;l++)o.call(n,A[l])&&(s[A[l]]=n[A[l]])}}return s}},function(t,e,n){var r=n(692);t.exports=function(t,e){var n=r(t,e);return n?n.version:null}},function(t,e,n){var r=n(692);t.exports=function(t,e){var n=r(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}},function(t,e,n){var r=n(316);t.exports=function(t,e,n,i){"string"===typeof n&&(i=n,n=void 0);try{return new r(t,n).inc(e,i).version}catch(o){return null}}},function(t,e,n){var r=n(692),i=n(895);t.exports=function(t,e){if(i(t,e))return null;var n=r(t),o=r(e),a=n.prerelease.length||o.prerelease.length,A=a?"pre":"",s=a?"prerelease":"";for(var c in n)if(("major"===c||"minor"===c||"patch"===c)&&n[c]!==o[c])return A+c;return s}},function(t,e,n){var r=n(316);t.exports=function(t,e){return new r(t,e).major}},function(t,e,n){var r=n(316);t.exports=function(t,e){return new r(t,e).minor}},function(t,e,n){var r=n(316);t.exports=function(t,e){return new r(t,e).patch}},function(t,e,n){var r=n(692);t.exports=function(t,e){var n=r(t,e);return n&&n.prerelease.length?n.prerelease:null}},function(t,e,n){var r=n(392);t.exports=function(t,e,n){return r(e,t,n)}},function(t,e,n){var r=n(392);t.exports=function(t,e){return r(t,e,!0)}},function(t,e,n){var r=n(896);t.exports=function(t,e){return t.sort((function(t,n){return r(t,n,e)}))}},function(t,e,n){var r=n(896);t.exports=function(t,e){return t.sort((function(t,n){return r(n,t,e)}))}},function(t,e,n){var r=n(316),i=n(692),o=n(691),a=o.re,A=o.t;t.exports=function(t,e){if(t instanceof r)return t;if("number"===typeof t&&(t=String(t)),"string"!==typeof t)return null;var n=null;if((e=e||{}).rtl){for(var o;(o=a[A.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),a[A.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;a[A.COERCERTL].lastIndex=-1}else n=t.match(a[A.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}},function(t,e,n){var r=n(393);t.exports=function(t,e){return new r(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))}},function(t,e,n){var r=n(316),i=n(393);t.exports=function(t,e,n){var o=null,a=null,A=null;try{A=new i(e,n)}catch(s){return null}return t.forEach((function(t){A.test(t)&&(o&&-1!==a.compare(t)||(a=new r(o=t,n)))})),o}},function(t,e,n){var r=n(316),i=n(393);t.exports=function(t,e,n){var o=null,a=null,A=null;try{A=new i(e,n)}catch(s){return null}return t.forEach((function(t){A.test(t)&&(o&&1!==a.compare(t)||(a=new r(o=t,n)))})),o}},function(t,e,n){var r=n(316),i=n(393),o=n(777);t.exports=function(t,e){t=new i(t,e);var n=new r("0.0.0");if(t.test(n))return n;if(n=new r("0.0.0-0"),t.test(n))return n;n=null;for(var a=0;a<t.set.length;++a){t.set[a].forEach((function(t){var e=new r(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!o(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(t.operator))}}))}return n&&t.test(n)?n:null}},function(t,e,n){var r=n(393);t.exports=function(t,e){try{return new r(t,e).range||"*"}catch(n){return null}}},function(t,e,n){var r=n(900);t.exports=function(t,e,n){return r(t,e,">",n)}},function(t,e,n){var r=n(900);t.exports=function(t,e,n){return r(t,e,"<",n)}},function(t,e,n){var r=n(393);t.exports=function(t,e,n){return t=new r(t,n),e=new r(e,n),t.intersects(e)}},function(t,e,n){var r=n(1354),i=n(1083),o=n(779),a=n(392);t.exports=function(t,e,n){var A,s=[],c=null,u=null,l=t.sort((function(t,e){return a(t,e,n)})),g=i(l);try{for(g.s();!(A=g.n()).done;){var f=A.value;o(f,e,n)?(u=f,c||(c=f)):(u&&s.push([c,u]),u=null,c=null)}}catch(m){g.e(m)}finally{g.f()}c&&s.push([c,null]);for(var h=[],d=0,I=s;d<I.length;d++){var p=r(I[d],2),C=p[0],y=p[1];C===y?h.push(C):y||C!==l[0]?y?C===l[0]?h.push("<=".concat(y)):h.push("".concat(C," - ").concat(y)):h.push(">=".concat(C)):h.push("*")}var v=h.join(" || "),B="string"===typeof e.raw?e.raw:String(e);return v.length<B.length?v:e}},function(t,e,n){var r=n(1355),i=n(1356),o=n(502),a=n(1357);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){var r=n(1083),i=n(393),o=n(778).ANY,a=n(779),A=n(392),s=function(t,e,n){if(1===t.length&&t[0].semver===o)return 1===e.length&&e[0].semver===o;var i,s,l,g,f=new Set,h=r(t);try{for(h.s();!(l=h.n()).done;){var d=l.value;">"===d.operator||">="===d.operator?i=c(i,d,n):"<"===d.operator||"<="===d.operator?s=u(s,d,n):f.add(d.semver)}}catch(w){h.e(w)}finally{h.f()}if(f.size>1)return null;if(i&&s){if((g=A(i.semver,s.semver,n))>0)return null;if(0===g&&(">="!==i.operator||"<="!==s.operator))return null}var I,p,C,y=r(f);try{for(y.s();!(I=y.n()).done;){var v=I.value;if(i&&!a(v,String(i),n))return null;if(s&&!a(v,String(s),n))return null;var B,m=r(e);try{for(m.s();!(B=m.n()).done;){var b=B.value;if(!a(v,String(b),n))return!1}}catch(w){m.e(w)}finally{m.f()}return!0}}catch(w){y.e(w)}finally{y.f()}var E,Q=r(e);try{for(Q.s();!(E=Q.n()).done;){var F=E.value;if(C=C||">"===F.operator||">="===F.operator,p=p||"<"===F.operator||"<="===F.operator,i)if(">"===F.operator||">="===F.operator){if(c(i,F,n)===F)return!1}else if(">="===i.operator&&!a(i.semver,String(F),n))return!1;if(s)if("<"===F.operator||"<="===F.operator){if(u(s,F,n)===F)return!1}else if("<="===s.operator&&!a(s.semver,String(F),n))return!1;if(!F.operator&&(s||i)&&0!==g)return!1}}catch(w){Q.e(w)}finally{Q.f()}return!(i&&p&&!s&&0!==g)&&!(s&&C&&!i&&0!==g)},c=function(t,e,n){if(!t)return e;var r=A(t.semver,e.semver,n);return r>0?t:r<0||">"===e.operator&&">="===t.operator?e:t},u=function(t,e,n){if(!t)return e;var r=A(t.semver,e.semver,n);return r<0?t:r>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=function(t,e,n){t=new i(t,n),e=new i(e,n);var o,a=!1,A=r(t.set);try{t:for(A.s();!(o=A.n()).done;){var c,u=o.value,l=r(e.set);try{for(l.s();!(c=l.n()).done;){var g=c.value,f=s(u,g,n);if(a=a||null!==f,f)continue t}}catch(h){l.e(h)}finally{l.f()}if(a)return!1}}catch(h){A.e(h)}finally{A.f()}return!0}},function(t,e){Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function t(){var e=isNaN(arguments[0])?1:Number(arguments[0]);return e?Array.prototype.reduce.call(this,(function(n,r){return Array.isArray(r)?n.push.apply(n,t.call(r,e-1)):n.push(r),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(t){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})},function(t,e,n){"use strict";var r=n(23),i=n(9),o=(n(20),n(180));var a=function(t){var e=function(e){var n=t(e);return e.css?Object(i.a)({},Object(o.a)(n,t(Object(i.a)({theme:e.theme},e.css))),{},function(t,e){var n={};return Object.keys(t).forEach((function(r){-1===e.indexOf(r)&&(n[r]=t[r])})),n}(e.css,[t.filterProps])):n};return e.propTypes={},e.filterProps=["css"].concat(Object(r.a)(t.filterProps)),e};var A=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=function(t){return e.reduce((function(e,n){var r=n(t);return r?Object(o.a)(e,r):e}),{})};return r.propTypes={},r.filterProps=e.reduce((function(t,e){return t.concat(e.filterProps)}),[]),r},s=n(1),c=n(319);function u(t,e){return e&&"string"===typeof e?e.split(".").reduce((function(t,e){return t&&t[e]?t[e]:null}),t):null}var l=function(t){var e=t.prop,n=t.cssProperty,r=void 0===n?t.prop:n,i=t.themeKey,o=t.transform,a=function(t){if(null==t[e])return null;var n=t[e],a=u(t.theme,i)||{};return Object(c.a)(t,n,(function(t){var e;return"function"===typeof a?e=a(t):Array.isArray(a)?e=a[t]||t:(e=u(a,t)||t,o&&(e=o(e))),!1===r?e:Object(s.a)({},r,e)}))};return a.propTypes={},a.filterProps=[e],a};function g(t){return"number"!==typeof t?t:"".concat(t,"px solid")}var f=A(l({prop:"border",themeKey:"borders",transform:g}),l({prop:"borderTop",themeKey:"borders",transform:g}),l({prop:"borderRight",themeKey:"borders",transform:g}),l({prop:"borderBottom",themeKey:"borders",transform:g}),l({prop:"borderLeft",themeKey:"borders",transform:g}),l({prop:"borderColor",themeKey:"palette"}),l({prop:"borderRadius",themeKey:"shape"})),h=A(l({prop:"displayPrint",cssProperty:!1,transform:function(t){return{"@media print":{display:t}}}}),l({prop:"display"}),l({prop:"overflow"}),l({prop:"textOverflow"}),l({prop:"visibility"}),l({prop:"whiteSpace"})),d=A(l({prop:"flexBasis"}),l({prop:"flexDirection"}),l({prop:"flexWrap"}),l({prop:"justifyContent"}),l({prop:"alignItems"}),l({prop:"alignContent"}),l({prop:"order"}),l({prop:"flex"}),l({prop:"flexGrow"}),l({prop:"flexShrink"}),l({prop:"alignSelf"}),l({prop:"justifyItems"}),l({prop:"justifySelf"})),I=A(l({prop:"gridGap"}),l({prop:"gridColumnGap"}),l({prop:"gridRowGap"}),l({prop:"gridColumn"}),l({prop:"gridRow"}),l({prop:"gridAutoFlow"}),l({prop:"gridAutoColumns"}),l({prop:"gridAutoRows"}),l({prop:"gridTemplateColumns"}),l({prop:"gridTemplateRows"}),l({prop:"gridTemplateAreas"}),l({prop:"gridArea"})),p=A(l({prop:"position"}),l({prop:"zIndex",themeKey:"zIndex"}),l({prop:"top"}),l({prop:"right"}),l({prop:"bottom"}),l({prop:"left"})),C=A(l({prop:"color",themeKey:"palette"}),l({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"})),y=l({prop:"boxShadow",themeKey:"shadows"});function v(t){return t<=1?"".concat(100*t,"%"):t}var B=l({prop:"width",transform:v}),m=l({prop:"maxWidth",transform:v}),b=l({prop:"minWidth",transform:v}),E=l({prop:"height",transform:v}),Q=l({prop:"maxHeight",transform:v}),F=l({prop:"minHeight",transform:v}),w=(l({prop:"size",cssProperty:"width",transform:v}),l({prop:"size",cssProperty:"height",transform:v}),A(B,m,b,E,Q,F,l({prop:"boxSizing"}))),S=n(904),R=A(l({prop:"fontFamily",themeKey:"typography"}),l({prop:"fontSize",themeKey:"typography"}),l({prop:"fontStyle",themeKey:"typography"}),l({prop:"fontWeight",themeKey:"typography"}),l({prop:"letterSpacing"}),l({prop:"lineHeight"}),l({prop:"textAlign"})),U=n(28),x=n(0),k=n.n(x),O=n(32),N=n(318),D=n.n(N),G=n(542);function _(t,e){var n={};return Object.keys(t).forEach((function(r){-1===e.indexOf(r)&&(n[r]=t[r])})),n}var M=n(175),T=function(t){var e=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.name,o=Object(U.a)(n,["name"]);var a,A=r,s="function"===typeof e?function(t){return{root:function(n){return e(Object(i.a)({theme:t},n))}}}:{root:e},c=Object(G.a)(s,Object(i.a)({Component:t,name:r||t.displayName,classNamePrefix:A},o));e.filterProps&&(a=e.filterProps,delete e.filterProps),e.propTypes&&(e.propTypes,delete e.propTypes);var u=k.a.forwardRef((function(e,n){var r=e.children,o=e.className,A=e.clone,s=e.component,u=Object(U.a)(e,["children","className","clone","component"]),l=c(e),g=Object(O.a)(l.root,o),f=u;if(a&&(f=_(f,a)),A)return k.a.cloneElement(r,Object(i.a)({className:Object(O.a)(r.props.className,g)},f));if("function"===typeof r)return r(Object(i.a)({className:g},f));var h=s||t;return k.a.createElement(h,Object(i.a)({ref:n,className:g},f),r)}));return D()(u,t),u}}(t);return function(t,n){return e(t,Object(i.a)({defaultTheme:M.a},n))}},j=a(A(f,h,d,I,p,C,y,w,S.b,R)),L=T("div")(j,{name:"MuiBox"});e.a=L},function(t,e,n){"use strict";var r=n(157),i=n(182),o=(n(20),n(0)),a=n.n(o),A=n(65),s=n.n(A),c=!1,u=n(233),l=function(t){function e(e,n){var r;r=t.call(this,e,n)||this;var i,o=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?o?(i="exited",r.appearStatus="entering"):i="entered":i=e.unmountOnExit||e.mountOnEnter?"unmounted":"exited",r.state={status:i},r.nextCallback=null,r}Object(i.a)(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&"unmounted"===e.status?{status:"exited"}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(e="entering"):"entering"!==n&&"entered"!==n||(e="exiting")}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,n,r=this.props.timeout;return t=e=n=r,null!=r&&"number"!==typeof r&&(t=r.exit,e=r.enter,n=void 0!==r.appear?r.appear:e),{exit:t,enter:e,appear:n}},n.updateStatus=function(t,e){void 0===t&&(t=!1),null!==e?(this.cancelNextCallback(),"entering"===e?this.performEnter(t):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(t){var e=this,n=this.props.enter,r=this.context?this.context.isMounting:t,i=this.props.nodeRef?[r]:[s.a.findDOMNode(this),r],o=i[0],a=i[1],A=this.getTimeouts(),u=r?A.appear:A.enter;!t&&!n||c?this.safeSetState({status:"entered"},(function(){e.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:"entering"},(function(){e.props.onEntering(o,a),e.onTransitionEnd(u,(function(){e.safeSetState({status:"entered"},(function(){e.props.onEntered(o,a)}))}))})))},n.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:s.a.findDOMNode(this);e&&!c?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){t.props.onExiting(r),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:"exited"},(function(){t.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){t.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,e.nextCallback=null,t(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:s.a.findDOMNode(this),r=null==t&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if("unmounted"===t)return null;var e=this.props,n=e.children,i=(e.in,e.mountOnEnter,e.unmountOnExit,e.appear,e.enter,e.exit,e.timeout,e.addEndListener,e.onEnter,e.onEntering,e.onEntered,e.onExit,e.onExiting,e.onExited,e.nodeRef,Object(r.a)(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"===typeof n?n(t,i):a.a.cloneElement(a.a.Children.only(n),i))},e}(a.a.Component);function g(){}l.contextType=u.a,l.propTypes={},l.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g,onEntering:g,onEntered:g,onExit:g,onExiting:g,onExited:g},l.UNMOUNTED="unmounted",l.EXITED="exited",l.ENTERING="entering",l.ENTERED="entered",l.EXITING="exiting";e.a=l},function(t,e,n){t.exports=n(1380).default,t.exports.utils=n(926),t.exports.Responsive=n(1427).default,t.exports.Responsive.utils=n(1385),t.exports.WidthProvider=n(1428).default},function(t,e,n){"use strict";var r={},i={};function o(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function a(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function A(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function s(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+A(-e,6):e>9999?"+"+A(e,6):A(e,4))+"-"+A(t.getUTCMonth()+1,2)+"-"+A(t.getUTCDate(),2)+(o?"T"+A(n,2)+":"+A(r,2)+":"+A(i,2)+"."+A(o,3)+"Z":i?"T"+A(n,2)+":"+A(r,2)+":"+A(i,2)+"Z":r||n?"T"+A(n,2)+":"+A(r,2)+"Z":"")}e.a=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function A(t,e){var o,a=[],A=t.length,s=0,c=0,u=A<=0,l=!1;function g(){if(u)return i;if(l)return l=!1,r;var e,o,a=s;if(34===t.charCodeAt(a)){for(;s++<A&&34!==t.charCodeAt(s)||34===t.charCodeAt(++s););return(e=s)>=A?u=!0:10===(o=t.charCodeAt(s++))?l=!0:13===o&&(l=!0,10===t.charCodeAt(s)&&++s),t.slice(a+1,e-1).replace(/""/g,'"')}for(;s<A;){if(10===(o=t.charCodeAt(e=s++)))l=!0;else if(13===o)l=!0,10===t.charCodeAt(s)&&++s;else if(o!==n)continue;return t.slice(a,e)}return u=!0,t.slice(a,A)}for(10===t.charCodeAt(A-1)&&--A,13===t.charCodeAt(A-1)&&--A;(o=g())!==i;){for(var f=[];o!==r&&o!==i;)f.push(o),o=g();e&&null==(f=e(f,c++))||a.push(f)}return a}function c(e,n){return e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))}function u(e){return e.map(l).join(t)}function l(t){return null==t?"":t instanceof Date?s(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,i=A(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=o(t);return function(r,i){return e(n(r),i,t)}}(t,e):o(t)}));return i.columns=r||[],i},parseRows:A,format:function(e,n){return null==n&&(n=a(e)),[n.map(l).join(t)].concat(c(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=a(t)),c(t,e).join("\n")},formatRows:function(t){return t.map(u).join("\n")},formatRow:u,formatValue:l}}},function(t,e,n){var r,i=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function i(t,e){if(!r[t]){r[t]={};for(var n=0;n<t.length;n++)r[t][t.charAt(n)]=n}return r[t][e]}var o={compressToBase64:function(t){if(null==t)return"";var n=o._compress(t,6,(function(t){return e.charAt(t)}));switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(t){return null==t?"":""==t?null:o._decompress(t.length,32,(function(n){return i(e,t.charAt(n))}))},compressToUTF16:function(e){return null==e?"":o._compress(e,15,(function(e){return t(e+32)}))+" "},decompressFromUTF16:function(t){return null==t?"":""==t?null:o._decompress(t.length,16384,(function(e){return t.charCodeAt(e)-32}))},compressToUint8Array:function(t){for(var e=o.compress(t),n=new Uint8Array(2*e.length),r=0,i=e.length;r<i;r++){var a=e.charCodeAt(r);n[2*r]=a>>>8,n[2*r+1]=a%256}return n},decompressFromUint8Array:function(e){if(null===e||void 0===e)return o.decompress(e);for(var n=new Array(e.length/2),r=0,i=n.length;r<i;r++)n[r]=256*e[2*r]+e[2*r+1];var a=[];return n.forEach((function(e){a.push(t(e))})),o.decompress(a.join(""))},compressToEncodedURIComponent:function(t){return null==t?"":o._compress(t,6,(function(t){return n.charAt(t)}))},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),o._decompress(t.length,32,(function(e){return i(n,t.charAt(e))})))},compress:function(e){return o._compress(e,16,(function(e){return t(e)}))},_compress:function(t,e,n){if(null==t)return"";var r,i,o,a={},A={},s="",c="",u="",l=2,g=3,f=2,h=[],d=0,I=0;for(o=0;o<t.length;o+=1)if(s=t.charAt(o),Object.prototype.hasOwnProperty.call(a,s)||(a[s]=g++,A[s]=!0),c=u+s,Object.prototype.hasOwnProperty.call(a,c))u=c;else{if(Object.prototype.hasOwnProperty.call(A,u)){if(u.charCodeAt(0)<256){for(r=0;r<f;r++)d<<=1,I==e-1?(I=0,h.push(n(d)),d=0):I++;for(i=u.charCodeAt(0),r=0;r<8;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1}else{for(i=1,r=0;r<f;r++)d=d<<1|i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i=0;for(i=u.charCodeAt(0),r=0;r<16;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1}0==--l&&(l=Math.pow(2,f),f++),delete A[u]}else for(i=a[u],r=0;r<f;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1;0==--l&&(l=Math.pow(2,f),f++),a[c]=g++,u=String(s)}if(""!==u){if(Object.prototype.hasOwnProperty.call(A,u)){if(u.charCodeAt(0)<256){for(r=0;r<f;r++)d<<=1,I==e-1?(I=0,h.push(n(d)),d=0):I++;for(i=u.charCodeAt(0),r=0;r<8;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1}else{for(i=1,r=0;r<f;r++)d=d<<1|i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i=0;for(i=u.charCodeAt(0),r=0;r<16;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1}0==--l&&(l=Math.pow(2,f),f++),delete A[u]}else for(i=a[u],r=0;r<f;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1;0==--l&&(l=Math.pow(2,f),f++)}for(i=2,r=0;r<f;r++)d=d<<1|1&i,I==e-1?(I=0,h.push(n(d)),d=0):I++,i>>=1;for(;;){if(d<<=1,I==e-1){h.push(n(d));break}I++}return h.join("")},decompress:function(t){return null==t?"":""==t?null:o._decompress(t.length,32768,(function(e){return t.charCodeAt(e)}))},_decompress:function(e,n,r){var i,o,a,A,s,c,u,l=[],g=4,f=4,h=3,d="",I=[],p={val:r(0),position:n,index:1};for(i=0;i<3;i+=1)l[i]=i;for(a=0,s=Math.pow(2,2),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;switch(a){case 0:for(a=0,s=Math.pow(2,8),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;u=t(a);break;case 1:for(a=0,s=Math.pow(2,16),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;u=t(a);break;case 2:return""}for(l[3]=u,o=u,I.push(u);;){if(p.index>e)return"";for(a=0,s=Math.pow(2,h),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;switch(u=a){case 0:for(a=0,s=Math.pow(2,8),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;l[f++]=t(a),u=f-1,g--;break;case 1:for(a=0,s=Math.pow(2,16),c=1;c!=s;)A=p.val&p.position,p.position>>=1,0==p.position&&(p.position=n,p.val=r(p.index++)),a|=(A>0?1:0)*c,c<<=1;l[f++]=t(a),u=f-1,g--;break;case 2:return I.join("")}if(0==g&&(g=Math.pow(2,h),h++),l[u])d=l[u];else{if(u!==f)return null;d=o+o.charAt(0)}I.push(d),l[f++]=o+d.charAt(0),o=d,0==--g&&(g=Math.pow(2,h),h++)}}};return o}();void 0===(r=function(){return i}.call(e,n,e,t))||(t.exports=r)},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(111),i=n(3),o=n(8),a=n(6),A=n(7),s=n(235),c=n(197),u=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),l=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),g=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),f=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),h={POSITION:{size:3,value:new Float32Array(l)},NORMAL:{size:3,value:new Float32Array(g)},TEXCOORD_0:{size:2,value:new Float32Array(f)}},d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,A=void 0===n?Object(c.c)("cube-geometry"):n;return Object(o.a)(this,Object(a.a)(e).call(this,Object(r.a)({},t,{id:A,indices:{size:1,value:new Uint16Array(u)},attributes:Object(r.a)({},h,t.attributes)})))}return Object(A.a)(e,t),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(3),i=n(8),o=n(6),a=n(7),A=n(379),s=n(235),c=[-1,-1,1,-1,-1,1,1,1],u=function(t){function e(t,n){var a;Object(r.a)(this,e);var A=c.map((function(t){return-1===t?0:t}));return(a=Object(i.a)(this,Object(o.a)(e).call(this,t,Object.assign({},n,{vs:"attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n  gl_Position = vec4(aClipSpacePosition, 0., 1.);\n  position = aClipSpacePosition;\n  coordinate = aCoordinate;\n  uv = aTexCoord;\n}\n",geometry:new s.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(c)},aTexCoord:{size:2,value:new Float32Array(A)},aCoordinate:{size:2,value:new Float32Array(A)}}})})))).setVertexCount(4),a}return Object(a.a)(e,t),e}(A.a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=u(n(0)),i=u(n(1136)),o=u(n(166)),a=n(926),A=n(1381),s=u(n(1417)),c=u(n(1426));function u(t){return t&&t.__esModule?t:{default:t}}function l(t){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=B(t);if(e){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y(this,n)}}function y(t,e){return!e||"object"!==l(e)&&"function"!==typeof e?v(t):e}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B(t){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=!1;try{b=/firefox/i.test(navigator.userAgent)}catch(Q){}var E=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(l,t);var e,n,c,u=C(l);function l(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),m(v(n=u.call(this,t,e)),"state",{activeDrag:null,layout:(0,a.synchronizeLayoutWithChildren)(n.props.layout,n.props.children,n.props.cols,(0,a.compactType)(n.props)),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,droppingDOMNode:null,children:[]}),m(v(n),"dragEnterCounter",0),m(v(n),"onDragOver",(function(t){if(b&&-1===t.nativeEvent.target.className.indexOf("react-grid-layout"))return!1;var e=n.props,i=e.droppingItem,o=e.margin,a=e.cols,s=e.rowHeight,c=e.maxRows,u=e.width,l=e.containerPadding,g=n.state.layout,d=t.nativeEvent,I=d.layerX,p=d.layerY,C={left:I,top:p,e:t};if(n.state.droppingDOMNode){if(n.state.droppingPosition){var y=n.state.droppingPosition,v=y.left,B=y.top;(v!=I||B!=p)&&n.setState({droppingPosition:C})}}else{var m={cols:a,margin:o,maxRows:c,rowHeight:s,containerWidth:u,containerPadding:l||o},E=(0,A.calcXY)(m,p,I,i.w,i.h);n.setState({droppingDOMNode:r.default.createElement("div",{key:i.i}),droppingPosition:C,layout:[].concat(h(g),[f(f({},i),{},{x:E.x,y:E.y,static:!1,isDraggable:!0})])})}t.stopPropagation(),t.preventDefault()})),m(v(n),"removeDroppingPlaceholder",(function(){var t=n.props,e=t.droppingItem,r=t.cols,i=n.state.layout,o=(0,a.compact)(i.filter((function(t){return t.i!==e.i})),(0,a.compactType)(n.props),r);n.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})})),m(v(n),"onDragLeave",(function(){n.dragEnterCounter--,0===n.dragEnterCounter&&n.removeDroppingPlaceholder()})),m(v(n),"onDragEnter",(function(){n.dragEnterCounter++})),m(v(n),"onDrop",(function(t){var e=n.props.droppingItem,r=n.state.layout,i=r.find((function(t){return t.i===e.i}));n.dragEnterCounter=0,n.removeDroppingPlaceholder(),n.props.onDrop(r,i,t)})),(0,a.autoBindHandlers)(v(n),["onDragStart","onDrag","onDragStop","onResizeStart","onResize","onResizeStop"]),n}return e=l,c=[{key:"getDerivedStateFromProps",value:function(t,e){var n;return e.activeDrag?null:((0,i.default)(t.layout,e.propsLayout)&&t.compactType===e.compactType?(0,a.childrenEqual)(t.children,e.children)||(n=e.layout):n=t.layout,n?{layout:(0,a.synchronizeLayoutWithChildren)(n,t.children,t.cols,(0,a.compactType)(t)),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}}],(n=[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function(t,e){return this.props.children!==t.children||!(0,a.fastRGLPropsEqual)(this.props,t,i.default)||this.state.activeDrag!==e.activeDrag||this.state.mounted!==e.mounted||this.state.droppingPosition!==e.droppingPosition}},{key:"componentDidUpdate",value:function(t,e){if(!this.state.activeDrag){var n=this.state.layout,r=e.layout;this.onLayoutMaybeChanged(n,r)}}},{key:"containerHeight",value:function(){if(this.props.autoSize){var t=(0,a.bottom)(this.state.layout),e=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+2*e+"px"}}},{key:"onDragStart",value:function(t,e,n,r){var i=r.e,o=r.node,A=this.state.layout,s=(0,a.getLayoutItem)(A,t);if(s)return this.setState({oldDragItem:(0,a.cloneLayoutItem)(s),oldLayout:this.state.layout}),this.props.onDragStart(A,s,s,null,i,o)}},{key:"onDrag",value:function(t,e,n,r){var i=r.e,o=r.node,A=this.state.oldDragItem,s=this.state.layout,c=this.props.cols,u=(0,a.getLayoutItem)(s,t);if(u){var l={w:u.w,h:u.h,x:u.x,y:u.y,placeholder:!0,i:t};s=(0,a.moveElement)(s,u,e,n,!0,this.props.preventCollision,(0,a.compactType)(this.props),c),this.props.onDrag(s,A,u,l,i,o),this.setState({layout:(0,a.compact)(s,(0,a.compactType)(this.props),c),activeDrag:l})}}},{key:"onDragStop",value:function(t,e,n,r){var i=r.e,o=r.node;if(this.state.activeDrag){var A=this.state.oldDragItem,s=this.state.layout,c=this.props,u=c.cols,l=c.preventCollision,g=(0,a.getLayoutItem)(s,t);if(g){s=(0,a.moveElement)(s,g,e,n,!0,l,(0,a.compactType)(this.props),u),this.props.onDragStop(s,A,g,null,i,o);var f=(0,a.compact)(s,(0,a.compactType)(this.props),u),h=this.state.oldLayout;this.setState({activeDrag:null,layout:f,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(f,h)}}}},{key:"onLayoutMaybeChanged",value:function(t,e){e||(e=this.state.layout),(0,i.default)(e,t)||this.props.onLayoutChange(t)}},{key:"onResizeStart",value:function(t,e,n,r){var i=r.e,o=r.node,A=this.state.layout,s=(0,a.getLayoutItem)(A,t);s&&(this.setState({oldResizeItem:(0,a.cloneLayoutItem)(s),oldLayout:this.state.layout}),this.props.onResizeStart(A,s,s,null,i,o))}},{key:"onResize",value:function(t,e,n,r){var i=r.e,o=r.node,A=this.state,s=A.layout,c=A.oldResizeItem,u=this.props,l=u.cols,g=u.preventCollision,h=(0,a.getLayoutItem)(s,t);if(h){var d;if(g){var I=(0,a.getAllCollisions)(s,f(f({},h),{},{w:e,h:n})).filter((function(t){return t.i!==h.i}));if(d=I.length>0){var p=1/0,C=1/0;I.forEach((function(t){t.x>h.x&&(p=Math.min(p,t.x)),t.y>h.y&&(C=Math.min(C,t.y))})),Number.isFinite(p)&&(h.w=p-h.x),Number.isFinite(C)&&(h.h=C-h.y)}}d||(h.w=e,h.h=n);var y={w:h.w,h:h.h,x:h.x,y:h.y,static:!0,i:t};this.props.onResize(s,c,h,y,i,o),this.setState({layout:(0,a.compact)(s,(0,a.compactType)(this.props),l),activeDrag:y})}}},{key:"onResizeStop",value:function(t,e,n,r){var i=r.e,o=r.node,A=this.state,s=A.layout,c=A.oldResizeItem,u=this.props.cols,l=(0,a.getLayoutItem)(s,t);this.props.onResizeStop(s,c,l,null,i,o);var g=(0,a.compact)(s,(0,a.compactType)(this.props),u),f=this.state.oldLayout;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null}),this.onLayoutMaybeChanged(g,f)}},{key:"placeholder",value:function(){var t=this.state.activeDrag;if(!t)return null;var e=this.props,n=e.width,i=e.cols,o=e.margin,a=e.containerPadding,A=e.rowHeight,c=e.maxRows,u=e.useCSSTransforms,l=e.transformScale;return r.default.createElement(s.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder",containerWidth:n,cols:i,margin:o,containerPadding:a||o,maxRows:c,rowHeight:A,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:u,transformScale:l},r.default.createElement("div",null))}},{key:"processGridItem",value:function(t,e){if(t&&t.key){var n=(0,a.getLayoutItem)(this.state.layout,String(t.key));if(!n)return null;var i=this.props,o=i.width,A=i.cols,c=i.margin,u=i.containerPadding,l=i.rowHeight,g=i.maxRows,f=i.isDraggable,h=i.isResizable,d=i.isBounded,I=i.useCSSTransforms,p=i.transformScale,C=i.draggableCancel,y=i.draggableHandle,v=i.resizeHandles,B=this.state,m=B.mounted,b=B.droppingPosition,E="boolean"===typeof n.isDraggable?n.isDraggable:!n.static&&f,Q="boolean"===typeof n.isResizable?n.isResizable:!n.static&&h,F=n.resizeHandles||v,w=E&&d&&!1!==n.isBounded;return r.default.createElement(s.default,{containerWidth:o,cols:A,margin:c,containerPadding:u||c,maxRows:g,rowHeight:l,cancel:C,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:Q,isBounded:w,useCSSTransforms:I&&m,usePercentages:!m,transformScale:p,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:e?b:void 0,resizeHandles:F},t)}}},{key:"render",value:function(){var t=this,e=this.props,n=e.className,i=e.style,A=e.isDroppable,s=e.innerRef,c=(0,o.default)("react-grid-layout",n),u=f({height:this.containerHeight()},i);return r.default.createElement("div",{ref:s,className:c,style:u,onDrop:A?this.onDrop:a.noop,onDragLeave:A?this.onDragLeave:a.noop,onDragEnter:A?this.onDragEnter:a.noop,onDragOver:A?this.onDragOver:a.noop},r.default.Children.map(this.props.children,(function(e){return t.processGridItem(e)})),A&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}])&&I(e.prototype,n),c&&I(e,c),l}(r.default.Component);e.default=E,m(E,"displayName","ReactGridLayout"),m(E,"propTypes",c.default),m(E,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:a.noop,onDragStart:a.noop,onDrag:a.noop,onDragStop:a.noop,onResizeStart:a.noop,onResize:a.noop,onResizeStop:a.noop,onDrop:a.noop})},function(t,e,n){"use strict";function r(t){var e=t.margin,n=t.containerPadding,r=t.containerWidth,i=t.cols;return(r-e[0]*(i-1)-2*n[0])/i}function i(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function o(t,e,n){return Math.max(Math.min(t,n),e)}Object.defineProperty(e,"__esModule",{value:!0}),e.calcGridColWidth=r,e.calcGridItemWHPx=i,e.calcGridItemPosition=function(t,e,n,o,a,A){var s=t.margin,c=t.containerPadding,u=t.rowHeight,l=r(t),g={};A&&A.resizing?(g.width=Math.round(A.resizing.width),g.height=Math.round(A.resizing.height)):(g.width=i(o,l,s[0]),g.height=i(a,u,s[1]));A&&A.dragging?(g.top=Math.round(A.dragging.top),g.left=Math.round(A.dragging.left)):(g.top=Math.round((u+s[1])*n+c[1]),g.left=Math.round((l+s[0])*e+c[0]));return g},e.calcXY=function(t,e,n,i,a){var A=t.margin,s=t.cols,c=t.rowHeight,u=t.maxRows,l=r(t),g=Math.round((n-A[0])/(l+A[0])),f=Math.round((e-A[1])/(c+A[1]));return g=o(g,0,s-i),f=o(f,0,u-a),{x:g,y:f}},e.calcWH=function(t,e,n,i,a){var A=t.margin,s=t.maxRows,c=t.cols,u=t.rowHeight,l=r(t),g=Math.round((e+A[0])/(l+A[0])),f=Math.round((n+A[1])/(u+A[1]));return g=o(g,0,c-i),f=o(f,0,s-a),{w:g,h:f}},e.clamp=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBoundPosition=function(t,e,n){if(!t.props.bounds)return[e,n];var a=t.props.bounds;a="string"===typeof a?a:function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}(a);var A=o(t);if("string"===typeof a){var s,c=A.ownerDocument,u=c.defaultView;if(!((s="parent"===a?A.parentNode:c.querySelector(a))instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');var l=u.getComputedStyle(A),g=u.getComputedStyle(s);a={left:-A.offsetLeft+(0,r.int)(g.paddingLeft)+(0,r.int)(l.marginLeft),top:-A.offsetTop+(0,r.int)(g.paddingTop)+(0,r.int)(l.marginTop),right:(0,i.innerWidth)(s)-(0,i.outerWidth)(A)-A.offsetLeft+(0,r.int)(g.paddingRight)-(0,r.int)(l.marginRight),bottom:(0,i.innerHeight)(s)-(0,i.outerHeight)(A)-A.offsetTop+(0,r.int)(g.paddingBottom)-(0,r.int)(l.marginBottom)}}(0,r.isNum)(a.right)&&(e=Math.min(e,a.right));(0,r.isNum)(a.bottom)&&(n=Math.min(n,a.bottom));(0,r.isNum)(a.left)&&(e=Math.max(e,a.left));(0,r.isNum)(a.top)&&(n=Math.max(n,a.top));return[e,n]},e.snapToGrid=function(t,e,n){var r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]},e.canDragX=function(t){return"both"===t.props.axis||"x"===t.props.axis},e.canDragY=function(t){return"both"===t.props.axis||"y"===t.props.axis},e.getControlPosition=function(t,e,n){var r="number"===typeof e?(0,i.getTouch)(t,e):null;if("number"===typeof e&&!r)return null;var a=o(n),A=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,i.offsetXYFromParent)(r||t,A,n.props.scale)},e.createCoreData=function(t,e,n){var i=t.state,a=!(0,r.isNum)(i.lastX),A=o(t);return a?{node:A,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:A,deltaX:e-i.lastX,deltaY:n-i.lastY,lastX:i.lastX,lastY:i.lastY,x:e,y:n}},e.createDraggableData=function(t,e){var n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}};var r=n(1119),i=n(1137);function o(t){var e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){void 0}},function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=A(n(0)),i=A(n(20)),o=n(1423),a=n(1424);function A(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return l(u(e=t.call.apply(t,[this].concat(r))||this),"state",{slackW:0,slackH:0}),e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var A=i.prototype;return A.lockAspectRatio=function(t,e,n){return[t=(e=t/n)*n,e]},A.runConstraints=function(t,e){var n=[this.props.minConstraints,this.props.maxConstraints],r=n[0],i=n[1];if(!r&&!i)return[t,e];if(this.props.lockAspectRatio)if(e===this.props.height){var o=this.props.width/this.props.height;t=(e=t/o)*o}else{var a=this.props.height/this.props.width;e=(t=e/a)*a}var A=t,s=e,c=this.state,u=c.slackW,l=c.slackH;return t+=u,e+=l,r&&(t=Math.max(r[0],t),e=Math.max(r[1],e)),i&&(t=Math.min(i[0],t),e=Math.min(i[1],e)),l+=s-e,(u+=A-t)===this.state.slackW&&l===this.state.slackH||this.setState({slackW:u,slackH:l}),[t,e]},A.resizeHandler=function(t,e){var n=this;return function(r,i){var o=i.node,a=i.deltaX,A=i.deltaY;a/=n.props.transformScale,A/=n.props.transformScale;var s=("both"===n.props.axis||"x"===n.props.axis)&&-1===["n","s"].indexOf(e),c=("both"===n.props.axis||"y"===n.props.axis)&&-1===["e","w"].indexOf(e);s&&"w"===e[e.length-1]&&(a=-a),c&&"n"===e[0]&&(A=-A);var u=n.props.width+(s?a:0),l=n.props.height+(c?A:0),g=u!==n.props.width,f=l!==n.props.height;if("onResize"!==t||g||f){var h=n.runConstraints(u,l);u=h[0],l=h[1];var d={};if("onResizeStart"===t);else if("onResizeStop"===t)d.slackW=d.slackH=0;else if(u===n.props.width&&l===n.props.height)return;"function"===typeof n.props[t]?("function"===typeof r.persist&&r.persist(),n.setState(d,(function(){return n.props[t](r,{node:o,size:{width:u,height:l},handle:e})}))):n.setState(d)}}},A.renderResizeHandle=function(t){var e=this.props.handle;return e?"function"===typeof e?e(t):e:r.default.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+t})},A.render=function(){var t=this,e=this.props,n=e.children,i=e.draggableOpts,A=(e.width,e.height,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart,e.resizeHandles),u=(e.transformScale,function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(e,["children","draggableOpts","width","height","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"])),g=u.className?u.className+" react-resizable":"react-resizable";return(0,a.cloneElement)(n,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(n,!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},u,{className:g,children:[n.props.children,A.map((function(e){return r.default.createElement(o.DraggableCore,s({},i,{key:"resizableHandle-"+e,onStop:t.resizeHandler("onResizeStop",e),onStart:t.resizeHandler("onResizeStart",e),onDrag:t.resizeHandler("onResize",e)}),t.renderResizeHandle(e))}))]}))},i}(r.default.Component);e.default=g,l(g,"propTypes",{children:i.default.element.isRequired,width:i.default.number.isRequired,height:i.default.number.isRequired,handle:i.default.element,handleSize:i.default.array,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,lockAspectRatio:i.default.bool,axis:i.default.oneOf(["both","x","y","none"]),minConstraints:i.default.arrayOf(i.default.number),maxConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,draggableOpts:i.default.object}),l(g,"defaultProps",{handleSize:[20,20],lockAspectRatio:!1,axis:"both",minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBreakpointFromWidth=function(t,e){for(var n=i(t),r=n[0],o=1,a=n.length;o<a;o++){var A=n[o];e>t[A]&&(r=A)}return r},e.getColsFromBreakpoint=function(t,e){if(!e[t])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+t+" is missing!");return e[t]},e.findOrGenerateResponsiveLayout=function(t,e,n,o,a,A){if(t[n])return(0,r.cloneLayout)(t[n]);for(var s=t[o],c=i(e),u=c.slice(c.indexOf(n)),l=0,g=u.length;l<g;l++){var f=u[l];if(t[f]){s=t[f];break}}return s=(0,r.cloneLayout)(s||[]),(0,r.compact)((0,r.correctBounds)(s,{cols:a}),A,a)},e.sortBreakpoints=i;var r=n(926);function i(t){return Object.keys(t).sort((function(e,n){return t[e]-t[n]}))}},function(t,e,n){"use strict";var r=n(310);e.a={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n  vec4 pos = u_ModelMatrix * position;\n  pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n  vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n  vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n  vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n  pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n  pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n  pbr_vUV = uv;\n#else\n  pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n  float NdotL;\n  float NdotV;\n  float NdotH;\n  float LdotH;\n  float VdotH;\n  float perceptualRoughness;\n  float metalness;\n  vec3 reflectance0;\n  vec3 reflectance90;\n  float alphaRoughness;\n  vec3 diffuseColor;\n  vec3 specularColor;\n  vec3 n;\n  vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n  vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n  vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n  vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n  return vec4(linOut,srgbIn.w);;\n#else\n  return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n  vec3 pos_dx = dFdx(pbr_vPosition);\n  vec3 pos_dy = dFdy(pbr_vPosition);\n  vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n  vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n  vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n  vec3 ng = normalize(pbr_vNormal);\n#else\n  vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n  t = normalize(t - ng * dot(ng, t));\n  vec3 b = normalize(cross(ng, t));\n  mat3 tbn = mat3(t, b, ng);\n#else\n  mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n  vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n  n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n  vec3 n = normalize(tbn[2].xyz);\n#endif\n\n  return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n  float mipCount = 9.0;\n  float lod = (pbrInputs.perceptualRoughness * mipCount);\n  vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n    vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n  vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n  vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n  vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n  vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n  vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n  diffuse *= u_ScaleIBLAmbient.x;\n  specular *= u_ScaleIBLAmbient.y;\n\n  return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n  return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n  return pbrInputs.reflectance0 +\n    (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n    pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n  float NdotL = pbrInputs.NdotL;\n  float NdotV = pbrInputs.NdotV;\n  float r = pbrInputs.alphaRoughness;\n\n  float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n  float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n  return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n  float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n  float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n  return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n  pbrInputs.NdotL = 1.0;\n  pbrInputs.NdotH = 0.0;\n  pbrInputs.LdotH = 0.0;\n  pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n  vec3 n = pbrInputs.n;\n  vec3 v = pbrInputs.v;\n  vec3 l = normalize(lightDirection);\n  vec3 h = normalize(l+v);\n\n  pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n  pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n  pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n  pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n  vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n  PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n  vec3 F = specularReflection(pbrInputs);\n  float G = geometricOcclusion(pbrInputs);\n  float D = microfacetDistribution(pbrInputs);\n  vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n  vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n  return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n  vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n  vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n  if (baseColor.a < u_AlphaCutoff) {\n    discard;\n  }\n#endif\n\n  vec3 color = vec3(0, 0, 0);\n\n  if(pbr_uUnlit){\n    color.rgb = baseColor.rgb;\n  }\n  else{\n\n\n    float perceptualRoughness = u_MetallicRoughnessValues.y;\n    float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n    vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n    perceptualRoughness = mrSample.g * perceptualRoughness;\n    metallic = mrSample.b * metallic;\n#endif\n    perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n    metallic = clamp(metallic, 0.0, 1.0);\n\n    float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n    vec3 f0 = vec3(0.04);\n    vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n    diffuseColor *= 1.0 - metallic;\n    vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n    float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n    vec3 specularEnvironmentR0 = specularColor.rgb;\n    vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n    vec3 n = getNormal();\n    vec3 v = normalize(u_Camera - pbr_vPosition);\n\n    float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n    vec3 reflection = -normalize(reflect(v, n));\n\n    PBRInfo pbrInputs = PBRInfo(\n      0.0,\n      NdotV,\n      0.0,\n      0.0,\n      0.0,\n      perceptualRoughness,\n      metallic,\n      specularEnvironmentR0,\n      specularEnvironmentR90,\n      alphaRoughness,\n      diffuseColor,\n      specularColor,\n      n,\n      v\n    );\n\n#ifdef USE_LIGHTS\n    PBRInfo_setAmbientLight(pbrInputs);\n    color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n      if (i < lighting_uDirectionalLightCount) {\n        PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n        color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n      }\n    }\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n      if (i < lighting_uPointLightCount) {\n        PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n        float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n        color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n      }\n    }\n#endif\n#ifdef USE_IBL\n    color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n    float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n    color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n    vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n    color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n    color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n    color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n    color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n  }\n\n  return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r.a]}},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#cells","title":"Vitessce cell data","type":"object","definitions":{"coord":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number"}},"positiveFloatValues":{"type":"object","patternProperties":{".":{"type":"number","minimum":0}}},"stringValues":{"type":"object","patternProperties":{".":{"type":"string"}}}},"patternProperties":{".":{"additionalProperties":false,"required":[],"properties":{"mappings":{"type":"object","patternProperties":{".":{"$ref":"#/definitions/coord"}}},"xy":{"$ref":"#/definitions/coord"},"genes":{"$ref":"#/definitions/positiveFloatValues"},"factors":{"$ref":"#/definitions/stringValues"},"poly":{"type":"array","items":{"$ref":"#/definitions/coord"}}}}}}')},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#molecules","title":"Vitessce molecule data","type":"object","definitions":{"coord":{"type":"array","maxItems":2,"minItems":2,"items":{"type":"number"}}},"patternProperties":{".":{"type":"array","items":{"$ref":"#/definitions/coord"}}}}')},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#neighborhoods","title":"Vitessce neighborhood data","type":"object","definitions":{"coord":{"type":"array","maxItems":2,"minItems":2,"items":{"type":"number"}}},"patternProperties":{".":{"additionalProperties":false,"required":["poly"],"properties":{"poly":{"type":"array","maxItems":3,"minItems":3,"items":{"$ref":"#/definitions/coord"}}}}}}')},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#genes","title":"Vitessce gene data","type":"object","definitions":{"positiveFloatValues":{"type":"object","patternProperties":{".":{"type":"number","minimum":0}}}},"patternProperties":{".":{"additionalProperties":false,"required":["max","cells"],"properties":{"max":{"type":"number"},"cells":{"$ref":"#/definitions/positiveFloatValues"}}}}}')},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#clusters","title":"Vitessce cluster data","type":"object","definitions":{"stringArray":{"type":"array","items":{"type":"string"}},"matrix":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}}}},"additionalProperties":false,"required":["rows","cols","matrix"],"properties":{"rows":{"$ref":"#/definitions/stringArray"},"cols":{"$ref":"#/definitions/stringArray"},"matrix":{"$ref":"#/definitions/matrix"}}}')},function(t){t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://github.com/hubmapconsortium/vitessce/#dataset","title":"Vitessce data set","type":"object","definitions":{"components":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["component","x","y"],"properties":{"component":{"type":"string"},"props":{"type":"object"},"x":{"type":"integer"},"y":{"type":"integer"},"w":{"type":"integer"},"h":{"type":"integer"}}}},"requestInit":{"type":"object","additionalProperties":false,"required":[],"properties":{"method":{"type":"string"},"headers":{"type":"object"},"body":{"type":"string"},"mode":{"type":"string"},"credentials":{"type":"string"},"cache":{"type":"string"},"redirect":{"type":"string"},"referrer":{"type":"string"},"integrity":{"type":"string"}}}},"additionalProperties":false,"required":["version","name","layers"],"properties":{"name":{"type":"string"},"public":{"type":"boolean"},"description":{"type":"string"},"layers":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","type","fileType","url"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"fileType":{"type":"string"},"url":{"type":"string"},"requestInit":{"$ref":"#/definitions/requestInit"}}}},"staticLayout":{"$ref":"#/definitions/components"},"version":{"type":"string","enum":["0.1.0"]}}}')},function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=90)}({17:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=n(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var n=e.match(t);return n&&n.length>0&&n[1]||""},t.getSecondMatch=function(t,e){var n=e.match(t);return n&&n.length>1&&n[2]||""},t.matchAndReturnConst=function(t,e,n){if(t.test(e))return n},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,n,r){void 0===r&&(r=!1);var i=t.getVersionPrecision(e),o=t.getVersionPrecision(n),a=Math.max(i,o),A=0,s=t.map([e,n],(function(e){var n=a-t.getVersionPrecision(e),r=e+new Array(n+1).join(".0");return t.map(r.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(r&&(A=a-Math.min(i,o)),a-=1;a>=A;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===A)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}},t.map=function(t,e){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(t,e);for(n=0;n<t.length;n+=1)r.push(e(t[n]));return r},t.find=function(t,e){var n,r;if(Array.prototype.find)return Array.prototype.find.call(t,e);for(n=0,r=t.length;n<r;n+=1){var i=t[n];if(e(i,n))return i}},t.assign=function(t){for(var e,n,r=t,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[t].concat(o));var A=function(){var t=o[e];"object"==typeof t&&null!==t&&Object.keys(t).forEach((function(e){r[e]=t[e]}))};for(e=0,n=o.length;e<n;e+=1)A();return t},t.getBrowserAlias=function(t){return r.BROWSER_ALIASES_MAP[t]},t.getBrowserTypeByAlias=function(t){return r.BROWSER_MAP[t]||""},t}();e.default=i,t.exports=e.default},18:function(t,e,n){"use strict";e.__esModule=!0,e.ENGINE_MAP=e.OS_MAP=e.PLATFORMS_MAP=e.BROWSER_MAP=e.BROWSER_ALIASES_MAP=void 0,e.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},e.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},e.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},e.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},e.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var A=function(){function t(){}var e,n;return t.getParser=function(t,e){if(void 0===e&&(e=!1),"string"!=typeof t)throw new Error("UserAgent should be a string");return new i.default(t,e)},t.parse=function(t){return new i.default(t).getResult()},e=t,(n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}])&&a(e,n),t}();e.default=A,t.exports=e.default},91:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=s(n(92)),i=s(n(93)),o=s(n(94)),a=s(n(95)),A=s(n(17));function s(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(t,e){if(void 0===e&&(e=!1),null==t||""===t)throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},!0!==e&&this.parse()}var e=t.prototype;return e.getUA=function(){return this._ua},e.test=function(t){return t.test(this._ua)},e.parseBrowser=function(){var t=this;this.parsedResult.browser={};var e=A.default.find(r.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser},e.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},e.getBrowserName=function(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},e.getBrowserVersion=function(){return this.getBrowser().version},e.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},e.parseOS=function(){var t=this;this.parsedResult.os={};var e=A.default.find(i.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os},e.getOSName=function(t){var e=this.getOS().name;return t?String(e).toLowerCase()||"":e||""},e.getOSVersion=function(){return this.getOS().version},e.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},e.getPlatformType=function(t){void 0===t&&(t=!1);var e=this.getPlatform().type;return t?String(e).toLowerCase()||"":e||""},e.parsePlatform=function(){var t=this;this.parsedResult.platform={};var e=A.default.find(o.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform},e.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},e.getEngineName=function(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},e.parseEngine=function(){var t=this;this.parsedResult.engine={};var e=A.default.find(a.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine},e.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},e.getResult=function(){return A.default.assign({},this.parsedResult)},e.satisfies=function(t){var e=this,n={},r=0,i={},o=0;if(Object.keys(t).forEach((function(e){var a=t[e];"string"==typeof a?(i[e]=a,o+=1):"object"==typeof a&&(n[e]=a,r+=1)})),r>0){var a=Object.keys(n),s=A.default.find(a,(function(t){return e.isOS(t)}));if(s){var c=this.satisfies(n[s]);if(void 0!==c)return c}var u=A.default.find(a,(function(t){return e.isPlatform(t)}));if(u){var l=this.satisfies(n[u]);if(void 0!==l)return l}}if(o>0){var g=Object.keys(i),f=A.default.find(g,(function(t){return e.isBrowser(t,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var n=this.getBrowserName().toLowerCase(),r=t.toLowerCase(),i=A.default.getBrowserTypeByAlias(r);return e&&i&&(r=i.toLowerCase()),r===n},e.compareVersion=function(t){var e=[0],n=t,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(n=t.substr(1),"="===t[1]?(r=!0,n=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?n=t.substr(1):"~"===t[0]&&(r=!0,n=t.substr(1)),e.indexOf(A.default.compareVersions(i,n,r))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=c,t.exports=e.default},92:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e={name:"Android Browser"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=a,t.exports=e.default},93:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:o.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=i.default.getWindowsVersionName(e);return{name:o.OS_MAP.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(e),r={name:o.OS_MAP.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=i.default.getAndroidVersionName(e),r={name:o.OS_MAP.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:o.OS_MAP.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:o.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.PlayStation4,version:e}}}];e.default=a,t.exports=e.default},94:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];e.default=a,t.exports=e.default},95:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:o.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:o.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe:function(t){var e={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];e.default=a,t.exports=e.default}})},,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){var n,i;if(void 0===e){var o,a=Object(r.a)(t);try{for(a.s();!(o=a.n()).done;){var A=o.value;null!=A&&(void 0===n?A>=A&&(n=i=A):(n>A&&(n=A),i<A&&(i=A)))}}catch(g){a.e(g)}finally{a.f()}}else{var s,c=-1,u=Object(r.a)(t);try{for(u.s();!(s=u.n()).done;){var l=s.value;null!=(l=e(l,++c,t))&&(void 0===n?l>=l&&(n=i=l):(n>l&&(n=l),i<l&&(i=l)))}}catch(g){u.e(g)}finally{u.f()}}return[n,i]}},function(t,e){t.exports=function(t,e,n){return t===e||t.className===e.className&&n(t.style,e.style)&&t.width===e.width&&t.autoSize===e.autoSize&&t.cols===e.cols&&t.draggableCancel===e.draggableCancel&&t.draggableHandle===e.draggableHandle&&n(t.verticalCompact,e.verticalCompact)&&n(t.compactType,e.compactType)&&n(t.layout,e.layout)&&n(t.margin,e.margin)&&n(t.containerPadding,e.containerPadding)&&t.rowHeight===e.rowHeight&&t.maxRows===e.maxRows&&t.isBounded===e.isBounded&&t.isDraggable===e.isDraggable&&t.isResizable===e.isResizable&&t.preventCollision===e.preventCollision&&t.useCSSTransforms===e.useCSSTransforms&&t.transformScale===e.transformScale&&t.isDroppable===e.isDroppable&&n(t.resizeHandles,e.resizeHandles)&&t.onLayoutChange===e.onLayoutChange&&t.onDragStart===e.onDragStart&&t.onDrag===e.onDrag&&t.onDragStop===e.onDragStop&&t.onResizeStart===e.onResizeStart&&t.onResize===e.onResize&&t.onResizeStop===e.onResizeStop&&t.onDrop===e.onDrop&&n(t.droppingItem,e.droppingItem)&&n(t.innerRef,e.innerRef)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=l(n(0)),i=l(n(65)),o=l(n(20)),a=n(1418),A=n(1422),s=n(926),c=n(1381),u=l(n(166));function l(t){return t&&t.__esModule?t:{default:t}}function g(t){return(g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=B(t);if(e){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y(this,n)}}function y(t,e){return!e||"object"!==g(e)&&"function"!==typeof e?v(t):e}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B(t){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(g,t);var e,n,o,l=C(g);function g(){var t;d(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(v(t=l.call.apply(l,[this].concat(n))),"state",{resizing:null,dragging:null,className:""}),m(v(t),"currentNode",void 0),m(v(t),"onDragStart",(function(e,n){var r=n.node,i=t.props.onDragStart;if(i){var o={top:0,left:0},a=r.offsetParent;if(a){var A=a.getBoundingClientRect(),s=r.getBoundingClientRect(),u=s.left/t.props.transformScale,l=A.left/t.props.transformScale,g=s.top/t.props.transformScale,f=A.top/t.props.transformScale;o.left=u-l+a.scrollLeft,o.top=g-f+a.scrollTop,t.setState({dragging:o});var h=(0,c.calcXY)(t.getPositionParams(),o.top,o.left,t.props.w,t.props.h),d=h.x,I=h.y;return i.call(v(t),t.props.i,d,I,{e:e,node:r,newPosition:o})}}})),m(v(t),"onDrag",(function(e,n){var r=n.node,i=n.deltaX,o=n.deltaY,a=t.props,A=a.onDrag,s=a.transformScale;if(A){if(i/=s,o/=s,!t.state.dragging)throw new Error("onDrag called before onDragStart.");var u=t.state.dragging.top+o,l=t.state.dragging.left+i,g=t.props,f=g.isBounded,h=g.i,d=g.w,I=g.h,p=g.containerWidth,C=t.getPositionParams();if(f){var y=r.offsetParent;if(y){var B=t.props,m=B.margin,b=B.rowHeight,E=y.clientHeight-(0,c.calcGridItemWHPx)(I,b,m[1]);u=(0,c.clamp)(u,0,E);var Q=(0,c.calcGridColWidth)(C),F=p-(0,c.calcGridItemWHPx)(d,Q,m[0]);l=(0,c.clamp)(l,0,F)}}var w={top:u,left:l};t.setState({dragging:w});var S=(0,c.calcXY)(C,u,l,d,I),R=S.x,U=S.y;return A.call(v(t),h,R,U,{e:e,node:r,newPosition:w})}})),m(v(t),"onDragStop",(function(e,n){var r=n.node,i=t.props.onDragStop;if(i){if(!t.state.dragging)throw new Error("onDragEnd called before onDragStart.");var o=t.props,a=o.w,A=o.h,s=o.i,u=t.state.dragging,l=u.left,g=u.top,f={top:g,left:l};t.setState({dragging:null});var h=(0,c.calcXY)(t.getPositionParams(),g,l,a,A),d=h.x,I=h.y;return i.call(v(t),s,d,I,{e:e,node:r,newPosition:f})}})),m(v(t),"onResizeStop",(function(e,n){t.onResizeHandler(e,n,"onResizeStop")})),m(v(t),"onResizeStart",(function(e,n){t.onResizeHandler(e,n,"onResizeStart")})),m(v(t),"onResize",(function(e,n){t.onResizeHandler(e,n,"onResize")})),t}return e=g,(n=[{key:"shouldComponentUpdate",value:function(t,e){if(this.props.children!==t.children)return!0;if(this.props.droppingPosition!==t.droppingPosition)return!0;var n=(0,c.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),r=(0,c.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,e);return!(0,s.fastPositionEqual)(n,r)||this.props.useCSSTransforms!==t.useCSSTransforms}},{key:"componentDidMount",value:function(){this.moveDroppingItem({})}},{key:"componentDidUpdate",value:function(t){this.moveDroppingItem(t)}},{key:"moveDroppingItem",value:function(t){var e=this.props.droppingPosition;if(e){var n=t.droppingPosition||{left:0,top:0},r=this.state.dragging;this.currentNode||(this.currentNode=i.default.findDOMNode(this));var o=r&&e.left!==n.left||e.top!==n.top;if(r){if(o){var a=e.left-r.left,A=e.top-r.top;this.onDrag(e.e,{node:this.currentNode,deltaX:a,deltaY:A})}}else this.onDragStart(e.e,{node:this.currentNode,deltaX:e.left,deltaY:e.top})}}},{key:"getPositionParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}},{key:"createStyle",value:function(t){var e,n=this.props,r=n.usePercentages,i=n.containerWidth;return n.useCSSTransforms?e=(0,s.setTransform)(t):(e=(0,s.setTopLeft)(t),r&&(e.left=(0,s.perc)(t.left/i),e.width=(0,s.perc)(t.width/i))),e}},{key:"mixinDraggable",value:function(t,e){return r.default.createElement(a.DraggableCore,{disabled:!e,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale},t)}},{key:"mixinResizable",value:function(t,e,n){var i=this.props,o=i.cols,a=i.x,s=i.minW,u=i.minH,l=i.maxW,g=i.maxH,f=i.transformScale,h=i.resizeHandles,d=this.getPositionParams(),I=(0,c.calcGridItemPosition)(d,0,0,o-a,0).width,p=(0,c.calcGridItemPosition)(d,0,0,s,u),C=(0,c.calcGridItemPosition)(d,0,0,l,g),y=[p.width,p.height],v=[Math.min(C.width,I),Math.min(C.height,1/0)];return r.default.createElement(A.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:e.width,height:e.height,minConstraints:y,maxConstraints:v,onResizeStop:this.onResizeStop,onResizeStart:this.onResizeStart,onResize:this.onResize,transformScale:f,resizeHandles:h},t)}},{key:"onResizeHandler",value:function(t,e,n){var r=e.node,i=e.size,o=this.props[n];if(o){var a=this.props,A=a.cols,s=a.x,u=a.y,l=a.i,g=a.maxH,f=a.minH,h=this.props,d=h.minW,I=h.maxW,p=(0,c.calcWH)(this.getPositionParams(),i.width,i.height,s,u),C=p.w,y=p.h;d=Math.max(d,1),I=Math.min(I,A-s),C=(0,c.clamp)(C,d,I),y=(0,c.clamp)(y,f,g),this.setState({resizing:"onResizeStop"===n?null:i}),o.call(this,l,C,y,{e:t,node:r,size:i})}}},{key:"render",value:function(){var t=this.props,e=t.x,n=t.y,i=t.w,o=t.h,a=t.isDraggable,A=t.isResizable,s=t.droppingPosition,l=t.useCSSTransforms,g=(0,c.calcGridItemPosition)(this.getPositionParams(),e,n,i,o,this.state),f=r.default.Children.only(this.props.children),d=r.default.cloneElement(f,{className:(0,u.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:Boolean(this.state.resizing),"react-draggable":a,"react-draggable-dragging":Boolean(this.state.dragging),dropping:Boolean(s),cssTransforms:l}),style:h(h(h({},this.props.style),f.props.style),this.createStyle(g))});return d=this.mixinResizable(d,g,A),d=this.mixinDraggable(d,a)}}])&&I(e.prototype,n),o&&I(e,o),g}(r.default.Component);e.default=b,m(b,"propTypes",{children:o.default.element,cols:o.default.number.isRequired,containerWidth:o.default.number.isRequired,rowHeight:o.default.number.isRequired,margin:o.default.array.isRequired,maxRows:o.default.number.isRequired,containerPadding:o.default.array.isRequired,x:o.default.number.isRequired,y:o.default.number.isRequired,w:o.default.number.isRequired,h:o.default.number.isRequired,minW:function(t,e){var n=t[e];return"number"!==typeof n?new Error("minWidth not Number"):n>t.w||n>t.maxW?new Error("minWidth larger than item width/maxWidth"):void 0},maxW:function(t,e){var n=t[e];return"number"!==typeof n?new Error("maxWidth not Number"):n<t.w||n<t.minW?new Error("maxWidth smaller than item width/minWidth"):void 0},minH:function(t,e){var n=t[e];return"number"!==typeof n?new Error("minHeight not Number"):n>t.h||n>t.maxH?new Error("minHeight larger than item height/maxHeight"):void 0},maxH:function(t,e){var n=t[e];return"number"!==typeof n?new Error("maxHeight not Number"):n<t.h||n<t.minH?new Error("maxHeight smaller than item height/minHeight"):void 0},i:o.default.string.isRequired,onDragStop:o.default.func,onDragStart:o.default.func,onDrag:o.default.func,onResizeStop:o.default.func,onResizeStart:o.default.func,onResize:o.default.func,isDraggable:o.default.bool.isRequired,isResizable:o.default.bool.isRequired,isBounded:o.default.bool.isRequired,static:o.default.bool,useCSSTransforms:o.default.bool.isRequired,transformScale:o.default.number,className:o.default.string,handle:o.default.string,cancel:o.default.string,droppingPosition:o.default.shape({e:o.default.object.isRequired,left:o.default.number.isRequired,top:o.default.number.isRequired})}),m(b,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1})},function(t,e,n){"use strict";var r=n(1419),i=r.default,o=r.DraggableCore;t.exports=i,t.exports.default=i,t.exports.DraggableCore=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==h(t)&&"function"!==typeof t)return{default:t};var e=f();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}n.default=t,e&&e.set(t,n);return n}(n(0)),i=g(n(20)),o=g(n(65)),a=g(n(166)),A=n(1137),s=n(1382),c=n(1119),u=g(n(1421)),l=g(n(1383));function g(t){return t&&t.__esModule?t:{default:t}}function f(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return f=function(){return t},t}function h(t){return(h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function I(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){S(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e,n){return e&&B(t.prototype,e),n&&B(t,n),t}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=w(t);if(e){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(t,e){return!e||"object"!==h(e)&&"function"!==typeof e?F(t):e}function F(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function S(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var R=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(n,t);var e=E(n);function n(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),S(F(r=e.call(this,t)),"onDragStart",(function(t,e){if((0,l.default)("Draggable: onDragStart: %j",e),!1===r.props.onStart(t,(0,s.createDraggableData)(F(r),e)))return!1;r.setState({dragging:!0,dragged:!0})})),S(F(r),"onDrag",(function(t,e){if(!r.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",e);var n=(0,s.createDraggableData)(F(r),e),i={x:n.x,y:n.y};if(r.props.bounds){var o=i.x,a=i.y;i.x+=r.state.slackX,i.y+=r.state.slackY;var A=p((0,s.getBoundPosition)(F(r),i.x,i.y),2),c=A[0],u=A[1];i.x=c,i.y=u,i.slackX=r.state.slackX+(o-i.x),i.slackY=r.state.slackY+(a-i.y),n.x=i.x,n.y=i.y,n.deltaX=i.x-r.state.x,n.deltaY=i.y-r.state.y}if(!1===r.props.onDrag(t,n))return!1;r.setState(i)})),S(F(r),"onDragStop",(function(t,e){if(!r.state.dragging)return!1;if(!1===r.props.onStop(t,(0,s.createDraggableData)(F(r),e)))return!1;(0,l.default)("Draggable: onDragStop: %j",e);var n={dragging:!1,slackX:0,slackY:0};if(Boolean(r.props.position)){var i=r.props.position,o=i.x,a=i.y;n.x=o,n.y=a}r.setState(n)})),r.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:v({},t.position),slackX:0,slackY:0,isElementSVG:!1},!t.position||t.onDrag||t.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),r}return m(n,null,[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.position,r=e.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:v({},n)})}}]),m(n,[{key:"componentDidMount",value:function(){"undefined"!==typeof window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){return this.props.nodeRef?this.props.nodeRef.current:o.default.findDOMNode(this)}},{key:"render",value:function(){var t,e=this.props,n=(e.axis,e.bounds,e.children),i=e.defaultPosition,o=e.defaultClassName,c=e.defaultClassNameDragging,l=e.defaultClassNameDragged,g=e.position,f=e.positionOffset,h=(e.scale,I(e,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),p={},C=null,y=!Boolean(g)||this.state.dragging,B=g||i,m={x:(0,s.canDragX)(this)&&y?this.state.x:B.x,y:(0,s.canDragY)(this)&&y?this.state.y:B.y};this.state.isElementSVG?C=(0,A.createSVGTransform)(m,f):p=(0,A.createCSSTransform)(m,f);var b=(0,a.default)(n.props.className||"",o,(S(t={},c,this.state.dragging),S(t,l,this.state.dragged),t));return r.createElement(u.default,d({},h,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:b,style:v(v({},n.props.style),p),transform:C}))}}]),n}(r.Component);e.default=R,S(R,"displayName","Draggable"),S(R,"propTypes",v(v({},u.default.propTypes),{},{axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe})),S(R,"defaultProps",v(v({},u.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPrefix=i,e.browserPrefixToKey=o,e.browserPrefixToStyle=function(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t},e.default=void 0;var r=["Moz","Webkit","O","ms"];function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"===typeof window||"undefined"===typeof window.document)return"";var e=window.document.documentElement.style;if(t in e)return"";for(var n=0;n<r.length;n++)if(o(t,r[n])in e)return r[n];return""}function o(t,e){return e?"".concat(e).concat(function(t){for(var e="",n=!0,r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):"-"===t[r]?n=!0:e+=t[r];return e}(t)):t}var a=i();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==g(t)&&"function"!==typeof t)return{default:t};var e=l();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}n.default=t,e&&e.set(t,n);return n}(n(0)),i=u(n(20)),o=u(n(65)),a=n(1137),A=n(1382),s=n(1119),c=u(n(1383));function u(t){return t&&t.__esModule?t:{default:t}}function l(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return l=function(){return t},t}function g(t){return(g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=B(t);if(e){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y(this,n)}}function y(t,e){return!e||"object"!==g(e)&&"function"!==typeof e?v(t):e}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B(t){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b={start:"touchstart",move:"touchmove",stop:"touchend"},E={start:"mousedown",move:"mousemove",stop:"mouseup"},Q=E,F=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(u,t);var e,n,i,s=C(u);function u(){var t;d(this,u);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(v(t=s.call.apply(s,[this].concat(n))),"state",{dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null}),m(v(t),"mounted",!1),m(v(t),"handleDragStart",(function(e){if(t.props.onMouseDown(e),!t.props.allowAnyClick&&"number"===typeof e.button&&0!==e.button)return!1;var n=t.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var r=n.ownerDocument;if(!(t.props.disabled||!(e.target instanceof r.defaultView.Node)||t.props.handle&&!(0,a.matchesSelectorAndParentsTo)(e.target,t.props.handle,n)||t.props.cancel&&(0,a.matchesSelectorAndParentsTo)(e.target,t.props.cancel,n))){"touchstart"===e.type&&e.preventDefault();var i=(0,a.getTouchIdentifier)(e);t.setState({touchIdentifier:i});var o=(0,A.getControlPosition)(e,i,v(t));if(null!=o){var s=o.x,u=o.y,l=(0,A.createCoreData)(v(t),s,u);(0,c.default)("DraggableCore: handleDragStart: %j",l),(0,c.default)("calling",t.props.onStart),!1!==t.props.onStart(e,l)&&!1!==t.mounted&&(t.props.enableUserSelectHack&&(0,a.addUserSelectStyles)(r),t.setState({dragging:!0,lastX:s,lastY:u}),(0,a.addEvent)(r,Q.move,t.handleDrag),(0,a.addEvent)(r,Q.stop,t.handleDragStop))}}})),m(v(t),"handleDrag",(function(e){var n=(0,A.getControlPosition)(e,t.state.touchIdentifier,v(t));if(null!=n){var r=n.x,i=n.y;if(Array.isArray(t.props.grid)){var o=r-t.state.lastX,a=i-t.state.lastY,s=f((0,A.snapToGrid)(t.props.grid,o,a),2);if(o=s[0],a=s[1],!o&&!a)return;r=t.state.lastX+o,i=t.state.lastY+a}var u=(0,A.createCoreData)(v(t),r,i);if((0,c.default)("DraggableCore: handleDrag: %j",u),!1!==t.props.onDrag(e,u)&&!1!==t.mounted)t.setState({lastX:r,lastY:i});else try{t.handleDragStop(new MouseEvent("mouseup"))}catch(g){var l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t.handleDragStop(l)}}})),m(v(t),"handleDragStop",(function(e){if(t.state.dragging){var n=(0,A.getControlPosition)(e,t.state.touchIdentifier,v(t));if(null!=n){var r=n.x,i=n.y,o=(0,A.createCoreData)(v(t),r,i);if(!1===t.props.onStop(e,o)||!1===t.mounted)return!1;var s=t.findDOMNode();s&&t.props.enableUserSelectHack&&(0,a.removeUserSelectStyles)(s.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",o),t.setState({dragging:!1,lastX:NaN,lastY:NaN}),s&&((0,c.default)("DraggableCore: Removing handlers"),(0,a.removeEvent)(s.ownerDocument,Q.move,t.handleDrag),(0,a.removeEvent)(s.ownerDocument,Q.stop,t.handleDragStop))}}})),m(v(t),"onMouseDown",(function(e){return Q=E,t.handleDragStart(e)})),m(v(t),"onMouseUp",(function(e){return Q=E,t.handleDragStop(e)})),m(v(t),"onTouchStart",(function(e){return Q=b,t.handleDragStart(e)})),m(v(t),"onTouchEnd",(function(e){return Q=b,t.handleDragStop(e)})),t}return e=u,(n=[{key:"componentDidMount",value:function(){this.mounted=!0;var t=this.findDOMNode();t&&(0,a.addEvent)(t,b.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var t=this.findDOMNode();if(t){var e=t.ownerDocument;(0,a.removeEvent)(e,E.move,this.handleDrag),(0,a.removeEvent)(e,b.move,this.handleDrag),(0,a.removeEvent)(e,E.stop,this.handleDragStop),(0,a.removeEvent)(e,b.stop,this.handleDragStop),(0,a.removeEvent)(t,b.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,a.removeUserSelectStyles)(e)}}},{key:"findDOMNode",value:function(){return this.props.nodeRef?this.props.nodeRef.current:o.default.findDOMNode(this)}},{key:"render",value:function(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&I(e.prototype,n),i&&I(e,i),u}(r.Component);e.default=F,m(F,"displayName","DraggableCore"),m(F,"propTypes",{allowAnyClick:i.default.bool,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(t,e){if(t[e]&&1!==t[e].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),m(F,"defaultProps",{allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},function(t,e,n){"use strict";t.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},t.exports.Resizable=n(1384).default,t.exports.ResizableBox=n(1425).default},function(t,e,n){var r,i;window,t.exports=(r=n(0),i=n(65),function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){t.exports=n(5)()},function(t,e){t.exports=r},function(t,e){t.exports=i},function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&t.push(a)}else if("object"===o)for(var A in r)n.call(r,A)&&r[A]&&t.push(A)}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(r=function(){return i}.apply(e,[]))||(t.exports=r)}()},function(t,e,n){var r=n(7),i=r.default,o=r.DraggableCore;t.exports=i,t.exports.default=i,t.exports.DraggableCore=o},function(t,e,n){"use strict";var r=n(6);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,a){if(a!==r){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=n(0),a=n.n(o),A=n(2),s=n.n(A),c=n(3),u=n.n(c);function l(t,e){for(var n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function g(t){return"function"==typeof t||"[object Function]"===Object.prototype.toString.call(t)}function f(t){return"number"==typeof t&&!isNaN(t)}function h(t){return parseInt(t,10)}function d(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var I=["Moz","Webkit","O","ms"];function p(t,e){return e?"".concat(e).concat(function(t){for(var e="",n=!0,r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):"-"===t[r]?n=!0:e+=t[r];return e}(t)):t}var C=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var e=window.document.documentElement.style;if(t in e)return"";for(var n=0;n<I.length;n++)if(p(t,I[n])in e)return I[n];return""}();function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var B="";function m(t,e){return B||(B=l(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(e){return g(t[e])}))),!!g(t[B])&&t[B](e)}function b(t,e,n){var r=t;do{if(m(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function E(t,e,n){t&&(t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener?t.addEventListener(e,n,!0):t["on"+e]=n)}function Q(t,e,n){t&&(t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener?t.removeEventListener(e,n,!0):t["on"+e]=null)}function F(t){var e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return(e+=h(n.borderTopWidth))+h(n.borderBottomWidth)}function w(t){var e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return(e+=h(n.borderLeftWidth))+h(n.borderRightWidth)}function S(t){var e=t.clientHeight,n=t.ownerDocument.defaultView.getComputedStyle(t);return(e-=h(n.paddingTop))-h(n.paddingBottom)}function R(t){var e=t.clientWidth,n=t.ownerDocument.defaultView.getComputedStyle(t);return(e-=h(n.paddingLeft))-h(n.paddingRight)}function U(t,e,n){var r=t.x,i=t.y,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(e){var a="".concat("string"==typeof e.x?e.x:e.x+n),A="".concat("string"==typeof e.y?e.y:e.y+n);o="translate(".concat(a,", ").concat(A,")")+o}return o}function x(t){if(t){var e,n,r=t.getElementById("react-draggable-style-el");r||((r=t.createElement("style")).type="text/css",r.id="react-draggable-style-el",r.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",r.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",t.getElementsByTagName("head")[0].appendChild(r)),t.body&&(n="react-draggable-transparent-selection",(e=t.body).classList?e.classList.add(n):e.className.match(new RegExp("(?:^|\\s)".concat(n,"(?!\\S)")))||(e.className+=" ".concat(n)))}}function k(t){try{t&&t.body&&(e=t.body,n="react-draggable-transparent-selection",e.classList?e.classList.remove(n):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(n,"(?!\\S)"),"g"),"")),t.selection?t.selection.empty():window.getSelection().removeAllRanges()}catch(t){}var e,n}function O(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(n,!0).forEach((function(e){v(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({touchAction:"none"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function N(t){return"both"===t.props.axis||"x"===t.props.axis}function D(t){return"both"===t.props.axis||"y"===t.props.axis}function G(t,e,n){var r="number"==typeof e?function(t,e){return t.targetTouches&&l(t.targetTouches,(function(t){return e===t.identifier}))||t.changedTouches&&l(t.changedTouches,(function(t){return e===t.identifier}))}(t,e):null;if("number"==typeof e&&!r)return null;var i=T(n);return function(t,e,n){var r=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect();return{x:(t.clientX+e.scrollLeft-r.left)/n,y:(t.clientY+e.scrollTop-r.top)/n}}(r||t,n.props.offsetParent||i.offsetParent||i.ownerDocument.body,n.props.scale)}function _(t,e,n){var r=t.state,i=!f(r.lastX),o=T(t);return i?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:n}}function M(t,e){var n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function T(t){var e=s.a.findDOMNode(t);if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function P(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function W(t,e){return(W=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var H={start:"touchstart",move:"touchmove",stop:"touchend"},Y={start:"mousedown",move:"mousemove",stop:"mouseup"},X=Y,z=function(t){function e(){var t,n,r,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,a=new Array(o),A=0;A<o;A++)a[A]=arguments[A];return r=this,i=(t=Z(e)).call.apply(t,[this].concat(a)),n=!i||"object"!==j(i)&&"function"!=typeof i?P(r):i,J(P(n),"state",{dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null}),J(P(n),"handleDragStart",(function(t){if(n.props.onMouseDown(t),!n.props.allowAnyClick&&"number"==typeof t.button&&0!==t.button)return!1;var e=s.a.findDOMNode(P(n));if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var r=e.ownerDocument;if(!(n.props.disabled||!(t.target instanceof r.defaultView.Node)||n.props.handle&&!b(t.target,n.props.handle,e)||n.props.cancel&&b(t.target,n.props.cancel,e))){var i=function(t){return t.targetTouches&&t.targetTouches[0]?t.targetTouches[0].identifier:t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].identifier:void 0}(t);n.setState({touchIdentifier:i});var o=G(t,i,P(n));if(null!=o){var a=o.x,A=o.y,c=_(P(n),a,A);n.props.onStart,!1!==n.props.onStart(t,c)&&(n.props.enableUserSelectHack&&x(r),n.setState({dragging:!0,lastX:a,lastY:A}),E(r,X.move,n.handleDrag),E(r,X.stop,n.handleDragStop))}}})),J(P(n),"handleDrag",(function(t){"touchmove"===t.type&&t.preventDefault();var e=G(t,n.state.touchIdentifier,P(n));if(null!=e){var r,i,o,a=e.x,A=e.y;if(Array.isArray(n.props.grid)){var s=a-n.state.lastX,c=A-n.state.lastY,u=L((r=n.props.grid,i=s,o=c,[Math.round(i/r[0])*r[0],Math.round(o/r[1])*r[1]]),2);if(s=u[0],c=u[1],!s&&!c)return;a=n.state.lastX+s,A=n.state.lastY+c}var l=_(P(n),a,A);if(!1!==n.props.onDrag(t,l))n.setState({lastX:a,lastY:A});else try{n.handleDragStop(new MouseEvent("mouseup"))}catch(t){var g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.handleDragStop(g)}}})),J(P(n),"handleDragStop",(function(t){if(n.state.dragging){var e=G(t,n.state.touchIdentifier,P(n));if(null!=e){var r=e.x,i=e.y,o=_(P(n),r,i),a=s.a.findDOMNode(P(n));a&&n.props.enableUserSelectHack&&k(a.ownerDocument),n.setState({dragging:!1,lastX:NaN,lastY:NaN}),n.props.onStop(t,o),a&&(Q(a.ownerDocument,X.move,n.handleDrag),Q(a.ownerDocument,X.stop,n.handleDragStop))}}})),J(P(n),"onMouseDown",(function(t){return X=Y,n.handleDragStart(t)})),J(P(n),"onMouseUp",(function(t){return X=Y,n.handleDragStop(t)})),J(P(n),"onTouchStart",(function(t){return X=H,n.handleDragStart(t)})),J(P(n),"onTouchEnd",(function(t){return X=H,n.handleDragStop(t)})),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&W(t,e)}(e,i.a.Component),n=e,(r=[{key:"componentWillUnmount",value:function(){var t=s.a.findDOMNode(this);if(t){var e=t.ownerDocument;Q(e,Y.move,this.handleDrag),Q(e,H.move,this.handleDrag),Q(e,Y.stop,this.handleDragStop),Q(e,H.stop,this.handleDragStop),this.props.enableUserSelectHack&&k(e)}}},{key:"render",value:function(){return i.a.cloneElement(i.a.Children.only(this.props.children),{style:O(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&V(n.prototype,r),e}();function K(t){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q(){return(q=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$(n,!0).forEach((function(e){at(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function et(t){return(et=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function it(t,e,n){return e&&rt(t.prototype,e),n&&rt(t,n),t}function ot(t,e){return(ot=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function at(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}J(z,"displayName","DraggableCore"),J(z,"propTypes",{allowAnyClick:a.a.bool,disabled:a.a.bool,enableUserSelectHack:a.a.bool,offsetParent:function(t,e){if(t[e]&&1!==t[e].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:a.a.arrayOf(a.a.number),handle:a.a.string,cancel:a.a.string,onStart:a.a.func,onDrag:a.a.func,onStop:a.a.func,onMouseDown:a.a.func,scale:a.a.number,className:d,style:d,transform:d}),J(z,"defaultProps",{allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),n.d(e,"default",(function(){return At})),n.d(e,"DraggableCore",(function(){return z}));var At=function(t){function e(t){var n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=et(e).call(this,t),n=!r||"object"!==K(r)&&"function"!=typeof r?nt(this):r,at(nt(n),"onDragStart",(function(t,e){if(!1===n.props.onStart(t,M(nt(n),e)))return!1;n.setState({dragging:!0,dragged:!0})})),at(nt(n),"onDrag",(function(t,e){if(!n.state.dragging)return!1;var r=M(nt(n),e),i={x:r.x,y:r.y};if(n.props.bounds){var o=i.x,a=i.y;i.x+=n.state.slackX,i.y+=n.state.slackY;var A=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(function(t,e,n){if(!t.props.bounds)return[e,n];var r=t.props.bounds;r="string"==typeof r?r:function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}(r);var i=T(t);if("string"==typeof r){var o,a=i.ownerDocument,A=a.defaultView;if(!((o="parent"===r?i.parentNode:a.querySelector(r))instanceof A.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');var s=A.getComputedStyle(i),c=A.getComputedStyle(o);r={left:-i.offsetLeft+h(c.paddingLeft)+h(s.marginLeft),top:-i.offsetTop+h(c.paddingTop)+h(s.marginTop),right:R(o)-w(i)-i.offsetLeft+h(c.paddingRight)-h(s.marginRight),bottom:S(o)-F(i)-i.offsetTop+h(c.paddingBottom)-h(s.marginBottom)}}return f(r.right)&&(e=Math.min(e,r.right)),f(r.bottom)&&(n=Math.min(n,r.bottom)),f(r.left)&&(e=Math.max(e,r.left)),f(r.top)&&(n=Math.max(n,r.top)),[e,n]}(nt(n),i.x,i.y),2),s=A[0],c=A[1];i.x=s,i.y=c,i.slackX=n.state.slackX+(o-i.x),i.slackY=n.state.slackY+(a-i.y),r.x=i.x,r.y=i.y,r.deltaX=i.x-n.state.x,r.deltaY=i.y-n.state.y}if(!1===n.props.onDrag(t,r))return!1;n.setState(i)})),at(nt(n),"onDragStop",(function(t,e){if(!n.state.dragging)return!1;if(!1===n.props.onStop(t,M(nt(n),e)))return!1;var r={dragging:!1,slackX:0,slackY:0};if(Boolean(n.props.position)){var i=n.props.position,o=i.x,a=i.y;r.x=o,r.y=a}n.setState(r)})),n.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:tt({},t.position),slackX:0,slackY:0,isElementSVG:!1},!t.position||t.onDrag||t.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ot(t,e)}(e,i.a.Component),it(e,null,[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.position,r=e.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:{x:n.x,y:n.y,prevPropsPosition:tt({},n)}}}]),it(e,[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&s.a.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"render",value:function(){var t,e=this.props,n=(e.axis,e.bounds,e.children),r=e.defaultPosition,o=e.defaultClassName,a=e.defaultClassNameDragging,A=e.defaultClassNameDragged,s=e.position,c=e.positionOffset,l=(e.scale,function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(e,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),g={},f=null,h=!Boolean(s)||this.state.dragging,d=s||r,I={x:N(this)&&h?this.state.x:d.x,y:D(this)&&h?this.state.y:d.y};this.state.isElementSVG?f=function(t,e){return U(t,e,"")}(I,c):g=function(t,e){var n=U(t,e,"px");return v({},p("transform",C),n)}(I,c);var y=u()(n.props.className||"",o,(at(t={},a,this.state.dragging),at(t,A,this.state.dragged),t));return i.a.createElement(z,q({},l,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),i.a.cloneElement(i.a.Children.only(n),{className:y,style:tt({},n.props.style,{},g),transform:f}))}}]),e}();at(At,"displayName","Draggable"),at(At,"propTypes",tt({},z.propTypes,{axis:a.a.oneOf(["both","x","y","none"]),bounds:a.a.oneOfType([a.a.shape({left:a.a.number,right:a.a.number,top:a.a.number,bottom:a.a.number}),a.a.string,a.a.oneOf([!1])]),defaultClassName:a.a.string,defaultClassNameDragging:a.a.string,defaultClassNameDragged:a.a.string,defaultPosition:a.a.shape({x:a.a.number,y:a.a.number}),positionOffset:a.a.shape({x:a.a.oneOfType([a.a.number,a.a.string]),y:a.a.oneOfType([a.a.number,a.a.string])}),position:a.a.shape({x:a.a.number,y:a.a.number}),className:d,style:d,transform:d})),at(At,"defaultProps",tt({},z.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}))}]))},function(t,e,n){"use strict";e.__esModule=!0,e.cloneElement=function(t,e){e.style&&t.props.style&&(e.style=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t.props.style,{},e.style));e.className&&t.props.className&&(e.className=t.props.className+" "+e.className);return i.default.cloneElement(t,e)};var r,i=(r=n(0))&&r.__esModule?r:{default:r};function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=a(n(0)),i=a(n(20)),o=a(n(1384));function a(t){return t&&t.__esModule?t:{default:t}}function A(){return(A=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return c(s(e=t.call.apply(t,[this].concat(r))||this),"state",{width:e.props.width,height:e.props.height,propsWidth:e.props.width,propsHeight:e.props.height}),c(s(e),"onResize",(function(t,n){var r=n.size;r.width,r.height;e.props.onResize?(t.persist&&t.persist(),e.setState(r,(function(){return e.props.onResize&&e.props.onResize(t,n)}))):e.setState(r)})),e}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i.getDerivedStateFromProps=function(t,e){return e.propsWidth!==t.width||e.propsHeight!==t.height?{width:t.width,height:t.height,propsWidth:t.width,propsHeight:t.height}:null},i.prototype.render=function(){var t=this.props,e=t.handle,n=t.handleSize,i=(t.onResize,t.onResizeStart),a=t.onResizeStop,s=t.draggableOpts,c=t.minConstraints,u=t.maxConstraints,l=t.lockAspectRatio,g=t.axis,f=(t.width,t.height,t.resizeHandles),h=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles"]);return r.default.createElement(o.default,{handle:e,handleSize:n,width:this.state.width,height:this.state.height,onResizeStart:i,onResize:this.onResize,onResizeStop:a,draggableOpts:s,minConstraints:c,maxConstraints:u,lockAspectRatio:l,axis:g,resizeHandles:f},r.default.createElement("div",A({style:{width:this.state.width+"px",height:this.state.height+"px"}},h)))},i}(r.default.Component);e.default=u,c(u,"propTypes",{height:i.default.number,width:i.default.number}),c(u,"defaultProps",{handleSize:[20,20]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(20)),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var a={className:r.default.string,style:r.default.object,width:r.default.number,autoSize:r.default.bool,cols:r.default.number,draggableCancel:r.default.string,draggableHandle:r.default.string,verticalCompact:function(t){t.verticalCompact,0},compactType:r.default.oneOf(["vertical","horizontal"]),layout:function(t){var e=t.layout;void 0!==e&&n(926).validateLayout(e,"layout")},margin:r.default.arrayOf(r.default.number),containerPadding:r.default.arrayOf(r.default.number),rowHeight:r.default.number,maxRows:r.default.number,isBounded:r.default.bool,isDraggable:r.default.bool,isResizable:r.default.bool,preventCollision:r.default.bool,useCSSTransforms:r.default.bool,transformScale:r.default.number,isDroppable:r.default.bool,resizeHandles:r.default.arrayOf(r.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),onLayoutChange:r.default.func,onDragStart:r.default.func,onDrag:r.default.func,onDragStop:r.default.func,onResizeStart:r.default.func,onResize:r.default.func,onResizeStop:r.default.func,onDrop:r.default.func,droppingItem:r.default.shape({i:r.default.string.isRequired,w:r.default.number.isRequired,h:r.default.number.isRequired}),children:function(t,e){var n=t[e],r={};i.default.Children.forEach(n,(function(t){if(r[t.key])throw new Error('Duplicate child key "'+t.key+'" found! This will cause problems in ReactGridLayout.');r[t.key]=!0}))},innerRef:r.default.any};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==l(t)&&"function"!==typeof t)return{default:t};var e=u();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}n.default=t,e&&e.set(t,n);return n}(n(0)),i=c(n(20)),o=c(n(1136)),a=n(926),A=n(1385),s=c(n(1380));function c(t){return t&&t.__esModule?t:{default:t}}function u(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}function l(t){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(){return(g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function f(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e){return(C=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m(t);if(e){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(t,e){return!e||"object"!==l(e)&&"function"!==typeof e?B(t):e}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=function(t){return Object.prototype.toString.call(t)};function Q(t,e){return null==t?null:Array.isArray(t)?t:t[e]}var F=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)}(u,t);var e,n,i,c=y(u);function u(){var t;I(this,u);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return b(B(t=c.call.apply(c,[this].concat(n))),"state",t.generateInitialState()),b(B(t),"onLayoutChange",(function(e){t.props.onLayoutChange(e,d(d({},t.props.layouts),{},b({},t.state.breakpoint,e)))})),t}return e=u,i=[{key:"getDerivedStateFromProps",value:function(t,e){if(!(0,o.default)(t.layouts,e.layouts)){var n=e.breakpoint,r=e.cols;return{layout:(0,A.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,n,n,r,t.compactType),layouts:t.layouts}}return null}}],(n=[{key:"generateInitialState",value:function(){var t=this.props,e=t.width,n=t.breakpoints,r=t.layouts,i=t.cols,o=(0,A.getBreakpointFromWidth)(n,e),a=(0,A.getColsFromBreakpoint)(o,i),s=!1===this.props.verticalCompact?null:this.props.compactType;return{layout:(0,A.findOrGenerateResponsiveLayout)(r,n,o,o,a,s),breakpoint:o,cols:a}}},{key:"componentDidUpdate",value:function(t){this.props.width==t.width&&this.props.breakpoint===t.breakpoint&&(0,o.default)(this.props.breakpoints,t.breakpoints)&&(0,o.default)(this.props.cols,t.cols)||this.onWidthChange(t)}},{key:"onWidthChange",value:function(t){var e=this.props,n=e.breakpoints,r=e.cols,i=e.layouts,o=e.compactType,s=this.props.breakpoint||(0,A.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),c=this.state.breakpoint,u=(0,A.getColsFromBreakpoint)(s,r),l=d({},i);if(c!==s||t.breakpoints!==n||t.cols!==r){c in l||(l[c]=(0,a.cloneLayout)(this.state.layout));var g=(0,A.findOrGenerateResponsiveLayout)(l,n,s,c,u,o);g=(0,a.synchronizeLayoutWithChildren)(g,this.props.children,u,o),l[s]=g,this.props.onLayoutChange(g,l),this.props.onBreakpointChange(s,u),this.setState({breakpoint:s,layout:g,cols:u})}var f=Q(this.props.margin,s),h=Q(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,f,u,h)}},{key:"render",value:function(){var t=this.props,e=(t.breakpoint,t.breakpoints,t.cols,t.layouts,t.margin),n=t.containerPadding,i=(t.onBreakpointChange,t.onLayoutChange,t.onWidthChange,f(t,["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"]));return r.createElement(s.default,g({},i,{margin:Q(e,this.state.breakpoint),containerPadding:Q(n,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}])&&p(e.prototype,n),i&&p(e,i),u}(r.Component);e.default=F,b(F,"propTypes",{breakpoint:i.default.string,breakpoints:i.default.object,cols:i.default.object,margin:i.default.oneOfType([i.default.array,i.default.object]),containerPadding:i.default.oneOfType([i.default.array,i.default.object]),layouts:function(t,e){if("[object Object]"!==E(t[e]))throw new Error("Layout property must be an object. Received: "+E(t[e]));Object.keys(t[e]).forEach((function(e){if(!(e in t.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,a.validateLayout)(t.layouts[e],"layouts."+e)}))},width:i.default.number.isRequired,onBreakpointChange:i.default.func,onLayoutChange:i.default.func,onWidthChange:i.default.func}),b(F,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},layouts:{},margin:[10,10],containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},onBreakpointChange:a.noop,onLayoutChange:a.noop,onWidthChange:a.noop})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,n;return n=e=function(e){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(i,e);var n=function(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d(t);if(e){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}(i);function i(){var t;u(this,i);for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return I(h(t=n.call.apply(n,[this].concat(r))),"state",{width:1280}),I(h(t),"mounted",!1),I(h(t),"onWindowResize",(function(){if(t.mounted){var e=o.default.findDOMNode(h(t));e instanceof HTMLElement&&t.setState({width:e.offsetWidth})}})),t}return function(t,e,n){e&&l(t.prototype,e);n&&l(t,n)}(i,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),this.onWindowResize()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize)}},{key:"render",value:function(){var e=this.props,n=e.measureBeforeMount,i=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(e,["measureBeforeMount"]);return n&&!this.mounted?r.createElement("div",{className:this.props.className,style:this.props.style}):r.createElement(t,c({},i,this.state))}}]),i}(r.Component),I(e,"defaultProps",{measureBeforeMount:!1}),I(e,"propTypes",{measureBeforeMount:i.default.bool}),n};var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==s(t)&&"function"!==typeof t)return{default:t};var e=A();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}n.default=t,e&&e.set(t,n);return n}(n(0)),i=a(n(20)),o=a(n(65));function a(t){return t&&t.__esModule?t:{default:t}}function A(){if("function"!==typeof WeakMap)return null;var t=new WeakMap;return A=function(){return t},t}function s(t){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){},function(t,e,n){},function(t,e,n){},,,,,,function(t,e,n){"use strict";n.r(e);var r=n(1116),i=n(1117),o=n(1118),a=n(12),A=n(0),s=n.n(A),c=n(11),u=n(14),l=n(24),g=n(25),f=n(1362),h=n(84),d=n.n(h),I=n(18),p=n(92);function C(t,e){for(var n=[],r=0;r<t.length;r++)n.push(t[r+1]-t[r]);return Object.entries(e).map((function(e){var r,i=Object(a.a)(e,2),o=i[0],A=i[1];return{i:o,y:A.y,h:A.h||1,x:t[A.x],w:(r=n.slice(A.x,A.x+(A.w||1)),r.reduce((function(t,e){return t+e}),0))}}))}var y=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"componentDidUpdate",value:function(t){this.props.height!==t.height&&this.onWindowResize()}}]),n}(Object(f.WidthProvider)(f.Responsive));function v(t){var e,n=t.layout,r=t.getComponent,i=t.padding,o=t.margin,A=t.draggableHandle,c=t.reactGridLayoutProps,u=t.rowHeight,l=t.theme,g=t.height,f=t.onRemoveComponent,h=t.onLayoutChange,v=function(t){var e={},n={},r={},i={},o={};if(("components"in t?t.components:t).forEach((function(t,e){var n="".concat("i").concat(e);i[n]={component:t.component,props:t.props||{},coordinationScopes:t.coordinationScopes||{}},o[n]={id:n,x:t.x,y:t.y,w:t.w,h:t.h}})),"components"in t)Object.entries(t.columns).forEach((function(t){var i=Object(a.a)(t,2),A=i[0],s=i[1];e[A]=s[s.length-1],n[A]=C(s,o),r[A]=A}));else{e.ID=12,n.ID=C(Object(p.e)(13),o),r.ID=1e3}return{cols:e,layouts:n,breakpoints:r,components:i}}(n),B=v.cols,m=v.layouts,b=v.breakpoints,E=v.components,Q=(e=m,Math.max.apply(Math,Object(I.a)(Object.values(e).map((function(t){return Math.max.apply(Math,Object(I.a)(t.map((function(t){return t.y+t.h}))))}))))),F=s.a.createElement("style",null,"\n        ".concat(A," {\n          cursor: grab;\n        }\n        ").concat(A,":active {\n          cursor: grabbing;\n        }\n     ")),w=Object.entries(E).map((function(t,e){var n=Object(a.a)(t,2),i=n[0],o=n[1],A=r(o.component);return s.a.createElement("div",{key:i},s.a.createElement(A,Object.assign({},o.props,{uuid:e,coordinationScopes:o.coordinationScopes,theme:l,removeGridComponent:function(){f(e)}})))}));return m&&E&&b&&B&&s.a.createElement(s.a.Fragment,null,F,s.a.createElement(y,Object.assign({className:"layout",cols:B,layouts:m,breakpoints:b,height:g,rowHeight:u||(window.innerHeight-2*i-(Q-1)*o)/Q,containerPadding:[i,i],margin:[o,o],draggableHandle:A,onLayoutChange:function(t){if(t.length===Object.entries(E).length){var e=[];t.forEach((function(t){var n=t.i,r=E[n];if(r){var i=parseInt(n.substring(n.indexOf("i")+1),10),o={x:t.x,y:t.y,w:t.w,h:t.h},a={x:r.x,y:r.y,w:r.w,h:r.h};d()(o,a)||e.push([i,o])}})),e.length>0&&h(e)}}},c),w))}v.defaultProps={padding:10,margin:10};var B=n(16),m=n(555),b=n.n(m),E=n(331),Q=n.n(E),F=function(){function t(e){var n=e.type,r=e.url,i=e.requestInit,o=e.options;Object(c.a)(this,t),this.type=n,this.url=r,this.requestInit=i,this.options=o,this.subscriptions={}}return Object(u.a)(t,[{key:"load",value:function(){throw new Error("The load() method has not been implemented.")}},{key:"subscribe",value:function(t){var e=Q()();return this.subscriptions[e]=t,e}},{key:"unsubscribe",value:function(t){delete this.subscriptions[t]}},{key:"publish",value:function(t){Object.values(this.subscriptions).forEach((function(e){e(t)}))}}]),t}(),w=n(128),S=n(1387),R=n(1388),U=n(1389),x=n(840),k=n(335),O={cells:S,molecules:R,neighborhoods:U,raster:x,"cell-sets":k},N=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this,t);var i=t.type;return r.schema=O[i],r}return Object(u.a)(n,[{key:"load",value:function(){var t=this,e=this.url,n=this.requestInit,r=this.type,i=this.fileType;return this.data||(this.data=fetch(e,n).then((function(t){return t.ok?t.json():Promise.reject(new w.b(r,i,e,t.headers))})).catch((function(t){return Promise.resolve(t)})).then((function(n){if(n instanceof w.a)return Promise.reject(n);var o=t.validate(n),A=Object(a.a)(o,2),s=A[0],c=A[1];return s?Promise.resolve({data:n,url:e}):Promise.reject(new w.d(r,i,e,c))}))),this.data}},{key:"validate",value:function(t){var e=this.schema,n=this.type;if(!e)throw Error("No schema for ".concat(n));var r,i=(new b.a).compile(e),o=i(t);return o||(r=i.errors),[o,r]}}]),n}(F),D=n(61),G=n(126),_=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this,t);var i=Object(D.a)(r),o=i.url;i.requestInit;return r.store=new G.c(o),r}return Object(u.a)(n,[{key:"loadAttrs",value:function(){var t=this.store;return this.attrs||(this.attrs=t.getItem(".zattrs").then((function(t){var e=new TextDecoder("utf-8");return JSON.parse(e.decode(t))}))),this.attrs}},{key:"loadArr",value:function(){var t=this.store;return this.arr||(this.arr=Object(G.e)({store:t,path:"/",mode:"r"}).then((function(t){return new Promise((function(e){t.getRaw([null,null]).then(e)}))}))),this.arr}},{key:"load",value:function(){return Promise.all([this.loadAttrs(),this.loadArr()]).then((function(t){return Promise.resolve({data:t,url:null})}))}}]),n}(F),M=n(5),T=n.n(M),j=n(21),L=n(74),V=n(90),Z=n(1390),P=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;return Object(c.a)(this,n),(r=e.call(this,t)).schema=Z,r}return Object(u.a)(n,[{key:"load",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,r,i,o,a,A,s,c;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(Object(L.a)(n.prototype),"load",this).call(this).catch((function(t){return Promise.resolve(t)}));case 2:if(!((e=t.sent)instanceof w.a)){t.next=5;break}return t.abrupt("return",Promise.reject(e));case 5:return r=e.data,i=e.url,o=Object.keys(r),a=o.length>0?Object.keys(r[o[0]].cells):[],A={rows:a,cols:o},s=a.flatMap((function(t){return o.map((function(e){return r[e].cells[t]/r[e].max*255}))})),c={data:Uint8Array.from(s)},t.abrupt("return",Promise.resolve({data:[A,c],url:i}));case 12:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(N),W=n(1415),J=n(308),H=n.n(J),Y=n(1391),X=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;return Object(c.a)(this,n),(r=e.call(this,t)).schema=Y,r}return Object(u.a)(n,[{key:"load",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,r,i,o,A,s,c,u,l,g,f,h;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(Object(L.a)(n.prototype),"load",this).call(this).catch((function(t){return Promise.resolve(t)}));case 2:if(!((e=t.sent)instanceof w.a)){t.next=5;break}return t.abrupt("return",Promise.reject(e));case 5:return r=e.data,i=e.url,o=r.rows,A=r.cols,s=r.matrix,u=[(c={rows:A,cols:o}).rows.length,c.cols.length],l=s.map((function(t){var e=Object(W.a)(t),n=Object(a.a)(e,2),r=n[0],i=n[1];return t.map((function(t){return Math.floor((t-r)/(i-r)*255)}))})),g=H()(u[0]).map((function(t){return H()(u[1]).map((function(e){return l[e][t]}))})),f=g.flat(),h={data:Uint8Array.from(f)},t.abrupt("return",Promise.resolve({data:[c,h],url:i}));case 14:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(N),z=n(26),K=n(185);function q(t){return $.apply(this,arguments)}function $(){return($=Object(j.a)(T.a.mark((function t(e){var n,r,i,o,a,A,s,c,u,l,g,f,h,d,I,p,C,y;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.type,r=e.url,i=e.metadata,o=e.requestInit,t.t0=n,t.next="zarr"===t.t0?4:"ome-tiff"===t.t0?10:26;break;case 4:return A=(a=i||{}).dimensions,s=a.isPyramid,c=a.transform,u=c.scale,l=void 0===u?0:u,g=c.translate,f=void 0===g?{x:0,y:0}:g,t.next=8,Object(K.g)({url:r,dimensions:A,isPyramid:s,scale:l,translate:f});case 8:return h=t.sent,t.abrupt("return",h);case 10:if(!i||!("omeTiffOffsetsUrl"in i)){t.next=24;break}return d=i.omeTiffOffsetsUrl,t.next=14,fetch(d,o);case 14:if(!(I=t.sent).ok){t.next=23;break}return t.next=18,I.json();case 18:return p=t.sent,t.next=21,Object(K.f)({urlOrFile:r,offsets:p,headers:o});case 21:return C=t.sent,t.abrupt("return",C);case 23:throw new Error("Offsets not found but provided.");case 24:return y=Object(K.f)({urlOrFile:r,headers:o}),t.abrupt("return",y);case 26:throw Error("Image type (".concat(n,") is not supported"));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tt,et=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this,t);var i=t.url,o=t.options;return!i&&o&&(r.url=URL.createObjectURL(new Blob([JSON.stringify(o)])),r.options=void 0),r.schema=x,r}return Object(u.a)(n,[{key:"load",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,r,i,o,a,A,s,c;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(Object(L.a)(n.prototype),"load",this).call(this).catch((function(t){return Promise.resolve(t)}));case 2:if(!((e=t.sent)instanceof w.a)){t.next=5;break}return t.abrupt("return",Promise.reject(e));case 5:return r=e.data,i=r.images,o=r.renderLayers,a=r.usePhysicalSizeScaling,A=void 0!==a&&a,s=i.filter((function(t){return!t.url.includes("zarr")})).map((function(t){return[t.url,t.name]})),c=i.map((function(t){return Object(z.a)({},t,{loaderCreator:function(){var e=Object(j.a)(T.a.mark((function e(){var n;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()})})),t.abrupt("return",Promise.resolve({data:{layers:c,renderLayers:o,usePhysicalSizeScaling:A},urls:s}));case 10:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(N),nt=n(384),rt=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;return Object(c.a)(this,n),(r=e.call(this,t)).schema=k,r}return Object(u.a)(n,[{key:"load",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,r,i,o;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(V.a)(Object(L.a)(n.prototype),"load",this).call(this).catch((function(t){return Promise.resolve(t)}));case 2:if(!((e=t.sent)instanceof w.a)){t.next=5;break}return t.abrupt("return",Promise.reject(e));case 5:return r=e.data,i=e.url,o=Object(nt.f)(r,"cell"),t.abrupt("return",Promise.resolve({data:o,url:i}));case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(N),it=n(121),ot=n(85),at=n(377),At=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this,t);var i=Object(D.a)(r),o=i.url;i.requestInit;return r.store=new G.c(o),r}return Object(u.a)(n,[{key:"getJson",value:function(){var t=Object(j.a)(T.a.mark((function t(e){var n,r;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.store.getItem(e);case 3:return n=t.sent,r=(new TextDecoder).decode(n),t.abrupt("return",JSON.parse(r));case 8:if(t.prev=8,t.t0=t.catch(0),!(t.t0 instanceof G.d)){t.next=12;break}return t.abrupt("return",{});case 12:throw t.t0;case 13:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e){return t.apply(this,arguments)}}()},{key:"decodeTextArray",value:function(t){return(new TextDecoder).decode(t.slice(4)).replace(/[\u0000-\u001c]|\ufffdc/g,",").split(",").filter(Boolean)}},{key:"loadCellSetIds",value:function(t){var e=this,n=this.store;return this.cellSets||(this.cellSets=Promise.all(t.map(function(){var t=Object(j.a)(T.a.mark((function t(r){var i,o,a,A,s,c,u;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getJson("".concat(r,"/.zattrs"));case 2:if(i=t.sent,!(o=i.categories)){t.next=8;break}return t.next=7,e.getFlatTextArr("/obs/".concat(o));case 7:a=t.sent;case 8:return t.next=10,Object(G.e)({store:n,path:r,mode:"r"});case 10:return A=t.sent,t.next=13,A.get();case 13:return s=t.sent,c=s.data,u=Object(at.a)(Array,Object(I.a)(c)).map((function(t){return a?a[t]:t})),t.abrupt("return",u);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()))),this.cellSets}},{key:"loadNumeric",value:function(t){var e=this.store;return Object(G.e)({store:e,path:t,mode:"r"}).then((function(t){return t.get()}))}},{key:"getFlatArrDecompressed",value:function(t){var e=this.store;return Object(G.e)({store:e,path:t,mode:"r"}).then(function(){var t=Object(j.a)(T.a.mark((function t(n){var r,i,o,a,A;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Uint8Array,i=0;case 2:return t.prev=3,t.next=6,e.getItem("".concat(n.keyPrefix).concat(String(i)));case 6:return o=t.sent,t.next=9,n.compressor.decode(o);case 9:a=t.sent,(A=new Uint8Array(a.buffer.byteLength+r.buffer.byteLength)).set(new Uint8Array(r.buffer),0),A.set(a,r.buffer.byteLength),r=A,i+=1,t.next=22;break;case 17:if(t.prev=17,t.t0=t.catch(3),!(t.t0 instanceof G.d)){t.next=21;break}return t.abrupt("break",24);case 21:throw t.t0;case 22:t.next=2;break;case 24:return t.abrupt("return",r);case 25:case"end":return t.stop()}}),t,null,[[3,17]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"getFlatTextArr",value:function(t){var e=this;return this.getFlatArrDecompressed(t).then((function(t){return e.decodeTextArray(t)}))}},{key:"loadCellNames",value:function(){var t=this;return this.cellNames||(this.cellNames=this.getJson("obs/.zattrs").then((function(e){var n=e._index;return t.getFlatTextArr("/obs/".concat(n))}))),this.cellNames}}]),n}(F),st={CellSetsZarrLoader:function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"load",value:function(){var t=this.options,e=t.map((function(t){return t.setName}));return Promise.all([this.loadCellNames(),this.loadCellSetIds(e)]).then((function(e){var n=Object(a.a)(e,2),r=n[0],i=n[1],o=Object(it.m)(ot.h);return i.forEach((function(e,n){var i={name:t[n].groupName,children:[]},a=Array.apply(void 0,Object(I.a)(new Set(e))).sort(),A={};a.forEach((function(t){return A[t]={name:t,set:[]}})),e.forEach((function(t,e){return A[t].set.push([r[e],null])})),Object.values(A).forEach((function(t){return i=Object(it.d)(i,t)})),o.tree.push(i)})),Promise.resolve({data:o,url:null})}))}}]),n}(At),CellsZarrLoader:function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"loadXy",value:function(){var t=this.options.xy;return this.xy?this.xy:!this.xy&&t?(this.xy=this.loadNumeric(t),this.xy):(this.xy=Promise.resolve(null),this.xy)}},{key:"loadPoly",value:function(){var t=this.options.poly;return this.poly?this.poly:!this.poly&&t?(this.poly=this.loadNumeric(t),this.poly):(this.poly=Promise.resolve(null),this.poly)}},{key:"loadMappings",value:function(){var t=this,e=this.options.mappings;return this.mappings?this.mappings:!this.mappings&&e?(this.mappings=Promise.all(Object.keys(e).map(function(){var n=Object(j.a)(T.a.mark((function n(r){var i;return T.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e[r].key,n.t0=r,n.next=4,t.loadNumeric(i);case 4:return n.t1=n.sent,n.abrupt("return",{coordinationName:n.t0,arr:n.t1});case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}())),this.mappings):(this.mappings=Promise.resolve(null),this.mappings)}},{key:"loadFactors",value:function(){var t=this.options.factors;return this.loadCellSetIds(t)}},{key:"load",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,n,r,i,o,A,s,c,u=this;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this.loadMappings(),this.loadXy(),this.loadPoly(),this.loadCellNames(),this.loadFactors()]);case 2:return e=t.sent,n=Object(a.a)(e,5),r=n[0],i=n[1],o=n[2],A=n[3],s=n[4],c={},A.forEach((function(t,e){if(c[t]={},r&&r.forEach((function(n){var r=n.coordinationName,i=n.arr;c[t].mappings||(c[t].mappings={});var o=u.options.mappings[r].dims;c[t].mappings[r]=o.map((function(t){return i.data[e][t]}))})),i&&(c[t].xy=i.data[e]),o&&(c[t].poly=o.data[e]),s){var n={};s.forEach((function(t,r){return n[u.options.factors[r].split("/").slice(-1)]=t[e]})),c[t].factors=n}})),t.abrupt("return",Promise.resolve({data:c,url:null}));case 12:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),n}(At),MatrixZarrLoader:function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"_loadCSRSparseCellXGene",value:function(){var t=Object(j.a)(T.a.mark((function t(e,n){var r,i,o,A,s,c,u,l;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.store,t.next=3,Promise.all(["indptr","indices","data"].map(function(){var t=Object(j.a)(T.a.mark((function t(n){var i,o,a;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(G.e)({store:r,path:"".concat(e,"/").concat(n),mode:"r"});case 2:return i=t.sent,t.next=5,i.getRaw(null);case 5:return o=t.sent,a=o.data,t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return i=t.sent,o=Object(a.a)(i,3),A=o[0],s=o[1],c=o[2],u=new Float32Array(n[0]*n[1]).fill(0),l=0,A.forEach((function(t,e){for(var r=A[e],i=A[e+1],o=r;o<i;o+=1){var a=c[o],g=s[o];u[l*n[1]+g]=a}l+=1})),t.abrupt("return",{data:u});case 12:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_loadCSCSparseCellXGene",value:function(){var t=Object(j.a)(T.a.mark((function t(e,n){var r,i,o,A,s,c,u,l;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.store,t.next=3,Promise.all(["indptr","indices","data"].map(function(){var t=Object(j.a)(T.a.mark((function t(n){var i,o,a;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(G.e)({store:r,path:"".concat(e,"/").concat(n),mode:"r"});case 2:return i=t.sent,t.next=5,i.getRaw(null);case 5:return o=t.sent,a=o.data,t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return i=t.sent,o=Object(a.a)(i,3),A=o[0],s=o[1],c=o[2],u=new Float32Array(n[0]*n[1]).fill(0),l=0,A.forEach((function(t,e){for(var r=A[e],i=A[e+1],o=r;o<i;o+=1){var a=c[o],g=s[o];u[g*n[1]+l]=a}l+=1})),t.abrupt("return",{data:u});case 12:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"loadCellXGene",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,n,r,i;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.store,!this.arr){t.next=3;break}return t.abrupt("return",this.arr);case 3:return n=this.options.matrix,t.next=6,this.getJson("".concat(n,"/.zattrs"));case 6:if(r=t.sent,!(i=r["encoding-type"])){t.next=15;break}if("csr_matrix"!==i){t.next=12;break}return this.arr=this._loadCSRSparseCellXGene(n,r.shape),t.abrupt("return",this.arr);case 12:if("csc_matrix"!==i){t.next=15;break}return this.arr=this._loadCSCSparseCellXGene(n,r.shape),t.abrupt("return",this.arr);case 15:return this.arr=Object(G.e)({store:e,path:n,mode:"r"}).then((function(t){return new Promise((function(e){t.getRaw(null).then(e)}))})),t.abrupt("return",this.arr);case 17:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"loadGeneNames",value:function(){var t=Object(j.a)(T.a.mark((function t(){var e,n,r,i;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.geneNames){t.next=2;break}return t.abrupt("return",this.geneNames);case 2:if(!(e=this.options.geneFilter)){t.next=7;break}return t.next=6,this.getFlatArrDecompressed(e);case 6:n=t.sent;case 7:return t.next=9,this.getJson("var/.zattrs");case 9:if(r=t.sent,i=r._index,!this.geneNames){t.next=13;break}return t.abrupt("return",this.geneNames);case 13:return this.geneNames=this.getFlatTextArr("var/".concat(i)).then((function(t){return t.filter((function(t,e){return!n||n[e]}))})),t.abrupt("return",this.geneNames);case 15:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"load",value:function(){var t=this;return Promise.all([this.loadCellNames(),this.loadGeneNames(),this.loadCellXGene()]).then((function(e){var n=Object(a.a)(e,3),r=n[0],i=n[1],o=n[2].data,A={rows:r,cols:i};if(!t.min||!t.max){var s=Object(W.a)(o),c=Object(a.a)(s,2);t.min=c[0],t.max=c[1]}var u=255/(t.max-t.min);return{data:[A,{data:new Uint8Array(o.map((function(e){return Math.floor((e-t.min)*u)})))}],url:null}}))}}]),n}(At)},ct=function(t){Object(l.a)(n,t);var e=Object(g.a)(n);function n(t){var r;Object(c.a)(this,n),r=e.call(this,t);var i=Object(D.a)(r),o=i.url;i.requestInit;return r.store=new G.c(o),r}return Object(u.a)(n,[{key:"loadAttrs",value:function(){var t=this.store;return this.attrs||(this.attrs=t.getItem(".zattrs").then((function(t){var e=new TextDecoder("utf-8");return JSON.parse(e.decode(t))}))),this.attrs}},{key:"load",value:function(){var t=this.url;return this.loadAttrs().then((function(e){return Promise.resolve({data:e,url:t})}))}}]),n}(F),ut=(tt={"expression-matrix.zarr":_,"clusters.json":X,"genes.json":P,"cells.json":N,"molecules.json":N,"neighborhoods.json":N,"raster.json":et,"cell-sets.json":rt},Object(B.a)(tt,"".concat("anndata","-cell-sets.zarr"),st.CellSetsZarrLoader),Object(B.a)(tt,"".concat("anndata","-cells.zarr"),st.CellsZarrLoader),Object(B.a)(tt,"".concat("anndata","-expression-matrix.zarr"),st.MatrixZarrLoader),Object(B.a)(tt,"genomic-profiles.zarr",ct),tt);var lt=n(63);function gt(t){var e=t.rowHeight,n=t.config,r=t.getComponent,i=t.theme,o=t.height,c=function(t,e,n,r,i){var o=Object(A.useState)(n),s=Object(a.a)(o,2),c=s[0],u=s[1],l=Object(A.useState)(e),g=Object(a.a)(l,2),f=g[0],h=g[1],d=Object(A.useRef)();return Object(A.useEffect)((function(){var e=function(t){for(var e,n=0,r=0,i=t.length;r<i;r++)(e=t[r].y+t[r].h)>n&&(n=e);return n}(t.layout),n=function(t,e,n,r){return(t-2*r-(e-1)*n)/e}(c,e,r,i);h(n)}),[c,t,r,i]),Object(A.useEffect)((function(){null!==n&&void 0!==n&&u(n)}),[n]),Object(A.useEffect)((function(){if(null!==n&&void 0!==n)return function(){};function t(){if(d.current){var t=d.current.getBoundingClientRect();u(t.height)}}return window.addEventListener("resize",t),t(),function(){window.removeEventListener("resize",t)}}),[d,n]),[f,d]}(n,e,o,5,10),u=Object(a.a)(c,2),l=u[0],g=u[1],f=Object(lt.e)();Object(A.useEffect)((function(){f()}),[l,f]);var h=Object(lt.m)(),d=Object(lt.l)(),I=Object(lt.i)(),p=Object(lt.a)(),C=Object(lt.g)();return Object(A.useEffect)((function(){if(n){h(n);var t=function(t,e){var n={};return t.forEach((function(t){var r={name:t.name,description:t.description||e,loaders:{}};t.files.forEach((function(t){var e=ut[t.fileType]||N;r.loaders[t.type]=new e(t)})),n[t.uid]=r})),n}(n.datasets,n.description);d(t)}else d({})}),[n,h,d]),s.a.createElement("div",{ref:g,className:"vitessce-container vitessce-theme-".concat(i)},C&&s.a.createElement(v,{layout:C,height:o,rowHeight:l,theme:i,getComponent:r,draggableHandle:".title",margin:5,padding:10,onRemoveComponent:I,onLayoutChange:p,reactGridLayoutProps:{onResize:f,onResizeStop:f}}))}var ft="https://s3.amazonaws.com/vitessce-data/0.0.31/master_release";function ht(t){return function(e){return{name:e,type:e.toUpperCase(),fileType:"".concat(e,".json"),url:"".concat(ft,"/").concat(t,"/").concat(t,".").concat(e,".json")}}}var dt=["cells","cell-sets","raster","molecules","neighborhoods"],It="Spatial organization of the somatosensory cortex revealed by cyclic smFISH",pt={description:It,layers:[].concat(Object(I.a)(dt.map(ht("linnarsson"))),[Object(z.a)({},ht("linnarsson")("clusters"),{type:"EXPRESSION-MATRIX"})])},Ct={description:It,layers:dt.filter((function(t){return"clusters"!==t})).map(ht("linnarsson"))},yt="Giotto, a pipeline for integrative analysis and visualization of single-cell spatial transcriptomic data",vt={description:yt,layers:["cells","cell-sets"].map(ht("dries"))},Bt="Multiplexed imaging of high-density libraries of RNAs with MERFISH and expansion microscopy",mt={description:Bt,layers:[].concat(Object(I.a)(["cells","molecules"].map(ht("wang"))),[Object(z.a)({},ht("wang")("genes"),{name:"expression-matrix",type:"EXPRESSION-MATRIX"})])},bt={description:"High Bit Depth (uint16) Multiplex Immunofluorescence Imaging",layers:["raster"].map(ht("spraggins"))},Et={"just-scatter":{version:"0.1.0",public:!1,layers:[{name:"cells",type:"CELLS",fileType:"cells.json",url:"".concat(ft,"/linnarsson/linnarsson.cells.json"),requestInit:{method:"GET",headers:{"x-foo":"FAKE"},mode:"cors",credentials:"omit",cache:"no-store",redirect:"error",referrer:"FAKE",integrity:"FAKE"}}],name:"Linnarsson, just scatterplot",staticLayout:[{component:"scatterplot",props:{mapping:"t-SNE",view:{zoom:.75,target:[0,0,0]}},x:0,y:0,w:12,h:2}]},"just-scatter-expression":{version:"0.1.0",public:!1,layers:[{name:"cells",type:"CELLS",url:"https://s3.amazonaws.com/vitessce-data/0.0.20/master_release/linnarsson/linnarsson.cells.json"},{name:"genes",type:"GENES",url:"https://s3.amazonaws.com/vitessce-data/0.0.20/master_release/linnarsson/linnarsson.genes.json"}],name:"Linnarsson, just scatterplot and expression",staticLayout:[{component:"scatterplot",props:{mapping:"t-SNE",view:{zoom:.75,target:[0,0,0]}},x:0,y:0,w:8,h:2},{component:"genes",x:8,y:2,w:4,h:2}]},"linnarsson-2018":{name:"Linnarsson",version:"1.0.0",description:It,public:!0,datasets:[{uid:"linnarsson-2018",name:"Linnarsson 2018",description:"Linnarsson: ".concat(It),files:pt.layers.map((function(t){return{type:t.type.toLowerCase(),fileType:t.fileType,url:t.url}}))}],initStrategy:"auto",coordinationSpace:{embeddingZoom:{PCA:0,TSNE:.75},embeddingType:{PCA:"PCA",TSNE:"t-SNE"},spatialZoom:{A:-5.5},spatialTargetX:{A:16e3},spatialTargetY:{A:2e4}},layout:[{component:"description",x:0,y:0,w:2,h:1},{component:"layerController",x:0,y:1,w:2,h:4},{component:"status",x:0,y:5,w:2,h:1},{component:"spatial",coordinationScopes:{spatialZoom:"A",spatialTargetX:"A",spatialTargetY:"A"},x:2,y:0,w:4,h:4},{component:"genes",x:9,y:0,w:3,h:2},{component:"cellSets",x:9,y:3,w:3,h:2},{component:"heatmap",props:{transpose:!0},x:2,y:4,w:5,h:2},{component:"cellSetExpression",x:7,y:4,w:3,h:2},{component:"expressionHistogram",x:10,y:4,w:2,h:2},{component:"scatterplot",coordinationScopes:{embeddingType:"PCA",embeddingZoom:"PCA"},x:6,y:0,w:3,h:2},{component:"scatterplot",coordinationScopes:{embeddingType:"TSNE",embeddingZoom:"TSNE"},x:6,y:2,w:3,h:2}]},"linnarsson-2018-two-spatial":Object(z.a)({},pt,{version:"0.1.0",name:"Linnarsson (two spatial)",staticLayout:[{component:"spatial",props:{view:{zoom:-8,target:[18e3,18e3,0]}},x:0,y:0,w:5,h:2},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:2,w:5,h:2},{component:"spatial",props:{view:{zoom:-6,target:[18e3,18e3,0]}},x:5,y:0,w:5,h:2},{component:"scatterplot",props:{mapping:"PCA"},x:5,y:2,w:5,h:2},{component:"genes",x:10,y:2,w:2,h:2},{component:"heatmap",x:0,y:4,w:12}]}),"linnarsson-2018-just-spatial":Object(z.a)({},Ct,{version:"0.1.0",name:"Linnarsson (just spatial)",staticLayout:[{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:0,y:0,w:10,h:2},{component:"genes",x:10,y:1,w:2,h:1}]}),"linnarsson-2018-static":Object(z.a)({},pt,{version:"0.1.0",name:"Linnarsson (static layout)",staticLayout:[{component:"description",props:{description:"Linnarsson (static layout): ".concat(It)},x:0,y:0,w:3,h:1},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:2,w:3,h:2},{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:3,y:0,w:6,h:4},{component:"genes",x:9,y:2,w:3,h:2},{component:"heatmap",x:0,y:4,w:12,h:1}]}),"linnarsson-2018-dozen":Object(z.a)({},pt,{version:"0.1.0",name:"Linnarsson (static layout, redundant components for performance testing)",staticLayout:[{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:0,y:0,w:4,h:1},{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:0,y:1,w:4,h:1},{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:4,y:0,w:4,h:1},{component:"spatial",props:{view:{zoom:-6.5,target:[18e3,18e3,0]}},x:4,y:1,w:4,h:1},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:2,w:4,h:1},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:3,w:4,h:1},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:4,w:4,h:1},{component:"scatterplot",props:{mapping:"t-SNE"},x:0,y:5,w:4,h:1},{component:"scatterplot",props:{mapping:"PCA"},x:4,y:2,w:4,h:1},{component:"scatterplot",props:{mapping:"PCA"},x:4,y:3,w:4,h:1},{component:"scatterplot",props:{mapping:"PCA"},x:4,y:4,w:4,h:1},{component:"scatterplot",props:{mapping:"PCA"},x:4,y:5,w:4,h:1},{component:"genes",x:8,y:2,w:4,h:2},{component:"heatmap",x:8,y:4,w:4,h:2}]}),"dries-2019":{name:"Dries",version:"1.0.0",description:yt,public:!0,datasets:[{uid:"dries-2019",name:"Dries 2019",files:vt.layers.map((function(t){return{type:t.type.toLowerCase(),fileType:t.fileType,url:t.url}}))}],initStrategy:"auto",coordinationSpace:{embeddingType:{TSNE:"t-SNE",UMAP:"UMAP"},embeddingCellSetPolygonsVisible:{A:!1},embeddingCellSetLabelsVisible:{A:!0},embeddingCellSetLabelSize:{A:16},embeddingCellRadius:{A:1},embeddingZoom:{TSNE:3,UMAP:3},spatialZoom:{A:-4.4},spatialTargetX:{A:3800},spatialTargetY:{A:-900}},layout:[{component:"description",x:9,y:0,w:3,h:2},{component:"status",x:9,y:2,w:3,h:2},{component:"cellSets",x:9,y:4,w:3,h:4},{component:"cellSetSizes",x:5,y:4,w:4,h:4},{component:"scatterplot",coordinationScopes:{embeddingType:"TSNE",embeddingZoom:"TSNE",embeddingCellSetLabelsVisible:"A",embeddingCellSetLabelSize:"A",embeddingCellSetPolygonsVisible:"A",embeddingCellRadius:"A"},x:0,y:2,w:5,h:4},{component:"spatial",props:{cellRadius:50},coordinationScopes:{spatialZoom:"A",spatialTargetX:"A",spatialTargetY:"A"},x:5,y:0,w:4,h:4},{component:"scatterplot",coordinationScopes:{embeddingType:"UMAP",embeddingZoom:"UMAP",embeddingCellSetLabelsVisible:"A",embeddingCellSetLabelSize:"A",embeddingCellSetPolygonsVisible:"A",embeddingCellRadius:"A"},x:0,y:0,w:5,h:4}]},"wang-2019":{name:"Wang",version:"1.0.0",description:Bt,public:!0,datasets:[{uid:"wang-2019",name:"Wang 2019",files:mt.layers.map((function(t){return{type:t.type.toLowerCase(),fileType:t.fileType,url:t.url}}))}],initStrategy:"auto",coordinationSpace:{spatialZoom:{A:-1},spatialLayers:{A:[{type:"molecules",radius:2,opacity:1,visible:!0},{type:"cells",opacity:1,radius:50,visible:!0,stroked:!1}]}},layout:[{component:"spatial",coordinationScopes:{spatialZoom:"A",spatialLayers:"A"},x:0,y:0,w:10,h:2},{component:"genes",x:10,y:0,w:2,h:4},{component:"expressionHistogram",x:0,y:2,w:10,h:2}]},vanderbilt:Object(z.a)({},bt,{version:"0.1.0",name:"Spraggins",public:!0,staticLayout:[{component:"spatial",props:{view:{zoom:-6.5,target:[2e4,2e4,0]}},x:0,y:0,w:9,h:2},{component:"layerController",x:9,y:0,w:3,h:2}]}),"just-higlass":{public:!1,initStrategy:"auto",version:"1.0.0",datasets:[{uid:"higlass-dataset",name:"HiGlass Dataset",files:[]}],name:"HiGlass demo",coordinationSpace:{genomicZoomX:{A:0},genomicZoomY:{A:0},genomicTargetX:{A:1549999999.5},genomicTargetY:{A:1549999999.5}},layout:[{component:"higlass",coordinationScopes:{genomicZoomX:"A",genomicZoomY:"A",genomicTargetX:"A",genomicTargetY:"A"},props:{hgViewConfig:{uid:"aa",autocompleteSource:"/api/v1/suggest/?d=OHJakQICQD6gTD7skx4EWA&",genomePositionSearchBox:{autocompleteServer:"//higlass.io/api/v1",autocompleteId:"OHJakQICQD6gTD7skx4EWA",chromInfoServer:"//higlass.io/api/v1",chromInfoId:"hg19",visible:!0},chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",tracks:{top:[{type:"horizontal-gene-annotations",height:60,tilesetUid:"OHJakQICQD6gTD7skx4EWA",server:"//higlass.io/api/v1",uid:"OHJakQICQD6gTD7skx4EWA",options:{name:"Gene Annotations (hg19)",fontSize:10,labelPosition:"hidden",labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,minHeight:24,geneAnnotationHeight:16,geneLabelPosition:"outside",geneStrandSpacing:4,showMousePosition:!0,mousePositionColor:"#ff00ff",plusStrandColor:"#fdff54",minusStrandColor:"#68bf30",labelColor:"black",trackBorderWidth:0,trackBorderColor:"black"}},{chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",type:"horizontal-chromosome-labels",height:30,uid:"X4e_1DKiQHmyghDa6lLMVA",options:{color:"#808080",stroke:"black",fontSize:12,fontIsLeftAligned:!1,showMousePosition:!0,mousePositionColor:"#ff00ff"}}],left:[{type:"vertical-gene-annotations",width:60,tilesetUid:"OHJakQICQD6gTD7skx4EWA",server:"//higlass.io/api/v1",options:{labelPosition:"bottomRight",name:"Gene Annotations (hg19)",fontSize:10,labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,minWidth:24,geneAnnotationHeight:16,geneLabelPosition:"outside",geneStrandSpacing:4,showMousePosition:!0,mousePositionColor:"#ff00ff",plusStrandColor:"#fdff54",minusStrandColor:"#68bf30",labelColor:"black",trackBorderWidth:0,trackBorderColor:"black"},uid:"dqBTMH78Rn6DeSyDBoAEXw"},{chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",type:"vertical-chromosome-labels",width:30,uid:"RHdQK4IRQ7yJeDmKWb7Pcg",options:{color:"#777777",stroke:"black",fontSize:12,fontIsLeftAligned:!1,minWidth:35,showMousePosition:!0,mousePositionColor:"#ff00ff"}}],center:[{uid:"c1",type:"combined",height:600,contents:[{server:"//higlass.io/api/v1",tilesetUid:"CQMd6V_cRw6iCI_-Unl3PQ",type:"heatmap",options:{maxZoom:null,labelPosition:"bottomRight",name:"Rao et al. (2014) GM12878 MboI (allreps) 1kb",backgroundColor:"black",labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,labelShowResolution:!0,labelShowAssembly:!0,labelColor:"#ffffff",labelTextOpacity:.5,labelBackgroundColor:"black",labelBackgroundOpacity:.01,colorRange:["#000000","#222e54","#448db2","#68bf30","#fdff54","#FFFFFF"],colorbarBackgroundColor:"black",colorbarBackgroundOpacity:.01,colorbarPosition:"topRight",trackBorderWidth:0,trackBorderColor:"black",heatmapValueScaling:"log",showMousePosition:!0,mousePositionColor:"#ff00ff",showTooltip:!1,extent:"full",zeroValueColor:null,scaleStartPercent:"0.00000",scaleEndPercent:"1.00000"},height:500,uid:"GjuZed1ySGW1IzZZqFB9BA",transforms:[{name:"ICE",value:"weight"}]}],options:{}}],right:[],bottom:[],whole:[],gallery:[]},layout:{w:12,h:12,x:0,y:0,moved:!1,static:!1}}},x:0,y:0,w:8,h:2},{component:"higlass",coordinationScopes:{genomicZoomX:"A",genomicZoomY:"A",genomicTargetX:"A",genomicTargetY:"A"},props:{hgViewConfig:{uid:"aa",autocompleteSource:"/api/v1/suggest/?d=OHJakQICQD6gTD7skx4EWA&",genomePositionSearchBox:{autocompleteServer:"//higlass.io/api/v1",autocompleteId:"OHJakQICQD6gTD7skx4EWA",chromInfoServer:"//higlass.io/api/v1",chromInfoId:"hg19",visible:!0},chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",tracks:{top:[{type:"horizontal-gene-annotations",height:60,tilesetUid:"OHJakQICQD6gTD7skx4EWA",server:"//higlass.io/api/v1",uid:"OHJakQICQD6gTD7skx4EWA",options:{name:"Gene Annotations (hg19)",fontSize:10,labelPosition:"hidden",labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,minHeight:24,geneAnnotationHeight:16,geneLabelPosition:"outside",geneStrandSpacing:4,showMousePosition:!0,mousePositionColor:"#ff00ff",plusStrandColor:"#fdff54",minusStrandColor:"#68bf30",labelColor:"black",trackBorderWidth:0,trackBorderColor:"black"}},{chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",type:"horizontal-chromosome-labels",height:30,uid:"X4e_1DKiQHmyghDa6lLMVA",options:{color:"#808080",stroke:"black",fontSize:12,fontIsLeftAligned:!1,showMousePosition:!0,mousePositionColor:"#ff00ff"}}],left:[{type:"vertical-gene-annotations",width:60,tilesetUid:"OHJakQICQD6gTD7skx4EWA",server:"//higlass.io/api/v1",options:{labelPosition:"bottomRight",name:"Gene Annotations (hg19)",fontSize:10,labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,minWidth:24,geneAnnotationHeight:16,geneLabelPosition:"outside",geneStrandSpacing:4,showMousePosition:!0,mousePositionColor:"#ff00ff",plusStrandColor:"#fdff54",minusStrandColor:"#68bf30",labelColor:"black",trackBorderWidth:0,trackBorderColor:"black"},uid:"dqBTMH78Rn6DeSyDBoAEXw"},{chromInfoPath:"//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv",type:"vertical-chromosome-labels",width:30,uid:"RHdQK4IRQ7yJeDmKWb7Pcg",options:{color:"#777777",stroke:"black",fontSize:12,fontIsLeftAligned:!1,minWidth:35,showMousePosition:!0,mousePositionColor:"#ff00ff"}}],center:[{uid:"c1",type:"combined",height:600,contents:[{server:"//higlass.io/api/v1",tilesetUid:"CQMd6V_cRw6iCI_-Unl3PQ",type:"heatmap",options:{maxZoom:null,labelPosition:"bottomRight",name:"Rao et al. (2014) GM12878 MboI (allreps) 1kb",backgroundColor:"black",labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,labelShowResolution:!0,labelShowAssembly:!0,labelColor:"#ffffff",labelTextOpacity:.5,labelBackgroundColor:"black",labelBackgroundOpacity:.01,colorRange:["#000000","#222e54","#448db2","#68bf30","#fdff54","#FFFFFF"],colorbarBackgroundColor:"black",colorbarBackgroundOpacity:.01,colorbarPosition:"topRight",trackBorderWidth:0,trackBorderColor:"black",heatmapValueScaling:"log",showMousePosition:!0,mousePositionColor:"#ff00ff",showTooltip:!1,extent:"full",zeroValueColor:null,scaleStartPercent:"0.00000",scaleEndPercent:"1.00000"},height:500,uid:"GjuZed1ySGW1IzZZqFB9BA",transforms:[{name:"ICE",value:"weight"}]}],options:{}}],right:[],bottom:[],whole:[],gallery:[]},layout:{w:12,h:12,x:0,y:0,moved:!1,static:!1}}},x:8,y:0,w:4,h:2}]},"sc-atac-seq-10x-genomics-pbmc":{version:"1.0.0",name:"HiGlass serverless demo with 10x Genomics scATAC-seq 5k PBMC dataset",datasets:[{uid:"10x-genomics-pbmc",name:"10x Genomics PBMC",files:[{type:"genomic-profiles",fileType:"genomic-profiles.zarr",url:"http://higlass-serverless.s3.amazonaws.com/multivec/pbmc_10x_peaks_by_cluster.zarr"}]}],layout:[{component:"genomicProfiles",props:{profileTrackUidKey:"file"},x:0,y:0,w:8,h:2},{component:"description",props:{description:"10x Genomics scATAC-seq of 5k PBMCs. Note: the Zarr HiGlass Plugin Datafetcher is not yet optimized. Please be patient while the HiGlass tracks load."},x:8,y:0,w:4,h:2}],initStrategy:"auto"}};function Qt(t){return Object.entries(Et).filter((function(e){return t||e[1].public})).map((function(t){var e=Object(a.a)(t,2),n=e[0],r=e[1];return{id:n,name:r.name,description:r.description}}))}function Ft(t){return Et[t]}var wt=n(174),St=n(1122);function Rt(t){var e=t.configs,n=t.theme,r=e.map((function(t){var e=t.id,r=t.name,i=t.description;return s.a.createElement("div",{className:"list-group-item list-group-item-action flex-column align-items-start bg-secondary",key:e},s.a.createElement("a",{href:"?dataset=".concat(e,"&theme=").concat(n),key:e},s.a.createElement("h5",null,r),s.a.createElement("p",null,i)),s.a.createElement("a",{href:"?dataset=".concat(e,"&theme=").concat(n,"&small"),style:{fontSize:"75%"}},r," as component"))}));return s.a.createElement("div",{className:"list-group"},r)}function Ut(t){var e=t.configs,n=t.theme;return s.a.createElement("form",{method:"GET"},s.a.createElement("h1",null,"Vitessce"),s.a.createElement("div",null,"Select a dataset:"),s.a.createElement(Rt,{configs:e,theme:n}),s.a.createElement("br",null),s.a.createElement("div",null,"Or specify URL of configuration:"),s.a.createElement("div",{className:"input-group mb-3"},s.a.createElement("input",{type:"text",name:"url",className:"form-control"}),s.a.createElement("input",{type:"hidden",name:"theme",value:n}),s.a.createElement("div",{className:"input-group-append"},s.a.createElement("button",{className:"btn btn-outline-secondary",type:"submit"},"Load"))))}function xt(){return s.a.createElement(s.a.Fragment,null,s.a.createElement("p",{className:"info-paragraph"},"Vitessce is a visual integration tool for exploration of spatial single cell experiments. Its modular design is optimized for scalable, linked visualizations that support the spatial and non-spatial representation of tissue-, cell- and molecule-level data. Vitessce integrates the ",s.a.createElement("a",{href:"https://github.com/hms-dbmi/viv"},"Viv library")," to visualize highly multiplexed, high-resolution, high-bit depth image data directly from OME-TIFF files and Bio-Formats-compatible Zarr stores."),s.a.createElement("h5",{className:"info-section-text"},"Contributors"),s.a.createElement("ul",null,s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/keller-mark"},"Mark Keller")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/mccalluc"},"Chuck McCallum")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/ilan-gold"},"Ilan Gold")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/manzt"},"Trevor Manz")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/thomaslchan"},"Tos Chan")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/jkmarx"},"Jennifer Marx")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/pkharchenko"},"Peter Kharchenko")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/ngehlenborg"},"Nils Gehlenborg"))),s.a.createElement("h5",{className:"info-section-text"},"Source Code"),s.a.createElement("ul",null,s.a.createElement("li",null,s.a.createElement("a",{href:"https://github.com/hubmapconsortium/vitessce"},"GitHub")),s.a.createElement("li",null,s.a.createElement("a",{href:"https://www.npmjs.com/package/vitessce"},"NPM"))),s.a.createElement("h5",{className:"info-section-text"},"Funding"),s.a.createElement("ul",null,s.a.createElement("li",null,"NIH/OD Human BioMolecular Atlas Program (HuBMAP) (OT2OD026677, PI: Nils Gehlenborg)."),s.a.createElement("li",null,"NIH/NLM Biomedical Informatics and Data Science Research Training Program (T15LM007092, PI: Nils Gehlenborg)"),s.a.createElement("li",null,"Harvard Stem Cell Institute (CF-0014-17-03, PI: Nils Gehlenborg)")),s.a.createElement("p",{className:"info-section-text"},"This deployment: branch=",St.branch," | hash=",St.hash," | date=",St.date))}function kt(t){var e=t.configs,n=t.theme;return s.a.createElement("div",{className:"vitessce-container vitessce-theme-".concat(n," welcome-container")},s.a.createElement("div",{className:"react-grid-layout container-fluid",style:{height:"max(100vh, 100%)"}},s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"welcome-col-left"},s.a.createElement("div",{className:wt.b},s.a.createElement(Ut,{configs:e,theme:n}))),s.a.createElement("div",{className:"welcome-col-right"},s.a.createElement("div",{className:wt.b},s.a.createElement(xt,null))))))}function Ot(t){var e=t.title,n=t.preformatted,r=t.unformatted,i=t.theme;return s.a.createElement("div",{className:"vitessce-container vitessce-theme-".concat(i)},s.a.createElement("div",{className:"warning-layout container-fluid"},s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-12"},s.a.createElement("div",{className:wt.b},s.a.createElement("h1",null,e),s.a.createElement("pre",null,n),s.a.createElement("div",null,r))))))}var Nt=n(865),Dt=n(901),Gt=n(9),_t=(n(20),n(381)),Mt=n(714),Tt=n(382);var jt=function(t){var e=t.children,n=t.theme,r=Object(Mt.a)(),i=s.a.useMemo((function(){var t=null===r?n:function(t,e){return"function"===typeof e?e(t):Object(Gt.a)({},t,{},e)}(r,n);return null!=t&&(t[Tt.a]=null!==r),t}),[n,r]);return s.a.createElement(_t.a.Provider,{value:i},e)},Lt=n(558),Vt=n(202),Zt=n(1120),Pt=n(1392);function Wt(t){var e=t.onWarn,n=t.onConfigChange,r=t.onLoaderChange,i=t.validateOnConfigChange,o=Object(lt.p)(),a=Object(lt.h)();return Object(A.useEffect)((function(){return lt.o.subscribe((function(t){i&&t&&function(t){try{var e=(new b.a).addSchema(k).addSchema(x).compile(Zt);if(!e(t)){var n=JSON.stringify(e.errors,null,2);throw new Error("Config validation failed: ".concat(n))}}catch(r){console.error(r)}}(t),n&&t&&n(t)}),(function(t){return t.viewConfig}))}),[n,i]),Object(A.useEffect)((function(){e&&o&&e(o)}),[o,e]),Object(A.useEffect)((function(){r&&a&&r(a)}),[a,r]),null}var Jt=n(141),Ht=n(156),Yt=n(158),Xt=n(201);function zt(t){var e=t.description,n=t.metadata;return s.a.createElement("div",{className:"description"},s.a.createElement("p",null,e),n&&Array.from(n.entries()).map((function(t){var e=Object(a.a)(t,2),n=e[0],r=e[1],i=r.name,o=r.metadata;return o&&Object.entries(o).length>0?s.a.createElement("details",{key:n},s.a.createElement("summary",null,i),s.a.createElement("div",{className:"metadata-container"},s.a.createElement("table",null,s.a.createElement("tbody",null,Object.entries(o).map((function(t){var e=Object(a.a)(t,2),n=e[0],r=e[1];return s.a.createElement("tr",{key:n},s.a.createElement("th",{title:n},n),s.a.createElement("td",{title:r},r))})))))):null})))}var Kt=["raster"];var qt=n(1089),$t=n(1090),te=n(1091),ee=n(906),ne=n(905),re=n(907),ie=n(1093),oe=n(65),ae=n.n(oe);var Ae=Object.freeze({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.modulePath,n=void 0===e?".":e,r=t.importFunctionName,i=void 0===r?"__import__":r;try{self[i]=new Function("u","return import(u)")}catch(A){var o=new URL(n,location),a=function(t){URL.revokeObjectURL(t.src),t.remove()};self[i]=function(t){return new Promise((function(e,n){var r=new URL(t,o);if(self[i].moduleMap[r])return e(self[i].moduleMap[r]);var A=new Blob(["import * as m from '".concat(r,"';"),"".concat(i,".moduleMap['").concat(r,"']=m;")],{type:"text/javascript"}),s=Object.assign(document.createElement("script"),{type:"module",src:URL.createObjectURL(A),onerror:function(){n(new Error("Failed to import: ".concat(t))),a(s)},onload:function(){e(self[i].moduleMap[r]),a(s)}});document.head.appendChild(s)}))},self[i].moduleMap={}}}});window.higlassTracks=window.higlassTracks||{},window.higlassTracksByType=window.higlassTracksByType||{},window.higlassDataFetchersByType=window.higlassDataFetchersByType||{};var se=function(){return Math.random().toString(36).substring(2,8)},ce=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.force,r=void 0!==n&&n,i=se();window.higlassTracks[i];)i=se();t.name=i,window.higlassTracks[t.name]=t,window.higlassTracksByType[t.config.type]&&!r?console.warn("A track with the same type (".concat(t.config.type,") was already ")+"registered. To override it, set force to true."):window.higlassTracksByType[t.config.type]=t},ue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.force,r=void 0!==n&&n;window.higlassDataFetchersByType[t.config.type]&&!r?console.warn("A data fetcher with the same type (".concat(t.config.type,") was already ")+"registered. To override it, set force to true."):window.higlassDataFetchersByType[t.config.type]=t},le=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.pluginType,r=void 0===n?"track":n;"track"===r?ce(t,e):"dataFetcher"===r&&ue(t,e)};function ge(t,e,n){return(ge=fe()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&he(i,n.prototype),i}).apply(null,arguments)}function fe(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function he(t,e){return(he=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function de(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=t[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}(t,e)||be(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ie(Object(n),!0).forEach((function(e){Ce(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ce(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Be(t,e,n){return e&&ve(t.prototype,e),n&&ve(t,n),t}function me(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=be(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,A=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){A=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(A)throw o}}}}function be(t,e){if(t){if("string"===typeof t)return Ee(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(t,e):void 0}}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qe(t,e,n){var r=n?e[1]:e[0]*e[1],i=new Float32Array(r),o=0;if(n){var a,A=me(t);try{for(A.s();!(a=A.n()).done;){var s=a.value.data;i.set(s,o),o+=s.length}}catch(h){A.e(h)}finally{A.f()}}else for(var c=e[0],u=0;u<c;u++){var l,g=me(t);try{for(g.s();!(l=g.n()).done;){var f=l.value.data[u];i.set(f,o),o+=f.length}}catch(h){g.e(h)}finally{g.f()}}return i}var Fe=function t(e){if(!(this instanceof t?this.constructor:void 0))throw new Error('Uncaught TypeError: Class constructor cannot be invoked without "new"');for(var n=e.libraries.slugid,r=e.utils,i=r.absToChr,o=r.parseChromsizesRows,a=r.genomicRangeToChromosomeChunks,A=r.DenseDataExtrema1D,s=r.minNonZero,c=r.maxNonZero,u=function(){function t(e){ye(this,t),this.dataConfig=e,this.trackUid=n.nice(),e.url&&(this.store=new G.c(e.url)),void 0!==e.row&&(this.row=e.row)}return Be(t,[{key:"tilesetInfo",value:function(t){var e=this;return this.tilesetInfoLoading=!0,this.store.getItem(".zattrs").then((function(t){var e=new TextDecoder("utf-8");return JSON.parse(e.decode(t))})).then((function(n){e.tilesetInfoLoading=!1;var r=n.multiscales.map((function(t){return[t.name,t.metadata.chromsize]})),i=n.multiscales[n.multiscales.length-1],o=i.metadata.chromoffset+i.metadata.chromsize,a=n.shape[1],A=pe(pe({},n),{},{shape:[n.shape[1],n.shape[0]],chromSizes:r,tile_size:a,max_width:o,min_pos:[0],max_pos:[o],max_zoom:Math.ceil(Math.log(o/a)/Math.log(2))});return t&&t(A),A})).catch((function(n){e.tilesetInfoLoading=!1,t&&t({error:"Error parsing zarr multivec: ".concat(n)})}))}},{key:"fetchTilesDebounced",value:function(t,e){var n,r={},i=[],o=[],a=me(e);try{for(a.s();!(n=a.n()).done;){var A=n.value,s=A.split("."),c=parseInt(s[0],10),u=parseInt(s[1],10);Number.isNaN(u)||Number.isNaN(c)?console.warn("Invalid tile zoom or position:",c,u):(i.push(A),o.push(this.tile(c,u,A)))}}catch(l){a.e(l)}finally{a.f()}return Promise.all(o).then((function(e){for(var n=0;n<e.length;n++){var o=i[n];r[o]=e[n],r[o].tilePositionId=o}t(r)})),r}},{key:"tile",value:function(t,e,n){var r=this,u=this.store;return this.tilesetInfo().then((function(l){var g=+l.resolutions[t],f=+l.tile_size,h=g,d=e*f*g,I=d+f*g,p=l.chromSizes,C=o(p),y=de(i(d,C),2),v=y[0],B=y[1],m=de(i(I,C),2),b=m[0],E=m[1],Q=a(p,{chr:v,pos:B},{chr:b,pos:E},h,f);return Promise.all(Q.map((function(t){var e=de(t,3),n=e[0],i=e[1],o=e[2];return Object(G.e)({store:u,path:"/chromosomes/".concat(n,"/").concat(g,"/"),mode:"r"}).then((function(t){return void 0!==r.row?t.getRaw([r.row,Object(G.f)(i,o)]):t.get([null,Object(G.f)(i,o)])}))}))).then((function(i){var o=Qe(i,[l.shape[1],l.shape[0]],void 0!==r.row);return Promise.resolve({dense:o,denseDataExtrema:new A(o),dtype:"float32",min_value:Math.min.apply(null,o),max_value:Math.max.apply(null,o),minNonZero:s(o),maxNonZero:c(o),server:null,size:1,shape:l.shape,tileId:n,tilePos:[e],tilePositionId:n,tilesetUid:null,zoomLevel:t})}))}))}}]),t}(),l=arguments.length,g=new Array(l>1?l-1:0),f=1;f<l;f++)g[f-1]=arguments[f];return ge(u,g)};Fe.config={type:"zarr-multivec"};var we=n(75),Se=Lt.dependencies["window-pixi"],Re=Lt.dependencies.higlass,Ue="https://unpkg.com/window-pixi@".concat(Se,"/dist/pixi.").concat("min.js"),xe="https://unpkg.com/higlass@".concat(Re,"/dist/hglib.").concat("min.js");Ae.initialize(),le({dataFetcher:Fe,config:Fe.config},{pluginType:"dataFetcher"});var ke=s.a.lazy((function(){return window.React||(window.React=s.a),window.ReactDOM||(window.ReactDOM=ae.a),new Promise((function(t){var e=function(e){console.warn(e),t(Object(we.f)(Object(we.l)({title:"Could not load HiGlass",message:"The HiGlass scripts could not be dynamically imported."})))};__import__(Ue).then((function(){__import__(xe).then((function(){t(Object(we.f)(window.hglib.HiGlassComponent))})).catch(e)})).catch(e)}))}));function Oe(t){var e=t.coordinationScopes,n=t.theme,r=t.hgViewConfig,i=t.hgOptions,o=t.genomeSize,c=t.height,u=Object(lt.d)(Yt.b.higlass,e),l=Object(a.a)(u,2),g=l[0],f=g.genomicZoomX,h=g.genomicZoomY,d=g.genomicTargetX,I=g.genomicTargetY,p=l[1],C=p.setGenomicZoomX,y=p.setGenomicZoomY,v=p.setGenomicTargetX,B=p.setGenomicTargetY,m=Object(Jt.b)(),b=Object(a.a)(m,3),E=b[0],Q=(b[1],b[2]),F=Object(A.useState)(),w=Object(a.a)(F,2),S=w[0],R=w[1],U=Object(A.useRef)(),x=Object(A.useMemo)((function(){return Object(z.a)({},i,{theme:n})}),[i,n]),k=Object(A.useMemo)((function(){var t=d,e=o/Math.pow(2,f),n=E/800,i=[t-e*n/2,t+e*n/2],a=I,A=o/Math.pow(2,h),s=c/800,u=[a-A*s/2,a+A*s/2];return{editable:!1,zoomFixed:!1,trackSourceServers:["//higlass.io/api/v1"],exportViewUrl:"//higlass.io/api/v1/viewconfs",views:[Object(z.a)({uid:"main"},r,{initialXDomain:i,initialYDomain:u})],zoomLocks:{locksByViewUid:{},locksDict:{}},locationLocks:{locksByViewUid:{},locksDict:{}},valueScaleLocks:{locksByViewUid:{},locksDict:{}}}}),[d,o,f,E,I,h,c,r]);return Object(A.useEffect)((function(){var t=function(){U.current=!0},e=function(){U.current=!1},n=Q.current;return n.addEventListener("mouseenter",t),n.addEventListener("mouseleave",e),function(){n.removeEventListener("mouseenter",t),n.removeEventListener("mouseenter",e)}}),[Q]),Object(A.useEffect)((function(){return S?(S.api.on("viewConfig",(function(t){if(U.current){var e=JSON.parse(t),n=e.views[0].initialXDomain,r=e.views[0].initialYDomain,i=Math.log2(o/((n[1]-n[0])*(800/E))),a=Math.log2(o/((r[1]-r[0])*(800/c))),A=n[0]+(n[1]-n[0])/2,s=r[0]+(r[1]-r[0])/2;C(i),y(a),v(A),B(s)}})),function(){return S.api.off("viewConfig")}):function(){}}),[S,o,E,c,C,y,v,B]),s.a.createElement("div",{className:"higlass-wrapper-parent"},s.a.createElement("div",{className:"higlass-wrapper",ref:Q,style:{height:"".concat(c,"px")}},s.a.createElement(A.Suspense,{fallback:s.a.createElement("div",null,"Loading...")},s.a.createElement(ke,{ref:R,zoomFixed:!1,viewConfig:k,options:x}))))}Oe.defaultProps={hgOptions:{bounded:!0,pixelPreciseMarginPadding:!0,containerPaddingX:0,containerPaddingY:0,sizeMode:"default"},genomeSize:31e8};var Ne=[];var De=n(1092),Ge=n(15);function _e(t,e){var n=0;if(void 0===e){var r,i=Object(Ge.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;(o=+o)&&(n+=o)}}catch(u){i.e(u)}finally{i.f()}}else{var a,A=-1,s=Object(Ge.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value;(c=+e(c,++A,t))&&(n+=c)}}catch(u){s.e(u)}finally{s.f()}}return n}var Me=["genomic-profiles"],Te={hg38:{chromosomes:"NyITQvZsS_mOFNlz5C2LJg",genes:"P0PLbQMwTYGy-5uPIQid7A"},hg19:{chromosomes:"N12wVGG9SPiTkk03yUayUw",genes:"OHJakQICQD6gTD7skx4EWA"},mm9:{chromosomes:"WAVhNHYxQVueq6KulwgWiQ",genes:"GUm5aBiLRCyz2PsBea7Yzg"},mm10:{chromosomes:"EtrWT0VtScixmsmwFSd7zg",genes:"QDutvmyiSrec5nX4pA5WGQ"}};var je=n(273),Le=n.n(je),Ve=n(523);function Ze(t){var e=t.geneSelection,n=t.data,r=t.theme,i=t.width,o=t.height,a=t.marginRight,A=void 0===a?90:a,c=t.marginBottom,u=void 0===c?50:c,l={mark:{type:"bar"},encoding:{x:{field:"value",type:"quantitative",bin:{maxbins:50},title:e&&e.length>=1?"Normalized Expression Value":"Total Normalized Transcript Count"},y:{type:"quantitative",aggregate:"count",title:"Number of Cells"},color:{value:"gray"}},width:Le()(i-A,10,1/0),height:Le()(o-u,10,1/0),config:Ve.b[r]};return s.a.createElement(Ve.c,{data:n,spec:l})}var Pe=["expression-matrix"];var We=n(116);function Je(t){var e=t.domainMax,n=void 0===e?100:e,r=t.colors,i=t.data,o=t.theme,a=t.width,A=t.height,c=t.marginRight,u=void 0===c?90:c,l=t.marginBottom,g=void 0===l?120:l,f={domain:r.map((function(t){return t.name})),range:r.map((function(t){return Object(We.c)(t.color)}))},h=Le()(a-u,10,1/0),d=Le()(A-g,10,1/0),I=h/r.length,p="dark"===o?"white":"black",C={$schema:"https://vega.github.io/schema/vega/v5.json",description:"A violin plot showing distributions of expression levels for selected cell sets.",width:h,height:d,config:Object(z.a)({},Ve.b[o],{axisBand:{bandPosition:1,tickExtra:!0,tickOffset:0}}),signals:[{name:"bandWidth",value:I},{name:"width",value:h},{name:"height",value:d},{name:"trim",value:!0}],data:[{name:"density",source:Ve.a,transform:[{type:"kde",field:"value",groupby:["set"],bandwidth:0,extent:[0,n]}]},{name:"stats",source:Ve.a,transform:[{type:"aggregate",groupby:["set"],fields:["value","value","value"],ops:["q1","median","q3"],as:["q1","median","q3"]}]}],scales:[{name:"layout",type:"band",range:"width",domain:{data:Ve.a,field:"set"}},{name:"yscale",type:"linear",range:"height",domain:[0,n]},{name:"wscale",type:"linear",range:[0,{signal:"bandWidth"}],domain:{data:"density",field:"density"}},{name:"wscaleReversed",type:"linear",reverse:!0,range:[0,{signal:"bandWidth"}],domain:{data:"density",field:"density"}},Object(z.a)({name:"color",type:"ordinal"},f)],axes:[{orient:"left",scale:"yscale",zindex:1,title:"Normalized Expression Value"},{orient:"bottom",scale:"layout",tickCount:5,zindex:1,title:"Cell Set",labelAngle:-45,labelAlign:"right"}],marks:[{type:"group",from:{facet:{data:"density",name:"violin",groupby:"set"}},encode:{enter:{xc:{scale:"layout",field:"set",band:.5},width:{signal:"bandWidth"},height:{signal:"height"}}},data:[{name:"summary",source:"stats",transform:[{type:"filter",expr:"datum.set === parent.set"}]}],marks:[{type:"area",orient:"vertical",from:{data:"violin"},encode:{enter:{fill:{scale:"color",field:{parent:"set"}}},update:{width:{scale:"wscale",field:"density"},xc:{signal:"bandWidth / 2"},y2:{scale:"yscale",field:"value"},y:{scale:"yscale",value:0}}}},{type:"area",orient:"vertical",from:{data:"violin"},encode:{enter:{fill:{scale:"color",field:{parent:"set"}}},update:{width:{scale:"wscaleReversed",field:"density"},xc:{signal:"bandWidth"},y2:{scale:"yscale",field:"value"},y:{scale:"yscale",value:0}}}},{type:"rect",from:{data:"summary"},encode:{enter:{fill:{value:p},width:{value:2}},update:{y:{scale:"yscale",field:"q1"},y2:{scale:"yscale",field:"q3"},xc:{signal:"bandWidth / 2"}}}},{type:"rect",from:{data:"summary"},encode:{enter:{fill:{value:p},height:{value:2},width:{value:8}},update:{y:{scale:"yscale",field:"median"},xc:{signal:"bandWidth / 2"}}}}]}]};return s.a.createElement(Ve.c,{data:i,spec:C})}var He=["cell-sets","expression-matrix"];var Ye={description:function(t){var e=t.coordinationScopes,n=t.description,r=t.removeGridComponent,i=t.theme,o=Object(lt.h)(),c=Object(lt.d)(Yt.b.description,e),u=Object(a.a)(c,1)[0],l=u.dataset,g=u.spatialLayers,f=Object(Jt.c)(Kt),h=Object(a.a)(f,3),d=h[0],I=h[1],p=h[2];Object(A.useEffect)((function(){p()}),[o,l]);var C=Object(Ht.c)(o,l),y=Object(a.a)(C,1)[0],v=Object(Ht.h)(o,l,I,(function(){}),!1),B=Object(a.a)(v,3),m=B[0],b=B[1],E=B[2],Q=Object(A.useMemo)((function(){var t=new Map;g&&g.length>0&&m&&E&&b&&g.filter((function(t){return"raster"===t.type})).forEach((function(e){E[e.index]&&t.set("".concat(e.index),{name:m.layers[e.index].name,metadata:b[e.index].getMetadata()})}));return t}),[m,g,E,b]);return s.a.createElement(Xt.a,{title:"Data Set",removeGridComponent:r,isScroll:!0,theme:i,isReady:d},s.a.createElement(zt,{description:n||y,metadata:Q}))},status:qt.a,genes:$t.a,cellSets:te.a,scatterplot:ee.a,spatial:ne.a,heatmap:re.a,layerController:ie.a,cellSetSizes:De.a,expressionHistogram:function(t){var e=t.coordinationScopes,n=t.removeGridComponent,r=t.theme,i=Object(lt.h)(),o=Object(lt.d)(Yt.b.expressionHistogram,e),c=Object(a.a)(o,1)[0],u=c.dataset,l=c.geneSelection,g=Object(Jt.b)(),f=Object(a.a)(g,3),h=f[0],d=f[1],I=f[2],p=Object(Jt.d)(),C=Object(a.a)(p,3),y=C[0],v=C[1],B=C[2],m=Object(Jt.c)(Pe),b=Object(a.a)(m,3),E=b[0],Q=b[1],F=b[2];Object(A.useEffect)((function(){B(),F()}),[i,u]);var w=Object(Ht.d)(i,u,Q,v,!0),S=Object(a.a)(w,1)[0],R=l&&l.length>=1?l[0]:null,U=Object(A.useMemo)((function(){if(R&&S){var t=S.cols.length,e=S.cols.indexOf(R);if(-1!==e)return S.rows.map((function(n,r){return{value:100*S.matrix[r*t+e]/255,gene:R}}))}else if(S){var n=S.cols.length;return S.rows.map((function(t,e){return{value:100*_e(S.matrix.subarray(e*n,(e+1)*n))/255,gene:null}}))}return null}),[S,R]);return s.a.createElement(Xt.a,{title:"Expression Histogram".concat(R?" (".concat(R,")"):""),removeGridComponent:n,urls:y,theme:r,isReady:E},s.a.createElement("div",{ref:I,className:"vega-container"},s.a.createElement(Ze,{geneSelection:l,data:U,theme:r,width:h,height:d})))},genomicProfiles:function(t){var e=t.coordinationScopes,n=t.theme,r=t.removeGridComponent,i=t.profileTrackUidKey,o=void 0===i?"path":i,c=t.profileTrackNameKey,u=void 0===c?null:c,l=t.higlassServer,g=void 0===l?"https://higlass.io/api/v1":l,f=t.assembly,h=void 0===f?"hg38":f,p=Object(Jt.b)(),C=Object(a.a)(p,3),y=(C[0],C[1]),v=C[2],B=Object(lt.h)(),m=Object(lt.d)(Yt.b.genomicProfiles,e),b=Object(a.a)(m,1)[0],E=b.dataset,Q=b.cellSetColor,F=b.cellSetSelection,w=Object(Jt.c)(Me),S=Object(a.a)(w,3),R=S[0],U=S[1],x=S[2],k=Object(Jt.d)(),O=Object(a.a)(k,3),N=O[0],D=O[1],G=O[2],_=Object(Ht.e)(B,E,U,D,!0),M=Object(a.a)(_,1)[0],T=Object(A.useMemo)((function(){if(!M||1!==N.length)return null;var t=N[0].url,e="dark"===n?"#C0C0C0":"#000000",r="dark"===n?"#000000":"#f1f1f1",i="dark"===n?"dimgray":"silver",a=[{type:"horizontal-chromosome-labels",server:g,tilesetUid:Te[h].chromosomes,uid:"chromosome-labels",options:{color:e,fontSize:12,fontIsLeftAligned:!1,showMousePosition:!0,mousePositionColor:e},height:30},{type:"horizontal-gene-annotations",server:g,tilesetUid:Te[h].genes,uid:"gene-annotations",options:{name:"Gene Annotations (hg38)",fontSize:10,labelPosition:"hidden",labelLeftMargin:0,labelRightMargin:0,labelTopMargin:0,labelBottomMargin:0,minHeight:24,geneAnnotationHeight:16,geneLabelPosition:"outside",geneStrandSpacing:4,showMousePosition:!0,mousePositionColor:e,plusStrandColor:e,minusStrandColor:e,labelColor:"black",labelBackgroundColor:r,trackBorderWidth:0,trackBorderColor:"black"},height:70}],A=_e(a.map((function(t){return t.height}))),s=(y-A-10)/M.row_infos.length,c=M.row_infos.map((function(r,a){var A,c=r[o],l=Array.isArray(c),g=u?r[u]:l?c[c.length-1]:c,f=!!l&&(null===F||void 0===F?void 0:F.find((function(t){return d()(t,c)}))),h=l?null===Q||void 0===Q||null===(A=Q.find((function(t){return d()(t.path,c)})))||void 0===A?void 0:A.color:null,I=l?c.join("__"):c,p={type:"horizontal-bar",uid:"bar-track-".concat(I),data:{type:"zarr-multivec",url:t,row:a},options:{name:g,showMousePosition:!0,mousePositionColor:e,labelColor:"dark"===n?"white":"black",labelBackgroundColor:"dark"===n?"black":"white",labelShowAssembly:!1},height:s};if(h&&f){var C=h;p.options.barFillColor="rgb(".concat(C[0],",").concat(C[1],",").concat(C[2],")")}else p.options.barFillColor=i;return p}));return{tracks:{top:[].concat(a,Object(I.a)(c)),left:[],center:[],right:[],bottom:[],whole:[],gallery:[]},layout:{w:12,h:12,x:0,y:0,static:!1}}}),[M,N,n,y,o,u,F,Q,g,h]);return Object(A.useEffect)((function(){G(),x()}),[B,E]),s.a.createElement("div",{className:"higlass-title-wrapper"},s.a.createElement(Xt.a,{title:"Genomic Profiles",removeGridComponent:r,theme:n,isReady:R,urls:N},s.a.createElement("div",{className:"higlass-lazy-wrapper",ref:v},T?s.a.createElement(Oe,{coordinationScopes:e,theme:n,hgViewConfig:T,height:y}):null)))},cellSetExpression:function(t){var e=t.coordinationScopes,n=t.removeGridComponent,r=t.theme,i=Object(lt.h)(),o=Object(lt.d)(Yt.b.cellSetExpression,e),c=Object(a.a)(o,1)[0],u=c.dataset,l=c.geneSelection,g=c.cellSetSelection,f=c.cellSetColor,h=c.additionalCellSets,d=Object(Jt.b)(),I=Object(a.a)(d,3),p=I[0],C=I[1],y=I[2],v=Object(Jt.d)(),B=Object(a.a)(v,3),m=B[0],b=B[1],E=B[2],Q=Object(Jt.c)(He),F=Object(a.a)(Q,3),w=F[0],S=F[1],R=F[2];Object(A.useEffect)((function(){E(),R()}),[i,u]);var U=Object(Ht.d)(i,u,S,b,!0),x=Object(a.a)(U,1)[0],k=Object(Ht.a)(i,u,S,b,!0),O=function(t,e,n,r,i,o){var s=Object(A.useMemo)((function(){return Object(we.n)(e,n)}),[e,n]),c=Object(A.useMemo)((function(){if(s&&i&&r&&r.length>=1&&t){var e=Object(it.r)(s,i,o),n=r[0],a=t.cols.indexOf(n);if(-1!==a){var A=t.cols.length,c=-1/0;return[e.map((function(e){var r=t.rows.indexOf(e.obsId),i=100*t.matrix[r*A+a]/255;return c=Math.max(i,c),{value:i,gene:n,set:e.name}})),c]}}return[null,null]}),[t,r,s,i,o]),u=Object(a.a)(c,2),l=u[0],g=u[1];return[l,Object(A.useMemo)((function(){return s&&i?Object(it.s)(s,i,o):[]}),[s,i,o]),g]}(x,Object(a.a)(k,1)[0],h,l,g,f),N=Object(a.a)(O,3),D=N[0],G=N[1],_=N[2];return s.a.createElement(Xt.a,{title:"Expression by Cell Set",removeGridComponent:n,urls:m,theme:r,isReady:w},s.a.createElement("div",{ref:y,className:"vega-container"},D?s.a.createElement(Je,{domainMax:_,colors:G,data:D,theme:r,width:p,height:C}):s.a.createElement("span",null,"Select a gene.")))},higlass:function(t){var e=t.coordinationScopes,n=t.theme,r=t.hgViewConfig,i=t.removeGridComponent,o=Object(Jt.b)(),A=Object(a.a)(o,3),c=(A[0],A[1]),u=A[2],l=Object(Jt.c)(Ne),g=Object(a.a)(l,3),f=g[0],h=(g[1],g[2],Object(Jt.d)()),d=Object(a.a)(h,3),I=d[0];return d[1],d[2],s.a.createElement("div",{className:"higlass-title-wrapper"},s.a.createElement(Xt.a,{title:"HiGlass",removeGridComponent:i,theme:n,isReady:f,urls:I},s.a.createElement("div",{className:"higlass-lazy-wrapper",ref:u},s.a.createElement(Oe,{coordinationScopes:e,theme:n,hgViewConfig:r,height:c}))))}};function Xe(t){if(void 0===Ye[t])throw new Error('Could not find definition for "'.concat(t,'" in registry.'));return Ye[t]}function ze(t,e){var n,r=Object.keys((null===t||void 0===t||null===(n=t.coordinationSpace)||void 0===n?void 0:n[e])||{}),i=t.layout.map((function(t){var n;return null===(n=t.coordinationScopes)||void 0===n?void 0:n[e]}));return Array.from(new Set([].concat(Object(I.a)(r),Object(I.a)(i))))}function Ke(t){var e=t,n=e,r=n.layout,i=n.datasets;return Object.values(Yt.c).forEach((function(t){if(!r.every((function(e){var n;return!Yt.b[e.component].includes(t)||(null===(n=e.coordinationScopes)||void 0===n?void 0:n[t])}))){var n=Yt.d[t];"dataset"===t&&i.length>=1&&(n=i[0].uid),e=Yt.a.includes(t)?function(t,e,n){var r=Object(z.a)({},t,{layout:Object(I.a)(t.layout)}),i={};return r.layout.forEach((function(o,a){var A;if(Yt.b[o.component].includes(e)&&!(null===(A=o.coordinationScopes)||void 0===A?void 0:A[e])){var s=Object(p.c)([].concat(Object(I.a)(ze(t,e)),Object(I.a)(Object.keys(i))));i[s]=n,r.layout[a]=Object(z.a)({},o,{coordinationScopes:Object(z.a)({},o.coordinationScopes,Object(B.a)({},e,s))})}})),r.coordinationSpace=Object(z.a)({},r.coordinationSpace,Object(B.a)({},e,Object(z.a)({},r.coordinationSpace[e],{},i))),r}(e,t,n):function(t,e,n){var r,i=Object(p.c)(ze(t,e));return Object(z.a)({},t,{coordinationSpace:Object(z.a)({},t.coordinationSpace,Object(B.a)({},e,Object(z.a)({},null===t||void 0===t||null===(r=t.coordinationSpace)||void 0===r?void 0:r[e],Object(B.a)({},i,n)))),layout:t.layout.map((function(t){var n;return Object(z.a)({},t,{coordinationScopes:Object(z.a)({},t.coordinationScopes,{},Yt.b[t.component].includes(e)&&!(null===(n=t.coordinationScopes)||void 0===n?void 0:n[e])?Object(B.a)({},e,i):{})})}))})}(e,t,n)}})),e}function qe(t,e,n){var r,i=Object.keys(n["".concat(t,"Zoom")]),o=Object.keys(n["".concat(t,"TargetX")]),A=Object.keys(n["".concat(t,"TargetY")]),s=Object(p.c)(i),c=Object(p.c)(o),u=Object(p.c)(A),l=e.zoom,g=Object(a.a)(e.target,2),f=g[0],h=g[1];return n["".concat(t,"Zoom")][s]=l,n["".concat(t,"TargetX")][c]=f,n["".concat(t,"TargetY")][u]=h,r={},Object(B.a)(r,"".concat(t,"Zoom"),s),Object(B.a)(r,"".concat(t,"TargetX"),c),Object(B.a)(r,"".concat(t,"TargetY"),u),r}var $e=Object(Nt.a)({disableGlobal:!0});function tn(t){var e=t.config,n=t.rowHeight,r=t.height,i=t.theme,o=t.onWarn,c=t.onConfigChange,u=t.onLoaderChange,l=t.validateOnConfigChange,g=void 0!==l&&l,f=Object(A.useMemo)((function(){if(!e)return[{title:"No such dataset",unformatted:"The dataset configuration could not be found."},!1];if(!e.version)return[{title:"Missing version",unformatted:"The dataset configuration is missing a version, preventing validation."},!1];var t=e;if("0.1.0"===e.version){var n=(new b.a).compile(Pt);if(!n(e))return[{title:"Config validation failed",preformatted:JSON.stringify(n.errors,null,2)},!1];t=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n={embeddingType:{},embeddingZoom:{},embeddingTargetX:{},embeddingTargetY:{},spatialZoom:{},spatialTargetX:{},spatialTargetY:{}},r=[];t.staticLayout.forEach((function(t){var e=Object(z.a)({},t,{coordinationScopes:{}});if("scatterplot"===t.component&&(t.props.mapping&&(n.embeddingType[t.props.mapping]=t.props.mapping,e=Object(z.a)({},e,{coordinationScopes:Object(z.a)({},e.coordinationScopes,{embeddingType:t.props.mapping})})),t.props.view)){var i=qe("embedding",t.props.view,n);e=Object(z.a)({},e,{coordinationScopes:Object(z.a)({},e.coordinationScopes,{},i)})}if("spatial"===t.component&&t.props.view){var o=qe("spatial",t.props.view,n);e=Object(z.a)({},e,{coordinationScopes:Object(z.a)({},e.coordinationScopes,{},o)})}r.push(e)}));var i=e||Q()();return{version:"1.0.0",name:t.name,description:t.description,public:t.public,datasets:[{uid:i,name:i,files:t.layers.map((function(t){return{type:t.type.toLowerCase(),fileType:t.fileType,url:t.url}}))}],initStrategy:"auto",coordinationSpace:n,layout:r}}(e)}console.groupCollapsed("\ud83d\ude84 Vitessce (".concat(Lt.version,") view configuration")),console.info("data:,".concat(JSON.stringify(t))),console.info(JSON.stringify(t,null,2)),console.groupEnd();var r=(new b.a).addSchema(k).addSchema(x).compile(Zt);return r(t)?[function(t){return"auto"===t.initStrategy?Ke(t):t}(t),!0]:[{title:"Config validation failed",preformatted:JSON.stringify(r.errors,null,2)},!1]}),[e]),h=Object(a.a)(f,2),I=h[0],p=h[1];return Object(A.useEffect)((function(){p&&!d()(I,e)&&c&&c(I)}),[p,e,I,c]),p?s.a.createElement(Dt.b,{generateClassName:$e},s.a.createElement(jt,{theme:Vt.a[i]},s.a.createElement(gt,{config:I,getComponent:Xe,rowHeight:n,height:r,theme:i}),s.a.createElement(Wt,{onWarn:o,onConfigChange:c,onLoaderChange:u,validateOnConfigChange:g}))):s.a.createElement(Ot,Object.assign({theme:i},I))}n(1429),n(1430),n(1431);function en(t){var e=t.response,n=t.theme,r=Object(A.useState)(!0),i=Object(a.a)(r,2),o=i[0],c=i[1],u=Object(A.useRef)();return Object(A.useEffect)((function(){e.then((function(t){u.current=t,c(!1)}))}),[e]),o?s.a.createElement(Ot,{title:"Loading...",theme:n}):s.a.createElement(u.current)}function nn(t){return"\n    ok: ".concat(t.ok,"\n    status: ").concat(t.status,"\n    statusText: ").concat(t.statusText,"\n    redirected: ").concat(t.redirected,"\n    type: ").concat(t.type,"\n    url: ").concat(t.url)}function rn(t,e,n){return t.ok?t.text().then((function(r){try{var i=JSON.parse(r);return Promise.resolve((function(){return s.a.createElement(tn,{config:i,theme:e,onConfigChange:n?console.log:void 0,validateOnConfigChange:n})}))}catch(o){return Promise.resolve((function(){return s.a.createElement(Ot,{title:"Error parsing JSON",preformatted:nn(t),unformatted:"".concat(o.message,": ").concat(r),theme:e})}))}})):Promise.resolve((function(){return s.a.createElement(Ot,{title:"Fetch response not OK",preformatted:nn(t),theme:e})}))}function on(t){return["light","dark"].includes(t)?t:"dark"}function an(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=new URLSearchParams(window.location.search),n=e.get("dataset"),r="true"===e.get("debug"),i=e.get("url"),o="all"===e.get("show"),a=on(e.get("theme"));if(n){var A=Ft(n);return s.a.createElement(tn,{config:A,rowHeight:t,theme:a,onConfigChange:r?console.log:void 0,validateOnConfigChange:r})}if(i){var c=fetch(i).then((function(t){return rn(t,a,r)})).catch((function(t){return Promise.resolve(s.a.createElement(Ot,{title:"Error fetching",unformatted:t.message,theme:a}))}));return s.a.createElement(en,{response:c,theme:a})}var u=Qt(o);return s.a.createElement(kt,{configs:u,theme:a})}var An=n(1393),sn=n.n(An),cn=n(1364);var un={Chrome:32779,"Internet Explorer":2047,Edge:2047,Safari:65e3,Firefox:65e3},ln=function t(e){Object(c.a)(this,t),this.message=e};function gn(t){var e=t.conf,n=t.onOverMaximumUrlLength,r=void 0===n?function(){}:n,i=Object(cn.compressToEncodedURIComponent)(JSON.stringify(e)),o="".concat("vitessce_conf_length","=").concat(i.length,"&").concat("vitessce_conf_version","=").concat("0.0.1","&").concat("vitessce_conf","=").concat(i),a=sn.a.parse(window.navigator.userAgent).browser.name,A=un[a];if(o.length>A){var s=Object.entries(un).filter((function(t){return t[1]>o.length})).map((function(t){return t[0]})),c="Configuration is ".concat(i.length," characters; max URL for ").concat(a," is ").concat(A,": it will work on ").concat(s.join(", ")||"no browser",".");console.error(c),r({message:c,willWorkOn:s})}return o}function fn(t){var e=new URLSearchParams(t.replace("#","&")),n=e.get("vitessce_conf"),r=Number(e.get("vitessce_conf_length"));if(r!==n.length)throw new ln("Compressed conf length (".concat(n.length,") != expected (").concat(r,"). URL truncated?"));if("0.0.1"===e.get("vitessce_conf_version"))return JSON.parse(Object(cn.decompressFromEncodedURIComponent)(n));throw new Error("Unrecognized URL Param Version")}var hn=function(){function t(e,n,r){Object(c.a)(this,t),this.file={url:e,type:n,fileType:r}}return Object(u.a)(t,[{key:"toJSON",value:function(){return this.file}}]),t}(),dn=function(){function t(e,n,r){Object(c.a)(this,t),this.dataset={uid:e,name:n,description:r,files:[]}}return Object(u.a)(t,[{key:"addFile",value:function(t,e,n){return this.dataset.files.push(new hn(t,e,n)),this}},{key:"toJSON",value:function(){return Object(z.a)({},this.dataset,{files:this.dataset.files.map((function(t){return t.toJSON()}))})}}]),t}(),In=function(){function t(e,n,r,i,o,a){Object(c.a)(this,t),this.view={component:e,coordinationScopes:n,x:r,y:i,w:o,h:a}}return Object(u.a)(t,[{key:"useCoordination",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n;return i.forEach((function(e){t.view.coordinationScopes[e.cType]=e.cScope})),this}},{key:"setXYWH",value:function(t,e,n,r){this.view.x=t,this.view.y=e,this.view.w=n,this.view.h=r}},{key:"toJSON",value:function(){return this.view}}]),t}(),pn=function t(e){Object(c.a)(this,t),this.views=e},Cn=function t(e){Object(c.a)(this,t),this.views=e};function yn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=new pn(e);return r}function vn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=new Cn(e);return r}var Bn=function(){function t(e,n){Object(c.a)(this,t),this.cType=e,this.cScope=n,this.cValue=null}return Object(u.a)(t,[{key:"setValue",value:function(t){return this.cValue=t,this}}]),t}(),mn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;Object(c.a)(this,t),this.config={version:"1.0.0",name:e,description:n,datasets:[],coordinationSpace:{},layout:[],initStrategy:"auto"}}return Object(u.a)(t,[{key:"addDataset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=n||{},i=r.uid,o=this.config.datasets.map((function(t){return t.dataset.uid})),A=i||Object(p.c)(o),s=new dn(A,t,e);this.config.datasets.push(s);var c=this.addCoordination(Yt.c.DATASET),u=Object(a.a)(c,1),l=u[0];return l.setValue(A),s}},{key:"addView",value:function(t,e,n){var r,i=n||{},o=i.x,A=void 0===o?0:o,s=i.y,c=void 0===s?0:s,u=i.w,l=void 0===u?1:u,g=i.h,f=void 0===g?1:g,h=i.mapping,d=void 0===h?null:h,I=this.config.coordinationSpace[Yt.c.DATASET]?Object.entries(this.config.coordinationSpace[Yt.c.DATASET]).filter((function(e){var n=Object(a.a)(e,2);n[0];return n[1].cValue===t.dataset.uid})).map((function(t){return Object(a.a)(t,1)[0]})):[];if(1!==I.length)throw new Error("No coordination scope matching the dataset parameter could be found in the coordination space.");r=Object(a.a)(I,1)[0];var p=Object(B.a)({},Yt.c.DATASET,r),C=new In(e,p,A,c,l,f);if(d){var y=this.addCoordination(Yt.c.EMBEDDING_TYPE),v=Object(a.a)(y,1)[0];v.setValue(d),C.useCoordination(v)}return this.config.layout.push(C),C}},{key:"addCoordination",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n,o=[];return i.forEach((function(e){var n=t.config.coordinationSpace[e]?Object.keys(t.config.coordinationSpace[e]):[],r=new Bn(e,Object(p.c)(n));t.config.coordinationSpace[r.cType]||(t.config.coordinationSpace[r.cType]={}),t.config.coordinationSpace[r.cType][r.cScope]=r,o.push(r)})),o}},{key:"linkViews",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.addCoordination.apply(this,Object(I.a)(e));return t.forEach((function(t){r.forEach((function(e){t.useCoordination(e)}))})),Array.isArray(n)&&n.length===e.length&&r.forEach((function(t,e){t.setValue(n[e])})),this}},{key:"layout",value:function(t){return function t(e,n,r,i,o){var a=r-n,A=o-i;if(e instanceof In)e.setXYWH(n,i,a,A);else if(e instanceof pn){var s=e.views,c=s.length;s.forEach((function(e,r){t(e,n+a/c*r,n+a/c*(r+1),i,o)}))}else if(e instanceof Cn){var u=e.views,l=u.length;u.forEach((function(e,o){t(e,n,r,i+A/l*o,i+A/l*(o+1))}))}}(t,0,12,0,12),this}},{key:"toJSON",value:function(){return Object(z.a)({},this.config,{datasets:this.config.datasets.map((function(t){return t.toJSON()})),coordinationSpace:Object(p.b)(Object.entries(this.config.coordinationSpace).map((function(t){var e=Object(a.a)(t,2),n=e[0],r=e[1];return[n,Object(p.b)(Object.entries(r).map((function(t){var e=Object(a.a)(t,2);return[e[0],e[1].cValue]})))]}))),layout:this.config.layout.map((function(t){return t.toJSON()}))})}}],[{key:"fromJSON",value:function(e){var n=new t(e.name,e.description);return e.datasets.forEach((function(t){var e=n.addDataset(t.name,t.description,{uid:t.uid});t.files.forEach((function(t){e.addFile(t.url,t.type,t.fileType)}))})),Object.keys(e.coordinationSpace).forEach((function(t){if(t!==Yt.c.DATASET){var r=e.coordinationSpace[t];n.config.coordinationSpace[t]={},Object.entries(r).forEach((function(e){var r=Object(a.a)(e,2),i=r[0],o=r[1],A=new Bn(t,i);A.setValue(o),n.config.coordinationSpace[t][i]=A}))}})),e.layout.forEach((function(t){var e=new In(t.component,t.coordinationScopes,t.x,t.y,t.w,t.h);n.config.layout.push(e)})),n}}]),t}();n.d(e,"Heatmap",(function(){return r.Heatmap})),n.d(e,"Spatial",(function(){return i.Spatial})),n.d(e,"Scatterplot",(function(){return o.Scatterplot})),n.d(e,"VitessceGrid",(function(){return gt})),n.d(e,"createApp",(function(){return an})),n.d(e,"Vitessce",(function(){return tn})),n.d(e,"encodeConfInUrl",(function(){return gn})),n.d(e,"decodeURLParamsToConf",(function(){return fn})),n.d(e,"VitessceConfig",(function(){return mn})),n.d(e,"hconcat",(function(){return yn})),n.d(e,"vconcat",(function(){return vn}))}])}));
//# sourceMappingURL=index.min.js.map

/***/ }),

/***/ "./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;


/***/ }),

/***/ "./node_modules/webpack/buildin/module.js":
/*!***********************************!*\
  !*** (webpack)/buildin/module.js ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = function(module) {
	if (!module.webpackPolyfill) {
		module.deprecate = function() {};
		module.paths = [];
		// module.parent = undefined by default
		if (!module.children) module.children = [];
		Object.defineProperty(module, "loaded", {
			enumerable: true,
			get: function() {
				return module.l;
			}
		});
		Object.defineProperty(module, "id", {
			enumerable: true,
			get: function() {
				return module.i;
			}
		});
		module.webpackPolyfill = 1;
	}
	return module;
};


/***/ }),

/***/ "./package.json":
/*!**********************!*\
  !*** ./package.json ***!
  \**********************/
/*! exports provided: name, version, description, author, main, repository, keywords, files, scripts, devDependencies, dependencies, jupyterlab, babel, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"vitessce-jupyter\",\"version\":\"0.1.3\",\"description\":\"Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce\",\"author\":\"Mark Keller\",\"main\":\"dist/index.js\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vitessce/vitessce-jupyter.git\"},\"keywords\":[\"jupyter\",\"widgets\",\"ipython\",\"ipywidgets\",\"jupyterlab\",\"jupyterlab-extension\"],\"files\":[\"lib/**/*.js\",\"dist/*.js\"],\"scripts\":{\"build\":\"webpack\",\"watch\":\"webpack --watch --mode=development\",\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"devDependencies\":{\"@babel/core\":\"7.9.0\",\"babel-loader\":\"8.1.0\",\"babel-preset-react-app\":\"^9.1.2\",\"css-loader\":\"^1.0.1\",\"pnp-webpack-plugin\":\"^1.6.4\",\"react-dev-utils\":\"^10.2.1\",\"resolve\":\"^1.17.0\",\"style-loader\":\"^0.23.1\",\"webpack\":\"^4.37.0\",\"webpack-cli\":\"^3.3.6\"},\"dependencies\":{\"@jupyter-widgets/base\":\"^1.1 || ^2 || ^3\",\"lodash\":\"^4.17.4\",\"pubsub-js\":\"^1.9.0\",\"react\":\"~16.9.0\",\"react-dom\":\"~16.9.0\",\"vitessce\":\"^1.1.4\"},\"jupyterlab\":{\"extension\":\"dist/labplugin\",\"externalExtensions\":{\"@jupyter-widgets/jupyterlab-manager\":\"2.0.0\"}},\"babel\":{\"presets\":[\"react-app\"]}}");

/***/ }),

/***/ "@jupyter-widgets/base":
/*!****************************************!*\
  !*** external "@jupyter-widgets/base" ***!
  \****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE__jupyter_widgets_base__;

/***/ })

/******/ })});;
//# sourceMappingURL=index.js.map