{"version":3,"file":"js/chunk-vendors.6c83b1df.js","mappings":";;;;;;;;;;;;;;;AAeA;;ACdA;;;;;;;;;;;;;;;;;;;;;;;;;AC8vCA;;AC9vCA","sources":["webpack://puzzle/./node_modules/@bilibili/bili-mirror/dist/esm/_virtual/_tslib.js","webpack://puzzle/./node_modules/@bilibili/dynamic-import/dist/index.js","webpack://puzzle/./node_modules/@bilibili/mf-cube-utils/lib/popper.js","webpack://puzzle/./node_modules/@bilibili/svg-icon-next/dist/index.cjs"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\nexport { __awaiter };\n","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(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 resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(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), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar importShimURL = \"https://s1.hdslb.com/bfs/static/dynamic-import/es-module-shims@1.9.0.js\";\nvar __async = function __async(__this, __arguments, generator) {\n return new Promise(function (resolve, reject) {\n var fulfilled = function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n };\n var step = function step(x) {\n return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n };\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\nfunction importUMD(options) {\n return new Promise(function (resolve, reject) {\n var script = document.createElement(\"script\");\n script.onload = function () {\n resolve(window[options.name]);\n script.remove();\n };\n script.onerror = reject;\n script.src = options.url;\n document.head.appendChild(script);\n });\n}\nfunction importESM(url) {\n var polyfillImport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return __async(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var importShim;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return importUMD({\n name: \"importShim\",\n url: importShimURL\n });\n case 2:\n importShim = _context.sent;\n return _context.abrupt(\"return\", importShim(url));\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nexport { importESM, importUMD };\n","/**\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version {{version}}\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n//\n// Cross module loader\n// Supported: Node, AMD, Browser globals\n//\n// (function (root, factory) {\n// if (typeof define === 'function' && define.amd) {\n// // AMD. Register as an anonymous module.\n// define(factory);\n// }\n// else if (typeof module === 'object' && module.exports) {\n// // Node. Does not work with strict CommonJS, but\n// // only CommonJS-like environments that support module.exports,\n// // like Node.\n// module.exports = factory();\n// }\n// else {\n// // Browser globals (root is window)\n// root.Popper = factory();\n// }\n// }(this, () => {\n// const root = window;\n\n// // default options\n// const DEFAULTS = {\n// // placement of the popper\n// placement: 'bottom',\n\n// gpuAcceleration: true,\n\n// // shift popper from its origin by the given amount of pixels (can be negative)\n// offset: 0,\n\n// // the element which will act as boundary of the popper\n// boundariesElement: 'viewport',\n\n// // amount of pixel used to define a minimum distance between the boundaries and the popper\n// boundariesPadding: 5,\n\n// // popper will try to prevent overflow following this order,\n// // by default, then, it could overflow on the left and on top of the boundariesElement\n// preventOverflowOrder: ['left', 'right', 'top', 'bottom'],\n\n// // the behavior used by flip to change the placement of the popper\n// flipBehavior: 'flip',\n\n// arrowElement: '[x-arrow]',\n\n// arrowOffset: 0,\n\n// // list of functions used to modify the offsets before they are applied to the popper\n// modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],\n\n// modifiersIgnored: [],\n\n// forceAbsolute: false\n// };\n\n// /**\n// * Create a new Popper.js instance\n// * @constructor Popper\n// * @param {HTMLElement} reference - The reference element used to position the popper\n// * @param {HTMLElement|Object} popper\n// * The HTML element used as popper, or a configuration used to generate the popper.\n// * @param {String} [popper.tagName='div'] The tag name of the generated popper.\n// * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.\n// * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.\n// * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.\n// * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.\n// * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.\n// * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.\n// * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.\n// * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.\n// * @param {Object} options\n// * @param {String} [options.placement=bottom]\n// * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),\n// * left(-start, -end)`\n// *\n// * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']\n// * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of\n// * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its\n// * reference element.\n// * By default, it will look for a child node of the popper with the `x-arrow` attribute.\n// *\n// * @param {Boolean} [options.gpuAcceleration=true]\n// * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the\n// * browser to use the GPU to accelerate the rendering.\n// * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.\n// *\n// * @param {Number} [options.offset=0]\n// * Amount of pixels the popper will be shifted (can be negative).\n// *\n// * @param {String|Element} [options.boundariesElement='viewport']\n// * The element which will define the boundaries of the popper position, the popper will never be placed outside\n// * of the defined boundaries (except if `keepTogether` is enabled)\n// *\n// * @param {Number} [options.boundariesPadding=5]\n// * Additional padding for the boundaries\n// *\n// * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]\n// * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,\n// * this means that the last ones will never overflow\n// *\n// * @param {String|Array} [options.flipBehavior='flip']\n// * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to\n// * overlap its reference element. Defining `flip` as value, the placement will be flipped on\n// * its axis (`right - left`, `top - bottom`).\n// * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify\n// * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,\n// * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)\n// *\n// * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]\n// * List of functions used to modify the data before they are applied to the popper, add your custom functions\n// * to this array to edit the offsets and placement.\n// * The function should reflect the @params and @returns of preventOverflow\n// *\n// * @param {Array} [options.modifiersIgnored=[]]\n// * Put here any built-in modifier name you want to exclude from the modifiers list\n// * The function should reflect the @params and @returns of preventOverflow\n// *\n// * @param {Boolean} [options.removeOnDestroy=false]\n// * Set to true if you want to automatically remove the popper when you call the `destroy` method.\n// */\n// function Popper(reference, popper, options) {\n// this._reference = reference.jquery ? reference[0] : reference;\n// this.state = {};\n\n// // if the popper variable is a configuration object, parse it to generate an HTMLElement\n// // generate a default popper if is not defined\n// const isNotDefined = typeof popper === 'undefined' || popper === null;\n// const isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';\n// if (isNotDefined || isConfig) {\n// this._popper = this.parse(isConfig ? popper : {});\n// }\n// // otherwise, use the given HTMLElement as popper\n// else {\n// this._popper = popper.jquery ? popper[0] : popper;\n// }\n\n// // with {} we create a new object with the options inside it\n// this._options = Object.assign({}, DEFAULTS, options);\n\n// // refactoring modifiers' list\n// this._options.modifiers = this._options.modifiers.map((modifier) => {\n// // remove ignored modifiers\n// if (this._options.modifiersIgnored.indexOf(modifier) !== -1) {\n// return;\n// }\n\n// // set the x-placement attribute before everything else because it could be used to add margins to the popper\n// // margins needs to be calculated to get the correct popper offsets\n// if (modifier === 'applyStyle') {\n// this._popper.setAttribute('x-placement', this._options.placement);\n// }\n\n// // return predefined modifier identified by string or keep the custom one\n// return this.modifiers[modifier] || modifier;\n// });\n\n// // make sure to apply the popper position before any computation\n// this.state.position = this._getPosition(this._popper, this._reference);\n// setStyle(this._popper, { position: this.state.position, top: 0 });\n\n// // fire the first update to position the popper in the right place\n// this.update();\n\n// // setup event listeners, they will take care of update the position in specific situations\n// this._setupEventListeners();\n// return this;\n// }\n\n// //\n// // Methods\n// //\n// /**\n// * Destroy the popper\n// * @method\n// * @memberof Popper\n// */\n// Popper.prototype.destroy = function () {\n// this._popper.removeAttribute('x-placement');\n// this._popper.style.left = '';\n// this._popper.style.position = '';\n// this._popper.style.top = '';\n// this._popper.style[getSupportedPropertyName('transform')] = '';\n// this._removeEventListeners();\n\n// // remove the popper if user explicity asked for the deletion on destroy\n// if (this._options.removeOnDestroy) {\n// this._popper.remove();\n// }\n// return this;\n// };\n\n// /**\n// * Updates the position of the popper, computing the new offsets and applying the new style\n// * @method\n// * @memberof Popper\n// */\n// Popper.prototype.update = function () {\n// let data = { instance: this, styles: {} };\n\n// // store placement inside the data object, modifiers will be able to edit `placement` if needed\n// // and refer to _originalPlacement to know the original value\n// data.placement = this._options.placement;\n// data._originalPlacement = this._options.placement;\n\n// // compute the popper and reference offsets and put them inside data.offsets\n// data.offsets = this._getOffsets(this._popper, this._reference, data.placement);\n\n// // get boundaries\n// data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);\n\n// data = this.runModifiers(data, this._options.modifiers);\n\n// if (typeof this.state.updateCallback === 'function') {\n// this.state.updateCallback(data);\n// }\n// };\n\n// /**\n// * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.\n// * @method\n// * @memberof Popper\n// * @param {Function} callback\n// */\n// Popper.prototype.onCreate = function (callback) {\n// // the createCallbacks return as first argument the popper instance\n// callback(this);\n// return this;\n// };\n\n// /**\n// * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations\n// * used to style popper and its arrow.\n// * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!\n// * @method\n// * @memberof Popper\n// * @param {Function} callback\n// */\n// Popper.prototype.onUpdate = function (callback) {\n// this.state.updateCallback = callback;\n// return this;\n// };\n\n// /**\n// * Helper used to generate poppers from a configuration file\n// * @method\n// * @memberof Popper\n// * @param config {Object} configuration\n// * @returns {HTMLElement} popper\n// */\n// Popper.prototype.parse = function (config) {\n// const defaultConfig = {\n// tagName: 'div',\n// classNames: ['popper'],\n// attributes: [],\n// parent: root.document.body,\n// content: '',\n// contentType: 'text',\n// arrowTagName: 'div',\n// arrowClassNames: ['popper__arrow'],\n// arrowAttributes: ['x-arrow']\n// };\n// config = Object.assign({}, defaultConfig, config);\n\n// const d = root.document;\n\n// const popper = d.createElement(config.tagName);\n// addClassNames(popper, config.classNames);\n// addAttributes(popper, config.attributes);\n// if (config.contentType === 'node') {\n// popper.appendChild(config.content.jquery ? config.content[0] : config.content);\n// }\n// else if (config.contentType === 'html') {\n// popper.innerHTML = config.content;\n// }\n// else {\n// popper.textContent = config.content;\n// }\n\n// if (config.arrowTagName) {\n// const arrow = d.createElement(config.arrowTagName);\n// addClassNames(arrow, config.arrowClassNames);\n// addAttributes(arrow, config.arrowAttributes);\n// popper.appendChild(arrow);\n// }\n\n// let parent = config.parent.jquery ? config.parent[0] : config.parent;\n\n// // if the given parent is a string, use it to match an element\n// // if more than one element is matched, the first one will be used as parent\n// // if no elements are matched, the script will throw an error\n// if (typeof parent === 'string') {\n// parent = d.querySelectorAll(config.parent);\n// if (parent.length > 1) {\n// console.warn(`WARNING: the given \\`parent\\` query(${config.parent}) matched more than one element, the first one will be used`);\n// }\n// if (parent.length === 0) {\n// throw 'ERROR: the given `parent` doesn\\'t exists!';\n// }\n// parent = parent[0];\n// }\n// // if the given parent is a DOM nodes list or an array of nodes with more than one element,\n// // the first one will be used as parent\n// if (parent.length > 1 && parent instanceof Element === false) {\n// console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');\n// parent = parent[0];\n// }\n\n// // append the generated popper to its parent\n// parent.appendChild(popper);\n\n// return popper;\n\n// /**\n// * Adds class names to the given element\n// * @function\n// * @ignore\n// * @param {HTMLElement} target\n// * @param {Array} classes\n// */\n// function addClassNames(element, classNames) {\n// classNames.forEach((className) => {\n// element.classList.add(className);\n// });\n// }\n\n// /**\n// * Adds attributes to the given element\n// * @function\n// * @ignore\n// * @param {HTMLElement} target\n// * @param {Array} attributes\n// * @example\n// * addAttributes(element, [ 'data-info:foobar' ]);\n// */\n// function addAttributes(element, attributes) {\n// attributes.forEach((attribute) => {\n// element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');\n// });\n// }\n// };\n\n// /**\n// * Helper used to get the position which will be applied to the popper\n// * @method\n// * @memberof Popper\n// * @param config {HTMLElement} popper element\n// * @param reference {HTMLElement} reference element\n// * @returns {String} position\n// */\n// Popper.prototype._getPosition = function (popper, reference) {\n// const container = getOffsetParent(reference);\n\n// if (this._options.forceAbsolute) {\n// return 'absolute';\n// }\n\n// // Decide if the popper will be fixed\n// // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together\n// const isParentFixed = isFixed(reference, container);\n// return isParentFixed ? 'fixed' : 'absolute';\n// };\n\n// /**\n// * Get offsets to the popper\n// * @method\n// * @memberof Popper\n// * @access private\n// * @param {Element} popper - the popper element\n// * @param {Element} reference - the reference element (the popper will be relative to this)\n// * @returns {Object} An object containing the offsets which will be applied to the popper\n// */\n// Popper.prototype._getOffsets = function (popper, reference, placement) {\n// placement = placement.split('-')[0];\n// const popperOffsets = {};\n\n// popperOffsets.position = this.state.position;\n// const isParentFixed = popperOffsets.position === 'fixed';\n\n// //\n// // Get reference element position\n// //\n// const referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);\n\n// //\n// // Get popper sizes\n// //\n// const popperRect = getOuterSizes(popper);\n\n// //\n// // Compute offsets of popper\n// //\n\n// // depending by the popper placement we have to compute its offsets slightly differently\n// if (['right', 'left'].indexOf(placement) !== -1) {\n// popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;\n// if (placement === 'left') {\n// popperOffsets.left = referenceOffsets.left - popperRect.width;\n// }\n// else {\n// popperOffsets.left = referenceOffsets.right;\n// }\n// }\n// else {\n// popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;\n// if (placement === 'top') {\n// popperOffsets.top = referenceOffsets.top - popperRect.height;\n// }\n// else {\n// popperOffsets.top = referenceOffsets.bottom;\n// }\n// }\n\n// // Add width and height to our offsets object\n// popperOffsets.width = popperRect.width;\n// popperOffsets.height = popperRect.height;\n\n// return {\n// popper: popperOffsets,\n// reference: referenceOffsets\n// };\n// };\n\n// /**\n// * Setup needed event listeners used to update the popper position\n// * @method\n// * @memberof Popper\n// * @access private\n// */\n// Popper.prototype._setupEventListeners = function () {\n// // NOTE: 1 DOM access here\n// this.state.updateBound = this.update.bind(this);\n// root.addEventListener('resize', this.state.updateBound);\n// // if the boundariesElement is window we don't need to listen for the scroll event\n// if (this._options.boundariesElement !== 'window') {\n// let target = getScrollParent(this._reference);\n// // here it could be both `body` or `documentElement` thanks to Firefox, we then check both\n// if (target === root.document.body || target === root.document.documentElement) {\n// target = root;\n// }\n// target.addEventListener('scroll', this.state.updateBound);\n// this.state.scrollTarget = target;\n// }\n// };\n\n// /**\n// * Remove event listeners used to update the popper position\n// * @method\n// * @memberof Popper\n// * @access private\n// */\n// Popper.prototype._removeEventListeners = function () {\n// // NOTE: 1 DOM access here\n// root.removeEventListener('resize', this.state.updateBound);\n// if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {\n// this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);\n// this.state.scrollTarget = null;\n// }\n// this.state.updateBound = null;\n// };\n\n// /**\n// * Computed the boundaries limits and return them\n// * @method\n// * @memberof Popper\n// * @access private\n// * @param {Object} data - Object containing the property \"offsets\" generated by `_getOffsets`\n// * @param {Number} padding - Boundaries padding\n// * @param {Element} boundariesElement - Element used to define the boundaries\n// * @returns {Object} Coordinates of the boundaries\n// */\n// Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {\n// // NOTE: 1 DOM access here\n// let boundaries = {};\n// let width; let\n// height;\n// if (boundariesElement === 'window') {\n// const body = root.document.body;\n// const html = root.document.documentElement;\n\n// height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n// width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);\n\n// boundaries = {\n// top: 0,\n// right: width,\n// bottom: height,\n// left: 0\n// };\n// }\n// else if (boundariesElement === 'viewport') {\n// const offsetParent = getOffsetParent(this._popper);\n// const scrollParent = getScrollParent(this._popper);\n// const offsetParentRect = getOffsetRect(offsetParent);\n\n// // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`\n// const getScrollTopValue = function (element) {\n// return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;\n// };\n// const getScrollLeftValue = function (element) {\n// return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;\n// };\n\n// // if the popper is fixed we don't have to substract scrolling from the boundaries\n// const scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);\n// const scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);\n\n// boundaries = {\n// top: 0 - (offsetParentRect.top - scrollTop),\n// right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),\n// bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),\n// left: 0 - (offsetParentRect.left - scrollLeft)\n// };\n// }\n// else if (getOffsetParent(this._popper) === boundariesElement) {\n// boundaries = {\n// top: 0,\n// left: 0,\n// right: boundariesElement.clientWidth,\n// bottom: boundariesElement.clientHeight\n// };\n// }\n// else {\n// boundaries = getOffsetRect(boundariesElement);\n// }\n// boundaries.left += padding;\n// boundaries.right -= padding;\n// boundaries.top += padding;\n// boundaries.bottom -= padding;\n// return boundaries;\n// };\n\n// /**\n// * Loop trough the list of modifiers and run them in order, each of them will then edit the data object\n// * @method\n// * @memberof Popper\n// * @access public\n// * @param {Object} data\n// * @param {Array} modifiers\n// * @param {Function} ends\n// */\n// Popper.prototype.runModifiers = function (data, modifiers, ends) {\n// let modifiersToRun = modifiers.slice();\n// if (ends !== undefined) {\n// modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));\n// }\n\n// modifiersToRun.forEach((modifier) => {\n// if (isFunction(modifier)) {\n// data = modifier.call(this, data);\n// }\n// });\n\n// return data;\n// };\n\n// /**\n// * Helper used to know if the given modifier depends from another one.\n// * @method\n// * @memberof Popper\n// * @param {String} requesting - name of requesting modifier\n// * @param {String} requested - name of requested modifier\n// * @returns {Boolean}\n// */\n// Popper.prototype.isModifierRequired = function (requesting, requested) {\n// const index = getArrayKeyIndex(this._options.modifiers, requesting);\n// return !!this._options.modifiers.slice(0, index).filter((modifier) => modifier === requested).length;\n// };\n\n// //\n// // Modifiers\n// //\n\n// /**\n// * Modifiers list\n// * @namespace Popper.modifiers\n// * @memberof Popper\n// * @type {Object}\n// */\n// Popper.prototype.modifiers = {};\n\n// /**\n// * Apply the computed styles to the popper element\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by `update` method\n// * @returns {Object} The same data object\n// */\n// Popper.prototype.modifiers.applyStyle = function (data) {\n// // apply the final offsets to the popper\n// // NOTE: 1 DOM access here\n// const styles = {\n// position: data.offsets.popper.position\n// };\n\n// // round top and left to avoid blurry text\n// const left = Math.round(data.offsets.popper.left);\n// const top = Math.round(data.offsets.popper.top);\n\n// // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper\n// // we automatically use the supported prefixed version if needed\n// let prefixedProperty;\n// if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {\n// styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n// styles.top = 0;\n// styles.left = 0;\n// }\n// // othwerise, we use the standard `left` and `top` properties\n// else {\n// styles.left = left;\n// styles.top = top;\n// }\n\n// // any property present in `data.styles` will be applied to the popper,\n// // in this way we can make the 3rd party modifiers add custom styles to it\n// // Be aware, modifiers could override the properties defined in the previous\n// // lines of this modifier!\n// Object.assign(styles, data.styles);\n\n// setStyle(this._popper, styles);\n\n// // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)\n// // NOTE: 1 DOM access here\n// this._popper.setAttribute('x-placement', data.placement);\n\n// // if the arrow modifier is required and the arrow style has been computed, apply the arrow style\n// if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {\n// setStyle(data.arrowElement, data.offsets.arrow);\n// }\n\n// return data;\n// };\n\n// /**\n// * Modifier used to shift the popper on the start or end of its reference element side\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by `update` method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.shift = function (data) {\n// const placement = data.placement;\n// const basePlacement = placement.split('-')[0];\n// const shiftVariation = placement.split('-')[1];\n\n// // if shift shiftVariation is specified, run the modifier\n// if (shiftVariation) {\n// const reference = data.offsets.reference;\n// const popper = getPopperClientRect(data.offsets.popper);\n\n// const shiftOffsets = {\n// y: {\n// start: { top: reference.top },\n// end: { top: reference.top + reference.height - popper.height }\n// },\n// x: {\n// start: { left: reference.left },\n// end: { left: reference.left + reference.width - popper.width }\n// }\n// };\n\n// const axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';\n\n// data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);\n// }\n\n// return data;\n// };\n\n// /**\n// * Modifier used to make sure the popper does not overflows from it's boundaries\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by `update` method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.preventOverflow = function (data) {\n// const order = this._options.preventOverflowOrder;\n// const popper = getPopperClientRect(data.offsets.popper);\n\n// const check = {\n// left() {\n// let left = popper.left;\n// if (popper.left < data.boundaries.left) {\n// left = Math.max(popper.left, data.boundaries.left);\n// }\n// return { left };\n// },\n// right() {\n// let left = popper.left;\n// if (popper.right > data.boundaries.right) {\n// left = Math.min(popper.left, data.boundaries.right - popper.width);\n// }\n// return { left };\n// },\n// top() {\n// let top = popper.top;\n// if (popper.top < data.boundaries.top) {\n// top = Math.max(popper.top, data.boundaries.top);\n// }\n// return { top };\n// },\n// bottom() {\n// let top = popper.top;\n// if (popper.bottom > data.boundaries.bottom) {\n// top = Math.min(popper.top, data.boundaries.bottom - popper.height);\n// }\n// return { top };\n// }\n// };\n\n// order.forEach((direction) => {\n// data.offsets.popper = Object.assign(popper, check[direction]());\n// });\n\n// return data;\n// };\n\n// /**\n// * Modifier used to make sure the popper is always near its reference\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by _update method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.keepTogether = function (data) {\n// const popper = getPopperClientRect(data.offsets.popper);\n// const reference = data.offsets.reference;\n// const f = Math.floor;\n\n// if (popper.right < f(reference.left)) {\n// data.offsets.popper.left = f(reference.left) - popper.width;\n// }\n// if (popper.left > f(reference.right)) {\n// data.offsets.popper.left = f(reference.right);\n// }\n// if (popper.bottom < f(reference.top)) {\n// data.offsets.popper.top = f(reference.top) - popper.height;\n// }\n// if (popper.top > f(reference.bottom)) {\n// data.offsets.popper.top = f(reference.bottom);\n// }\n\n// return data;\n// };\n\n// /**\n// * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.\n// * Requires the `preventOverflow` modifier before it in order to work.\n// * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by _update method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.flip = function (data) {\n// // check if preventOverflow is in the list of modifiers before the flip modifier.\n// // otherwise flip would not work as expected.\n// if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {\n// console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');\n// return data;\n// }\n\n// if (data.flipped && data.placement === data._originalPlacement) {\n// // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n// return data;\n// }\n\n// let placement = data.placement.split('-')[0];\n// let placementOpposite = getOppositePlacement(placement);\n// const variation = data.placement.split('-')[1] || '';\n\n// let flipOrder = [];\n// if (this._options.flipBehavior === 'flip') {\n// flipOrder = [\n// placement,\n// placementOpposite\n// ];\n// }\n// else {\n// flipOrder = this._options.flipBehavior;\n// }\n\n// flipOrder.forEach((step, index) => {\n// if (placement !== step || flipOrder.length === index + 1) {\n// return;\n// }\n\n// placement = data.placement.split('-')[0];\n// placementOpposite = getOppositePlacement(placement);\n\n// const popperOffsets = getPopperClientRect(data.offsets.popper);\n\n// // this boolean is used to distinguish right and bottom from top and left\n// // they need different computations to get flipped\n// const a = ['right', 'bottom'].indexOf(placement) !== -1;\n\n// // using Math.floor because the reference offsets may contain decimals we are not going to consider here\n// if (\n// a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite])\n// || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])\n// ) {\n// // we'll use this boolean to detect any flip loop\n// data.flipped = true;\n// data.placement = flipOrder[index + 1];\n// if (variation) {\n// data.placement += `-${variation}`;\n// }\n// data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;\n\n// data = this.runModifiers(data, this._options.modifiers, this._flip);\n// }\n// });\n// return data;\n// };\n\n// /**\n// * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.\n// * The offsets will shift the popper on the side of its reference element.\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by _update method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.offset = function (data) {\n// const offset = this._options.offset;\n// const popper = data.offsets.popper;\n\n// if (data.placement.indexOf('left') !== -1) {\n// popper.top -= offset;\n// }\n// else if (data.placement.indexOf('right') !== -1) {\n// popper.top += offset;\n// }\n// else if (data.placement.indexOf('top') !== -1) {\n// popper.left -= offset;\n// }\n// else if (data.placement.indexOf('bottom') !== -1) {\n// popper.left += offset;\n// }\n// return data;\n// };\n\n// /**\n// * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element\n// * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed\n// * @method\n// * @memberof Popper.modifiers\n// * @argument {Object} data - The data object generated by _update method\n// * @returns {Object} The data object, properly modified\n// */\n// Popper.prototype.modifiers.arrow = function (data) {\n// let arrow = this._options.arrowElement;\n// const arrowOffset = this._options.arrowOffset;\n\n// // if the arrowElement is a string, suppose it's a CSS selector\n// if (typeof arrow === 'string') {\n// arrow = this._popper.querySelector(arrow);\n// }\n\n// // if arrow element is not found, don't run the modifier\n// if (!arrow) {\n// return data;\n// }\n\n// // the arrow element must be child of its popper\n// if (!this._popper.contains(arrow)) {\n// console.warn('WARNING: `arrowElement` must be child of its popper element!');\n// return data;\n// }\n\n// // arrow depends on keepTogether in order to work\n// if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {\n// console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');\n// return data;\n// }\n\n// const arrowStyle = {};\n// const placement = data.placement.split('-')[0];\n// const popper = getPopperClientRect(data.offsets.popper);\n// const reference = data.offsets.reference;\n// const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n// const len = isVertical ? 'height' : 'width';\n// const side = isVertical ? 'top' : 'left';\n// const translate = isVertical ? 'translateY' : 'translateX';\n// const altSide = isVertical ? 'left' : 'top';\n// const opSide = isVertical ? 'bottom' : 'right';\n// const arrowSize = getOuterSizes(arrow)[len];\n\n// //\n// // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction\n// //\n\n// // top/left side\n// if (reference[opSide] - arrowSize < popper[side]) {\n// data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);\n// }\n// // bottom/right side\n// if (reference[side] + arrowSize > popper[opSide]) {\n// data.offsets.popper[side] += (reference[side] + arrowSize) - popper[opSide];\n// }\n\n// // compute center of the popper\n// const center = reference[side] + (arrowOffset || (reference[len] / 2) - (arrowSize / 2));\n\n// let sideValue = center - popper[side];\n\n// // prevent arrow from being placed not contiguously to its popper\n// sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);\n// arrowStyle[side] = sideValue;\n// arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow\n\n// data.offsets.arrow = arrowStyle;\n// data.arrowElement = arrow;\n\n// return data;\n// };\n\n// //\n// // Helpers\n// //\n\n// /**\n// * Get the outer sizes of the given element (offset size + margins)\n// * @function\n// * @ignore\n// * @argument {Element} element\n// * @returns {Object} object containing width and height properties\n// */\n// function getOuterSizes(element) {\n// // NOTE: 1 DOM access here\n// const _display = element.style.display; const\n// _visibility = element.style.visibility;\n// element.style.display = 'block'; element.style.visibility = 'hidden';\n// const calcWidthToForceRepaint = element.offsetWidth;\n\n// // original method\n// const styles = root.getComputedStyle(element);\n// const x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n// const y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n// const result = { width: element.offsetWidth + y, height: element.offsetHeight + x };\n\n// // reset element styles\n// element.style.display = _display; element.style.visibility = _visibility;\n// return result;\n// }\n\n// /**\n// * Get the opposite placement of the given one/\n// * @function\n// * @ignore\n// * @argument {String} placement\n// * @returns {String} flipped placement\n// */\n// function getOppositePlacement(placement) {\n// const hash = {\n// left: 'right', right: 'left', bottom: 'top', top: 'bottom'\n// };\n// return placement.replace(/left|right|bottom|top/g, (matched) => hash[matched]);\n// }\n\n// /**\n// * Given the popper offsets, generate an output similar to getBoundingClientRect\n// * @function\n// * @ignore\n// * @argument {Object} popperOffsets\n// * @returns {Object} ClientRect like output\n// */\n// function getPopperClientRect(popperOffsets) {\n// const offsets = Object.assign({}, popperOffsets);\n// offsets.right = offsets.left + offsets.width;\n// offsets.bottom = offsets.top + offsets.height;\n// return offsets;\n// }\n\n// /**\n// * Given an array and the key to find, returns its index\n// * @function\n// * @ignore\n// * @argument {Array} arr\n// * @argument keyToFind\n// * @returns index or null\n// */\n// function getArrayKeyIndex(arr, keyToFind) {\n// let i = 0; let\n// key;\n// for (key in arr) {\n// if (arr[key] === keyToFind) {\n// return i;\n// }\n// i++;\n// }\n// return null;\n// }\n\n// /**\n// * Get CSS computed property of the given element\n// * @function\n// * @ignore\n// * @argument {Eement} element\n// * @argument {String} property\n// */\n// function getStyleComputedProperty(element, property) {\n// // NOTE: 1 DOM access here\n// const css = root.getComputedStyle(element, null);\n// return css[property];\n// }\n\n// /**\n// * Returns the offset parent of the given element\n// * @function\n// * @ignore\n// * @argument {Element} element\n// * @returns {Element} offset parent\n// */\n// function getOffsetParent(element) {\n// // NOTE: 1 DOM access here\n// const offsetParent = element.offsetParent;\n// return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;\n// }\n\n// /**\n// * Returns the scrolling parent of the given element\n// * @function\n// * @ignore\n// * @argument {Element} element\n// * @returns {Element} offset parent\n// */\n// function getScrollParent(element) {\n// const parent = element.parentNode;\n\n// if (!parent) {\n// return element;\n// }\n\n// if (parent === root.document) {\n// // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is\n// // greater than 0 and return the proper element\n// if (root.document.body.scrollTop || root.document.body.scrollLeft) {\n// return root.document.body;\n// }\n// return root.document.documentElement;\n// }\n\n// // Firefox want us to check `-x` and `-y` variations as well\n// if (\n// ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1\n// || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1\n// || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1\n// ) {\n// // If the detected scrollParent is body, we perform an additional check on its parentNode\n// // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise\n// // fixes issue #65\n// return parent;\n// }\n// return getScrollParent(element.parentNode);\n// }\n\n// /**\n// * Check if the given element is fixed or is inside a fixed parent\n// * @function\n// * @ignore\n// * @argument {Element} element\n// * @argument {Element} customContainer\n// * @returns {Boolean} answer to \"isFixed?\"\n// */\n// function isFixed(element) {\n// if (element === root.document.body) {\n// return false;\n// }\n// if (getStyleComputedProperty(element, 'position') === 'fixed') {\n// return true;\n// }\n// return element.parentNode ? isFixed(element.parentNode) : element;\n// }\n\n// /**\n// * Set the style to the given popper\n// * @function\n// * @ignore\n// * @argument {Element} element - Element to apply the style to\n// * @argument {Object} styles - Object with a list of properties and values which will be applied to the element\n// */\n// function setStyle(element, styles) {\n// function is_numeric(n) {\n// return (n !== '' && !isNaN(parseFloat(n)) && isFinite(n));\n// }\n// Object.keys(styles).forEach((prop) => {\n// let unit = '';\n// // add unit if the value is numeric and is one of the following\n// if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {\n// unit = 'px';\n// }\n// element.style[prop] = styles[prop] + unit;\n// });\n// }\n\n// /**\n// * Check if the given variable is a function\n// * @function\n// * @ignore\n// * @argument {*} functionToCheck - variable to check\n// * @returns {Boolean} answer to: is a function?\n// */\n// function isFunction(functionToCheck) {\n// const getType = {};\n// return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n// }\n\n// /**\n// * Get the position of the given element, relative to its offset parent\n// * @function\n// * @ignore\n// * @param {Element} element\n// * @return {Object} position - Coordinates of the element and its `scrollTop`\n// */\n// function getOffsetRect(element) {\n// const elementRect = {\n// width: element.offsetWidth,\n// height: element.offsetHeight,\n// left: element.offsetLeft,\n// top: element.offsetTop\n// };\n\n// elementRect.right = elementRect.left + elementRect.width;\n// elementRect.bottom = elementRect.top + elementRect.height;\n\n// // position\n// return elementRect;\n// }\n\n// /**\n// * Get bounding client rect of given element\n// * @function\n// * @ignore\n// * @param {HTMLElement} element\n// * @return {Object} client rect\n// */\n// function getBoundingClientRect(element) {\n// const rect = element.getBoundingClientRect();\n\n// // whether the IE version is lower than 11\n// const isIE = navigator.userAgent.indexOf('MSIE') != -1;\n\n// // fix ie document bounding top always 0 bug\n// const rectTop = isIE && element.tagName === 'HTML'\n// ? -element.scrollTop\n// : rect.top;\n\n// return {\n// left: rect.left,\n// top: rectTop,\n// right: rect.right,\n// bottom: rect.bottom,\n// width: rect.right - rect.left,\n// height: rect.bottom - rectTop\n// };\n// }\n\n// /**\n// * Given an element and one of its parents, return the offset\n// * @function\n// * @ignore\n// * @param {HTMLElement} element\n// * @param {HTMLElement} parent\n// * @return {Object} rect\n// */\n// function getOffsetRectRelativeToCustomParent(element, parent, fixed) {\n// const elementRect = getBoundingClientRect(element);\n// const parentRect = getBoundingClientRect(parent);\n\n// if (fixed) {\n// const scrollParent = getScrollParent(parent);\n// parentRect.top += scrollParent.scrollTop;\n// parentRect.bottom += scrollParent.scrollTop;\n// parentRect.left += scrollParent.scrollLeft;\n// parentRect.right += scrollParent.scrollLeft;\n// }\n\n// const rect = {\n// top: elementRect.top - parentRect.top,\n// left: elementRect.left - parentRect.left,\n// bottom: (elementRect.top - parentRect.top) + elementRect.height,\n// right: (elementRect.left - parentRect.left) + elementRect.width,\n// width: elementRect.width,\n// height: elementRect.height\n// };\n// return rect;\n// }\n\n// /**\n// * Get the prefixed supported property name\n// * @function\n// * @ignore\n// * @argument {String} property (camelCase)\n// * @returns {String} prefixed property (camelCase)\n// */\n// function getSupportedPropertyName(property) {\n// const prefixes = ['', 'ms', 'webkit', 'moz', 'o'];\n\n// for (let i = 0; i < prefixes.length; i++) {\n// const toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;\n// if (typeof root.document.body.style[toCheck] !== 'undefined') {\n// return toCheck;\n// }\n// }\n// return null;\n// }\n\n// /**\n// * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source\n// * objects to a target object. It will return the target object.\n// * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway\n// * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n// * @function\n// * @ignore\n// */\n// if (!Object.assign) {\n// Object.defineProperty(Object, 'assign', {\n// enumerable: false,\n// configurable: true,\n// writable: true,\n// value(target) {\n// if (target === undefined || target === null) {\n// throw new TypeError('Cannot convert first argument to object');\n// }\n\n// const to = Object(target);\n// for (let i = 1; i < arguments.length; i++) {\n// let nextSource = arguments[i];\n// if (nextSource === undefined || nextSource === null) {\n// continue;\n// }\n// nextSource = Object(nextSource);\n\n// const keysArray = Object.keys(nextSource);\n// for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n// const nextKey = keysArray[nextIndex];\n// const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n// if (desc !== undefined && desc.enumerable) {\n// to[nextKey] = nextSource[nextKey];\n// }\n// }\n// }\n// return to;\n// }\n// });\n// }\n\n// return Popper;\n// }));\n\nexport default function Popper() {\n var root = window;\n\n // default options\n var DEFAULTS = {\n // placement of the popper\n placement: 'bottom',\n gpuAcceleration: true,\n // shift popper from its origin by the given amount of pixels (can be negative)\n offset: 0,\n // the element which will act as boundary of the popper\n boundariesElement: 'viewport',\n // amount of pixel used to define a minimum distance between the boundaries and the popper\n boundariesPadding: 5,\n // popper will try to prevent overflow following this order,\n // by default, then, it could overflow on the left and on top of the boundariesElement\n preventOverflowOrder: ['left', 'right', 'top', 'bottom'],\n // the behavior used by flip to change the placement of the popper\n flipBehavior: 'flip',\n arrowElement: '[x-arrow]',\n arrowOffset: 0,\n // list of functions used to modify the offsets before they are applied to the popper\n modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],\n modifiersIgnored: [],\n forceAbsolute: false\n };\n\n /**\n * Create a new Popper.js instance\n * @constructor Popper\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement|Object} popper\n * The HTML element used as popper, or a configuration used to generate the popper.\n * @param {String} [popper.tagName='div'] The tag name of the generated popper.\n * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.\n * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.\n * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.\n * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.\n * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.\n * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.\n * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.\n * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.\n * @param {Object} options\n * @param {String} [options.placement=bottom]\n * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),\n * left(-start, -end)`\n *\n * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']\n * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of\n * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its\n * reference element.\n * By default, it will look for a child node of the popper with the `x-arrow` attribute.\n *\n * @param {Boolean} [options.gpuAcceleration=true]\n * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the\n * browser to use the GPU to accelerate the rendering.\n * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.\n *\n * @param {Number} [options.offset=0]\n * Amount of pixels the popper will be shifted (can be negative).\n *\n * @param {String|Element} [options.boundariesElement='viewport']\n * The element which will define the boundaries of the popper position, the popper will never be placed outside\n * of the defined boundaries (except if `keepTogether` is enabled)\n *\n * @param {Number} [options.boundariesPadding=5]\n * Additional padding for the boundaries\n *\n * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]\n * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,\n * this means that the last ones will never overflow\n *\n * @param {String|Array} [options.flipBehavior='flip']\n * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to\n * overlap its reference element. Defining `flip` as value, the placement will be flipped on\n * its axis (`right - left`, `top - bottom`).\n * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify\n * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,\n * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)\n *\n * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]\n * List of functions used to modify the data before they are applied to the popper, add your custom functions\n * to this array to edit the offsets and placement.\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Array} [options.modifiersIgnored=[]]\n * Put here any built-in modifier name you want to exclude from the modifiers list\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Boolean} [options.removeOnDestroy=false]\n * Set to true if you want to automatically remove the popper when you call the `destroy` method.\n */\n function Popper(reference, popper, options) {\n var _this = this;\n this._reference = reference.jquery ? reference[0] : reference;\n this.state = {};\n\n // if the popper variable is a configuration object, parse it to generate an HTMLElement\n // generate a default popper if is not defined\n var isNotDefined = typeof popper === 'undefined' || popper === null;\n var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';\n if (isNotDefined || isConfig) {\n this._popper = this.parse(isConfig ? popper : {});\n }\n // otherwise, use the given HTMLElement as popper\n else {\n this._popper = popper.jquery ? popper[0] : popper;\n }\n\n // with {} we create a new object with the options inside it\n this._options = Object.assign({}, DEFAULTS, options);\n\n // refactoring modifiers' list\n this._options.modifiers = this._options.modifiers.map(function (modifier) {\n // remove ignored modifiers\n if (_this._options.modifiersIgnored.indexOf(modifier) !== -1) {\n return;\n }\n\n // set the x-placement attribute before everything else because it could be used to add margins to the popper\n // margins needs to be calculated to get the correct popper offsets\n if (modifier === 'applyStyle') {\n _this._popper.setAttribute('x-placement', _this._options.placement);\n }\n\n // return predefined modifier identified by string or keep the custom one\n return _this.modifiers[modifier] || modifier;\n });\n\n // make sure to apply the popper position before any computation\n this.state.position = this._getPosition(this._popper, this._reference);\n setStyle(this._popper, {\n position: this.state.position,\n top: 0\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n // setup event listeners, they will take care of update the position in specific situations\n this._setupEventListeners();\n return this;\n }\n\n //\n // Methods\n //\n /**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\n Popper.prototype.destroy = function () {\n this._popper.removeAttribute('x-placement');\n this._popper.style.left = '';\n this._popper.style.position = '';\n this._popper.style.top = '';\n this._popper.style[getSupportedPropertyName('transform')] = '';\n this._removeEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n if (this._options.removeOnDestroy) {\n this._popper.remove();\n }\n return this;\n };\n\n /**\n * Updates the position of the popper, computing the new offsets and applying the new style\n * @method\n * @memberof Popper\n */\n Popper.prototype.update = function () {\n var data = {\n instance: this,\n styles: {}\n };\n\n // store placement inside the data object, modifiers will be able to edit `placement` if needed\n // and refer to _originalPlacement to know the original value\n data.placement = this._options.placement;\n data._originalPlacement = this._options.placement;\n\n // compute the popper and reference offsets and put them inside data.offsets\n data.offsets = this._getOffsets(this._popper, this._reference, data.placement);\n\n // get boundaries\n data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);\n data = this.runModifiers(data, this._options.modifiers);\n if (typeof this.state.updateCallback === 'function') {\n this.state.updateCallback(data);\n }\n };\n\n /**\n * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onCreate = function (callback) {\n // the createCallbacks return as first argument the popper instance\n callback(this);\n return this;\n };\n\n /**\n * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations\n * used to style popper and its arrow.\n * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onUpdate = function (callback) {\n this.state.updateCallback = callback;\n return this;\n };\n\n /**\n * Helper used to generate poppers from a configuration file\n * @method\n * @memberof Popper\n * @param config {Object} configuration\n * @returns {HTMLElement} popper\n */\n Popper.prototype.parse = function (config) {\n var defaultConfig = {\n tagName: 'div',\n classNames: ['popper'],\n attributes: [],\n parent: root.document.body,\n content: '',\n contentType: 'text',\n arrowTagName: 'div',\n arrowClassNames: ['popper__arrow'],\n arrowAttributes: ['x-arrow']\n };\n config = Object.assign({}, defaultConfig, config);\n var d = root.document;\n var popper = d.createElement(config.tagName);\n addClassNames(popper, config.classNames);\n addAttributes(popper, config.attributes);\n if (config.contentType === 'node') {\n popper.appendChild(config.content.jquery ? config.content[0] : config.content);\n } else if (config.contentType === 'html') {\n popper.innerHTML = config.content;\n } else {\n popper.textContent = config.content;\n }\n if (config.arrowTagName) {\n var arrow = d.createElement(config.arrowTagName);\n addClassNames(arrow, config.arrowClassNames);\n addAttributes(arrow, config.arrowAttributes);\n popper.appendChild(arrow);\n }\n var parent = config.parent.jquery ? config.parent[0] : config.parent;\n\n // if the given parent is a string, use it to match an element\n // if more than one element is matched, the first one will be used as parent\n // if no elements are matched, the script will throw an error\n if (typeof parent === 'string') {\n parent = d.querySelectorAll(config.parent);\n if (parent.length > 1) {\n console.warn(\"WARNING: the given `parent` query(\" + config.parent + \") matched more than one element, the first one will be used\");\n }\n if (parent.length === 0) {\n throw 'ERROR: the given `parent` doesn\\'t exists!';\n }\n parent = parent[0];\n }\n // if the given parent is a DOM nodes list or an array of nodes with more than one element,\n // the first one will be used as parent\n if (parent.length > 1 && parent instanceof Element === false) {\n console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');\n parent = parent[0];\n }\n\n // append the generated popper to its parent\n parent.appendChild(popper);\n return popper;\n\n /**\n * Adds class names to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} classes\n */\n function addClassNames(element, classNames) {\n classNames.forEach(function (className) {\n element.classList.add(className);\n });\n }\n\n /**\n * Adds attributes to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} attributes\n * @example\n * addAttributes(element, [ 'data-info:foobar' ]);\n */\n function addAttributes(element, attributes) {\n attributes.forEach(function (attribute) {\n element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');\n });\n }\n };\n\n /**\n * Helper used to get the position which will be applied to the popper\n * @method\n * @memberof Popper\n * @param config {HTMLElement} popper element\n * @param reference {HTMLElement} reference element\n * @returns {String} position\n */\n Popper.prototype._getPosition = function (popper, reference) {\n var container = getOffsetParent(reference);\n if (this._options.forceAbsolute) {\n return 'absolute';\n }\n\n // Decide if the popper will be fixed\n // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together\n var isParentFixed = isFixed(reference, container);\n return isParentFixed ? 'fixed' : 'absolute';\n };\n\n /**\n * Get offsets to the popper\n * @method\n * @memberof Popper\n * @access private\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\n Popper.prototype._getOffsets = function (popper, reference, placement) {\n placement = placement.split('-')[0];\n var popperOffsets = {};\n popperOffsets.position = this.state.position;\n var isParentFixed = popperOffsets.position === 'fixed';\n\n //\n // Get reference element position\n //\n var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);\n\n //\n // Get popper sizes\n //\n var popperRect = getOuterSizes(popper);\n\n //\n // Compute offsets of popper\n //\n\n // depending by the popper placement we have to compute its offsets slightly differently\n if (['right', 'left'].indexOf(placement) !== -1) {\n popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;\n if (placement === 'left') {\n popperOffsets.left = referenceOffsets.left - popperRect.width;\n } else {\n popperOffsets.left = referenceOffsets.right;\n }\n } else {\n popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;\n if (placement === 'top') {\n popperOffsets.top = referenceOffsets.top - popperRect.height;\n } else {\n popperOffsets.top = referenceOffsets.bottom;\n }\n }\n\n // Add width and height to our offsets object\n popperOffsets.width = popperRect.width;\n popperOffsets.height = popperRect.height;\n return {\n popper: popperOffsets,\n reference: referenceOffsets\n };\n };\n\n /**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._setupEventListeners = function () {\n // NOTE: 1 DOM access here\n this.state.updateBound = this.update.bind(this);\n root.addEventListener('resize', this.state.updateBound);\n // if the boundariesElement is window we don't need to listen for the scroll event\n if (this._options.boundariesElement !== 'window') {\n var target = getScrollParent(this._reference);\n // here it could be both `body` or `documentElement` thanks to Firefox, we then check both\n if (target === root.document.body || target === root.document.documentElement) {\n target = root;\n }\n target.addEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = target;\n }\n };\n\n /**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._removeEventListeners = function () {\n // NOTE: 1 DOM access here\n root.removeEventListener('resize', this.state.updateBound);\n if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {\n this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = null;\n }\n this.state.updateBound = null;\n };\n\n /**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper\n * @access private\n * @param {Object} data - Object containing the property \"offsets\" generated by `_getOffsets`\n * @param {Number} padding - Boundaries padding\n * @param {Element} boundariesElement - Element used to define the boundaries\n * @returns {Object} Coordinates of the boundaries\n */\n Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {\n // NOTE: 1 DOM access here\n var boundaries = {};\n var width;\n var height;\n if (boundariesElement === 'window') {\n var body = root.document.body;\n var html = root.document.documentElement;\n height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);\n boundaries = {\n top: 0,\n right: width,\n bottom: height,\n left: 0\n };\n } else if (boundariesElement === 'viewport') {\n var offsetParent = getOffsetParent(this._popper);\n var scrollParent = getScrollParent(this._popper);\n var offsetParentRect = getOffsetRect(offsetParent);\n\n // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`\n var getScrollTopValue = function getScrollTopValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;\n };\n var getScrollLeftValue = function getScrollLeftValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;\n };\n\n // if the popper is fixed we don't have to substract scrolling from the boundaries\n var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);\n var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);\n boundaries = {\n top: 0 - (offsetParentRect.top - scrollTop),\n right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),\n bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),\n left: 0 - (offsetParentRect.left - scrollLeft)\n };\n } else if (getOffsetParent(this._popper) === boundariesElement) {\n boundaries = {\n top: 0,\n left: 0,\n right: boundariesElement.clientWidth,\n bottom: boundariesElement.clientHeight\n };\n } else {\n boundaries = getOffsetRect(boundariesElement);\n }\n boundaries.left += padding;\n boundaries.right -= padding;\n boundaries.top += padding;\n boundaries.bottom -= padding;\n return boundaries;\n };\n\n /**\n * Loop trough the list of modifiers and run them in order, each of them will then edit the data object\n * @method\n * @memberof Popper\n * @access public\n * @param {Object} data\n * @param {Array} modifiers\n * @param {Function} ends\n */\n Popper.prototype.runModifiers = function (data, modifiers, ends) {\n var _this2 = this;\n var modifiersToRun = modifiers.slice();\n if (ends !== undefined) {\n modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));\n }\n modifiersToRun.forEach(function (modifier) {\n if (isFunction(modifier)) {\n data = modifier.call(_this2, data);\n }\n });\n return data;\n };\n\n /**\n * Helper used to know if the given modifier depends from another one.\n * @method\n * @memberof Popper\n * @param {String} requesting - name of requesting modifier\n * @param {String} requested - name of requested modifier\n * @returns {Boolean}\n */\n Popper.prototype.isModifierRequired = function (requesting, requested) {\n var index = getArrayKeyIndex(this._options.modifiers, requesting);\n return !!this._options.modifiers.slice(0, index).filter(function (modifier) {\n return modifier === requested;\n }).length;\n };\n\n //\n // Modifiers\n //\n\n /**\n * Modifiers list\n * @namespace Popper.modifiers\n * @memberof Popper\n * @type {Object}\n */\n Popper.prototype.modifiers = {};\n\n /**\n * Apply the computed styles to the popper element\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The same data object\n */\n Popper.prototype.modifiers.applyStyle = function (data) {\n // apply the final offsets to the popper\n // NOTE: 1 DOM access here\n var styles = {\n position: data.offsets.popper.position\n };\n\n // round top and left to avoid blurry text\n var left = Math.round(data.offsets.popper.left);\n var top = Math.round(data.offsets.popper.top);\n\n // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper\n // we automatically use the supported prefixed version if needed\n var prefixedProperty;\n if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {\n styles[prefixedProperty] = \"translate3d(\" + left + \"px, \" + top + \"px, 0)\";\n styles.top = 0;\n styles.left = 0;\n }\n // othwerise, we use the standard `left` and `top` properties\n else {\n styles.left = left;\n styles.top = top;\n }\n\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n Object.assign(styles, data.styles);\n setStyle(this._popper, styles);\n\n // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)\n // NOTE: 1 DOM access here\n this._popper.setAttribute('x-placement', data.placement);\n\n // if the arrow modifier is required and the arrow style has been computed, apply the arrow style\n if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {\n setStyle(data.arrowElement, data.offsets.arrow);\n }\n return data;\n };\n\n /**\n * Modifier used to shift the popper on the start or end of its reference element side\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.shift = function (data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftVariation = placement.split('-')[1];\n\n // if shift shiftVariation is specified, run the modifier\n if (shiftVariation) {\n var reference = data.offsets.reference;\n var popper = getPopperClientRect(data.offsets.popper);\n var shiftOffsets = {\n y: {\n start: {\n top: reference.top\n },\n end: {\n top: reference.top + reference.height - popper.height\n }\n },\n x: {\n start: {\n left: reference.left\n },\n end: {\n left: reference.left + reference.width - popper.width\n }\n }\n };\n var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';\n data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);\n }\n return data;\n };\n\n /**\n * Modifier used to make sure the popper does not overflows from it's boundaries\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.preventOverflow = function (data) {\n var order = this._options.preventOverflowOrder;\n var popper = getPopperClientRect(data.offsets.popper);\n var check = {\n left: function left() {\n var left = popper.left;\n if (popper.left < data.boundaries.left) {\n left = Math.max(popper.left, data.boundaries.left);\n }\n return {\n left: left\n };\n },\n right: function right() {\n var left = popper.left;\n if (popper.right > data.boundaries.right) {\n left = Math.min(popper.left, data.boundaries.right - popper.width);\n }\n return {\n left: left\n };\n },\n top: function top() {\n var top = popper.top;\n if (popper.top < data.boundaries.top) {\n top = Math.max(popper.top, data.boundaries.top);\n }\n return {\n top: top\n };\n },\n bottom: function bottom() {\n var top = popper.top;\n if (popper.bottom > data.boundaries.bottom) {\n top = Math.min(popper.top, data.boundaries.bottom - popper.height);\n }\n return {\n top: top\n };\n }\n };\n order.forEach(function (direction) {\n data.offsets.popper = Object.assign(popper, check[direction]());\n });\n return data;\n };\n\n /**\n * Modifier used to make sure the popper is always near its reference\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.keepTogether = function (data) {\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var f = Math.floor;\n if (popper.right < f(reference.left)) {\n data.offsets.popper.left = f(reference.left) - popper.width;\n }\n if (popper.left > f(reference.right)) {\n data.offsets.popper.left = f(reference.right);\n }\n if (popper.bottom < f(reference.top)) {\n data.offsets.popper.top = f(reference.top) - popper.height;\n }\n if (popper.top > f(reference.bottom)) {\n data.offsets.popper.top = f(reference.bottom);\n }\n return data;\n };\n\n /**\n * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.\n * Requires the `preventOverflow` modifier before it in order to work.\n * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.flip = function (data) {\n var _this3 = this;\n // check if preventOverflow is in the list of modifiers before the flip modifier.\n // otherwise flip would not work as expected.\n if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {\n console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');\n return data;\n }\n if (data.flipped && data.placement === data._originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n var flipOrder = [];\n if (this._options.flipBehavior === 'flip') {\n flipOrder = [placement, placementOpposite];\n } else {\n flipOrder = this._options.flipBehavior;\n }\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return;\n }\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n var popperOffsets = getPopperClientRect(data.offsets.popper);\n\n // this boolean is used to distinguish right and bottom from top and left\n // they need different computations to get flipped\n var a = ['right', 'bottom'].indexOf(placement) !== -1;\n\n // using Math.floor because the reference offsets may contain decimals we are not going to consider here\n if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {\n // we'll use this boolean to detect any flip loop\n data.flipped = true;\n data.placement = flipOrder[index + 1];\n if (variation) {\n data.placement += \"-\" + variation;\n }\n data.offsets.popper = _this3._getOffsets(_this3._popper, _this3._reference, data.placement).popper;\n data = _this3.runModifiers(data, _this3._options.modifiers, _this3._flip);\n }\n });\n return data;\n };\n\n /**\n * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.\n * The offsets will shift the popper on the side of its reference element.\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.offset = function (data) {\n var offset = this._options.offset;\n var popper = data.offsets.popper;\n if (data.placement.indexOf('left') !== -1) {\n popper.top -= offset;\n } else if (data.placement.indexOf('right') !== -1) {\n popper.top += offset;\n } else if (data.placement.indexOf('top') !== -1) {\n popper.left -= offset;\n } else if (data.placement.indexOf('bottom') !== -1) {\n popper.left += offset;\n }\n return data;\n };\n\n /**\n * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element\n * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.arrow = function (data) {\n var arrow = this._options.arrowElement;\n var arrowOffset = this._options.arrowOffset;\n\n // if the arrowElement is a string, suppose it's a CSS selector\n if (typeof arrow === 'string') {\n arrow = this._popper.querySelector(arrow);\n }\n\n // if arrow element is not found, don't run the modifier\n if (!arrow) {\n return data;\n }\n\n // the arrow element must be child of its popper\n if (!this._popper.contains(arrow)) {\n console.warn('WARNING: `arrowElement` must be child of its popper element!');\n return data;\n }\n\n // arrow depends on keepTogether in order to work\n if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {\n console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');\n return data;\n }\n var arrowStyle = {};\n var placement = data.placement.split('-')[0];\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n var len = isVertical ? 'height' : 'width';\n var side = isVertical ? 'top' : 'left';\n var translate = isVertical ? 'translateY' : 'translateX';\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowSize = getOuterSizes(arrow)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);\n }\n // bottom/right side\n if (reference[side] + arrowSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];\n }\n\n // compute center of the popper\n var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);\n var sideValue = center - popper[side];\n\n // prevent arrow from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);\n arrowStyle[side] = sideValue;\n arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow\n\n data.offsets.arrow = arrowStyle;\n data.arrowElement = arrow;\n return data;\n };\n\n //\n // Helpers\n //\n\n /**\n * Get the outer sizes of the given element (offset size + margins)\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\n function getOuterSizes(element) {\n // NOTE: 1 DOM access here\n var _display = element.style.display;\n var _visibility = element.style.visibility;\n element.style.display = 'block';\n element.style.visibility = 'hidden';\n var calcWidthToForceRepaint = element.offsetWidth;\n\n // original method\n var styles = root.getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n\n // reset element styles\n element.style.display = _display;\n element.style.visibility = _visibility;\n return result;\n }\n\n /**\n * Get the opposite placement of the given one/\n * @function\n * @ignore\n * @argument {String} placement\n * @returns {String} flipped placement\n */\n function getOppositePlacement(placement) {\n var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n }\n\n /**\n * Given the popper offsets, generate an output similar to getBoundingClientRect\n * @function\n * @ignore\n * @argument {Object} popperOffsets\n * @returns {Object} ClientRect like output\n */\n function getPopperClientRect(popperOffsets) {\n var offsets = Object.assign({}, popperOffsets);\n offsets.right = offsets.left + offsets.width;\n offsets.bottom = offsets.top + offsets.height;\n return offsets;\n }\n\n /**\n * Given an array and the key to find, returns its index\n * @function\n * @ignore\n * @argument {Array} arr\n * @argument keyToFind\n * @returns index or null\n */\n function getArrayKeyIndex(arr, keyToFind) {\n var i = 0;\n var key;\n for (key in arr) {\n if (arr[key] === keyToFind) {\n return i;\n }\n i++;\n }\n return null;\n }\n\n /**\n * Get CSS computed property of the given element\n * @function\n * @ignore\n * @argument {Eement} element\n * @argument {String} property\n */\n function getStyleComputedProperty(element, property) {\n // NOTE: 1 DOM access here\n var css = root.getComputedStyle(element, null);\n return css[property];\n }\n\n /**\n * Returns the offset parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getOffsetParent(element) {\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;\n }\n\n /**\n * Returns the scrolling parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getScrollParent(element) {\n var parent = element.parentNode;\n if (!parent) {\n return element;\n }\n if (parent === root.document) {\n // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is\n // greater than 0 and return the proper element\n if (root.document.body.scrollTop || root.document.body.scrollLeft) {\n return root.document.body;\n }\n return root.document.documentElement;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {\n // If the detected scrollParent is body, we perform an additional check on its parentNode\n // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise\n // fixes issue #65\n return parent;\n }\n return getScrollParent(element.parentNode);\n }\n\n /**\n * Check if the given element is fixed or is inside a fixed parent\n * @function\n * @ignore\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\n function isFixed(element) {\n if (element === root.document.body) {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return element.parentNode ? isFixed(element.parentNode) : element;\n }\n\n /**\n * Set the style to the given popper\n * @function\n * @ignore\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles - Object with a list of properties and values which will be applied to the element\n */\n function setStyle(element, styles) {\n function is_numeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n }\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n }\n\n /**\n * Check if the given variable is a function\n * @function\n * @ignore\n * @argument {*} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\n function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }\n\n /**\n * Get the position of the given element, relative to its offset parent\n * @function\n * @ignore\n * @param {Element} element\n * @return {Object} position - Coordinates of the element and its `scrollTop`\n */\n function getOffsetRect(element) {\n var elementRect = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n left: element.offsetLeft,\n top: element.offsetTop\n };\n elementRect.right = elementRect.left + elementRect.width;\n elementRect.bottom = elementRect.top + elementRect.height;\n\n // position\n return elementRect;\n }\n\n /**\n * Get bounding client rect of given element\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\n function getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n\n // whether the IE version is lower than 11\n var isIE = navigator.userAgent.indexOf('MSIE') != -1;\n\n // fix ie document bounding top always 0 bug\n var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;\n return {\n left: rect.left,\n top: rectTop,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.right - rect.left,\n height: rect.bottom - rectTop\n };\n }\n\n /**\n * Given an element and one of its parents, return the offset\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @return {Object} rect\n */\n function getOffsetRectRelativeToCustomParent(element, parent, fixed) {\n var elementRect = getBoundingClientRect(element);\n var parentRect = getBoundingClientRect(parent);\n if (fixed) {\n var scrollParent = getScrollParent(parent);\n parentRect.top += scrollParent.scrollTop;\n parentRect.bottom += scrollParent.scrollTop;\n parentRect.left += scrollParent.scrollLeft;\n parentRect.right += scrollParent.scrollLeft;\n }\n var rect = {\n top: elementRect.top - parentRect.top,\n left: elementRect.left - parentRect.left,\n bottom: elementRect.top - parentRect.top + elementRect.height,\n right: elementRect.left - parentRect.left + elementRect.width,\n width: elementRect.width,\n height: elementRect.height\n };\n return rect;\n }\n\n /**\n * Get the prefixed supported property name\n * @function\n * @ignore\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase)\n */\n function getSupportedPropertyName(property) {\n var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];\n for (var i = 0; i < prefixes.length; i++) {\n var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;\n if (typeof root.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n }\n\n /**\n * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source\n * objects to a target object. It will return the target object.\n * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway\n * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @function\n * @ignore\n */\n if (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: function value(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n nextSource = Object(nextSource);\n var keysArray = Object.keys(nextSource);\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n }\n });\n }\n return Popper;\n}","/*! For license information please see index.cjs.LICENSE.txt */\nvar t,r={d:function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r:function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})}},e={};function n(){n=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a=\"function\"==typeof Symbol?Symbol:{},u=a.iterator||\"@@iterator\",c=a.asyncIterator||\"@@asyncIterator\",s=a.toStringTag||\"@@toStringTag\";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},\"\")}catch(t){l=function(t,r,e){return t[r]=e}}function f(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,a=Object.create(o.prototype),u=new R(n||[]);return i(a,\"_invoke\",{value:C(t,e,u)}),a}function h(t,r,e){try{return{type:\"normal\",arg:t.call(r,e)}}catch(t){return{type:\"throw\",arg:t}}}r.wrap=f;var p=\"suspendedStart\",y=\"suspendedYield\",v=\"executing\",m=\"completed\",d={};function g(){}function O(){}function w(){}var b={};l(b,u,(function(){return this}));var _=Object.getPrototypeOf,T=_&&_(_(I([])));T&&T!==e&&o.call(T,u)&&(b=T);var E=w.prototype=g.prototype=Object.create(b);function N(t){[\"next\",\"throw\",\"return\"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function A(t,r){function e(n,i,a,u){var c=h(t[n],t,i);if(\"throw\"!==c.type){var s=c.arg,l=s.value;return l&&\"object\"==x(l)&&o.call(l,\"__await\")?r.resolve(l.__await).then((function(t){e(\"next\",t,a,u)}),(function(t){e(\"throw\",t,a,u)})):r.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return e(\"throw\",t,a,u)}))}u(c.arg)}var n;i(this,\"_invoke\",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function C(r,e,n){var o=p;return function(i,a){if(o===v)throw new Error(\"Generator is already running\");if(o===m){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===d)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=v;var s=h(r,e,n);if(\"normal\"===s.type){if(o=n.done?m:y,s.arg===d)continue;return{value:s.arg,done:n.done}}\"throw\"===s.type&&(o=m,n.method=\"throw\",n.arg=s.arg)}}}function S(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,\"throw\"===n&&r.iterator.return&&(e.method=\"return\",e.arg=t,S(r,e),\"throw\"===e.method)||\"return\"!==n&&(e.method=\"throw\",e.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),d;var i=h(o,r.iterator,e.arg);if(\"throw\"===i.type)return e.method=\"throw\",e.arg=i.arg,e.delegate=null,d;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,\"return\"!==e.method&&(e.method=\"next\",e.arg=t),e.delegate=null,d):a:(e.method=\"throw\",e.arg=new TypeError(\"iterator result is not an object\"),e.delegate=null,d)}function M(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function L(t){var r=t.completion||{};r.type=\"normal\",delete r.arg,t.completion=r}function R(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(M,this),this.reset(!0)}function I(r){if(r||\"\"===r){var e=r[u];if(e)return e.call(r);if(\"function\"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,i=function e(){for(;++n=0;--i){var a=this.tryEntries[i],u=a.completion;if(\"root\"===a.tryLoc)return n(\"end\");if(a.tryLoc<=this.prev){var c=o.call(a,\"catchLoc\"),s=o.call(a,\"finallyLoc\");if(c&&s){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,\"finallyLoc\")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),L(e),d}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if(\"throw\"===n.type){var o=n.arg;L(e)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(r,e,n){return this.delegate={iterator:I(r),resultName:e,nextLoc:n},\"next\"===this.method&&(this.arg=t),d}},r}function o(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var r=this,e=arguments;return new Promise((function(n,i){var a=t.apply(r,e);function u(t){o(a,n,i,u,c,\"next\",t)}function c(t){o(a,n,i,u,c,\"throw\",t)}u(void 0)}))}}function a(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||w(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,r,e){return r=s(r),function(t,r){if(r&&(\"object\"===x(r)||\"function\"==typeof r))return r;if(void 0!==r)throw new TypeError(\"Derived constructors may only return object or undefined\");return l(t)}(t,c()?Reflect.construct(r,e||[],s(t).constructor):r.apply(t,e))}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(c=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function l(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}function f(t,r){if(\"function\"!=typeof r&&null!==r)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),r&&h(t,r)}function h(t,r){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},h(t,r)}function p(t,r,e){return(r=d(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function y(t,r){if(!(t instanceof r))throw new TypeError(\"Cannot call a class as a function\")}function v(t,r){for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function x(t){return x=\"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},x(t)}function O(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(null!=e){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,r)||w(t,r)||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 w(t,r){if(t){if(\"string\"==typeof t)return b(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===e&&t.constructor&&(e=t.constructor.name),\"Map\"===e||\"Set\"===e?Array.from(t):\"Arguments\"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?b(t,r):void 0}}function b(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);et.phi1&&(t.phi2-=2*M),1===t.sweepFlag&&t.phi2n)return[];if(0===n)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var o=Math.sqrt(n);return[[(t*e+r*o)/(t*t+r*r),(r*e-t*o)/(t*t+r*r)],[(t*e-r*o)/(t*t+r*r),(r*e+t*o)/(t*t+r*r)]]}var I,k=Math.PI/180;function P(t,r,e){return(1-e)*t+e*r}function j(t,r,e,n){return t+Math.cos(n/180*M)*r+Math.sin(n/180*M)*e}function H(t,r,e,n){var o=1e-6,i=r-t,a=e-r,u=3*i+3*(n-e)-6*a,c=6*(a-i),s=3*i;return Math.abs(u)2&&void 0!==arguments[2]?arguments[2]:1e-6,n=t*t/4-r;if(n<-e)return[];if(n<=e)return[-t/2];var o=Math.sqrt(n);return[-t/2-o,-t/2+o]}(c/u,s/u,o)}function U(t,r,e,n,o){var i=1-o;return t*(i*i*i)+r*(3*i*i*o)+e*(3*i*o*o)+n*(o*o*o)}!function(t){function r(){return o((function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t}))}function e(){var t=NaN,r=NaN,e=NaN,n=NaN;return o((function(o,i,a){return o.type&F.SMOOTH_CURVE_TO&&(o.type=F.CURVE_TO,t=isNaN(t)?i:t,r=isNaN(r)?a:r,o.x1=o.relative?i-t:2*i-t,o.y1=o.relative?a-r:2*a-r),o.type&F.CURVE_TO?(t=o.relative?i+o.x2:o.x2,r=o.relative?a+o.y2:o.y2):(t=NaN,r=NaN),o.type&F.SMOOTH_QUAD_TO&&(o.type=F.QUAD_TO,e=isNaN(e)?i:e,n=isNaN(n)?a:n,o.x1=o.relative?i-e:2*i-e,o.y1=o.relative?a-n:2*a-n),o.type&F.QUAD_TO?(e=o.relative?i+o.x1:o.x1,n=o.relative?a+o.y1:o.y1):(e=NaN,n=NaN),o}))}function n(){var t=NaN,r=NaN;return o((function(e,n,o){if(e.type&F.SMOOTH_QUAD_TO&&(e.type=F.QUAD_TO,t=isNaN(t)?n:t,r=isNaN(r)?o:r,e.x1=e.relative?n-t:2*n-t,e.y1=e.relative?o-r:2*o-r),e.type&F.QUAD_TO){t=e.relative?n+e.x1:e.x1,r=e.relative?o+e.y1:e.y1;var i=e.x1,a=e.y1;e.type=F.CURVE_TO,e.x1=((e.relative?0:n)+2*i)/3,e.y1=((e.relative?0:o)+2*a)/3,e.x2=(e.x+2*i)/3,e.y2=(e.y+2*a)/3}else t=NaN,r=NaN;return e}))}function o(t){var r=0,e=0,n=NaN,o=NaN;return function(i){if(isNaN(n)&&!(i.type&F.MOVE_TO))throw new Error(\"path must start with moveto\");var a=t(i,r,e,n,o);return i.type&F.CLOSE_PATH&&(r=n,e=o),void 0!==i.x&&(r=i.relative?r+i.x:i.x),void 0!==i.y&&(e=i.relative?e+i.y:i.y),i.type&F.MOVE_TO&&(n=r,o=e),a}}function i(t,r,e,n,i,a){return S(t,r,e,n,i,a),o((function(o,u,c,s){var l=o.x1,f=o.x2,h=o.relative&&!isNaN(s),p=void 0!==o.x?o.x:h?0:u,y=void 0!==o.y?o.y:h?0:c;function v(t){return t*t}o.type&F.HORIZ_LINE_TO&&0!==r&&(o.type=F.LINE_TO,o.y=o.relative?0:c),o.type&F.VERT_LINE_TO&&0!==e&&(o.type=F.LINE_TO,o.x=o.relative?0:u),void 0!==o.x&&(o.x=o.x*t+y*e+(h?0:i)),void 0!==o.y&&(o.y=p*r+o.y*n+(h?0:a)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*e+(h?0:i)),void 0!==o.y1&&(o.y1=l*r+o.y1*n+(h?0:a)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*e+(h?0:i)),void 0!==o.y2&&(o.y2=f*r+o.y2*n+(h?0:a));var m=t*n-r*e;if(void 0!==o.xRot&&(1!==t||0!==r||0!==e||1!==n))if(0===m)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=F.LINE_TO;else{var d=o.xRot*Math.PI/180,g=Math.sin(d),x=Math.cos(d),O=1/v(o.rX),w=1/v(o.rY),b=v(x)*O+v(g)*w,_=2*g*x*(O-w),T=v(g)*O+v(x)*w,E=b*n*n-_*r*n+T*r*r,N=_*(t*n+r*e)-2*(b*e*n+T*t*r),A=b*e*e-_*t*e+T*t*t,C=(Math.atan2(N,E-A)+Math.PI)%Math.PI/2,S=Math.sin(C),M=Math.cos(C);o.rX=Math.abs(m)/Math.sqrt(E*v(M)+N*S*M+A*v(S)),o.rY=Math.abs(m)/Math.sqrt(E*v(S)-N*S*M+A*v(M)),o.xRot=180*C/Math.PI}return void 0!==o.sweepFlag&&0>m&&(o.sweepFlag=+!o.sweepFlag),o}))}t.ROUND=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e13;function r(r){return Math.round(r*t)/t}return S(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),void 0!==t.rX&&(t.rX=r(t.rX)),void 0!==t.rY&&(t.rY=r(t.rY)),t}},t.TO_ABS=r,t.TO_REL=function(){return o((function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o((function(n,o,i,a,u){if(isNaN(a)&&!(n.type&F.MOVE_TO))throw new Error(\"path must start with moveto\");return r&&n.type&F.HORIZ_LINE_TO&&(n.type=F.LINE_TO,n.y=n.relative?0:i),e&&n.type&F.VERT_LINE_TO&&(n.type=F.LINE_TO,n.x=n.relative?0:o),t&&n.type&F.CLOSE_PATH&&(n.type=F.LINE_TO,n.x=n.relative?a-o:a,n.y=n.relative?u-i:u),n.type&F.ARC&&(0===n.rX||0===n.rY)&&(n.type=F.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n}))},t.NORMALIZE_ST=e,t.QT_TO_C=n,t.INFO=o,t.SANITIZE=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;S(t);var r=NaN,e=NaN,n=NaN,i=NaN;return o((function(o,a,u,c,s){var l=Math.abs,f=!1,h=0,p=0;if(o.type&F.SMOOTH_CURVE_TO&&(h=isNaN(r)?0:a-r,p=isNaN(e)?0:u-e),o.type&(F.CURVE_TO|F.SMOOTH_CURVE_TO)?(r=o.relative?a+o.x2:o.x2,e=o.relative?u+o.y2:o.y2):(r=NaN,e=NaN),o.type&F.SMOOTH_QUAD_TO?(n=isNaN(n)?a:2*a-n,i=isNaN(i)?u:2*u-i):o.type&F.QUAD_TO?(n=o.relative?a+o.x1:o.x1,i=o.relative?u+o.y1:o.y2):(n=NaN,i=NaN),o.type&F.LINE_COMMANDS||o.type&F.ARC&&(0===o.rX||0===o.rY||!o.lArcFlag)||o.type&F.CURVE_TO||o.type&F.SMOOTH_CURVE_TO||o.type&F.QUAD_TO||o.type&F.SMOOTH_QUAD_TO){var y=void 0===o.x?0:o.relative?o.x:o.x-a,v=void 0===o.y?0:o.relative?o.y:o.y-u;h=isNaN(n)?void 0===o.x1?h:o.relative?o.x:o.x1-a:n-a,p=isNaN(i)?void 0===o.y1?p:o.relative?o.y:o.y1-u:i-u;var m=void 0===o.x2?0:o.relative?o.x:o.x2-a,d=void 0===o.y2?0:o.relative?o.y:o.y2-u;l(y)<=t&&l(v)<=t&&l(h)<=t&&l(p)<=t&&l(m)<=t&&l(d)<=t&&(f=!0)}return o.type&F.CLOSE_PATH&&l(a-c)<=t&&l(u-s)<=t&&(f=!0),f?[]:o}))},t.MATRIX=i,t.ROTATE=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;S(t,r,e);var n=Math.sin(t),o=Math.cos(t);return i(o,n,-n,o,r-r*o+e*n,e-r*n-e*o)},t.TRANSLATE=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return S(t,r),i(1,0,0,1,t,r)},t.SCALE=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return S(t,r),i(t,0,0,r,0,0)},t.SKEW_X=function(t){return S(t),i(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return S(t),i(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return S(t),i(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return S(t),i(1,0,0,-1,0,t)},t.A_TO_C=function(){return o((function(t,r,e){return F.ARC===t.type?function(t,r,e){t.cX||L(t,r,e);for(var n=Math.min(t.phi1,t.phi2),o=Math.max(t.phi1,t.phi2)-n,i=Math.ceil(o/90),a=new Array(i),u=r,c=e,s=0;su.maxX&&(u.maxX=t),tu.maxY&&(u.maxY=t),th&&c(U(e,o.x1,o.x2,o.x,h))}}catch(t){f.e(t)}finally{f.f()}var p,y=g(H(n,o.y1,o.y2,o.y));try{for(y.s();!(p=y.n()).done;){var v=p.value;0v&&s(U(n,o.y1,o.y2,o.y,v))}}catch(t){y.e(t)}finally{y.f()}}if(o.type&F.ARC){c(o.x),s(o.y),L(o,e,n);var m,d=o.xRot/180*Math.PI,x=Math.cos(d)*o.rX,w=Math.sin(d)*o.rX,b=-Math.sin(d)*o.rY,_=Math.cos(d)*o.rY,T=O(o.phi1o.phi2?[o.phi2+360,o.phi1+360]:[o.phi2,o.phi1],2),E=T[0],N=T[1],A=function(t){var r=O(t,2),e=r[0],n=r[1],o=180*Math.atan2(n,e)/Math.PI;return oE&&SE&&k0&&void 0!==arguments[0]?arguments[0]:[];if(this.parse(\" \",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError(\"Unterminated command at the path end.\");return t}},{key:\"parse\",value:function(t){for(var r=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=function(t){e.push(t),r.curArgs.length=0,r.canParseCommandOrComma=!0},o=0;oc)throw new SyntaxError('Expected positive number, got \"'.concat(c,'\" at index \"').concat(o,'\"'))}else if((3===this.curArgs.length||4===this.curArgs.length)&&\"0\"!==this.curNumber&&\"1\"!==this.curNumber)throw new SyntaxError('Expected a flag, got \"'.concat(this.curNumber,'\" at index \"').concat(o,'\"'));this.curArgs.push(c),this.curArgs.length===G[this.curCommandType]&&(F.HORIZ_LINE_TO===this.curCommandType?n({type:F.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):F.VERT_LINE_TO===this.curCommandType?n({type:F.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===F.MOVE_TO||this.curCommandType===F.LINE_TO||this.curCommandType===F.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),F.MOVE_TO===this.curCommandType&&(this.curCommandType=F.LINE_TO)):this.curCommandType===F.CURVE_TO?n({type:F.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===F.SMOOTH_CURVE_TO?n({type:F.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===F.QUAD_TO?n({type:F.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===F.ARC&&n({type:F.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber=\"\",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!D(i))if(\",\"===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(\"+\"!==i&&\"-\"!==i&&\".\"!==i)if(u)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(\"Unterminated command at index \".concat(o,\".\"));if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character \"'.concat(i,'\" at index ').concat(o,\". Command cannot follow comma\"));if(this.canParseCommandOrComma=!1,\"z\"!==i&&\"Z\"!==i)if(\"h\"===i||\"H\"===i)this.curCommandType=F.HORIZ_LINE_TO,this.curCommandRelative=\"h\"===i;else if(\"v\"===i||\"V\"===i)this.curCommandType=F.VERT_LINE_TO,this.curCommandRelative=\"v\"===i;else if(\"m\"===i||\"M\"===i)this.curCommandType=F.MOVE_TO,this.curCommandRelative=\"m\"===i;else if(\"l\"===i||\"L\"===i)this.curCommandType=F.LINE_TO,this.curCommandRelative=\"l\"===i;else if(\"c\"===i||\"C\"===i)this.curCommandType=F.CURVE_TO,this.curCommandRelative=\"c\"===i;else if(\"s\"===i||\"S\"===i)this.curCommandType=F.SMOOTH_CURVE_TO,this.curCommandRelative=\"s\"===i;else if(\"q\"===i||\"Q\"===i)this.curCommandType=F.QUAD_TO,this.curCommandRelative=\"q\"===i;else if(\"t\"===i||\"T\"===i)this.curCommandType=F.SMOOTH_QUAD_TO,this.curCommandRelative=\"t\"===i;else{if(\"a\"!==i&&\"A\"!==i)throw new SyntaxError('Unexpected character \"'.concat(i,'\" at index ').concat(o,\".\"));this.curCommandType=F.ARC,this.curCommandRelative=\"a\"===i}else e.push({type:F.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal=\".\"===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}},{key:\"transform\",value:function(t){var r=Object.create(this,{parse:{value:function(r){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=g(Object.getPrototypeOf(this).parse.call(this,r));try{for(o.s();!(e=o.n()).done;){var i=e.value,u=t(i);Array.isArray(u)?n.push.apply(n,a(u)):n.push(u)}}catch(t){o.e(t)}finally{o.f()}return n}}});return r}}]),r}(),F=(t=function(t){function r(t){var e;return y(this,r),p(l(e=u(this,r)),\"commands\",void 0),e.commands=\"string\"==typeof t?r.parse(t):t,e}return f(r,V),m(r,[{key:\"encode\",value:function(){return r.encode(this.commands)}},{key:\"getBounds\",value:function(){var t=I.CALCULATE_BOUNDS();return this.transform(t),t}},{key:\"transform\",value:function(t){var r,e=[],n=g(this.commands);try{for(n.s();!(r=n.n()).done;){var o=t(r.value);Array.isArray(o)?e.push.apply(e,a(o)):e.push(o)}}catch(t){n.e(t)}finally{n.f()}return this.commands=e,this}}],[{key:\"encode\",value:function(t){return function(t){var r=\"\";Array.isArray(t)||(t=[t]);for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:0;if(n<=0)return r;for(var o in e)r[o]?r[o]=t(r[o],e[o],n-1):r[o]=e[o];return r},e?B[e]=u(B[e]||{},a,2):Object.keys(a).map((function(t){B[t]=u(B[t]||{},a[t],2)}));case 18:case\"end\":return t.stop()}}),t,null,[[4,10]])})));return function(r){return t.apply(this,arguments)}}(),tt=[],rt=function(){var t=i(n().mark((function t(r){var e;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Promise.all(r.map($)),tt.push(e),t.next=4,e;case 4:return t.abrupt(\"return\");case 5:case\"end\":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}(),et=function(){var t=i(n().mark((function t(r){var e;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Promise.all(r.map(function(){var t=i(n().mark((function t(r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:nt({icon:r});case 1:case\"end\":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}())),tt.push(e),t.next=4,e;case 4:return t.abrupt(\"return\");case 5:case\"end\":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}(),nt=function(){var t=i(n().mark((function t(r){var e,o,i,a,u,c,s,l,f,h,p,y,v,m;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.icon,u=a.split(\"/\"),c=O(u,3),s=c[0],l=c[1],f=c[2],s&&l&&f){t.next=5;break}throw new Error(\"SVGIconNext: invalid icon option\");case 5:return t.prev=5,t.next=8,Promise.all(tt);case 8:t.next=12;break;case 10:t.prev=10,t.t0=t.catch(5);case 12:if(null===(e=B[s])||void 0===e||null===(e=e[l])||void 0===e||!e[f]){t.next=14;break}return t.abrupt(\"return\",null===(h=B[s])||void 0===h||null===(h=h[l])||void 0===h?void 0:h[f]);case 14:if(null===(o=W[s])||void 0===o||null===(o=o[l])||void 0===o||!o[f]){t.next=16;break}return t.abrupt(\"return\",null===(p=W[s])||void 0===p||null===(p=p[l])||void 0===p?void 0:p[f]);case 16:return t.prev=16,v=\"undefined\"!=typeof window&&\"blob:\"===window.location.protocol?\"https://\":\"//\",m=J(\"\".concat(v).concat((n=void 0,\"undefined\"!=typeof window&&(null===(n=window.__BMG_AF__)||void 0===n?void 0:n.defDomain)||\"i0.\".concat(function(){return\"hdslb\"}(),\".com\")),\"/bfs/svg-next/\").concat(s,\"/\").concat(l,\"/v\").concat(f,\".json\")),K(W,u,m),t.t1=K,t.t2=B,t.t3=u,t.next=25,null===(y=W[s])||void 0===y||null===(y=y[l])||void 0===y?void 0:y[f];case 25:t.t4=t.sent,(0,t.t1)(t.t2,t.t3,t.t4),t.next=33;break;case 29:throw t.prev=29,t.t5=t.catch(16),K(W,u,null),new Error(\"SVGIconNext: fetch icon config failed\");case 33:return t.abrupt(\"return\",null===(i=B[s])||void 0===i||null===(i=i[l])||void 0===i?void 0:i[f]);case 34:case\"end\":return t.stop()}var n}),t,null,[[5,10],[16,29]])})));return function(r){return t.apply(this,arguments)}}();function ot(t){return ot=\"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},ot(t)}function it(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=0;--i){var a=this.tryEntries[i],u=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),s=n.call(a,\"finallyLoc\");if(c&&s){if(this.prev=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),S(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if(\"throw\"===n.type){var o=n.arg;S(e)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(r,e,n){return this.delegate={iterator:L(r),resultName:e,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},r}function ut(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function ct(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){ut(i,n,o,a,u,\"next\",t)}function u(t){ut(i,n,o,a,u,\"throw\",t)}a(void 0)}))}}function st(t,r){for(var e=0;e\\n ').concat(n.map((function(t,r){return'\")})).join(\"\\n \"),\"\\n\\n\"));case 9:case\"end\":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:\"render\",value:(i=ct(at().mark((function t(r){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt(\"return\");case 2:return t.next=4,this.initSvg(r);case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:\"mount\",value:(o=ct(at().mark((function t(r){var e;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=document.createElementNS(ht,\"svg\"),t.next=3,this.initSvg(e);case 3:r.appendChild(e);case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:\"initSvg\",value:(n=ct(at().mark((function t(r){var e,n,o,i,a,u,c;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return\"undefined\"!=typeof window&&(null===(e=window.performance)||void 0===e||e.now()),t.next=3,nt(this.options);case 3:if(o=t.sent){t.next=6;break}return t.abrupt(\"return\");case 6:return r.setAttributeNS(ft,\"xmlns\",ht),r.setAttributeNS(ft,\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),i=Z(this.options),r.setAttribute(\"viewBox\",[0,0].concat((s=i,function(t){if(Array.isArray(t))return it(t)}(s)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(s)||function(t,r){if(t){if(\"string\"==typeof t)return it(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===e&&t.constructor&&(e=t.constructor.name),\"Map\"===e||\"Set\"===e?Array.from(t):\"Arguments\"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?it(t,r):void 0}}(s)||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.\")}())).join(\" \")),r.setAttribute(\"width\",i[0].toString()),r.setAttribute(\"height\",i[1].toString()),a=z(this.options,o),u=q(this.options,o),o.default.map((function(t,e){var n=document.createElementNS(ht,\"path\");n.setAttribute(\"d\",a[e]),u&&n.setAttribute(\"fill\",\"string\"==typeof u?u:u[e]),r.appendChild(n)})),\"undefined\"!=typeof window&&(null===(n=window.performance)||void 0===n||n.now()),this.svgEl&&(null===(c=this.svgEl)||void 0===c||null===(c=c.parentNode)||void 0===c||c.removeChild(this.svgEl)),this.svgEl=r,t.abrupt(\"return\",r);case 19:case\"end\":return t.stop()}var s}),t,this)}))),function(t){return n.apply(this,arguments)})}],e&&st(r.prototype,e),Object.defineProperty(r,\"prototype\",{writable:!1}),t}();exports.SVGIconNext=e.SVGIconNext,exports.preloadIcons=e.preloadIcons,exports.preloadPacks=e.preloadPacks,Object.defineProperty(exports,\"__esModule\",{value:!0});"],"names":[],"sourceRoot":""}